summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/api.inc.php
diff options
context:
space:
mode:
authorJannik Schönartz2016-12-02 05:01:08 +0100
committerJannik Schönartz2016-12-02 05:01:08 +0100
commit18942f2e247d7e195367ddf7048d071be50feef5 (patch)
treef0e96c3fb73c2c2c4e3c4a88a4b6e97695e3258f /modules-available/locationinfo/api.inc.php
parentfixed daystoshow not working (diff)
downloadslx-admin-18942f2e247d7e195367ddf7048d071be50feef5.tar.gz
slx-admin-18942f2e247d7e195367ddf7048d071be50feef5.tar.xz
slx-admin-18942f2e247d7e195367ddf7048d071be50feef5.zip
locationinfo: added easymode to the opening time
Diffstat (limited to 'modules-available/locationinfo/api.inc.php')
-rw-r--r--modules-available/locationinfo/api.inc.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules-available/locationinfo/api.inc.php b/modules-available/locationinfo/api.inc.php
index 1e765be0..b96dbdc6 100644
--- a/modules-available/locationinfo/api.inc.php
+++ b/modules-available/locationinfo/api.inc.php
@@ -87,17 +87,19 @@ function checkIfHidden($locationID) {
return true;
}
}
+ return -1;
}
function getOpeningTimesFromParent($locationID) {
$dbquery = Database::simpleQuery("SELECT parentlocationid FROM `location` WHERE locationid = :locationID", array('locationID' => $locationID));
+ $parentlocationid = 0;
while($dbdata=$dbquery->fetch(PDO::FETCH_ASSOC)) {
- $parentlocationid = $dbdata['parentlocationid'];
+ $parentlocationid = (int)$dbdata['parentlocationid'];
}
if ($parentlocationid == 0) {
echo json_encode(array());
}else {
- echo getOpeningTimes($parentlocationid);
+ getOpeningTimes($parentlocationid);
}
}
@@ -110,6 +112,8 @@ function getOpeningTimes($locationID) {
$dbquery = Database::simpleQuery("SELECT openingtime FROM `location_info` WHERE locationid = :locationID", array('locationID' => $locationID));
$result = array();
+ $dbresult = array();
+
while($dbdata=$dbquery->fetch(PDO::FETCH_ASSOC)) {
$dbresult = json_decode($dbdata['openingtime'], true);
}
@@ -165,8 +169,6 @@ function getRoomInfoJson($locationID, $coords) {
}
function getPcInfos($locationID, $coords) {
- $dbquery;
-
if ($coords == '1') {
$dbquery = Database::simpleQuery("SELECT machineuuid, position, logintime FROM `machine` WHERE locationid = :locationID" , array('locationID' => $locationID));
} else {