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()).
" ".
100 "AND usr_id = ".$ilDB->quote($this->
getUserId()).
" ";
101 $this->db->query($query);
103 $query =
"INSERT INTO event_participants ".
104 "SET event_id = ".$ilDB->quote($this->
getEventId()).
", ".
105 "usr_id = ".$ilDB->quote($this->
getUserId()).
", ".
108 "mark = ".$ilDB->quote($this->
getMark()).
", ".
109 "comment = ".$ilDB->quote($this->
getComment()).
"";
110 $this->db->query($query);
116 return $this->participants[$a_usr_id] ? $this->participants[$a_usr_id] : array();
121 return $this->participants ? $this->participants : array();
126 return $this->participants[$a_usr_id][
'registered'] ?
true :
false;
131 return $this->participants[$a_usr_id][
'participated'] ?
true :
false;
143 $query =
"SELECT * FROM event_participants ".
144 "WHERE event_id = ".$ilDB->quote($a_event_id).
" ".
145 "AND usr_id = ".$ilDB->quote($a_usr_id).
" ";
146 $res = $ilDB->query($query);
149 $query =
"UPDATE event_participants ".
150 "SET participated = ".$ilDB->quote($a_status).
" ".
151 "WHERE event_id = ".$ilDB->quote($a_event_id).
" ".
152 "AND usr_id = ".$ilDB->quote($a_usr_id).
" ";
153 $ilDB->query($query);
157 $query =
"INSERT INTO event_participants ".
158 "SET registered = '0', ".
159 "participated = ".$ilDB->quote($a_status).
", ".
160 "event_id = ".$ilDB->quote($a_event_id).
", ".
161 "usr_id = ".$ilDB->quote($a_usr_id).
" ";
162 $ilDB->query($query);
171 $query =
"SELECT * FROM event_participants ".
172 "WHERE event_id = ".$ilDB->quote($a_event_id).
" ".
173 "AND registered = '1'";
174 $res = $ilDB->query($query);
177 $user_ids[] = $row->usr_id;
179 return $user_ids ? $user_ids : array();
186 $query =
"SELECT * FROM event_participants ".
187 "WHERE event_id = ".$ilDB->quote($a_event_id).
" ".
188 "AND participated = '1'";
189 $res = $ilDB->query($query);
192 $user_ids[] = $row->usr_id;
194 return $user_ids ? $user_ids : array();
201 $query =
"SELECT * FROM event_participants ".
202 "WHERE event_id = ".$ilDB->quote($a_event_id).
" ".
203 "AND usr_id = ".$ilDB->quote($a_usr_id).
" ";
204 $res = $ilDB->query($query);
207 return (
bool) $row->registered;
216 $query =
"SELECT * FROM event_participants ".
217 "WHERE event_id = ".$ilDB->quote($a_event_id).
" ".
218 "AND usr_id = ".$ilDB->quote($a_usr_id).
" ";
219 $res = $ilDB->query($query);
222 $query =
"UPDATE event_participants ".
223 "SET registered = '1' ".
224 "WHERE event_id = ".$ilDB->quote($a_event_id).
" ".
225 "AND usr_id = ".$ilDB->quote($a_usr_id).
" ";
226 $ilDB->query($query);
230 $query =
"INSERT INTO event_participants ".
231 "SET registered = '1', ".
232 "participated = '0', ".
233 "event_id = ".$ilDB->quote($a_event_id).
", ".
234 "usr_id = ".$ilDB->quote($a_usr_id).
" ";
235 $ilDB->query($query);
239 function register($a_usr_id)
248 $query =
"SELECT * FROM event_participants ".
249 "WHERE event_id = ".$ilDB->quote($a_event_id).
" ".
250 "AND usr_id = ".$ilDB->quote($a_usr_id).
" ";
251 $res = $ilDB->query($query);
254 $query =
"UPDATE event_participants ".
255 "SET registered = '0' ".
256 "WHERE event_id = ".$ilDB->quote($a_event_id).
" ".
257 "AND usr_id = ".$ilDB->quote($a_usr_id).
" ";
258 $ilDB->query($query);
262 $query =
"INSERT INTO event_participants ".
263 "SET registered = '0', ".
264 "participated = '0', ".
265 "event_id = ".$ilDB->quote($a_event_id).
", ".
266 "usr_id = ".$ilDB->quote($a_usr_id).
" ";
267 $ilDB->query($query);
280 $query =
"SELECT * FROM event_participants ".
281 "WHERE event_id = ".$ilDB->quote($a_event_id).
" ".
282 "AND usr_id = ".$ilDB->quote($a_usr_id).
" ";
283 $res = $ilDB->query($query);
295 $query =
"SELECT * FROM event_participants ".
296 "WHERE event_id = ".$ilDB->quote($a_event_id).
" ".
297 "AND usr_id = ".$ilDB->quote($a_usr_id).
" ";
298 $res = $ilDB->query($query);
301 return $row->comment;
313 $this->event_id = $a_event_id;
320 $query =
"DELETE FROM event_participants ".
321 "WHERE event_id = ".$ilDB->quote($a_event_id).
" ";
322 $ilDB->query($query);
329 $query =
"DELETE FROM event_participants ".
330 "WHERE usr_id = ".$ilDB->quote($a_usr_id).
" ";
331 $ilDB->query($query);
341 $query =
"SELECT * FROM event_participants ".
342 "WHERE event_id = ".$ilDB->quote($this->
getEventId()).
" ";
343 $res = $this->db->query($query);
346 $this->participants[$row->usr_id][
'usr_id'] = $row->usr_id;
347 $this->participants[$row->usr_id][
'registered'] = $row->registered;
348 $this->participants[$row->usr_id][
'participated'] = $row->participated;
349 $this->participants[$row->usr_id][
'mark'] = $row->mark;
350 $this->participants[$row->usr_id][
'comment'] = $row->comment;