Webui...
FossilOrigin-Name: 1347512fa601971a2b059929d532efbc74b254262bd0b6eef92e629df89a82f7
This commit is contained in:
26
src/webui/actube.php
Normal file
26
src/webui/actube.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?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";
|
||||
|
Reference in New Issue
Block a user