edit the old webend

- insert all new fields from the database
- own page for each function
- overview for last 50 alarm of all function in one
This commit is contained in:
Schrolli 2015-07-14 10:23:43 +02:00
parent bfd4e2c1a4
commit 1e18c2ed67
12 changed files with 214 additions and 104 deletions

BIN
www/old_webend/gfx/lupe.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

View file

@ -11,14 +11,22 @@ $db = new Database($dbhost, $dbuser, $dbpassword, $database, 1); //Show Error =
<html>
<head>
<title>BOSWatch</title>
<link rel="stylesheet" type="text/css" href="tooltip.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div style="text-align: center; width: 1250px; margin: 0px auto;">
<img src="gfx/logo.png" alt="BOSWatch"><br>
<a href="index.php?overview">[<EFBFBD>bersicht]</a> - <a href="index.php?parser">[Parser]</a>
<div id="navi">
<a href="index.php?overview">Overview</a> -
<a href="index.php?fms">FMS</a> -
<a href="index.php?zvei">ZVEI</a> -
<a href="index.php?pocsag">POCSAG</a> -
<a href="index.php?parser">Parser</a>
</div>
<br><br>
<?php
@ -28,6 +36,21 @@ $db = new Database($dbhost, $dbuser, $dbpassword, $database, 1); //Show Error =
include("tpl/content.overview.php");
include("tpl/template.overview.php");
}
elseif(isset($_GET['fms']))
{
include("tpl/content.fms.php");
include("tpl/template.fms.php");
}
elseif(isset($_GET['zvei']))
{
include("tpl/content.zvei.php");
include("tpl/template.zvei.php");
}
elseif(isset($_GET['pocsag']))
{
include("tpl/content.pocsag.php");
include("tpl/template.pocsag.php");
}
elseif(isset($_GET['parser']))
{
include("tpl/content.parser.php");
@ -42,5 +65,7 @@ $db = new Database($dbhost, $dbuser, $dbpassword, $database, 1); //Show Error =
?>
</div>
<div id="footer">BOSWatch Webend | 04/2015 - <?php echo date("m/Y"); ?> | find us at <a href="https://github.com/Schrolli91/BOSWatch" target="_blank">GitHub</a> </div>
</body>
</html>

42
www/old_webend/style.css Normal file
View file

@ -0,0 +1,42 @@
/*navigation*/
#navi{
width: 400px;
margin: auto;
border: 1px solid black;
padding: 5px;
font-weight: bold;
}
#navi a:link { color: red; text-decoration: none;}
#navi a:visited { color: red; }
#navi a:hover { color: black; }
#navi a:active { color: black; }
/*table center and border in*/
table { margin: auto; border-collapse: collapse; }
/*Tabellen mit Rahmen*/
table, th, td { border: 1px solid black; }
/*alternating line color in table*/
/*without first line (header)*/
tr:nth-child(2n+2) { background: #FFF; }
tr:nth-child(2n+3) { background: #CCC; }
/*table head*/
.tableHead{
color: white;
background-color: #BE2F01;
font-weight: bold;
}
/*footer*/
#footer{
margin-top: 50px;
margin-bottom: 25px;
text-align: center;
color: gray;
}
#footer a{ color: gray; }

View file

@ -0,0 +1,10 @@
<?php
//read FMS
$db->query("SELECT id, time, fms, status, direction, directionText, tsi, description FROM ".$tableFMS." ORDER BY id DESC");
$Rows = array();
while ($daten = $db->fetchAssoc())
{
$Rows[] = $daten;
}
$tpl['fms'] = $Rows;
?>

View file

@ -1,27 +1,11 @@
<?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;
//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;
//read POCSAG
$db->query("SELECT id, time, ric, funktion, text FROM ".$tablePOC." ORDER BY id DESC LIMIT 50");
$Rows = array();
while ($daten = $db->fetchAssoc())
{
$Rows[] = $daten;
}
$tpl['poc'] = $Rows;
?>
//read all
$db->query("SELECT id, time, fms as data, 'fms' AS typ FROM ".$tableFMS." UNION ALL SELECT id, time, zvei as data, 'zvei' AS typ FROM ".$tableZVEI." UNION ALL SELECT id, time, ric as data, 'pocsag' AS typ FROM ".$tablePOC." ORDER BY time DESC");
$Rows = array();
while ($daten = $db->fetchAssoc())
{
$Rows[] = $daten;
}
$tpl['lastAla'] = $Rows;

View file

@ -0,0 +1,10 @@
<?php
//read POCSAG
$db->query("SELECT id, time, ric, function, functionChar, bitrate, msg, description FROM ".$tablePOC." ORDER BY id DESC");
$Rows = array();
while ($daten = $db->fetchAssoc())
{
$Rows[] = $daten;
}
$tpl['poc'] = $Rows;
?>

View file

@ -0,0 +1,10 @@
<?php
//read ZVEI
$db->query("SELECT id, time, zvei, description FROM ".$tableZVEI." ORDER BY id DESC");
$Rows = array();
while ($daten = $db->fetchAssoc())
{
$Rows[] = $daten;
}
$tpl['zvei'] = $Rows;
?>

View file

@ -0,0 +1,30 @@
<b>Last FMS alarms</b>
<table style="width: 1000px;">
<tr class="tableHead">
<td>ID</td>
<td>Datum - Zeit</td>
<td>FMS</td>
<td>Stat.</td>
<td>Richt.</td>
<td>TKI</td>
<td>Beschreibung</td>
</tr>
<?php
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'] . " = " . $fms['directionText'] . "</td>";
echo "<td>". $fms['tsi'] . "</td>";
echo "<td>". $fms['description'] . "</td>";
echo "</tr>";
}
?>
</table>

View file

@ -1,84 +1,28 @@
Last alarms for FMS and ZVEI (max. 50)<br><br>
<div style="float: left; width: 800px;">
<b>Last FMS alarms</b>
<table border="1" style="width: 800px;">
<tr style="font-weight: bold;">
<div>
<b>Last 50 alarms</b>
<table style="width: 600px;">
<tr class="tableHead">
<td>ID</td>
<td>Datum - Zeit</td>
<td>FMS</td>
<td>Stat.</td>
<td>Richt.</td>
<td>TKI</td>
<td>Typ</td>
<td>Daten</td>
<td></td>
</tr>
<?php
foreach ($tpl['fms'] as $fms)
{
<?php
foreach ($tpl['lastAla'] as $lastAla)
{
$time = strtotime($fms['time']);
$time = date("d.m.Y H:i:s", $time);
$time = strtotime($lastAla['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>
<br>
<b>Last POCSAG alarms</b>
<table border="1" style="width: 800px;">
<tr style="font-weight: bold;">
<td>ID</td>
<td>Datum - Zeit</td>
<td>RIC</td>
<td>Funktion</td>
<td>Text</td>
</tr>
<?php
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>". $time . "</td>";
echo "<td>". $poc['ric'] . "</td>";
echo "<td>". $poc['funktion'] . "</td>";
echo "<td>". $poc['text'] . "</td>";
echo "</tr>";
}
?>
</table>
</div>
<div style="float: right; width: 400px;">
<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
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>";
}
?>
echo "<tr>";
echo "<td>". $lastAla['id'] . "</td>";
echo "<td>". $time . "</td>";
echo "<td>". $lastAla['typ'] . "</td>";
echo "<td>". $lastAla['data'] . "</td>";
echo "<td><a href='index.php?" . $lastAla['typ'] . "&id=" . $lastAla['id'] . "'><img src='gfx/lupe.png' alt='show'></a></td>";
echo "</tr>";
}
?>
</table>
</div>

View file

@ -0,0 +1 @@
no function yet!

View file

@ -0,0 +1,30 @@
<b>Last POCSAG alarms</b>
<table style="width: 1000px;">
<tr class="tableHead">
<td>ID</td>
<td>Datum - Zeit</td>
<td>RIC</td>
<td>Funktion</td>
<td>Bitrate</td>
<td>Nachricht</td>
<td>Beschreibung</td>
</tr>
<?php
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>". $time . "</td>";
echo "<td>". $poc['ric'] . "</td>";
echo "<td>". $poc['function'] . " = " . $poc['functionChar'] . "</td>";
echo "<td>". $poc['bitrate'] . "</td>";
echo "<td>". $poc['msg'] . "</td>";
echo "<td>". $poc['description'] . "</td>";
echo "</tr>";
}
?>
</table>

View file

@ -0,0 +1,24 @@
<b>Last ZVEI alarms</b>
<table style="width: 600px;">
<tr class="tableHead">
<td>ID</td>
<td>Datum - Zeit</td>
<td>Schleife</td>
<td>Beschreibung</td>
</tr>
<?php
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 "<td>". $zvei['description'] . "</td>";
echo "</tr>";
}
?>
</table>