move www-dir to exampleAddOns

This commit is contained in:
JHCD 2015-07-14 21:40:56 +02:00
parent beb955567f
commit ad88f65d0b
70 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,18 @@
</div>
</div>
<!-- Footer -->
</div>
<div id="copyright">
<ul>
<li style="color:grey">&copy; BOSWatch</li><li style="color:grey">Design: <a href="http://html5up.net">HTML5 UP</a></li>
</ul>
</div>
</body>
</html>

View file

@ -0,0 +1,50 @@
<html>
<head>
<title>BOSwatch - POCSAG</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<meta name="description" content="" />
<meta name="keywords" content="" />
<!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
<script src="js/jquery.min.js"></script>
<script src="js/jquery.dropotron.min.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/skel-layers.min.js"></script>
<script src="js/init.js"></script>
<noscript>
<style>
#highlights {
text-align: left;
width: 95%;
padding: 10px auto;
font-size: 90%;
}
</style>
<link rel="stylesheet" href="css/skel.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/style-desktop.css" />
<link rel="stylesheet" href="css/usermod.css" />
</noscript>
<!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
</head>
<body class="no-sidebar">
<!-- Header -->
<div id="header-wrapper" class="wrapper">
<div id="header">
<!-- Nav -->
<nav id="nav">
<ul>
<li><a href="show_pocsag.php">POCSAG</a></li>
<li><a href="show_fms.php">FMS</a></li>
<li><a href="show_zvei.php">ZVEI</a></li>
<li><a href="prefs.php">Einstellungen</a></li>
<li><a href="eintragen.html">Nutzer anlegen</a></li>
</ul>
</nav>
</div>
</div>

View file

@ -0,0 +1,38 @@
<b>Last FMS alarms</b>
<table border="1" style="width: 800px;">
<tr style="font-weight: bold;">
<td>ID</td>
<td>Datum - Zeit</td>
<td>FMS</td>
<td>Stat.</td>
<td>Richt.</td>
<td>TKI</td>
</tr>
<?php
//read FMS
$db->query("SELECT id, time, fms, status, direction, tsi FROM ".$tableFMS." ORDER BY id DESC LIMIT 50");
$Rows = array();
while ($daten = $db->fetchAssoc())
{
$Rows[] = $daten;
}
$tpl['fms'] = $Rows;
foreach ($tpl['fms'] as $fms)
{
$time = strtotime($fms['time']);
$time = date("d.m.Y H:i:s", $time);
echo "<tr>";
echo "<td>". $fms['id'] . "</td>";
echo "<td>". $time . "</td>";
echo "<td>". $fms['fms'] . "</td>";
echo "<td>". $fms['status'] . "</td>";
echo "<td>". $fms['direction'] . "</td>";
echo "<td>". $fms['tsi'] . "</td>";
echo "</tr>";
}
?>
</table>

View file

@ -0,0 +1,134 @@
<?php class Database
/**
Simple Database Class (C) by Bastian Schroll
**/
{
//Variablen
private $conn = null;
private $result = null;
private $show_error = 1;
/**
* Database::__construct()
*
* Stellt eine Verbung mit der MySQL Datenbank fest
*
* @param mixed $host Hostname des Datenbank Server
* @param mixed $user Username des Datenbank Nutzers
* @param mixed $password Passwort des Datenbank Nutzers
* @param mixed $database Name der Datenbank
* @param integer $show_error Zeige Fehlermeldungen
* @return TRUE/FALSE
*/
function __construct($host, $user, $password, $database, $show_error = 1)
{
$this->show_error = $show_error;
@$this->conn = mysql_connect($host, $user, $password);
if ($this->conn == false)
{
$this->error("Keine Verbindung zum Datenbank Server!", mysql_error());
return false;
}
if (!@mysql_select_db($database, $this->conn))
{
$this->error("Datenbank nicht gefunden!", mysql_error());
return false;
}
return true;
}
/**
* Database::query()
*
* F<EFBFBD>hrt einen MySQL Query aus
*
* @param mixed $query Auszuf<EFBFBD>hrender Query
* @return Result-Handler/FALSE
*/
function query($query)
{
$this->result = @mysql_query($query, $this->conn);
if ($this->result == false)
{
$this->error("Fehlerhafte Datenbank Anfrage!", mysql_error());
return false;
}
return $this->result;
}
/**
* Database::fetchAssoc()
*
* Liefert alle gefundnen Datens<EFBFBD>tze als Assoc
*
* @param mixed $result Externer Result-Handler
* @return gefundene Datens<EFBFBD>tze als Assoc
*/
function fetchAssoc($result = null)
{
if ($result != null)
{
return @mysql_fetch_assoc($result);
} else
{
return @mysql_fetch_assoc($this->result);
}
}
/**
* Database::count()
*
* Z<EFBFBD>hlt alle gefundenen Datens<EFBFBD>tze
*
* @param mixed $result Externer Result-Handler
* @return Anzahl gefundener Datens<EFBFBD>tze
*/
function count($result = null)
{
if ($result != null)
{
return @mysql_num_rows($result);
} else
{
return @mysql_num_rows($this->result);
}
}
/**
* Database::closeConnection()
*
* Schlie<EFBFBD>t die bestehende MySQL Verbindung
*
* @return TRUE/FALSE
*/
function closeConnection()
{
if (!@mysql_close($this->conn))
{
$this->error("Verbindung zur Datenbank konnte nicht getrennt werden!", mysql_error());
return false;
}
return true;
}
/**
* Database::error()
*
* Gibt eine Interne Fehlermeldung aus
*
* @param mixed $error_msg Text der Fehlermeldung
* @param mixed $sql_err MySQL Fehlermeldung per mysql_error()
* @return NULL
*/
private function error($error_msg, $sql_err)
{
if ($this->show_error)
{
echo "<br><strong>MySQL Error: $error_msg</strong><br>$sql_err";
return true;
//exit();
}
}
} ?>

View file

@ -0,0 +1,111 @@
<?php
// TRBOS-FMS http://www.lfs-bw.de/Fachthemen/Digitalfunk-Funk/Documents/Pruefstelle/TRBOS-FMS.pdf
// FMS Bayern https://www.stmi.bayern.de/assets/stmi/sus/feuerwehr/id2_17a_03_02_fms_kenng_fw_anl1_20020523.pdf
function parse($mode, $data)
{
//Data for Service Parsing
$service = array(
"0" => "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!";
}
}
?>

View file

@ -0,0 +1,39 @@
<table border="1" >
<tr style="font-weight: bold;">
<!-- <td>ID</td>
-->
<td>Einheit</td>
<td>Text</td>
<td>Datum - Zeit</td>
<td>RIC</td>
<td>F</td>
</tr>
<?php
$db->query("SELECT id, time, ric, funktion, text, description FROM ".$tablePOC." ORDER BY id DESC LIMIT 100");
$Rows = array();
while ($daten = $db->fetchAssoc())
{
$Rows[] = $daten;
}
$tpl['poc'] = $Rows;
foreach ($tpl['poc'] as $poc)
{
$time = strtotime($poc['time']);
$time = date("d.m.Y H:i:s", $time);
echo "<tr>";
// echo "<td>". $poc['id'] . "</td>";
//
echo "<td>". $poc['description'] . "</td>";
echo "<td>". $poc['text'] . "</td>";
echo "<td>". $time . "</td>";
echo "<td>". $poc['ric'] . "</td>";
echo "<td>". $poc['funktion'] . "</td>";
echo "</tr>";
}
?>
</table>

View file

@ -0,0 +1,34 @@
<b>Last ZVEI alarms</b>
<table border="1" style="width: 400px;">
<tr style="font-weight: bold;">
<td>ID</td>
<td>Datum - Zeit</td>
<td>Schleife</td>
</tr>
<?php
//read ZVEI
$db->query("SELECT id, time, zvei FROM ".$tableZVEI." ORDER BY id DESC LIMIT 50");
$Rows = array();
while ($daten = $db->fetchAssoc())
{
$Rows[] = $daten;
}
$tpl['zvei'] = $Rows;
foreach ($tpl['zvei'] as $zvei)
{
$time = strtotime($zvei['time']);
$time = date("d.m.Y H:i:s", $time);
echo "<tr>";
echo "<td>". $zvei['id'] . "</td>";
echo "<td>". $time . "</td>";
echo "<td>". $zvei['zvei'] . "</td>";
echo "</tr>";
}
?>
</table>