mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 08:22:17 +00:00
added Parking feauture to infocenter
This commit is contained in:
@@ -12,4 +12,21 @@ class Studienjahr_model extends DB_Model
|
||||
$this->pk = 'studienjahr_kurzbz';
|
||||
$this->hasSequence = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets current Studienjahr, as determined by its start and enddate
|
||||
* @return array|null
|
||||
*/
|
||||
public function getCurrStudienjahr()
|
||||
{
|
||||
$query = 'SELECT *
|
||||
FROM public.tbl_studienjahr
|
||||
JOIN public.tbl_studiensemester using(studienjahr_kurzbz)
|
||||
WHERE start <= now()
|
||||
AND ende >= now()
|
||||
ORDER by start DESC
|
||||
LIMIT 1';
|
||||
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,4 +90,36 @@ class PersonLog_model extends CI_Model
|
||||
|
||||
return success($result->result());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all logs with zeitpunkt > today
|
||||
* @param $person_id
|
||||
* @return array
|
||||
*/
|
||||
public function getLogsInFuture($person_id)
|
||||
{
|
||||
$this->db->order_by('zeitpunkt', 'DESC');
|
||||
$this->db->order_by('log_id', 'DESC');
|
||||
|
||||
$result = $this->db->get_where($this->dbTable, "person_id=".$this->db->escape($person_id)." AND zeitpunkt > now()");
|
||||
|
||||
return success($result->result());
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a log
|
||||
* @param $log_id
|
||||
* @return array
|
||||
*/
|
||||
public function deleteLog($log_id)
|
||||
{
|
||||
$this->load->library('PermissionLib');
|
||||
if(!$this->permissionlib->isEntitled('system.tbl_log', PermissionLib::DELETE_RIGHT))
|
||||
show_error('Permission denied - You need Access to system.tbl_log');
|
||||
|
||||
$this->db->where('log_id', $log_id);
|
||||
$result = $this->db->delete($this->dbTable);
|
||||
|
||||
return success($result);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user