33 $this->event_id = $a_event_id;
39 $this->user_id = $a_usr_id;
43 return $this->user_id;
47 $this->mark = $a_mark;
55 $this->comment = $a_comment;
63 $this->participated = $a_status;
71 $this->registered = $a_status;
81 $query =
"DELETE FROM event_participants ".
82 "WHERE event_id = ".$ilDB->quote($this->
getEventId() ,
'integer').
" ".
83 "AND usr_id = ".$ilDB->quote($this->
getUserId() ,
'integer').
" ";
86 $query =
"INSERT INTO event_participants (event_id,usr_id,registered,participated".
88 $ilDB->quote($this->
getEventId() ,
'integer').
", ".
89 $ilDB->quote($this->
getUserId() ,
'integer').
", ".
97 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
100 $lp_mark->setMark($this->
getMark());
104 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
112 return $this->participants[$a_usr_id] ? $this->participants[$a_usr_id] : array();
117 return $this->participants ? $this->participants : array();
122 return $this->participants[$a_usr_id][
'registered'] ?
true :
false;
127 return $this->participants[$a_usr_id][
'participated'] ?
true :
false;
139 $query =
"SELECT * FROM event_participants ".
140 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
141 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
145 $query =
"UPDATE event_participants ".
146 "SET participated = ".$ilDB->quote($a_status ,
'integer').
" ".
147 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
148 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
153 $query =
"INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
155 $ilDB->quote(0 ,
'integer').
", ".
156 $ilDB->quote($a_status ,
'integer').
", ".
157 $ilDB->quote($a_event_id ,
'integer').
", ".
158 $ilDB->quote($a_usr_id ,
'integer').
" ".
164 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
174 $query =
"SELECT * FROM event_participants ".
175 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
176 "AND registered = ".$ilDB->quote(1 ,
'integer');
180 $user_ids[] =
$row->usr_id;
182 return $user_ids ? $user_ids : array();
189 $query =
"SELECT * FROM event_participants ".
190 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
191 "AND participated = 1";
195 $user_ids[] =
$row->usr_id;
197 return $user_ids ? $user_ids : array();
204 $query =
"SELECT participated FROM event_participants ".
205 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
206 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
208 if ($rec = $ilDB->fetchAssoc(
$res))
210 return (
bool) $rec[
"participated"];
219 $query =
"SELECT * FROM event_participants ".
220 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
221 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
225 return (
bool)
$row->registered;
234 $query =
"SELECT * FROM event_participants ".
235 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
236 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
240 $query =
"UPDATE event_participants ".
241 "SET registered = '1' ".
242 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
243 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
248 $query =
"INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
252 $ilDB->quote($a_event_id ,
'integer').
", ".
253 $ilDB->quote($a_usr_id ,
'integer').
" ".
259 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
264 function register($a_usr_id)
273 $query =
"SELECT * FROM event_participants ".
274 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
275 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
279 $query =
"UPDATE event_participants ".
280 "SET registered = 0 ".
281 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ".
282 "AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
287 $query =
"INSERT INTO event_participants (registered,participated,event_id,usr_id) ".
291 $ilDB->quote($a_event_id ,
'integer').
", ".
292 $ilDB->quote($a_usr_id ,
'integer').
" ".
298 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
310 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
311 $lp_mark =
new ilLPMarks($a_event_id, $a_usr_id);
312 return $lp_mark->getMark();
331 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
332 $lp_mark =
new ilLPMarks($a_event_id, $a_usr_id);
333 return $lp_mark->getComment();
357 $this->event_id = $a_event_id;
364 $query =
"DELETE FROM event_participants ".
365 "WHERE event_id = ".$ilDB->quote($a_event_id ,
'integer').
" ";
368 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
377 $query =
"DELETE FROM event_participants ".
378 "WHERE usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
389 include_once
"Services/Tracking/classes/class.ilLPMarks.php";
393 $query =
"SELECT * FROM event_participants ".
394 "WHERE event_id = ".$ilDB->quote($this->
getEventId()).
" ";
398 $this->participants[
$row->usr_id][
'usr_id'] =
$row->usr_id;
399 $this->participants[
$row->usr_id][
'registered'] =
$row->registered;
400 $this->participants[
$row->usr_id][
'participated'] =
$row->participated;
407 $this->participants[
$row->usr_id][
'mark'] = $lp_mark->getMark();
408 $this->participants[
$row->usr_id][
'comment'] = $lp_mark->getComment();
413 $this->registered[] =
$row->usr_id;
415 if(
$row->participated)
417 $this->participated[] =
$row->usr_id;