diff --git a/www/index.php b/www/index.php index d80247c..e7146ec 100644 --- a/www/index.php +++ b/www/index.php @@ -25,18 +25,18 @@ $db = new Database($dbhost, $dbuser, $dbpassword, $database, 1); //Show Error = if(isset($_GET['overview'])) { - include("content.overview.php"); - include("template.overview.php"); + include("tpl/content.overview.php"); + include("tpl/template.overview.php"); } elseif(isset($_GET['parser'])) { - include("content.parser.php"); - include("template.parser.php"); + include("tpl/content.parser.php"); + include("tpl/template.parser.php"); } else { - include("content.overview.php"); - include("template.overview.php"); + include("tpl/content.overview.php"); + include("tpl/template.overview.php"); } ?> diff --git a/www/parser.php b/www/parser.php new file mode 100644 index 0000000..37bb708 --- /dev/null +++ b/www/parser.php @@ -0,0 +1,111 @@ + "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", + ); + + + //Data for ZVEI Parsing + $zvei = array( + "12345" => "testZvei", + "23456" => "testZvei", + "34567" => "testZvei", + ); + + + switch ($mode) { + //Parse Service + case "service": + $data = substr($data,0,1); + if (array_key_exists($data, $service)) + { + return $service[$data]; + }else + { + return $data; + } + break; + + //Parse Country + case "country": + $data = substr($data,1,1); + if (array_key_exists($data, $country)) + { + return $country[$data]; + }else + { + return $data; + } + break; + + //Parse direction + case "direction": + if (substr($data,9,1) == 1) + { + return "L->F"; + }elseif (substr($data,9,1) == 0) + { + return "F->L"; + }else + { + return "ERR!"; + } + break; + + //Parse Zvei + case "zvei": + if (array_key_exists($data, $zvei)) + { + return $data ." - ". $zvei[$data]; + }else + { + return $data; + } + break; + + default: + return "Parser: mode error!"; + } + } + +?> \ No newline at end of file diff --git a/www/content.overview.php b/www/tpl/content.overview.php similarity index 100% rename from www/content.overview.php rename to www/tpl/content.overview.php diff --git a/www/content.parser.php b/www/tpl/content.parser.php similarity index 100% rename from www/content.parser.php rename to www/tpl/content.parser.php diff --git a/www/template.overview.php b/www/tpl/template.overview.php similarity index 100% rename from www/template.overview.php rename to www/tpl/template.overview.php diff --git a/www/template.parser.php b/www/tpl/template.parser.php similarity index 100% rename from www/template.parser.php rename to www/tpl/template.parser.php