From a4e7d6f3f6d71788783d307d519141e42b87e67f Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Sat, 4 Apr 2015 19:10:50 +0200 Subject: [PATCH] directory structure and web-time format --- README.md | 2 +- {gfx => www/gfx}/logo.png | Bin www/index.php | 20 +++++++++++++------- www/parser.php | 4 ++-- 4 files changed, 16 insertions(+), 10 deletions(-) rename {gfx => www/gfx}/logo.png (100%) diff --git a/README.md b/README.md index 54c27bc..836ca18 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![# BOSWatch](/gfx/logo.png) +![# BOSWatch](/www/gfx/logo.png) Python Script to Recive and Decode German BOS Information with rtl_fm and multimon-NG diff --git a/gfx/logo.png b/www/gfx/logo.png similarity index 100% rename from gfx/logo.png rename to www/gfx/logo.png diff --git a/www/index.php b/www/index.php index a02cf78..b962b07 100644 --- a/www/index.php +++ b/www/index.php @@ -15,7 +15,7 @@ $db_link = mysqli_connect ($dbhost, $dbuser, $dbpassword, $database);
-

BOSWatch

+ BOSWatch
Last alarms for FMS and ZVEI (max. 50)

@@ -25,14 +25,17 @@ $db_link = mysqli_connect ($dbhost, $dbuser, $dbpassword, $database); $sql = "SELECT id, time, service, country, location, vehicle, status, direction, tsi FROM ".$tableFMS." ORDER BY id DESC LIMIT 50"; $db_erg = mysqli_query( $db_link, $sql ); - echo ''; while ($data = mysqli_fetch_array( $db_erg, MYSQL_ASSOC)) { + + $time = strtotime($data['time']); + $time = date("d.m.Y H:i:s", $time); + $fms_id = $data['service'].$data['country'].$data['location'].$data['vehicle'].$data['status'].$data['direction']; echo ""; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -51,14 +54,17 @@ $db_link = mysqli_connect ($dbhost, $dbuser, $dbpassword, $database); '; while ($data = mysqli_fetch_array( $db_erg, MYSQL_ASSOC)) { - echo ""; + + $time = strtotime($data['time']); + $time = date("d.m.Y H:i:s", $time); + + echo ""; echo ""; - echo ""; + echo ""; echo ""; echo ""; } diff --git a/www/parser.php b/www/parser.php index f74713f..e1242ad 100644 --- a/www/parser.php +++ b/www/parser.php @@ -55,9 +55,9 @@ case "direction": if(substr($fms,9,1) == 1){ - return "L-F"; + return "L->F"; }elseif(substr($fms,9,1) == 0){ - return "F-L"; + return "F->L"; } break;
". $data['id'] . "". $data['time'] . "". $time . "". parse("service",$fms_id) . "". parse("country",$fms_id) . "". $data['location'] . "
". $data['id'] . "". $data['time'] . "". $time . "". $data['zvei'] . "