ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilTimingAccepted.php
Go to the documentation of this file.
1
<?
php
2
/*
3
+-----------------------------------------------------------------------------+
4
| ILIAS open source |
5
+-----------------------------------------------------------------------------+
6
| Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7
| |
8
| This program is free software; you can redistribute it and/or |
9
| modify it under the terms of the GNU General Public License |
10
| as published by the Free Software Foundation; either version 2 |
11
| of the License, or (at your option) any later version. |
12
| |
13
| This program is distributed in the hope that it will be useful, |
14
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
| GNU General Public License for more details. |
17
| |
18
| You should have received a copy of the GNU General Public License |
19
| along with this program; if not, write to the Free Software |
20
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21
+-----------------------------------------------------------------------------+
22
*/
23
24
34
class
ilTimingAccepted
35
{
36
public
$ilErr
;
37
public
$ilDB
;
38
public
$lng
;
39
45
public
function
__construct
($crs_id, $a_usr_id)
46
{
47
global
$DIC
;
48
49
$ilErr
= $DIC[
'ilErr'
];
50
$ilDB
= $DIC[
'ilDB'
];
51
$lng
= $DIC[
'lng'
];
52
$tree
= $DIC[
'tree'
];
53
54
$this->ilErr = &
$ilErr
;
55
$this->db = &
$ilDB
;
56
$this->lng = &
$lng
;
57
58
$this->crs_id = $crs_id;
59
$this->user_id = $a_usr_id;
60
61
$this->
__read
();
62
}
63
64
public
function
getUserId
()
65
{
66
return
$this->user_id;
67
}
68
public
function
getCourseId
()
69
{
70
return
$this->crs_id;
71
}
72
public
function
accept
($a_status)
73
{
74
$this->accepted = $a_status;
75
}
76
public
function
isAccepted
()
77
{
78
return
$this->accepted ? true :
false
;
79
}
80
public
function
setRemark
($a_remark)
81
{
82
$this->remark = $a_remark;
83
}
84
public
function
getRemark
()
85
{
86
return
$this->remark;
87
}
88
public
function
setVisible
($a_visible)
89
{
90
$this->visible = $a_visible;
91
}
92
public
function
isVisible
()
93
{
94
return
$this->visible ? true :
false
;
95
}
96
97
public
function
update
()
98
{
99
ilTimingAccepted::_delete
($this->
getCourseId
(), $this->
getUserId
());
100
$this->
create
();
101
return
true
;
102
}
103
104
public
function
create
()
105
{
106
global
$DIC
;
107
108
$ilDB
= $DIC[
'ilDB'
];
109
110
$query
=
"INSERT INTO crs_timings_usr_accept (crs_id,usr_id,visible,accept,remark) "
.
111
"VALUES( "
.
112
$ilDB
->quote($this->
getCourseId
(),
'integer'
) .
", "
.
113
$ilDB
->quote($this->
getUserId
(),
'integer'
) .
", "
.
114
$ilDB
->quote($this->
isVisible
(),
'integer'
) .
", "
.
115
$ilDB
->quote($this->
isAccepted
(),
'integer'
) .
", "
.
116
$ilDB
->quote($this->
getRemark
(),
'text'
) .
" "
.
117
")"
;
118
$res
=
$ilDB
->manipulate(
$query
);
119
}
120
121
public
function
delete
()
122
{
123
return
ilTimingAccepted::_delete
($this->
getCourseId
(), $this->
getUserId
());
124
}
125
126
public
function
_delete
($a_crs_id, $a_usr_id)
127
{
128
global
$DIC
;
129
130
$ilDB
= $DIC[
'ilDB'
];
131
132
$query
=
"DELETE FROM crs_timings_usr_accept "
.
133
"WHERE crs_id = "
.
$ilDB
->quote($a_crs_id,
'integer'
) .
" "
.
134
"AND usr_id = "
.
$ilDB
->quote($a_usr_id,
'integer'
) .
" "
;
135
$res
=
$ilDB
->manipulate(
$query
);
136
}
137
138
public
function
_deleteByCourse
($a_crs_id)
139
{
140
global
$DIC
;
141
142
$ilDB
= $DIC[
'ilDB'
];
143
144
$query
=
"DELETE FROM crs_timings_usr_accept "
.
145
"WHERE crs_id = "
.
$ilDB
->quote($a_crs_id,
'integer'
) .
" "
;
146
$res
=
$ilDB
->manipulate(
$query
);
147
}
148
149
public
static
function
_deleteByUser
($a_usr_id)
150
{
151
global
$DIC
;
152
153
$ilDB
= $DIC[
'ilDB'
];
154
155
$query
=
"DELETE FROM crs_timings_usr_accept "
.
156
"WHERE usr_id = "
.
$ilDB
->quote($a_usr_id,
'integer'
) .
""
;
157
$res
=
$ilDB
->manipulate(
$query
);
158
}
159
160
public
function
__read
()
161
{
162
global
$DIC
;
163
164
$ilDB
= $DIC[
'ilDB'
];
165
166
$query
=
"SELECT * FROM crs_timings_usr_accept "
.
167
"WHERE crs_id = "
.
$ilDB
->quote($this->
getCourseId
(),
'integer'
) .
" "
.
168
"AND usr_id = "
.
$ilDB
->quote($this->
getUserId
(),
'integer'
) .
""
;
169
$res
= $this->db->query(
$query
);
170
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
171
$this->
setVisible
(
$row
->visible);
172
$this->
setRemark
(
$row
->remark);
173
$this->
accept
(
$row
->accept);
174
}
175
return
true
;
176
}
177
}
ilTimingAccepted\$ilErr
$ilErr
Definition:
class.ilTimingAccepted.php:36
ilTimingAccepted\update
update()
Definition:
class.ilTimingAccepted.php:97
$DIC
global $DIC
Definition:
saml.php:7
ilTimingAccepted\getRemark
getRemark()
Definition:
class.ilTimingAccepted.php:84
ilTimingAccepted\isVisible
isVisible()
Definition:
class.ilTimingAccepted.php:92
ilTimingAccepted\__construct
__construct($crs_id, $a_usr_id)
Constructor.
Definition:
class.ilTimingAccepted.php:45
ilTimingAccepted\create
create()
Definition:
class.ilTimingAccepted.php:104
ilTimingAccepted\getUserId
getUserId()
Definition:
class.ilTimingAccepted.php:64
ilTimingAccepted\__read
__read()
Definition:
class.ilTimingAccepted.php:160
ilTimingAccepted\_deleteByUser
static _deleteByUser($a_usr_id)
Definition:
class.ilTimingAccepted.php:149
ilTimingAccepted\getCourseId
getCourseId()
Definition:
class.ilTimingAccepted.php:68
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
$tree
$tree
Definition:
calendarserver.php:37
ilTimingAccepted\_delete
_delete($a_crs_id, $a_usr_id)
Definition:
class.ilTimingAccepted.php:126
ilTimingAccepted\setRemark
setRemark($a_remark)
Definition:
class.ilTimingAccepted.php:80
ilTimingAccepted\$ilDB
$ilDB
Definition:
class.ilTimingAccepted.php:37
$query
$query
Definition:
proxy_ylocal.php:13
$row
$row
Definition:
migrateto20.php:360
ilTimingAccepted\$lng
$lng
Definition:
class.ilTimingAccepted.php:38
ilTimingAccepted\_deleteByCourse
_deleteByCourse($a_crs_id)
Definition:
class.ilTimingAccepted.php:138
ilTimingAccepted
class ilTimingAccepted
Definition:
class.ilTimingAccepted.php:34
ilTimingAccepted\isAccepted
isAccepted()
Definition:
class.ilTimingAccepted.php:76
php
ilTimingAccepted\setVisible
setVisible($a_visible)
Definition:
class.ilTimingAccepted.php:88
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilTimingAccepted\accept
accept($a_status)
Definition:
class.ilTimingAccepted.php:72
Modules
Course
classes
Timings
class.ilTimingAccepted.php
Generated on Thu Jan 16 2025 19:02:01 for ILIAS by
1.8.13 (using
Doxyfile
)