50 $this->event_id = $a_event_id;
56 $this->user_id = $a_usr_id;
60 return $this->user_id;
64 $this->mark = $a_mark;
72 $this->comment = $a_comment;
80 $this->participated = $a_status;
84 return $this->participated;
88 $this->registered = $a_status;
92 return $this->registered;
98 $query =
"DELETE FROM event_participants ".
99 "WHERE event_id = ".$ilDB->quote($this->
getEventId() ,
'integer').
" ".
100 "AND usr_id = ".$ilDB->quote($this->
getUserId() ,
'integer').
" ";
103 $query =
"INSERT INTO event_participants (event_id,usr_id,registered,participated,mark,e_comment) ".
105 $ilDB->quote($this->
getEventId() ,
'integer').
", ".
106 $ilDB->quote($this->
getUserId() ,
'integer').
", ".
109 $ilDB->quote($this->
getMark() ,
'text').
", ".
110 $ilDB->quote($this->
getComment() ,
'text').
" ".
118 return $this->participants[$a_usr_id] ? $this->participants[$a_usr_id] : array();
123 return $this->participants ? $this->participants : array();
128 return $this->participants[$a_usr_id][
'registered'] ?
true :
false;
133 return $this->participants[$a_usr_id][
'participated'] ?
true :
false;
145 $query =
"SELECT * FROM event_participants ".
146 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
147 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
151 $query =
"UPDATE event_participants ".
152 "SET participated = ".$ilDB->quote($a_status ,
'integer').
" ".
153 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
154 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
159 $query =
"INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
161 $ilDB->quote(0 ,
'integer').
", ".
162 $ilDB->quote($a_status ,
'integer').
", ".
163 $ilDB->quote($a_event_id ,
'integer').
", ".
164 $ilDB->quote($a_usr_id ,
'integer').
" ".
175 $query =
"SELECT * FROM event_participants ".
176 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
177 "AND registered = ".$ilDB->quote(1 ,
'integer');
181 $user_ids[] =
$row->usr_id;
183 return $user_ids ? $user_ids : array();
190 $query =
"SELECT * FROM event_participants ".
191 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
192 "AND participated = 1";
196 $user_ids[] =
$row->usr_id;
198 return $user_ids ? $user_ids : array();
205 $query =
"SELECT * FROM event_participants ".
206 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
207 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
211 return (
bool)
$row->registered;
220 $query =
"SELECT * FROM event_participants ".
221 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
222 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
226 $query =
"UPDATE event_participants ".
227 "SET registered = '1' ".
228 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
229 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
234 $query =
"INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
238 $ilDB->quote($a_event_id ,
'integer').
", ".
239 $ilDB->quote($a_usr_id ,
'integer').
" ".
245 function register($a_usr_id)
254 $query =
"SELECT * FROM event_participants ".
255 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
256 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
260 $query =
"UPDATE event_participants ".
261 "SET registered = 0 ".
262 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
263 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
268 $query =
"INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
272 $ilDB->quote($a_event_id ,
'integer').
", ".
273 $ilDB->quote($a_usr_id ,
'integer').
" ".
288 $query =
"SELECT * FROM event_participants ".
289 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
290 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
303 $query =
"SELECT * FROM event_participants ".
304 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
305 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
309 return $row->e_comment;
321 $this->event_id = $a_event_id;
328 $query =
"DELETE FROM event_participants ".
329 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ";
337 $query =
"DELETE FROM event_participants ".
338 "WHERE usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
349 $query =
"SELECT * FROM event_participants ".
350 "WHERE event_id = ".$ilDB->quote($this->
getEventId()).
" ";
354 $this->participants[
$row->usr_id][
'usr_id'] =
$row->usr_id;
355 $this->participants[
$row->usr_id][
'registered'] =
$row->registered;
356 $this->participants[
$row->usr_id][
'participated'] =
$row->participated;
357 $this->participants[
$row->usr_id][
'mark'] =
$row->mark;
358 $this->participants[
$row->usr_id][
'comment'] =
$row->e_comment;