diff options
-rw-r--r-- | includes/model/NeededAngelTypes_model.php | 9 | ||||
-rw-r--r-- | includes/mysqli_provider.php | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/includes/model/NeededAngelTypes_model.php b/includes/model/NeededAngelTypes_model.php index 76796869..3bd3660f 100644 --- a/includes/model/NeededAngelTypes_model.php +++ b/includes/model/NeededAngelTypes_model.php @@ -87,14 +87,15 @@ function NeededAngelTypes_by_shift($shiftId) { $shift_entries = ShiftEntries_by_shift($shiftId); $needed_angeltypes = []; foreach ($needed_angeltypes_source as $angeltype) { + $angeltype['shift_entries'] = []; $angeltype['taken'] = 0; - foreach($shift_entries as $shift_entry) { - if($shift_entry['TID']==$angeltype['id'] && $shift_entry['freeloaded'] == 0) { - $angeltype['taken']++; + foreach ($shift_entries as $shift_entry) { + if ($shift_entry['TID'] == $angeltype['angel_type_id'] && $shift_entry['freeloaded'] == 0) { + $angeltype['taken'] ++; + $angeltype['shift_entries'][] = $shift_entry; } } - $angeltype['shift_entries'] = $shift_entries; $needed_angeltypes[] = $angeltype; } diff --git a/includes/mysqli_provider.php b/includes/mysqli_provider.php index b1fd5f4a..c81f157f 100644 --- a/includes/mysqli_provider.php +++ b/includes/mysqli_provider.php @@ -131,8 +131,8 @@ function sql_select_db($db_name) { function sql_select($query) { global $sql_connection; - echo $query . ";\n"; - echo debug_string_backtrace() . "\n"; +// echo $query . ";\n"; +// echo debug_string_backtrace() . "\n"; $result = $sql_connection->query($query); if ($result) { |