2017-12-04 18:22:58 +00:00
|
|
|
<?php
|
|
|
|
|
2018-05-23 10:14:20 +00:00
|
|
|
class Production extends Vn\Web\JsonRequest {
|
2017-12-04 18:22:58 +00:00
|
|
|
const PARAMS = ['deviceId'];
|
|
|
|
|
2018-05-23 10:14:20 +00:00
|
|
|
function run($db) {
|
|
|
|
$row = $db->getObject(
|
2018-01-17 11:49:09 +00:00
|
|
|
'SELECT displayText, status
|
|
|
|
FROM vn.routeGate WHERE deviceId = #',
|
|
|
|
[$_REQUEST['deviceId']]
|
|
|
|
);
|
2017-12-04 18:22:58 +00:00
|
|
|
|
2018-01-17 11:49:09 +00:00
|
|
|
if (!isset($row))
|
2018-05-23 10:14:20 +00:00
|
|
|
throw new Vn\Lib\UserException('Device not found');
|
2017-12-04 18:22:58 +00:00
|
|
|
|
2018-01-17 11:49:09 +00:00
|
|
|
return $row;
|
2017-12-04 18:22:58 +00:00
|
|
|
}
|
|
|
|
}
|