From 90bffc4950a12708c592f0139361c2a833f0e0e3 Mon Sep 17 00:00:00 2001 From: Dirk Riestere Date: Wed, 14 Dec 2016 18:38:40 +0100 Subject: Die funktion ist jetzt in der api und gibt ein leeres json zurück falls servertype nicht Hisinone ist --- modules-available/locationinfo/api.inc.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'modules-available') diff --git a/modules-available/locationinfo/api.inc.php b/modules-available/locationinfo/api.inc.php index d156f7ab..106f6498 100644 --- a/modules-available/locationinfo/api.inc.php +++ b/modules-available/locationinfo/api.inc.php @@ -230,3 +230,31 @@ function getPcInfos($locationID, $coords) { return $str; } +function fetchNewTimeTable($locationID){ + //Get room information + $dbquery1 = Database::simpleQuery("SELECT serverid, serverroomid FROM location_info WHERE locationid = :id", array('id' => $locationID)); + $dbd1=$dbquery1->fetch(PDO::FETCH_ASSOC); + $serverID = $dbd1['serverid']; + $roomID = $dbd1['serverroomid']; + //Get login data for the server + $dbquery2 = Database::simpleQuery("SELECT serverurl, servertype, login, passwd FROM `setting_location_info` WHERE serverid = :id", array('id' => $serverID)); + $dbd2=$dbquery2->fetch(PDO::FETCH_ASSOC); + $url = $dbd2['serverurl']; + $type = $dbd2['servetype']; + $lname = $dbd2['login']; + $passwd = $dbd2['passwd']; + //Return json with dates + if($type == 'HISinOne'){ + $array = file_get_contents($url . $roomID . '.json'); + $ttable = json_decode($array); + $results = count($ttable); + for ($r = 0; $r < $results; $r++){ + unset($ttable[$r]->allDay); + } + + } + else{ + $ttable = "{}"; + } + return json_encode($ttable); + } -- cgit v1.2.3-55-g7522 From c2e5b93599bb3b7b7b0c3b27db2eca16329d7e76 Mon Sep 17 00:00:00 2001 From: Dirk Riestere Date: Wed, 14 Dec 2016 18:40:32 +0100 Subject: vergessen eine datei zu speichern --- modules-available/locationinfo/page.inc.php | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'modules-available') diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php index 2dc32c84..f855c5c5 100644 --- a/modules-available/locationinfo/page.inc.php +++ b/modules-available/locationinfo/page.inc.php @@ -460,32 +460,5 @@ class Page_LocationInfo extends Page 'roomupdate' => $array['roomupdate'], 'configupdate' => $array['configupdate'], 'serverlist' => array_values($serverList), 'serverid' => $serverid, 'serverroomid' => $serverroomid)); } - private function fetchNewTimeTable($locationID){ - //Get room information - $dbquery1 = Database::simpleQuery("SELECT serverid, serverroomid FROM location_info WHERE locationid = :id", array('id' => $locationID)); - $dbd1=$dbquery1->fetch(PDO::FETCH_ASSOC); - $serverID = $dbd1['serverid']; - $roomID = $dbd1['serverroomid']; - //Get login data for the server - $dbquery2 = Database::simpleQuery("SELECT serverurl, servertype, login, passwd FROM `setting_location_info` WHERE serverid = :id", array('id' => $serverID)); - $dbd2=$dbquery2->fetch(PDO::FETCH_ASSOC); - $url = $dbd2['serverurl']; - $type = $dbd2['servetype']; - $lname = $dbd2['login']; - $passwd = $dbd2['passwd']; - //Return json with dates - if($type == 'HISinOne'){ - $array = file_get_contents($url . $roomID . '.json'); - $ttable = json_decode($array); - $results = count($ttable); - for ($r = 0; $r < $results; $r++){ - unset($ttable[$r]->allDay); - } - return json_encode($ttable); - } - - - - - } + } -- cgit v1.2.3-55-g7522