diff options
author | Dirk Riestere | 2016-12-12 20:46:48 +0100 |
---|---|---|
committer | Dirk Riestere | 2016-12-12 20:46:48 +0100 |
commit | b0e907bc78e8fe8e6989d7dcabe6324fa2fd126f (patch) | |
tree | 611a8c21e9a1d3dd98ac06ffbd678c0fc872b07c /modules-available/locationinfo/page.inc.php | |
parent | Fixed install.php int -> varchar (diff) | |
download | slx-admin-b0e907bc78e8fe8e6989d7dcabe6324fa2fd126f.tar.gz slx-admin-b0e907bc78e8fe8e6989d7dcabe6324fa2fd126f.tar.xz slx-admin-b0e907bc78e8fe8e6989d7dcabe6324fa2fd126f.zip |
Funktion um json von HisInOne abzufragen, es wird aber noch keine neue Datei erstellt
Diffstat (limited to 'modules-available/locationinfo/page.inc.php')
-rw-r--r-- | modules-available/locationinfo/page.inc.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php index 9b0cf487..2dc32c84 100644 --- a/modules-available/locationinfo/page.inc.php +++ b/modules-available/locationinfo/page.inc.php @@ -460,4 +460,32 @@ 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); + } + + + + + } } |