From ebe2b84fa451bb1e72b5618879a5495d4dc1e4ed Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Sat, 26 Nov 2016 11:33:20 -0800 Subject: Fixed a coordination bug which caused rotation bugs. Deleted the locationinfo db and added a setting_location_info all in the install.php --- modules-available/locationinfo/api.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'modules-available/locationinfo/api.inc.php') diff --git a/modules-available/locationinfo/api.inc.php b/modules-available/locationinfo/api.inc.php index e103905f..1e765be0 100644 --- a/modules-available/locationinfo/api.inc.php +++ b/modules-available/locationinfo/api.inc.php @@ -66,6 +66,8 @@ function getConfig($locationID) { while($dbresult=$dbquery->fetch(PDO::FETCH_ASSOC)) { $config = json_decode($dbresult['config'], true); $config['room'] = $dbresult['locationname']; + $date = getdate(); + $config['time'] = $date['year'] . "-" . $date['mon'] . "-" . $date['mday'] . " " . $date['hours'] . ":" . $date['minutes'] . ":" . $date['seconds']; } if (empty($config)) { echo json_encode(array()); @@ -181,8 +183,8 @@ function getPcInfos($locationID, $coords) { if ($coords == '1') { $position = json_decode($pc['position'], true); - $computer['x'] = $position['gridRow']; - $computer['y'] = $position['gridCol']; + $computer['x'] = $position['gridCol']; + $computer['y'] = $position['gridRow']; } $computer['inUse'] = 0; -- cgit v1.2.3-55-g7522