Kalender Anpassungen

- Anpassungen bei neuen Kalenderbenutzern
This commit is contained in:
Daniel Spitzer
2025-06-06 09:29:25 +02:00
parent a71ae02128
commit df2dd9c596
5 changed files with 68 additions and 35 deletions

View File

@@ -74,12 +74,13 @@ class TimerecordingModel
}
return $item;
}
public static function getAllHours($user_id)
{
$items = [];
$db = FronkDB::singleton();
$sql="SELECT SUM(`end` - `start`) AS gesamt_summe FROM Timerecording where user_id=$user_id AND `timerecordingCategory_id` =1";
$sql = "SELECT SUM(`end` - `start`) AS gesamt_summe FROM Timerecording where user_id=$user_id AND `timerecordingCategory_id` =1";
$res = $db->query($sql);
if ($db->num_rows($res)) {
while ($data = $db->fetch_object($res)) {
@@ -185,7 +186,7 @@ class TimerecordingModel
if (array_key_exists("start", $filter) && array_key_exists("hours", $filter)) {
$start = $filter['start'];
if (is_numeric($start)) {
$where .= " AND `start` >= $start AND (`hours`>0 or `hours_overtime`>0) ORDER by start ASC";
$where .= " AND `start` >= $start AND (`hours`>0 or `hours`<0 or `hours_overtime`>0) ORDER by start ASC";
}
}
if (array_key_exists("start", $filter) && array_key_exists("days", $filter)) {