diff options
author | Dirk Riestere | 2017-02-11 05:18:52 +0100 |
---|---|---|
committer | Dirk Riestere | 2017-02-11 05:18:52 +0100 |
commit | f42183951baa8b147c4861b3e1c9649f07d004dc (patch) | |
tree | 9a6f5ef37ef03969064c4f20cebb06a9bc7de1a4 /modules-available/locationinfo/HisInOneAPI.php | |
parent | Merge branch 'location-info-panel' of git.openslx.org:openslx-ng/slx-admin in... (diff) | |
download | slx-admin-f42183951baa8b147c4861b3e1c9649f07d004dc.tar.gz slx-admin-f42183951baa8b147c4861b3e1c9649f07d004dc.tar.xz slx-admin-f42183951baa8b147c4861b3e1c9649f07d004dc.zip |
Letzte Version war leider nicht vollständig was zu Fehlern führt
Diffstat (limited to 'modules-available/locationinfo/HisInOneAPI.php')
-rw-r--r-- | modules-available/locationinfo/HisInOneAPI.php | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/modules-available/locationinfo/HisInOneAPI.php b/modules-available/locationinfo/HisInOneAPI.php index 6593db4b..756b7d2b 100644 --- a/modules-available/locationinfo/HisInOneAPI.php +++ b/modules-available/locationinfo/HisInOneAPI.php @@ -2,7 +2,7 @@ interface iTimetableRequest { public function getJson($param); - public function getJsonsl($param); + public function getJsons($param); } class HisInOneSoapClient implements iTimetableRequest @@ -146,6 +146,14 @@ class HisInOneSoapClient implements iTimetableRequest } return json_encode($timetable); } + + public function toArray($response){ + $response = preg_replace("/(<\/?)(\w+):([^>]*>)/", "$1$2$3", $response); + $xml = new SimpleXMLElement($response); + $array = json_decode(json_encode((array)$xml), TRUE); + return $array; + } + //Request for a timetable with roomids as array public function getJsons($param){ //get all eventIDs in a given room @@ -193,19 +201,23 @@ class HisInOneSoapClient implements iTimetableRequest } function getCurrentWeekDates() { - $startdate = date('Y-m-d'); - $enddate = date('+1 week'); - - $DateArray = array(); - $timestamp = strtotime($startdate); - while ($startdate <= $enddate) { - $startdate = date('Y-m-d', $timestamp); - $DateArray[] = $startdate; - $timestamp = strtotime('+1 days', strtotime($startdate)); + $startdate = strtotime('Now'); + for($i=0 ;$i<=7; $i++) { + $DateArray[] = date('Y-m-d', strtotime("+ {$i} day", $startdate)); + } return $DateArray; } } + + +$params = array("planelementId"=>42); + try { + + } + catch (Exception $ex) { + var_dump($ex); + } ?> |