Merge pull request #65 from kevinkleist/develop

Änderungen am Webinterface
This commit is contained in:
Schrolli91 2015-07-14 15:12:23 +02:00
commit aaa575ddda
19 changed files with 98 additions and 394 deletions

View file

@ -0,0 +1,51 @@
-- MySQL dump 10.13 Distrib 5.5.43, for debian-linux-gnu (armv7l)
--
-- Host: localhost Database: login
-- ------------------------------------------------------
-- Server version 5.5.43-0+deb7u1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `login`
--
DROP TABLE IF EXISTS `login`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `login` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(150) DEFAULT NULL,
`passwort` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `login`
--
LOCK TABLES `login` WRITE;
/*!40000 ALTER TABLE `login` DISABLE KEYS */;
INSERT INTO `login` VALUES ,(1,'Test','098f6bcd4621d373cade4e832627b4f6');
/*!40000 ALTER TABLE `login` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

View file

@ -8,5 +8,6 @@ $database = "boswatch";
$tableFMS = "bos_fms";
$tableZVEI = "bos_zvei";
$tablePOC = "bos_pocsag";
$tableLOG = "login";
?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

View file

@ -6,12 +6,12 @@ session_start();
require_once ("config.php");
$verbindung = mysql_connect($dbhost, $dbuser , $dbpassword)
or die("Verbindung zur Datenbank konnte nicht hergestellt werden");
mysql_select_db("login") or die ("Datenbank konnte nicht ausgewählt werden");
mysql_select_db($tableLOG) or die ("Datenbank konnte nicht ausgewählt werden");
$username = $_POST["username"];
$passwort = md5($_POST["password"]);
$abfrage = "SELECT username, passwort FROM login WHERE username LIKE '$username' LIMIT 1";
$abfrage = "SELECT username, passwort FROM" $tableLOG "WHERE username LIKE '$username' LIMIT 1";
$ergebnis = mysql_query($abfrage);
$row = mysql_fetch_object($ergebnis);

View file

@ -11,7 +11,7 @@ session_start();
?>
<?php
if(($_SESSION["username"])!="Kevin")
if(($_SESSION["username"])!="Test")
{
echo "Sie sind nicht berechtigt fuer diesen Bereich";
exit;

View file

@ -1,9 +1,4 @@
<!DOCTYPE HTML>
<!--
Escape Velocity by HTML5 UP
html5up.net | @n33co
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<?php
session_start();
@ -20,24 +15,15 @@ if(!isset($_SESSION["username"]))
<?php
require_once ("config.php");
require_once ("tpl/parser.php");
require_once ("tpl/mysql.class.php");
$db = new Database($dbhost, $dbuser, $dbpassword, $database, 1); //Show Error = 1!
?>
$db = new Database($dbhost, $dbuser, $dbpassword, $database, 1); //Show Error = 1!
<?php
include("tpl/a_header.php");
?>
<!-- Highlights -->
<div class="wrapper style3">
<div class="title">FMS</div>
<div id="highlights" class="container" style="">
<?php
include("tpl/a_header.php");
?>
<div class="wrapper style3">
<div class="title">FMS</div>
<div id="highlights" class="container" style="">
<?php
include("tpl/fms.php");
include("tpl/a_footer.php");
?>
include("tpl/a_footer.php");
?>

View file

@ -1,9 +1,4 @@
<!DOCTYPE HTML>
<!--
Escape Velocity by HTML5 UP
html5up.net | @n33co
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<?php
session_start();
@ -20,24 +15,14 @@ if(!isset($_SESSION["username"]))
<?php
require_once ("config.php");
require_once ("tpl/parser.php");
require_once ("tpl/mysql.class.php");
$db = new Database($dbhost, $dbuser, $dbpassword, $database, 1); //Show Error = 1!
include("tpl/a_header.php");
?>
<?php
include("tpl/a_header.php");
?>
<!-- Highlights -->
<div class="wrapper style3">
<div class="title">POCSAG</div>
<div id="highlights" class="container" style="">
<?php
<div class="wrapper style3">
<div class="title">POCSAG</div>
<div id="highlights" class="container" style="">
<?php
include("tpl/pocsag.php");
include("tpl/a_footer.php");
?>
include("tpl/a_footer.php");
?>

View file

@ -1,9 +1,5 @@
<!DOCTYPE HTML>
<!--
Escape Velocity by HTML5 UP
html5up.net | @n33co
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<?php
session_start();
@ -23,21 +19,16 @@ require_once ("tpl/parser.php");
require_once ("tpl/mysql.class.php");
$db = new Database($dbhost, $dbuser, $dbpassword, $database, 1); //Show Error = 1!
include("tpl/a_header.php");
?>
<?php
include("tpl/a_header.php");
?>
<!-- Highlights -->
<div class="wrapper style3">
<div class="title">ZVEI</div>
<div id="highlights" class="container" style="">
<?php
include("tpl/zvei.php");
include("tpl/a_footer.php");
?>
<div id="highlights" class="container" style="">
<?php
include("tpl/zvei.php");
include("tpl/a_footer.php");
?>

View file

@ -1,27 +0,0 @@
<?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;
?>

View file

@ -1,3 +0,0 @@
<?php
?>

View file

@ -10,9 +10,9 @@ Simple Database Class (C) by Bastian Schroll
/**
* 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
@ -40,10 +40,10 @@ Simple Database Class (C) by Bastian Schroll
/**
* Database::query()
*
* Führt einen MySQL Query aus
*
* @param mixed $query Auszuführender Query
*
* F<EFBFBD>hrt einen MySQL Query aus
*
* @param mixed $query Auszuf<EFBFBD>hrender Query
* @return Result-Handler/FALSE
*/
function query($query)
@ -59,11 +59,11 @@ Simple Database Class (C) by Bastian Schroll
/**
* Database::fetchAssoc()
*
* Liefert alle gefundnen Datensätze als Assoc
*
*
* Liefert alle gefundnen Datens<EFBFBD>tze als Assoc
*
* @param mixed $result Externer Result-Handler
* @return gefundene Datensätze als Assoc
* @return gefundene Datens<EFBFBD>tze als Assoc
*/
function fetchAssoc($result = null)
{
@ -78,11 +78,11 @@ Simple Database Class (C) by Bastian Schroll
/**
* Database::count()
*
* Zählt alle gefundenen Datensätze
*
*
* Z<EFBFBD>hlt alle gefundenen Datens<EFBFBD>tze
*
* @param mixed $result Externer Result-Handler
* @return Anzahl gefundener Datensätze
* @return Anzahl gefundener Datens<EFBFBD>tze
*/
function count($result = null)
{
@ -97,9 +97,9 @@ Simple Database Class (C) by Bastian Schroll
/**
* Database::closeConnection()
*
* Schließt die bestehende MySQL Verbindung
*
*
* Schlie<EFBFBD>t die bestehende MySQL Verbindung
*
* @return TRUE/FALSE
*/
function closeConnection()
@ -114,9 +114,9 @@ Simple Database Class (C) by Bastian Schroll
/**
* 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
@ -131,4 +131,4 @@ Simple Database Class (C) by Bastian Schroll
}
}
} ?>
} ?>

View file

@ -1,84 +0,0 @@
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;">
<td>ID</td>
<td>Datum - Zeit</td>
<td>FMS</td>
<td>Stat.</td>
<td>Richt.</td>
<td>TKI</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'] . "</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>";
}
?>
</table>
</div>

View file

@ -1,3 +0,0 @@
<?php
?>

View file

@ -1,72 +0,0 @@
<?php
$seite = $_GET["seite"];
if(!isset($seite))
{
$seite =1;
}
$eintraege_pro_seite = 50;
$start = $seite * $eintraege_pro_seite - $eintraege_pro_seite;
$result = mysql_query("SELECT id FROM ".$tablePOC");
$tpl['zvei'] = $Rows;
//read POCSAG
$db->query("SELECT id, time, ric, funktion, text, description FROM ".$tablePOC." ORDER BY id DESC LIMIT 50");
$Rows = array();
while ($daten = $db->fetchAssoc())
{
$Rows[] = $daten;
}
$tpl['poc'] = $Rows;
?>
<table border="1" style="font-size:75%;text-align:left;
margin-left:auto;
margin-right:auto;
border-style:solid;
border-width:0.25px;
border-collapse:collapse;">
<tr style=" font-family="Helvetica";
font-weight:bold;">
<td style="font-weight:bolder;width:200px;">Datum - Uhrzeit</td>
<td style="font-weight:bolder;width:100px;">Funktion</td>
<td style="font-weight:bolder;width:120px;">Einheit</td>
<td style="font-weight:bolder;width:;">Alarmtext</td>
<td style="font-weight:bolder;">RIC</td>
<td style="font-weight:bolder;"> </td>
</tr>
<?php
foreach ($tpl['poc'] as $poc)
{
$time = strtotime($poc['time']);
$time = date("d.m.Y H:i:s", $time);
$tvpn = 'TVPN';
echo "<tr>";
echo "<td>". $time . "</td>";
if ($poc['funktion'] == 1)
echo "<td>A. hö. Drg.</td>";
if ($poc['funktion'] == 2)
echo "<td>Alarm</td>";
if ($poc['funktion'] == 3)
echo "<td>Einsatz</td>";
if ($poc['funktion'] == 4)
echo "<td>Einsatz abbrechen</td>";
echo "<td>". $poc['description'] . "</td>";
echo "<td>". $poc['text'] . "</td>";
echo "<td>". $poc['ric'] . $poc['funktion'] . "</td>";
echo "<td style=\"color:red;\">". $poc['funktion'] . "</td>";
echo "</tr>";
}
?>
</table>

View file

@ -1,37 +0,0 @@
<div style="font-size:30px;
text-align:left;
font-family:Helvetica;
">Alamierungen Feuerwehr Hamm</div>
<table border="1" style="text-align:center;
margin-left:auto;
margin-right:auto;
border-style:solid;
border-width:0.25px;
border-collapse:collapse;">
<tr style=" font-family="Helvetica";
font-weight:bold;">
<td style="padding:10px;">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>

View file

@ -1,84 +0,0 @@
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;">
<td>ID</td>
<td>Datum - Zeit</td>
<td>FMS</td>
<td>Stat.</td>
<td>Richt.</td>
<td>TKI</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'] . "</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>";
}
?>
</table>
</div>