summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-12-28 14:34:09 +0100
committermsquare <msquare@notrademark.de>2016-12-28 14:34:09 +0100
commitcbeb45ef16a62095a44f14dc7a2ff7a20b947c74 (patch)
tree64c6fe191beabe065e757fac6538ddee0aac3e59 /includes
parent45200b503d1a97ac289ad057a8e7353a4690b99a (diff)
redo
Diffstat (limited to 'includes')
-rw-r--r--includes/model/Shifts_model.php41
1 files changed, 0 insertions, 41 deletions
diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php
index 87edba8d..e7a93345 100644
--- a/includes/model/Shifts_model.php
+++ b/includes/model/Shifts_model.php
@@ -69,9 +69,7 @@ function Shifts_by_ShiftsFilter(ShiftsFilter $shiftsFilter) {
return $result;
}
-/*
function NeededAngeltypes_by_ShiftsFilter(ShiftsFilter $shiftsFilter) {
- $time_start = microtime(true);
$SQL = "SELECT `NeededAngelTypes`.*, `Shifts`.`SID`, `AngelTypes`.`id`, `AngelTypes`.`name`, `AngelTypes`.`restricted`, `AngelTypes`.`no_self_signup`
FROM `Shifts`
JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`shift_id`=`Shifts`.`SID`
@@ -93,45 +91,6 @@ function NeededAngeltypes_by_ShiftsFilter(ShiftsFilter $shiftsFilter) {
if ($result === false) {
engelsystem_error("Unable to load needed angeltypes by filter.");
}
- echo microtime(true)-$time_start;die();
- return $result;
-}
-*/
-function NeededAngeltypes_by_ShiftsFilter(ShiftsFilter $shiftsFilter) {
-// $time_start = microtime(true);
- $SQL = "CREATE TEMPORARY TABLE
- shifts_view
- AS
- SELECT `Shifts`.`SID`, `Shifts`.`PSID`, `Shifts`.`RID`
- FROM `Shifts`
- WHERE `Shifts`.`RID` IN (" . implode(',', $shiftsFilter->getRooms()) . ")
- AND `start` BETWEEN " . $shiftsFilter->getStartTime() . " AND " . $shiftsFilter->getEndTime() . "
- ;";
- $result = sql_query($SQL);
- if ($result === false) {
- engelsystem_error("Unable to load needed angeltypes by filter.");
- }
-
- $SQL = "SELECT `NeededAngelTypes`.*, `shifts_view`.`SID`, `AngelTypes`.`id`, `AngelTypes`.`name`, `AngelTypes`.`restricted`, `AngelTypes`.`no_self_signup`
- FROM `shifts_view`
- JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`shift_id`=`shifts_view`.`SID`
- JOIN `AngelTypes` ON `AngelTypes`.`id`= `NeededAngelTypes`.`angel_type_id`
- WHERE `shifts_view`.`PSID` IS NULL";
- $result1 = sql_select($SQL);
- if ($result === false) {
- engelsystem_error("Unable to load needed angeltypes by filter.");
- }
- $SQL = "SELECT `NeededAngelTypes`.*, `shifts_view`.`SID`, `AngelTypes`.`id`, `AngelTypes`.`name`, `AngelTypes`.`restricted`, `AngelTypes`.`no_self_signup`
- FROM `shifts_view`
- JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`room_id`=`shifts_view`.`RID`
- JOIN `AngelTypes` ON `AngelTypes`.`id`= `NeededAngelTypes`.`angel_type_id`
- WHERE NOT `shifts_view`.`PSID` IS NULL";
- $result2 = sql_select($SQL);
- if ($result === false) {
- engelsystem_error("Unable to load needed angeltypes by filter.");
- }
- $result = array_merge($result1, $result2);
-// echo microtime(true)-$time_start;die();
return $result;
}