53 $this->obj_id = $a_obj_id;
69 $query =
"DELETE FROM crs_waiting_list WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
86 $query =
"DELETE FROM crs_waiting_list WHERE usr_id = ".$ilDB->quote($a_usr_id ,
'integer');
102 $query =
"DELETE FROM crs_waiting_list ".
103 "WHERE usr_id = ".$ilDB->quote($a_usr_id,
'integer').
' '.
104 "AND obj_id = ".$ilDB->quote($a_obj_id,
'integer');
135 $query =
"INSERT INTO crs_waiting_list (obj_id,usr_id,sub_time) ".
137 $ilDB->quote($this->
getObjId() ,
'integer').
", ".
138 $ilDB->quote($a_usr_id ,
'integer').
", ".
139 $ilDB->quote(time() ,
'integer').
" ".
158 $query =
"UPDATE crs_waiting_list ".
159 "SET sub_time = ".$ilDB->quote($a_subtime ,
'integer').
" ".
160 "WHERE usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ".
161 "AND obj_id = ".$ilDB->quote($this->
getObjId() ,
'integer').
" ";
177 $query =
"DELETE FROM crs_waiting_list ".
178 " WHERE obj_id = ".$ilDB->quote($this->
getObjId() ,
'integer').
" ".
179 " AND usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
195 return isset($this->users[$a_usr_id]) ?
true :
false;
210 $query =
"SELECT usr_id ".
211 "FROM crs_waiting_list ".
212 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
'integer').
" ".
213 "AND usr_id = ".$ilDB->quote($a_usr_id,
'integer');
215 return $res->numRows() ?
true :
false;
226 return count($this->users);
238 return isset($this->users[$a_usr_id]) ? $this->users[$a_usr_id][
'position'] : -1;
249 return $this->users ? $this->users : array();
261 return isset($this->users[$a_usr_id]) ? $this->users[$a_usr_id] :
false;
271 return $this->user_ids ? $this->user_ids : array();
286 $this->users = array();
288 $query =
"SELECT * FROM crs_waiting_list ".
289 "WHERE obj_id = ".$ilDB->quote($this->
getObjId() ,
'integer').
" ORDER BY sub_time";
296 $this->users[
$row->usr_id][
'position'] = $counter;
297 $this->users[
$row->usr_id][
'time'] =
$row->sub_time;
298 $this->users[
$row->usr_id][
'usr_id'] =
$row->usr_id;
300 $this->user_ids[] =
$row->usr_id;