30 $this->event_id = $a_event_id;
36 $this->user_id = $a_usr_id;
40 return $this->user_id;
44 $this->mark = $a_mark;
52 $this->comment = $a_comment;
60 $this->participated = $a_status;
64 return $this->participated;
68 $this->registered = $a_status;
72 return $this->registered;
78 $query =
"DELETE FROM event_participants ".
79 "WHERE event_id = ".$ilDB->quote($this->
getEventId() ,
'integer').
" ".
80 "AND usr_id = ".$ilDB->quote($this->
getUserId() ,
'integer').
" ";
83 $query =
"INSERT INTO event_participants (event_id,usr_id,registered,participated".
85 $ilDB->quote($this->
getEventId() ,
'integer').
", ".
86 $ilDB->quote($this->
getUserId() ,
'integer').
", ".
94 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
97 $lp_mark->setMark($this->
getMark());
101 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
109 return $this->participants[$a_usr_id] ? $this->participants[$a_usr_id] : array();
114 return $this->participants ? $this->participants : array();
119 return $this->participants[$a_usr_id][
'registered'] ?
true :
false;
124 return $this->participants[$a_usr_id][
'participated'] ?
true :
false;
136 $query =
"SELECT * FROM event_participants ".
137 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
138 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
142 $query =
"UPDATE event_participants ".
143 "SET participated = ".$ilDB->quote($a_status ,
'integer').
" ".
144 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
145 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
150 $query =
"INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
152 $ilDB->quote(0 ,
'integer').
", ".
153 $ilDB->quote($a_status ,
'integer').
", ".
154 $ilDB->quote($a_event_id ,
'integer').
", ".
155 $ilDB->quote($a_usr_id ,
'integer').
" ".
161 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
171 $query =
"SELECT * FROM event_participants ".
172 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
173 "AND registered = ".$ilDB->quote(1 ,
'integer');
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 ,
'integer').
" ".
188 "AND participated = 1";
192 $user_ids[] =
$row->usr_id;
194 return $user_ids ? $user_ids : array();
201 $query =
"SELECT participated FROM event_participants ".
202 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
203 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
205 if ($rec = $ilDB->fetchAssoc(
$res))
207 return (
bool) $rec[
"participated"];
216 $query =
"SELECT * FROM event_participants ".
217 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
218 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
222 return (
bool)
$row->registered;
231 $query =
"SELECT * FROM event_participants ".
232 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
233 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
237 $query =
"UPDATE event_participants ".
238 "SET registered = '1' ".
239 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
240 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
245 $query =
"INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
249 $ilDB->quote($a_event_id ,
'integer').
", ".
250 $ilDB->quote($a_usr_id ,
'integer').
" ".
256 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
261 function register($a_usr_id)
270 $query =
"SELECT * FROM event_participants ".
271 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
272 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
276 $query =
"UPDATE event_participants ".
277 "SET registered = 0 ".
278 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
279 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
284 $query =
"INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
288 $ilDB->quote($a_event_id ,
'integer').
", ".
289 $ilDB->quote($a_usr_id ,
'integer').
" ".
295 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
307 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
308 $lp_mark =
new ilLPMarks($a_event_id, $a_usr_id);
309 return $lp_mark->getMark();
328 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
329 $lp_mark =
new ilLPMarks($a_event_id, $a_usr_id);
330 return $lp_mark->getComment();
354 $this->event_id = $a_event_id;
361 $query =
"DELETE FROM event_participants ".
362 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ";
365 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
374 $query =
"DELETE FROM event_participants ".
375 "WHERE usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
386 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
388 $query =
"SELECT * FROM event_participants ".
389 "WHERE event_id = ".$ilDB->quote($this->
getEventId()).
" ";
393 $this->participants[
$row->usr_id][
'usr_id'] =
$row->usr_id;
394 $this->participants[
$row->usr_id][
'registered'] =
$row->registered;
395 $this->participants[
$row->usr_id][
'participated'] =
$row->participated;
402 $this->participants[
$row->usr_id][
'mark'] = $lp_mark->getMark();
403 $this->participants[
$row->usr_id][
'comment'] = $lp_mark->getComment();