f1feb4bc0d
FossilOrigin-Name: 1347512fa601971a2b059929d532efbc74b254262bd0b6eef92e629df89a82f7
27 lines
397 B
PHP
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";
|
|
|