diff --git a/www/config.php b/www/config.php
index f0b96e5..e78cee2 100644
--- a/www/config.php
+++ b/www/config.php
@@ -2,7 +2,7 @@
$dbhost = "localhost";
$dbuser = "root";
-$dbpassword = "root";
+$dbpassword = "";
$database = "boswatch";
$tableFMS = "bos_fms";
diff --git a/www/index.php b/www/index.php
index 15a7573..a02cf78 100644
--- a/www/index.php
+++ b/www/index.php
@@ -1,7 +1,7 @@
@@ -9,34 +9,36 @@ $db_link = mysqli_connect ($dbhost, $dbuser, $dbpassword, $database);
BOSWatch
+
-
+
BOSWatch
Last alarms for FMS and ZVEI (max. 50)
-
+
Last FMS alarms
';
+ echo '
';
while ($data = mysqli_fetch_array( $db_erg, MYSQL_ASSOC))
{
+ $fms_id = $data['service'].$data['country'].$data['location'].$data['vehicle'].$data['status'].$data['direction'];
echo "";
echo "| ". $data['id'] . " | ";
echo "". $data['time'] . " | ";
- echo "". $data['service'] . " | ";
- echo "". $data['country'] . " | ";
+ echo "". parse("service",$fms_id) . " | ";
+ echo "". parse("country",$fms_id) . " | ";
echo "". $data['location'] . " | ";
echo "". $data['vehicle'] . " | ";
echo "". $data['status'] . " | ";
- echo "". $data['direction'] . " | ";
+ echo "". parse("direction",$fms_id) . " | ";
echo "". $data['tsi'] . " | ";
echo "
";
}
diff --git a/www/parser.php b/www/parser.php
new file mode 100644
index 0000000..f74713f
--- /dev/null
+++ b/www/parser.php
@@ -0,0 +1,69 @@
+ "Unbekannt",
+ "1" => "Polizei",
+ "2" => "Bundesgrenzschutz",
+ "3" => "Bundeskriminalamt",
+ "4" => "Katastrophenschutz",
+ "5" => "Zoll",
+ "6" => "Feuerwehr",
+ "7" => "Technisches Hilfswerk",
+ "8" => "Arbeiter-Samariter-Bund",
+ "9" => "Deutsches Rotes Kreuz",
+ "a" => "Johanniter-Unfall-Hilfe",
+ "b" => "Malteser-Hilfsdienst",
+ "c" => "Deutsche Lebensrettungsgesellschaft",
+ "d" => "Rettungsdienst",
+ "e" => "Zivilschutz",
+ "f" => "Fernwirktelegramm",
+ );
+
+ //Data for Country Parsing
+ $country = array(
+ "0" => "Sachsen",
+ "1" => "Bund",
+ "2" => "Baden-Württemberg",
+ "3" => "Bayern I",
+ "4" => "Berlin",
+ "5" => "Bremen",
+ "6" => "Hamburg",
+ "7" => "Hessen",
+ "8" => "Niedersachsen",
+ "9" => "Nordrhein-Westfalen",
+ "a" => "Rheinland-Pflaz",
+ "b" => "Schleswig-Holstein",
+ "c" => "Saarland",
+ "d" => "Bayern II",
+ "e" => "Meck-Pom/Sachsen-Anhalt",
+ "f" => "Brandenburg/Thüringen",
+ );
+
+ switch ($mode) {
+ case "service":
+ return $service[substr($fms,0,1)];
+ break;
+
+ case "country":
+ return $country[substr($fms,1,1)];
+ break;
+
+ case "direction":
+ if(substr($fms,9,1) == 1){
+ return "L-F";
+ }elseif(substr($fms,9,1) == 0){
+ return "F-L";
+ }
+ break;
+
+ default:
+ return "Parser: mode error!";
+ }
+ }
+
+?>
\ No newline at end of file