33 lines
1.0 KiB
PHP
33 lines
1.0 KiB
PHP
<?php
|
|
// Parse with sections
|
|
$ini = parse_ini_file("conf.ini", true);
|
|
|
|
mysql_connect($ini['db']['host'],$ini['db']['user'],$ini['db']['pass']);
|
|
mysql_select_db($ini['db']['db']);
|
|
|
|
if ($ini['db']['log']=="1"){
|
|
$arrival_time=microtime(true);
|
|
$filename=basename(__FILE__);
|
|
$filename="log_".$filename.".txt";
|
|
$chunck=strval($arrival_time)." ".$_SERVER['REQUEST_URI']."\r\n";
|
|
file_put_contents($filename,$chunck,FILE_APPEND);
|
|
}
|
|
|
|
//$q=mysql_query("SELECT latitude,longitude,enabled as state FROM notifications union SELECT latitude,longitude,enabled as state FROM notifications_notactive");
|
|
|
|
$q=mysql_query("SELECT latitude,longitude,enabled as state FROM notifications");
|
|
|
|
while($e=mysql_fetch_assoc($q))
|
|
$output[]=$e;
|
|
|
|
$q=mysql_query("SELECT latitude,longitude,signals as users,state,code,pro,TIMESTAMPDIFF(MINUTE,date,NOW()) AS difference FROM earthquakes where latitude<>0 AND longitude<>0 AND donotshow=0 AND ban<5");
|
|
|
|
while($e=mysql_fetch_assoc($q))
|
|
|
|
$output[]=$e;
|
|
|
|
print(json_encode($output));
|
|
|
|
mysql_close();
|
|
?>
|