Zeiterfassung Anpassungen
This commit is contained in:
@@ -9,7 +9,7 @@ class TimerecordingModel
|
||||
private $commend;
|
||||
private $approved;
|
||||
private $completed;
|
||||
|
||||
|
||||
|
||||
public static function find($data)
|
||||
{
|
||||
@@ -78,6 +78,7 @@ class TimerecordingModel
|
||||
return $items;
|
||||
|
||||
}
|
||||
|
||||
public static function getAllPermits()
|
||||
{
|
||||
$items = [];
|
||||
@@ -140,8 +141,27 @@ class TimerecordingModel
|
||||
$where .= " AND user_id=$userid";
|
||||
}
|
||||
}
|
||||
if (array_key_exists("start", $filter) && array_key_exists("end", $filter)) {
|
||||
$start = $filter['start'];
|
||||
$end = $filter['end'];
|
||||
if (is_numeric($start) && is_numeric($end)) {
|
||||
$where .= " AND `start` > $start AND `start` < $end";
|
||||
}
|
||||
}
|
||||
if (array_key_exists("starttime", $filter) && array_key_exists("endtime", $filter)) {
|
||||
$starttime = $filter['starttime'];
|
||||
$endtime = $filter['endtime'];
|
||||
$id = $filter['id'];
|
||||
if (is_numeric($starttime) && is_numeric($endtime)) {
|
||||
$where .= " AND ((`start` <= $starttime AND `end` >= $starttime ) || (`start` >= $endtime AND `end` <= $endtime) || (`start` >= $starttime AND `end` >= $starttime AND `start` <= $endtime AND `end` <= $endtime))";
|
||||
if ($id && is_numeric($id)) {
|
||||
$where .= " AND `id` != $id";
|
||||
}
|
||||
|
||||
//var_dump($filter, $where);exit;
|
||||
}
|
||||
}
|
||||
//
|
||||
// var_dump($filter, $where);exit;
|
||||
return $where;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user