actube/src/webui/actube.php
7u83@mail.ru f1feb4bc0d Webui...
FossilOrigin-Name: 1347512fa601971a2b059929d532efbc74b254262bd0b6eef92e629df89a82f7
2015-04-26 06:40:59 +00:00

27 lines
397 B
PHP

<?php
header('Content-Type: application/json');
class DB extends SQLite3
{
function __construct()
{
$this->open("../ac/ac.sqlite3");
}
}
$db = new DB();
$results = $db->query("SELECT acid as id, acname as name ,lastseen>datetime('now','-10 second') as active FROM acs;");
$r= array();
while ($row = $results->fetchArray()) {
array_push($r,$row);
}
$j = json_encode ($r);
echo "$j";