diff options
author | Michael Scherle | 2016-12-18 21:10:17 +0100 |
---|---|---|
committer | Michael Scherle | 2016-12-18 21:10:17 +0100 |
commit | 9ecaffdc667439377cd01dd86297050fed14e70b (patch) | |
tree | 804a1f6606d0788098e5c2c81ec9ceb40de6d6e7 /modules-available/locationinfo | |
parent | frontend: frontend now supports direkt calendar query if backends sends query... (diff) | |
parent | vergessen eine datei zu speichern (diff) | |
download | slx-admin-9ecaffdc667439377cd01dd86297050fed14e70b.tar.gz slx-admin-9ecaffdc667439377cd01dd86297050fed14e70b.tar.xz slx-admin-9ecaffdc667439377cd01dd86297050fed14e70b.zip |
Merge branch 'location-info-panel' of git.openslx.org:openslx-ng/slx-admin into location-info-panel
Diffstat (limited to 'modules-available/locationinfo')
-rw-r--r-- | modules-available/locationinfo/api.inc.php | 28 | ||||
-rw-r--r-- | modules-available/locationinfo/page.inc.php | 29 |
2 files changed, 29 insertions, 28 deletions
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); + } 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); - } - - - - - } + } |