Initial commit

This commit is contained in:
Manuel 2018-08-04 10:53:24 +02:00
commit 0f09a883f4
41 changed files with 4410 additions and 0 deletions

BIN
.DS_Store vendored Executable file

Binary file not shown.

View File

@ -0,0 +1,4 @@
<center><a href="$_SERVER[PHP_SELF]">zur&uuml;ck zur Admin-&Uuml;bersicht</a></center>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
$show_all
</table>

65
_html/body_admin_dme2org.html Executable file
View File

@ -0,0 +1,65 @@
<style type="text/css">
<!--
.Stil1 {
color: #FF0000;
font-weight: bold;
}
-->
</style>
<form name="form1" method="post" action="$_SERVER[php_self]?show=dme&do=setupdate">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr bgcolor="#FFFFFF">
<td>neue Organisation/Ort</td>
<td><!--<input name="new_org_typ" type="text" id="new_org_typ" size="3" maxlength="3">-->
<select name="new_org_typ" id="new_org_typ">
<option value="RLS" selected>Org</option>
<option value="FF">FF</option>
<option value="BF">BF</option>
<option value="RD">RD</option>
<option value="THW">THW</option>
<option value="KAT">KAT</option>
<option value="KBM">KBM</option>
<option value="RLS">RLS</option>
</select>
/
<input name="new_org" type="text" id="new_org" size="40">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>oder Organisation ausw&auml;hlen </td>
<td>
<select name="select_org" id="select_org">
$option_org
</select>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>Zusatz:</td>
<td><input name="bezeichnung" type="text" id="bezeichnung" value="$row[bezeichnung]" size="50"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>Formatierung:</td>
<td>
<select name="formatierung" id="formatierung">
$option_format
</select>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td><input type="hidden" name="id" value="$_GET[id]">
<input name="old_org" type="hidden" id="old_org" value="$_REQUEST[org]"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><div align="center"><a href="admin.php">Zur&uuml;ck</a> | <a href="$_SERVER[php_self]?show=dme&do=delete&id=$_GET[id]&org=$_GET[org]&adresse=$row[adresse]">RIC L&ouml;schen</a> </div></td>
<td bgcolor="#FFFFFF"><input type="submit" name="Submit" value="Aktualisieren"></td>
</tr>
</table>
</form>

32
_html/body_admin_index.html Executable file
View File

@ -0,0 +1,32 @@
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr bgcolor="#FFFFFF">
<td align="center"><a href="suche.php">Suche</a></td>
</tr>
</table>
<br>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr bgcolor="#FFFFFF">
<td>&nbsp;<strong>$num_dme</strong> DME/ZVEI ohne Organisation </td>
<td><div align="center"><a href="$_SERVER[php_self]?show=dme&org=0">anzeigen</a></div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>&nbsp;<strong>$num_kfz</strong> Fahrzeuge ohne Organisation </td>
<td><div align="center"><a href="$_SERVER[php_self]?show=kfz&org=0">anzeigen</a></div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>&nbsp;<strong>$num_user</strong> User im System, <strong>$num_new_user</strong> davon neu </td>
<td><div align="center"><a href="$_SERVER[php_self]?show=user">anzeigen</a></div></td>
</tr>
</table>
<br><br>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr bgcolor="#FFFFFF">
<td>
<form name="form" method="post" action="$_SERVER[PHP_SELF]">
&nbsp;$select_search_org
<input type="submit" name="Submit" value="Ausw&auml;hlen">
</form>
<div align="center"></div></td>
</tr>
$show_to_edit
</table>

46
_html/body_admin_kfz2org.html Executable file
View File

@ -0,0 +1,46 @@
<form name="form1" method="post" action="$_SERVER[php_self]?show=kfz&do=setupdate">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr bgcolor="#FFFFFF">
<td>neue Organisation/Ort</td>
<td>
<select name="new_org_typ" id="new_org_typ">
<option selected>Org</option>
<option value="FF">FF</option>
<option value="BF">BF</option>
<option value="RD">RD</option>
<option value="THW">THW</option>
<option value="KAT">KAT</option>
<option value="KBM">KBM</option>
<option value="RLS">RLS</option>
</select>
/
<input name="new_org" type="text" id="new_org" size="40">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>oder Organisation ausw&auml;hlen </td>
<td>
<select name="select_org" id="select_org">
$option_org
</select>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>Fahrzeug:</td>
<td><input name="bezeichnung" type="text" id="bezeichnung" value="$row[bezeichnung]" size="50"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><input type="hidden" name="id" value="$_GET[id]"><input name="old_org" type="hidden" id="old_org" value="$_REQUEST[org]"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><div align="center"><a href="admin.php">Zur&uuml;ck</a> | <a href="$_SERVER[php_self]?show=kfz&do=delete&id=$_GET[id]&org=$_GET[org]">KFZ L&ouml;schen</a> </div></td>
<td bgcolor="#FFFFFF"><input type="submit" name="Submit" value="Aktualisieren"></td>
</tr>
</table>
</form>

3
_html/body_index.html Executable file
View File

@ -0,0 +1,3 @@
<table width="98%" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000" valign="top">
$show_all
</table>

3
_html/body_kfz_uebersicht.html Executable file
View File

@ -0,0 +1,3 @@
<table width="98%" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">
$show_all
</table>

14
_html/body_message.html Executable file
View File

@ -0,0 +1,14 @@
<table width="90%" class="msg_box" border="0" cellspacing="1" cellpadding="0" id="privmessage">
<tr>
<td>
<b>Nachricht von:</b> $row[real_name] ($msg_date)<br>
<i>$msg_text</i>
</td>
</tr>
<tr>
<td align="right">
<a href="javascript:oeffnefenster('pmfunctions.inc.php?pmdo=reply&to=$row[userid_from]&msg_id=$row[id]');">antworten</a> - <a href="javascript:animatedcollapse.toggle('PrivateMessage')" onclick="doSQL('deletepm', '$row[id]')">l&ouml;schen</a> &nbsp;&nbsp;
</td>
</tr>
</table>
<br>

21
_html/body_message_reply.html Executable file
View File

@ -0,0 +1,21 @@
<body onload="javascript:document.form1.msg_text.focus()">
<form name="form1" method="post" action="$_SERVER[php_self]?pmdo=doreply">
<input name="userid_to" type="hidden" id="userid_to" value="$_GET[to]">
<input name="msg_id" type="hidden" id="msg_id" value="$_GET[msg_id]">
<table width="90%" class="msg_box" border="0" cellspacing="1" cellpadding="0">
<tr>
<td>
<b>Nachricht an:</b> $row[real_name]<br>
<textarea name="msg_text" rows="10" cols="50"></textarea>
</td>
</tr>
<tr>
<td align="right">
<input type="submit" name="Submit" value="Senden" onclick="javascript:window.close()">&nbsp;&nbsp;
</td>
</tr>
</table>
</form>
</body>

19
_html/body_message_write.html Executable file
View File

@ -0,0 +1,19 @@
<body onload="javascript:document.form1.msg_text.focus()">
<form name="form1" id="form1" method="post" action="$_SERVER[php_self]?pmdo=dowrite">
<table width="90%" class="msg_box" border="0" cellspacing="1" cellpadding="0">
<tr>
<td>
<b>Nachricht an:</b> $select_msg_to<br>
<textarea name="msg_text" id="msg_text" rows="10" cols="50"></textarea>
</td>
</tr>
<tr>
<td align="right">
<input type="submit" name="Submit" value="Senden" onclick="javascript:window.close()">&nbsp;&nbsp;
</td>
</tr>
</table>
</form>
</body>

View File

@ -0,0 +1,88 @@
<table width="500" border="0" cellspacing="0" cellpadding="0" style="font-face:Arial;font-size:11px;font-weight:normal;">
<tr>
<td>&nbsp;</td>
<td></td>
</tr>
<tr>
<td colspan="2">
<fieldset><legend><b>EMail Einstellung</b></legend>
<form name="form1" method="post" action="$_SERVER[PHP_SELF]?do=setmailform">
Alarm an EMailadresse senden
<font style="font-weight:bold;"><b>(Wenn leer an deine Loginmail)</b></font>: <br>
EMail: $mailform_mail
<br>
Alarmmail in Kurzform (zB f&uuml;r SMS):
$mailform_checkbox
<input type="submit" name="Submit" value="&Auml;ndern">
</form>
</fieldset>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td></td>
</tr>
<!-- ende alarmmail -->
<!-- start wap -->
<!--
<tr>
<td colspan="2">
<fieldset><legend><b>WAP Einstellung</b></legend>
<form name="form1" method="post" action="$_SERVER[PHP_SELF]?do=setwap">
<p>Was als Standart anzeige: $select_wap_orgfilter $select_wap_statfilter<br>
Wieviel soll gezeigt werden: $select_wap_show<br>
Wieviel Datens&auml;tze ausgeben: $select_wap_rows <br>
<font size="2"><b>(Bei zu vielen Meldungen k&ouml;nnen Anzeigeprobleme auftreten !!)</b></font>
<br>
Wap Passwort:
<input name="wap_pass" type="text" id="wap_pass" value="$wap_pass" size="10">
</p>
<p>
<input type="submit" name="Submit" value="&Auml;ndern">
<br>
<font size="2" color="#FF3300"><b>Achtung: Beim ersten Login werden deine Handydaten gespeichert.<br>
Sollte sich dein Handy &auml;ndern bitte an den Admin wenden.</b></font> </p>
</form>
</fieldset>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td></td>
</tr>
-->
<!-- ende wap -->
<!-- start abo -->
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td colspan="3">
<fieldset><legend><b>RIC's Abonnieren</b></legend>
W&auml;hle eine Organisation die du Abonnieren m&ouml;chtest:
<form name="form" method="post" action="$_SERVER[PHP_SELF]?do=abodet">
$select_search_ric
<input type="submit" name="Submit" value="Ausw&auml;hlen">
</form>
</fieldset>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="4"><b>Bestehende Abos</b></td>
</tr>
$abos
</table>
<p>&nbsp;</p>

View File

@ -0,0 +1,51 @@
<form name="form" method="post" action="$_SERVER[PHP_SELF]?do=aboins">
<table width="500" border="0" cellspacing="0" cellpadding="0" style="font-face:Arial;font-size:11px;font-weight:normal;">
<tr>
<td>
In welchem Zeitraum möchtest du Meldungen empfangen:
</td>
<td>
</td>
</tr>
<tr>
<td>Alarm zwischen
<select name="alarm_time_filter_from" id="alarm_time_filter_from">
<option value="00:00:00" selected>immer</option>
$select_time_filter
</select>
und
<select name="alarm_time_filter_to" id="alarm_time_filter_to">
<option value="00:00:00" selected>immer</option>
$select_time_filter
</select>
senden
</td>
<td></td>
</tr>
<!-- Stiwo -->
<tr>
<td><br>Nur bei Stichworten: <input name="alarm_stiwo" type="text" id="alarm_stiwo" size="40">
<br>Stichworte mit einem Komma trennen (vu,vku,brand). Leer = immer
</td>
<td></td>
</tr>
<!-- Stiwo -->
<tr><td>&nbsp;</td><td></td></tr>
<tr>
<td>
W&auml;hle eine Adresse die du Abonieren m&ouml;chtest:
</td>
<td>
</td>
</tr>
<tr>
<td>
$select_ric
<input type="submit" name="Submit" value="Ausw&auml;hlen">
</td>
<td>&nbsp;</td>
</tr>
</table>
</form>

84
_html/body_stats.html Executable file
View File

@ -0,0 +1,84 @@
<table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="right"></div></td>
<td bgcolor="#FF0000"><div align="center"><strong>Feuerwehr</strong></div></td>
<td bgcolor="#00CC00"><div align="center"><strong>Rettungsdienst</strong></div></td>
</tr>
<tr>
<td><div align="right"><strong>RIC</strong></div></td>
<td><div align="center">$count_ff_dme</div></td>
<td><div align="center">$count_rd_dme</div></td>
</tr>
<tr>
<td><div align="right"><strong>ZVEI</strong></div></td>
<td><div align="center">$count_ff_zvei</div></td>
<td><div align="center">$count_rd_zvei</div></td>
</tr>
<tr>
<td><div align="right"><strong>Fahrzeuge</strong></div></td>
<td><div align="center">$count_ff_kfz</div></td>
<td><div align="center">$count_rd_kfz</div></td>
</tr>
</table>
<p>&nbsp;</p>
<table width="800" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr>
<td valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td bgcolor="$orgcolor[6]">&nbsp;<strong>Organisation</strong></td>
<td bgcolor="$orgcolor[6]"><div align="center"><strong>Alarme</strong></div></td>
<td bgcolor="$orgcolor[6]"><div align="center"><strong>letzter</strong></div></td>
</tr>
$stats_ff
</table>
</td>
<td width="1"></td>
<td valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td bgcolor="$orgcolor[8]">&nbsp;<strong>Organisation</strong></td>
<td bgcolor="$orgcolor[8]"><div align="center"><strong>Alarme</strong></div></td>
<td bgcolor="$orgcolor[8]"><div align="center"><strong>letzter </strong></div></td>
</tr>
$stats_rd
</table>
</td>
</tr>
<tr>
<td height="1"></td>
<td></td>
<td></td>
</tr>
<tr>
<td valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td bgcolor="$orgcolor[7]">&nbsp;<strong>Organisation</strong></td>
<td bgcolor="$orgcolor[7]"><div align="center"><strong>Alarme</strong></div></td>
<td bgcolor="$orgcolor[7]"><div align="center"><strong>letzter</strong></div></td>
</tr>
$stats_thw
</table>
</td>
<td></td>
<td valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td bgcolor="$orgcolor[4]">&nbsp;<strong>Organisation</strong></td>
<td bgcolor="$orgcolor[4]"><div align="center"><strong>Alarme</strong></div></td>
<td bgcolor="$orgcolor[4]"><div align="center"><strong>letzter</strong></div></td>
</tr>
$stats_kat
</table>
</td>
</tr>
</table>

90
_html/body_suche.html Executable file
View File

@ -0,0 +1,90 @@
<form name="form1" method="post" action="$_SERVER[PHP_SELF]">
<table align="center">
<tr>
<td class="nav_box">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Suchen nach </td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>$select_search_what1</td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#FFFFFF">
<td> Suchwort</td>
<td><input name="search_word" type="text" id="search_word" size="20" value="$search_word"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>Ort der Organisation </td>
<td><input name="search_word_org" type="text" id="search_word_org" value="$search_word_org" size="20"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>Organisation </td>
<td>
$select_search_org
</td>
</tr>
<tr>
<td>oder</td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>$select_search_what2</td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>RIC/Schleife</td>
<td>
$select_search_ric
</td>
</tr>
<tr>
<td>und</td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>$checkbox_time
im Zeitraum </td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>von</td>
<td>
$select_tag_from
$select_monat_from
<input name="search_time_from" type="text" id="search_time_from" value="$search_time_from" size="5" maxlength="5">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>bis</td>
<td>
$select_tag_to
$select_monat_to
<input name="search_time_to" type="text" id="search_time_to" value="$search_time_to" size="5" maxlength="5"></td>
</tr>
<tr>
<td>und</td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>Anzahl der Ergebnisse </td>
<td>
$select_max_results
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" name="Submit" value="Suchen"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<table width="98%" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">
$show_all
</table>

10
_html/body_unwetter.html Executable file
View File

@ -0,0 +1,10 @@
<table width="450" class="uw_box" bgcolor="$row[u_farbe]" border="0" cellspacing="1" cellpadding="0" id="wetterkopf">
<tr>
<td>
<b>Unwetterstand</b> ($uw_warntime)<sup>$_SESSION[uw_isnew]</sup> <b>:</b> $row[u_meldung]<br>
</td>
<td align="right" valign="top">
$uw_show_link &nbsp;
</td>
</tr>
</table>

134
_html/rahmen.html Executable file
View File

@ -0,0 +1,134 @@
<html>
<head>
<title>$pagetitle</title>
$meta
$css
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="animatedcollapse.js"></script>
<script type="text/javascript">
animatedcollapse.addDiv('wetter', 'fade=1,height=350px')
animatedcollapse.addDiv('PrivateMessage', 'fade=1,height=80px')
animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
//$: Access to jQuery
//divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
//state: "block" or "none", depending on state
}
animatedcollapse.init()
</script>
<script type="text/javascript">
function oeffnefenster (url) {
fenster = window.open(url, "fenster1", "width=430,height=220,status=no,scrollbars=no,resizable=no");
fenster.focus();
}
</script>
$java_script
</head>
$body_html
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<!-- START Kopfzeile -->
<tr>
<td width="528" height="36"><img src="_img/top_1.gif" width="528" height="36"></td>
<td width="100%" background="_img/top_2.gif">&nbsp;</td>
</tr>
<!-- ENDE Kopfzeile -->
<!-- START Navigation -->
<tr>
<td height="30" colspan="2" align="center">
<table width="98%">
<tr>
<td class="nav_box">&nbsp;&nbsp;&nbsp;$nav_menu Online: <div style="display:inline;" id="onlUsers"></div></td>
<td class="nav_box" width="350" align="center">&nbsp;Anzeige: <b>$nav_org_filter $nav_filter</b> Stunden</td>
</tr>
<tr>
<td colspan="2" heigt="5"></td>
</tr>
</table>
</td>
</tr>
<!-- ENDE Navigation -->
<!-- START Messages und Unwettermeldungen -->
<tr>
<td height="1%" align="center" valign="top">
<div id="PrivateMessage" style="display:inline;"></div>
</td>
<td height="1%" align="center" valign="top">
<div id="Unwetter" style="display:inline;"></div>
<table width="450" class="uw_box" bgcolor="#FFE9B2" border="0" cellspacing="1" cellpadding="10" id="wetter" style="display:none;">
<tr>
<td><i><div id="UnwetterContent" style="display:inline;"></div></i></td>
</tr>
</table>
<br>
</td>
</tr>
<!-- ENDE Messages und Unwettermeldungen -->
<!-- START Mittelteil -->
<tr align="center">
<td background="_img/bg.gif" colspan="2" valign="top">
<div id="loading-indicator" style="display:none"><img src="_img/ajax-loader.gif" border="0"></div>
<div id="inhalt"></div>
$page_middle
</td>
</tr>
<!-- ENDE Mittelteil -->
<!-- START Fusszeile -->
<tr>
<td background="_img/foot.gif" height="35" colspan="2">&nbsp;</td>
</tr>
<!-- ENDE Fusszeile -->
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://livestats.rc-heli.de/" : "http://livestats.rc-heli.de/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 4);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://livestats.rc-heli.de/piwik.php?idsite=4" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->
</table>
</body>
</html>

21
_html/rss.html Executable file
View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="0.91">
<channel>
<title>Monitor RSS Feed</title>
<link>http://monitor.intern</link>
<description>FF Monitor RSS Feed</description>
<language>de-de</language>
<copyright>2006 ManuelW</copyright>
<!--
<image>
<url>http://www.beispielwebsite.de/images/logo.gif</url>
<title>Logo Beispielwebsite </title>
<link>http://www.beispielwebsite.de</link>
</image>
-->
$show_all
</channel>
</rss>

BIN
_img/ajax-loader.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
_img/bg.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

BIN
_img/foot.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

BIN
_img/hidden.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

BIN
_img/top_1.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
_img/top_2.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 837 B

438
admin.php Executable file
View File

@ -0,0 +1,438 @@
<?php
/*
* PHP Frontend for pocsag monitor
*
* Copyright (C) 2004-2005
* Manuel Weiser (manuelw@fire-devils.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
require('config.inc.php');
$_SESSION["load_complete"] = "";
$_SESSION["lastupdate"] = "";
$_SESSION["online_users"] = "";
// Prüfen ob admin
if( $_SESSION["admin"] != 1 ) exit;
/**************************/
// Seite zusammenstellen
//
//
// Wenn dme ohne Org anzuschauen ist
if( $_GET["show"] == 'dme' && !$_GET["do"] )
{
// Alle DME ohne Organisation holen
$result = mysql_query("SELECT id, adresse, bezeichnung, rec_typ FROM ric_zvei WHERE org_id = '0' ORDER BY bezeichnung ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$show_all .= '
<tr bgcolor="#FFFFFF">
<td align="center">'.$row["rec_typ"].'</td>
<td>&nbsp;<b>'.$row["adresse"].'</b> / '.$row["bezeichnung"].'</td>
<td align="center">&nbsp;<a href="'.$_SERVER["php_self"].'?show=dme&do=update&id='.$row["id"].'">zuordnen</a>&nbsp;</td>
<td align="center">&nbsp;<a href="'.$_SERVER["php_self"].'?show=dme&do=delete&id='.$row["id"].'">löschen</a>&nbsp;</td>
</tr>
';
}
// Seiteninhalt ausgeben
eval ("\$page_middle .= \"".gettemplate($template_dir."body_admin_dme-kfz_update")."\";");
}
//
// Wenn dme updaten
elseif( $_GET["show"] == 'dme' && $_GET["do"] == 'update' )
{
// Zusammenstellung bekannter Organisationen
$result = mysql_query("SELECT id, org_name, org FROM organisation ORDER BY org ASC, org_name ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
if( $_REQUEST["org"] == $row["id"] ) { $selected = 'selected'; } else { $selected = ''; }
$option_org .= '<option value="'.$row["id"].'" '.$selected.'>'.$row["org"].' '.$row["org_name"].'</option>';
}
// Zusammenstellung der Formatierungen
$result = mysql_query("SELECT id, beschreibung FROM formatierung ORDER BY beschreibung ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
if( $_REQUEST["form"] == $row["id"] ) { $selected = 'selected'; } else { $selected = ''; }
$option_format .= '<option value="'.$row["id"].'" '.$selected.'>'.$row["beschreibung"].'</option>';
}
// Abfrage des verlangten Datensatzes
$result = mysql_query("SELECT id, adresse, bezeichnung, rec_typ FROM ric_zvei WHERE id = '$_GET[id]'") or die (mysql_error());
$row = mysql_fetch_array($result);
// Seiteninhalt ausgeben
eval ("\$page_middle .= \"".gettemplate($template_dir."body_admin_dme2org")."\";");
}
//
// Wenn dme löschen
elseif( $_GET["show"] == 'dme' && $_GET["do"] == 'delete' )
{
$result = mysql_query("DELETE FROM ric_zvei WHERE id = '$_GET[id]'") or die (mysql_error());
$result = mysql_query("DELETE FROM alarm2mail WHERE adresse = '$_GET[adresse]'") or die (mysql_error());
// Prüfen ob noch weitere Einträge zur Org da sind, wenn nicht löschen
if( $_GET["org"] )
{
$result = mysql_query("SELECT a.id AS dme_id, b.id AS kfz_id
FROM ric_zvei a
LEFT JOIN kfz_fms b ON b.org_id = $_GET[org]
WHERE a.org_id = '$_GET[org]' OR b.org_id = '$_GET[org]'") or die (mysql_error());
$row = mysql_fetch_array($result);
if( !$row["dme_id"] && !$row["kfz_id"] )
{
$result = mysql_query("DELETE FROM organisation WHERE id = '$_GET[org]'") or die (mysql_error());
}
}
// Wohin gehen nach Aktion
if( !$_GET["org"] )
{
echo gohome($_SERVER["PHP_SELF"].'?show=dme&org=0');
}
else
{
echo gohome($_SERVER["PHP_SELF"]);
}
}
//
// dme Update ausführen
elseif( $_GET["show"] == 'dme' && $_GET["do"] == 'setupdate' )
{
// Schauen ob neue oder bestehende Organistaion gewählt wurde
if( $_REQUEST["new_org"] )
{
/////////////////$organisation = $_REQUEST["new_org"];
// Prüfen ob die Org schon existiert, wenn ja update kein eintrag
$result = mysql_query("SELECT id FROM organisation WHERE org_name = '$_REQUEST[new_org]' AND org = '$_REQUEST[new_org_typ]'") or die (mysql_error());
$row = mysql_fetch_array($result);
if( $row["id"] )
{
$org_id = $row["id"];
}
if( !$org_id )
{
$result = mysql_query("INSERT INTO organisation (org_name, org) VALUES ('$_REQUEST[new_org]', '$_REQUEST[new_org_typ]')");
$result = mysql_query("SELECT MAX(id) as new_id FROM organisation");
$row = mysql_fetch_row($result);
$org_id = $row[0];
}
}
else
{
$org_id = $_REQUEST["select_org"];
}
$result = mysql_query("UPDATE ric_zvei SET bezeichnung = '$_REQUEST[bezeichnung]', formatierung_id = '$_REQUEST[formatierung]', org_id = '$org_id' WHERE id='$_REQUEST[id]'") or die (mysql_error());
// Prüfen ob noch weitere Einträge zur Org da sind, wenn nicht löschen
if( $_REQUEST["old_org"] )
{
$result = mysql_query("SELECT a.id AS dme_id, b.id AS kfz_id
FROM ric_zvei a
LEFT JOIN kfz_fms b ON b.org_id = $_REQUEST[old_org]
WHERE a.org_id = '$_REQUEST[old_org]' OR b.org_id = '$_REQUEST[old_org]'") or die (mysql_error());
$row = mysql_fetch_array($result);
if( !$row["dme_id"] && !$row["kfz_id"] )
{
$result = mysql_query("DELETE FROM organisation WHERE id = '$_REQUEST[old_org]'") or die (mysql_error());
}
}
echo gohome($_SERVER["PHP_SELF"]);
}
//
// Wenn kfz ohne org anzusehen ist
elseif( $_GET["show"] == 'kfz' && !$_GET["do"] )
{
// Alle DME ohne Organisation holen
$result = mysql_query("SELECT id, bezeichnung FROM kfz_fms WHERE org_id = '0' ORDER BY bezeichnung ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$show_all .= '
<tr bgcolor="#FFFFFF">
<td>&nbsp;'.$row["bezeichnung"].'</td>
<td align="center">&nbsp;<a href="'.$_SERVER["php_self"].'?show=kfz&do=update&id='.$row["id"].'">zuordnen</a>&nbsp;</td>
<td align="center">&nbsp;<a href="'.$_SERVER["php_self"].'?show=kfz&do=delete&id='.$row["id"].'">löschen</a>&nbsp;</td>
</tr>
';
}
// Seiteninhalt ausgeben
eval ("\$page_middle .= \"".gettemplate($template_dir."body_admin_dme-kfz_update")."\";");
}
//
// Wenn kfz updaten
elseif( $_GET["show"] == 'kfz' && $_GET["do"] == 'update' )
{
// Zusammenstellung bekannter Organisationen
$result = mysql_query("SELECT id, org_name, org FROM organisation ORDER BY org ASC, org_name ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
if( $_REQUEST["org"] == $row["id"] ) { $selected = 'selected'; } else { $selected = ''; }
$option_org .= '<option value="'.$row["id"].'" '.$selected.'>'.$row["org"].' '.$row["org_name"].'</option>';
}
// Abfrage des verlangten Datensatzes
$result = mysql_query("SELECT id, bezeichnung FROM kfz_fms WHERE id = '$_GET[id]'") or die (mysql_error());
$row = mysql_fetch_array($result);
// Seiteninhalt ausgeben
eval ("\$page_middle .= \"".gettemplate($template_dir."body_admin_kfz2org")."\";");
}
//
// Wenn kfz löschen
elseif( $_GET["show"] == 'kfz' && $_GET["do"] == 'delete' )
{
$result = mysql_query("DELETE FROM kfz_fms WHERE id = '$_GET[id]'") or die (mysql_error());
// Prüfen ob noch weitere Einträge zur Org da sind, wenn nicht löschen
if( $_GET["org"] )
{
$result = mysql_query("SELECT a.id AS dme_id, b.id AS kfz_id
FROM ric_zvei a
LEFT JOIN kfz_fms b ON b.org_id = $_GET[org]
WHERE a.org_id = '$_GET[org]' OR b.org_id = '$_GET[org]'") or die (mysql_error());
$row = mysql_fetch_array($result);
if( !$row["dme_id"] && !$row["kfz_id"] )
{
$result = mysql_query("DELETE FROM organisation WHERE id = '$_GET[org]'") or die (mysql_error());
}
}
// Wohin gehen nach Aktion
if( !$_GET["org"] )
{
echo gohome($_SERVER["PHP_SELF"].'?show=kfz&org=0');
}
else
{
echo gohome($_SERVER["PHP_SELF"]);
}
}
//
// kfz Update ausfhren
elseif( $_GET["show"] == 'kfz' && $_GET["do"] == 'setupdate' )
{
// Schauen ob neue oder bestehende Organistaion gewhlt wurde
if( $_REQUEST["new_org"] )
{
$organisation = $_REQUEST["new_org"];
$result = mysql_query("INSERT INTO organisation (org_name, org) VALUES ('$organisation', '$_REQUEST[new_org_typ]')");
$result = mysql_query("SELECT MAX(id) as new_id FROM organisation");
$row = mysql_fetch_row($result);
$organisation = $row[0];
}
else
{
$organisation = $_REQUEST["select_org"];
}
$result = mysql_query("UPDATE kfz_fms SET bezeichnung = '$_REQUEST[bezeichnung]', org_id = '$organisation' WHERE id='$_REQUEST[id]'") or die (mysql_error());
// Prüfen ob noch weitere Einträge zur Org da sind, wenn nicht löschen
if( $_REQUEST["old_org"] )
{
$result = mysql_query("SELECT a.id AS dme_id, b.id AS kfz_id
FROM ric_zvei a
LEFT JOIN kfz_fms b ON b.org_id = $_REQUEST[old_org]
WHERE a.org_id = '$_REQUEST[old_org]' OR b.org_id = '$_REQUEST[old_org]'") or die (mysql_error());
$row = mysql_fetch_array($result);
if( !$row["dme_id"] && !$row["kfz_id"] )
{
$result = mysql_query("DELETE FROM organisation WHERE id = '$_REQUEST[old_org]'") or die (mysql_error());
}
}
echo gohome($_SERVER["PHP_SELF"]);
}
//
// Wenn Userliste anzeigen
elseif( $_GET["show"] == 'user' && !$_GET["do"] )
{
// Alle DME ohne Organisation holen
$result = mysql_query("SELECT id, a_name, real_name, a_admin, a_mail FROM admin_users ORDER BY a_admin DESC, a_name ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
if( $row["a_admin"] == '0' ) $status = '<b>(User)</b> ';
elseif( $row["a_admin"] == '1' ) $status = '<b>(Admin)</b> ';
elseif( $row["a_admin"] == '2' ) $status = '<b>(New)</b> ';
elseif( $row["a_admin"] == '3' ) $status = '<b>(Closed)</b> ';
if( $row["a_admin"] != '1') {
$show_del_button = '<a href="'.$_SERVER["php_self"].'?show=user&do=delete&id='.$row["id"].'">l&ouml;schen</a>';
} else {
$show_del_button = "";
}
$show_all .= '
<tr bgcolor="#FFFFFF">
<td>&nbsp;'.$status.$row["real_name"].'</td>
<td><font size="2">&nbsp;'.$row["a_mail"].'</font></td>
<!--<td align="center">&nbsp;<a href="'.$_SERVER["php_self"].'?show=user&do=update&id='.$row["id"].'">&auml;ndern</a>&nbsp;</td>-->
<td>'.$row["a_name"].'</td>
<td align="center">&nbsp;'.$show_del_button.'&nbsp;</td>
</tr>
';
}
// Benutzer eintragen
$show_all .= '
<tr bgcolor="#FFFFFF">
<td colspan="4"><br><br>Neuer User</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>Vorname / Name</td>
<td>EMail</td>
<td colspan="2"></td>
</tr>
<form name="form999" method="post" action="'.$_SERVER[php_self].'?show=user&do=insert">
<tr bgcolor="#FFFFFF">
<td><input name="ins_name" id="ins_name" type="text" size="30"> </td>
<td><input name="ins_mail" id="ins_mail" type="text" size="30"> </td>
<td colspan="2"><input type="submit" name="Submit" value="Eintragen"></td>
</tr>
</form>
';
// Seiteninhalt ausgeben
eval ("\$page_middle .= \"".gettemplate($template_dir."body_admin_dme-kfz_update")."\";");
}
// User eintragen
elseif( $_GET["show"] == 'user' && $_GET["do"] == 'insert' )
{
list($vorname, $nachname) = explode(" ", trim($_REQUEST["ins_name"]));
$ins_user_name = trim($vorname) .".". substr(trim($nachname),0,1);
$result = mysql_query("SELECT id FROM admin_users WHERE a_name = '$ins_user_name'");
$row = mysql_fetch_array($result);
if (!empty($row["id"])) $ins_user_name = trim($vorname) .".". substr(trim($nachname),0,1) ."". rand(1,99);
$result = mysql_query("INSERT INTO admin_users (a_name, real_name, a_mail, pm_allow) VALUES ('$ins_user_name', '$_REQUEST[ins_name]', '$_REQUEST[ins_mail]', '1')") or die(mysql_error);
echo gohome($_SERVER["PHP_SELF"].'?show=user');
}
//
// Wenn user löschen
elseif( $_GET["show"] == 'user' && $_GET["do"] == 'delete' )
{
$result = mysql_query("DELETE FROM messages WHERE userid_to = '$_GET[id]'") or die (mysql_error());
$result = mysql_query("DELETE FROM alarm2mail WHERE userid = '$_GET[id]'") or die (mysql_error());
$result = mysql_query("DELETE FROM admin_users WHERE id = '$_GET[id]'") or die (mysql_error());
echo gohome($_SERVER["PHP_SELF"].'?show=user');
}
//
// Wenn nichts vorgegeben
else
{
// Wir schauen nach dme die keiner Org zugeordnet sind
$result = mysql_query("SELECT id FROM ric_zvei WHERE org_id = '0'") or die (mysql_error());
$num_dme = mysql_num_rows($result);
// Wir schauen nach kfz die keiner Org zugeordnet sind
$result = mysql_query("SELECT id FROM kfz_fms WHERE org_id = '0'") or die (mysql_error());
$num_kfz = mysql_num_rows($result);
// Wir schauen nach der Userzahl
$result = mysql_query("SELECT id FROM admin_users") or die (mysql_error());
$num_user = mysql_num_rows($result);
$result = mysql_query("SELECT id FROM admin_users WHERE a_admin = '2'") or die (mysql_error());
$num_new_user = mysql_num_rows($result);
// Ausklappmenu erstellen
$select_search_org = '
<select name="search_org" id="search_org">
<option value="">--- w&auml;hle Org. zum bearbeiten ---</option>';
$result = mysql_query("SELECT id, org_name, org FROM organisation WHERE org != '' ORDER BY org ASC, org_name ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
if( $_REQUEST["search_org"] == $row["id"] ) { $selected = 'selected'; } else { $selected = ''; }
$select_search_org .= '
<option value="'.$row["id"].'" '.$selected.'>'.$row["org"].' &nbsp;&nbsp;'.$row["org_name"].'</option>
';
}
$select_search_org .= '
</select>
';
// Ausgabe zusammenstellen wenn org zum bearbeiten gewählt
if( $_REQUEST["search_org"] )
{
$show_ric = '--- <b>RIC/ZVEI</b> ----------<br>';
$result = mysql_query("SELECT id, adresse, bezeichnung, rec_typ, org_id, formatierung_id FROM ric_zvei WHERE org_id = '$_REQUEST[search_org]' ORDER BY rec_typ ASC, adresse ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$show_ric .= '&nbsp;<a href="'.$_SERVER["PHP_SELF"].'?do=update&id='.$row["id"].'&show=dme&org='.$row["org_id"].'&form='.$row["formatierung_id"].'">'.$row["adresse"].'</a> | '.$row["rec_typ"].' | '.$row["bezeichnung"].'<br>';
}
$show_ric .= '<br>--- <b>KFZ/FMS</b> ----------<br>';
$result = mysql_query("SELECT id, kennung, bezeichnung, org_id FROM kfz_fms WHERE org_id = '$_REQUEST[search_org]' ORDER BY kennung ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$show_ric .= '&nbsp;<a href="'.$_SERVER["PHP_SELF"].'?do=update&id='.$row["id"].'&show=kfz&org='.$row["org_id"].'">'.$row["kennung"].'</a> | '.$row["bezeichnung"].'<br>';
}
$show_to_edit = '<tr bgcolor="#FFFFFF">
<td>'.$show_ric.'</td>
</tr>';
}
// Seiteninhalt ausgeben
eval ("\$page_middle .= \"".gettemplate($template_dir."body_admin_index")."\";");
}
/**************************/
// Ausgabe Rahmen
//
eval ("dooutput(\"".gettemplate($template_dir."rahmen")."\");");
/**************************/
// Datenbank schliessen
//
mysql_close($dbconn);
?>

96
alarmmail.inc.php Executable file
View File

@ -0,0 +1,96 @@
<?php
/*
* PHP Frontend for pocsag monitor
*
* Copyright (C) 2004-2005
* Manuel Weiser (manuelw@fire-devils.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
// Done in Haupttabelle updaten
$result_check_ins = mysql_query("UPDATE dme SET zeit='$row[zeit]', done='1' WHERE num='$row[num]'") or die (mysql_error());
if( trim($row["funktion"]) != 'Klartext' && trim($row["funktion"]) != 'Info' && $amenable == 1 )
{
$result_alarm_mail = mysql_query("SELECT a.userid, a.time_from, a.time_to, a.stiwo, b.id, b.a_mail, b.a_alarmmail, b.a_alarmmail2sms, b.amail_count, b.ft_allow
FROM alarm2mail a
LEFT JOIN admin_users b ON b.id = a.userid
WHERE adresse=".$row["adresse_neu"]) or die(mysql_error());
while( $row_alarm_mail = mysql_fetch_array($result_alarm_mail) )
{
// Alarmmail Counter
$amail_count = $row_alarm_mail["amail_count"]+1;
// schauen ob für Alarm extra Mailadresse
if( $row_alarm_mail["a_alarmmail"] ) $row_alarm_mail["a_mail"] = $row_alarm_mail["a_alarmmail"];
// schauen ob Alarm im Zeitfenster liegt
if( $row_alarm_mail["time_from"] > $row_alarm_mail["time_to"] ) $row_alarm_mail["time_to"] = 24+$row_alarm_mail["time_to"];
// Stichwort checken
if( empty($row_alarm_mail["stiwo"]) ) { $stiwo_check = 'hit'; }
else { $stiwo_check = check_stiwo($row_alarm_mail["stiwo"], $row["text"]); }
// Meldung im EMailformat senden
if( $stiwo_check == 'hit' && $row_alarm_mail["a_alarmmail2sms"] == '0' && ( $row_alarm_mail["time_from"] == $row_alarm_mail["time_to"] || ($row_alarm_mail["time_from"] <= get_hour( get_time($row["zeit"]) ) && $row_alarm_mail["time_to"] > get_hour( get_time($row["zeit"]) ) ) ) )
{
// Mail normal senden
if ( $row_alarm_mail["ft_allow"] == 1 )
{
// Wenn FullText erlaubt
mail_alarm(get_date_long($row["zeit"]), get_time($row["zeit"]), $row_alarm_mail["a_mail"],$row["org"],$row["org_name"],$row["bezeichnung"],utf8_decode($row["text"]));
}
else
{
// Wenn FullText erlaubt
mail_alarm(get_date_long($row["zeit"]), get_time($row["zeit"]), $row_alarm_mail["a_mail"],$row["org"],$row["org_name"],$row["bezeichnung"],"Einsatzalarm");
}
// Mailcounter
$result_counter = mysql_query("UPDATE admin_users SET amail_count='$amail_count' WHERE id='$row_alarm_mail[id]'");
}
// Meldung im SMSformat senden
if( $stiwo_check == 'hit' && $row_alarm_mail["a_alarmmail2sms"] == '1' && ( $row_alarm_mail["time_from"] == $row_alarm_mail["time_to"] || ($row_alarm_mail["time_from"] <= get_hour( get_time($row["zeit"]) ) && $row_alarm_mail["time_to"] > get_hour( get_time($row["zeit"]) ) ) ) )
{
// Mail im SMS Format senden
if ( $row_alarm_mail["ft_allow"] == 1 )
{
// Wenn FullText erlaubt
mail_alarm_sms(get_date_long($row["zeit"]), get_time($row["zeit"]), $row_alarm_mail["a_mail"],$row["org"],$row["org_name"],utf8_decode($row["text"]));
}
else
{
// Wenn kein FullText erlaubt
mail_alarm_sms(get_date_long($row["zeit"]), get_time($row["zeit"]), $row_alarm_mail["a_mail"],$row["org"],$row["org_name"],"Einsatzalarm");
}
// Mailcounter
$result_counter = mysql_query("UPDATE admin_users SET amail_count='$amail_count' WHERE id='$row_alarm_mail[id]'");
}
}
}
// Einsatzcounter updaten
if( ($row["zeit"] - $row["last_alarm"]) > 1000 )
{
$alarmcount = $row["alarm_count"] + 1;
$result_check_ins = mysql_query("UPDATE organisation SET alarm_count='$alarmcount', last_alarm='$row[zeit]' WHERE id='$row[org_id]'") or die (mysql_error());
}
?>

223
animatedcollapse.js Executable file
View File

@ -0,0 +1,223 @@
//** Animated Collapsible DIV v2.0- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com.
//** May 24th, 08'- Script rewritten and updated to 2.0.
//** June 4th, 08'- Version 2.01: Bug fix to work with jquery 1.2.6 (which changed the way attr() behaves).
//** March 5th, 09'- Version 2.2, which adds the following:
//1) ontoggle($, divobj, state) event that fires each time a DIV is expanded/collapsed, including when the page 1st loads
//2) Ability to expand a DIV via a URL parameter string, ie: index.htm?expanddiv=jason or index.htm?expanddiv=jason,kelly
//** March 9th, 09'- Version 2.2.1: Optimized ontoggle event handler slightly.
//** July 3rd, 09'- Version 2.4, which adds the following:
//1) You can now insert rel="expand[divid] | collapse[divid] | toggle[divid]" inside arbitrary links to act as DIV togglers
//2) For image toggler links, you can insert the attributes "data-openimage" and "data-closedimage" to update its image based on the DIV state
var animatedcollapse={
divholders: {}, //structure: {div.id, div.attrs, div.$divref, div.$togglerimage}
divgroups: {}, //structure: {groupname.count, groupname.lastactivedivid}
lastactiveingroup: {}, //structure: {lastactivediv.id}
preloadimages: [],
show:function(divids){ //public method
if (typeof divids=="object"){
for (var i=0; i<divids.length; i++)
this.showhide(divids[i], "show")
}
else
this.showhide(divids, "show")
},
hide:function(divids){ //public method
if (typeof divids=="object"){
for (var i=0; i<divids.length; i++)
this.showhide(divids[i], "hide")
}
else
this.showhide(divids, "hide")
},
toggle:function(divid){ //public method
if (typeof divid=="object")
divid=divid[0]
this.showhide(divid, "toggle")
},
addDiv:function(divid, attrstring){ //public function
this.divholders[divid]=({id: divid, $divref: null, attrs: attrstring})
this.divholders[divid].getAttr=function(name){ //assign getAttr() function to each divholder object
var attr=new RegExp(name+"=([^,]+)", "i") //get name/value config pair (ie: width=400px,)
return (attr.test(this.attrs) && parseInt(RegExp.$1)!=0)? RegExp.$1 : null //return value portion (string), or 0 (false) if none found
}
this.currentid=divid //keep track of current div object being manipulated (in the event of chaining)
return this
},
showhide:function(divid, action){
var $divref=this.divholders[divid].$divref //reference collapsible DIV
if (this.divholders[divid] && $divref.length==1){ //if DIV exists
var targetgroup=this.divgroups[$divref.attr('groupname')] //find out which group DIV belongs to (if any)
if ($divref.attr('groupname') && targetgroup.count>1 && (action=="show" || action=="toggle" && $divref.css('display')=='none')){ //If current DIV belongs to a group
if (targetgroup.lastactivedivid && targetgroup.lastactivedivid!=divid) //if last active DIV is set
this.slideengine(targetgroup.lastactivedivid, 'hide') //hide last active DIV within group first
this.slideengine(divid, 'show')
targetgroup.lastactivedivid=divid //remember last active DIV
}
else{
this.slideengine(divid, action)
}
}
},
slideengine:function(divid, action){
var $divref=this.divholders[divid].$divref
var $togglerimage=this.divholders[divid].$togglerimage
if (this.divholders[divid] && $divref.length==1){ //if this DIV exists
var animateSetting={height: action}
if ($divref.attr('fade'))
animateSetting.opacity=action
$divref.animate(animateSetting, $divref.attr('speed')? parseInt($divref.attr('speed')) : 500, function(){
if ($togglerimage){
$togglerimage.attr('src', ($divref.css('display')=="none")? $togglerimage.data('srcs').closed : $togglerimage.data('srcs').open)
}
if (animatedcollapse.ontoggle){
try{
animatedcollapse.ontoggle(jQuery, $divref.get(0), $divref.css('display'))
}
catch(e){
alert("An error exists inside your \"ontoggle\" function:\n\n"+e+"\n\nAborting execution of function.")
}
}
})
return false
}
},
generatemap:function(){
var map={}
for (var i=0; i<arguments.length; i++){
if (arguments[i][1]!=null){ //do not generate name/value pair if value is null
map[arguments[i][0]]=arguments[i][1]
}
}
return map
},
init:function(){
var ac=this
jQuery(document).ready(function($){
animatedcollapse.ontoggle=animatedcollapse.ontoggle || null
var urlparamopenids=animatedcollapse.urlparamselect() //Get div ids that should be expanded based on the url (['div1','div2',etc])
var persistopenids=ac.getCookie('acopendivids') //Get list of div ids that should be expanded due to persistence ('div1,div2,etc')
var groupswithpersist=ac.getCookie('acgroupswithpersist') //Get list of group names that have 1 or more divs with "persist" attribute defined
if (persistopenids!=null) //if cookie isn't null (is null if first time page loads, and cookie hasnt been set yet)
persistopenids=(persistopenids=='nada')? [] : persistopenids.split(',') //if no divs are persisted, set to empty array, else, array of div ids
groupswithpersist=(groupswithpersist==null || groupswithpersist=='nada')? [] : groupswithpersist.split(',') //Get list of groups with divs that are persisted
jQuery.each(ac.divholders, function(){ //loop through each collapsible DIV object
this.$divref=$('#'+this.id)
if ((this.getAttr('persist') || jQuery.inArray(this.getAttr('group'), groupswithpersist)!=-1) && persistopenids!=null){ //if this div carries a user "persist" setting, or belong to a group with at least one div that does
var cssdisplay=(jQuery.inArray(this.id, persistopenids)!=-1)? 'block' : 'none'
}
else{
var cssdisplay=this.getAttr('hide')? 'none' : null
}
if (urlparamopenids[0]=="all" || jQuery.inArray(this.id, urlparamopenids)!=-1){ //if url parameter string contains the single array element "all", or this div's ID
cssdisplay='block' //set div to "block", overriding any other setting
}
else if (urlparamopenids[0]=="none"){
cssdisplay='none' //set div to "none", overriding any other setting
}
this.$divref.css(ac.generatemap(['height', this.getAttr('height')], ['display', cssdisplay]))
this.$divref.attr(ac.generatemap(['groupname', this.getAttr('group')], ['fade', this.getAttr('fade')], ['speed', this.getAttr('speed')]))
if (this.getAttr('group')){ //if this DIV has the "group" attr defined
var targetgroup=ac.divgroups[this.getAttr('group')] || (ac.divgroups[this.getAttr('group')]={}) //Get settings for this group, or if it no settings exist yet, create blank object to store them in
targetgroup.count=(targetgroup.count||0)+1 //count # of DIVs within this group
if (jQuery.inArray(this.id, urlparamopenids)!=-1){ //if url parameter string contains this div's ID
targetgroup.lastactivedivid=this.id //remember this DIV as the last "active" DIV (this DIV will be expanded). Overrides other settings
targetgroup.overridepersist=1 //Indicate to override persisted div that would have been expanded
}
if (!targetgroup.lastactivedivid && this.$divref.css('display')!='none' || cssdisplay=="block" && typeof targetgroup.overridepersist=="undefined") //if this DIV was open by default or should be open due to persistence
targetgroup.lastactivedivid=this.id //remember this DIV as the last "active" DIV (this DIV will be expanded)
this.$divref.css({display:'none'}) //hide any DIV that's part of said group for now
}
}) //end divholders.each
jQuery.each(ac.divgroups, function(){ //loop through each group
if (this.lastactivedivid && urlparamopenids[0]!="none") //show last "active" DIV within each group (one that should be expanded), unless url param="none"
ac.divholders[this.lastactivedivid].$divref.show()
})
if (animatedcollapse.ontoggle){
jQuery.each(ac.divholders, function(){ //loop through each collapsible DIV object and fire ontoggle event
animatedcollapse.ontoggle(jQuery, this.$divref.get(0), this.$divref.css('display'))
})
}
//Parse page for links containing rel attribute
var $allcontrols=$('a[rel]').filter('[rel^="collapse["], [rel^="expand["], [rel^="toggle["]') //get all elements on page with rel="collapse[]", "expand[]" and "toggle[]"
$allcontrols.each(function(){ //loop though each control link
this._divids=this.getAttribute('rel').replace(/(^\w+)|(\s+)/g, "").replace(/[\[\]']/g, "") //cache value 'div1,div2,etc' within identifier[div1,div2,etc]
if (this.getElementsByTagName('img').length==1 && ac.divholders[this._divids]){ //if control is an image link that toggles a single DIV (must be one to one to update status image)
animatedcollapse.preloadimage(this.getAttribute('data-openimage'), this.getAttribute('data-closedimage')) //preload control images (if defined)
$togglerimage=$(this).find('img').eq(0).data('srcs', {open:this.getAttribute('data-openimage'), closed:this.getAttribute('data-closedimage')}) //remember open and closed images' paths
ac.divholders[this._divids].$togglerimage=$(this).find('img').eq(0) //save reference to toggler image (to be updated inside slideengine()
ac.divholders[this._divids].$togglerimage.attr('src', (ac.divholders[this._divids].$divref.css('display')=="none")? $togglerimage.data('srcs').closed : $togglerimage.data('srcs').open)
}
$(this).click(function(){ //assign click behavior to each control link
var relattr=this.getAttribute('rel')
var divids=(this._divids=="")? [] : this._divids.split(',') //convert 'div1,div2,etc' to array
if (divids.length>0){
animatedcollapse[/expand/i.test(relattr)? 'show' : /collapse/i.test(relattr)? 'hide' : 'toggle'](divids) //call corresponding public function
return false
}
}) //end control.click
})// end control.each
$(window).bind('unload', function(){
ac.uninit()
})
}) //end doc.ready()
},
uninit:function(){
var opendivids='', groupswithpersist=''
jQuery.each(this.divholders, function(){
if (this.$divref.css('display')!='none'){
opendivids+=this.id+',' //store ids of DIVs that are expanded when page unloads: 'div1,div2,etc'
}
if (this.getAttr('group') && this.getAttr('persist'))
groupswithpersist+=this.getAttr('group')+',' //store groups with which at least one DIV has persistance enabled: 'group1,group2,etc'
})
opendivids=(opendivids=='')? 'nada' : opendivids.replace(/,$/, '')
groupswithpersist=(groupswithpersist=='')? 'nada' : groupswithpersist.replace(/,$/, '')
this.setCookie('acopendivids', opendivids)
this.setCookie('acgroupswithpersist', groupswithpersist)
},
getCookie:function(Name){
var re=new RegExp(Name+"=[^;]*", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return null
},
setCookie:function(name, value, days){
if (typeof days!="undefined"){ //if set persistent cookie
var expireDate = new Date()
expireDate.setDate(expireDate.getDate()+days)
document.cookie = name+"="+value+"; path=/; expires="+expireDate.toGMTString()
}
else //else if this is a session only cookie
document.cookie = name+"="+value+"; path=/"
},
urlparamselect:function(){
window.location.search.match(/expanddiv=([\w\-_,]+)/i) //search for expanddiv=divid or divid1,divid2,etc
return (RegExp.$1!="")? RegExp.$1.split(",") : []
},
preloadimage:function(){
var preloadimages=this.preloadimages
for (var i=0; i<arguments.length; i++){
if (arguments[i] && arguments[i].length>0){
preloadimages[preloadimages.length]=new Image()
preloadimages[preloadimages.length-1].src=arguments[i]
}
}
}
}

134
autocheck.php Executable file
View File

@ -0,0 +1,134 @@
<?php
/*
* PHP Frontend for pocsag monitor
*
* Copyright (C) 2004-2005
* Manuel Weiser (manuelw@fire-devils.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
require('config.inc.php');
$show_filter = ' Where a.done = "0" ';
$result = mysql_query("SELECT a.num, a.adresse AS adresse_neu, a.bezeichnung AS bezeichnung_neu, a.text, DATE_FORMAT(a.zeit, '%Y%m%d%H%i%s') AS zeit, a.funktion, a.REC_TYP, a.done,
b.adresse, b.formatierung_id, b.bezeichnung,
d.id AS org_id, d.org_name, d.org, d.alarm_count, d.last_alarm
FROM dme a
LEFT JOIN ric_zvei b ON b.adresse = a.adresse
LEFT JOIN organisation d ON d.id = b.org_id
$show_filter
ORDER BY a.zeit DESC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
if( $row["done"] == '0' )
{
require_once('alarmmail.inc.php');
}
$bezeichnung = $row["bezeichnung"];
// Eintragen der Bezeichnung wenn Bezeichnung in monrc vorhanden und update 1
if( $update_adresse_monrc && !$bezeichnung )
{
// prfen ob die ric schon vorhanden ist, wenn nicht eintragen
$result_check = mysql_query("SELECT id FROM ric_zvei WHERE adresse=".$row["adresse_neu"]);
$row_check = mysql_fetch_array($result_check);
if( !$row_check["id"] )
{
$result_check = mysql_query("INSERT INTO ric_zvei (adresse, bezeichnung, rec_typ, formatierung_id) VALUES ('$row[adresse_neu]', '$row[bezeichnung_neu]', '$row[REC_TYP]', '0')") or die(mysql_error());
$bezeichnung = $row["bezeichnung_neu"];
}
}
// Wenn unbekannte Ric Wert setzen
if( !$bezeichnung && !$row["org_name"] ) $bezeichnung = 'Unbekannt';
if( !$row["org_name"] ) $row["org_name"] = $row["adresse_neu"];
}
// Unwetter Check
$result = mysql_query("SELECT u_meldung, u_text, u_farbe, DATE_FORMAT(u_lastcheck, '%Y%m%d%H%i%s') AS u_lastcheck, DATE_FORMAT(u_lastchange, '%Y%m%d%H%i%s') AS u_lastchange FROM unwetter WHERE id = '1'") or die (mysql_error());
$row = mysql_fetch_array($result);
if( ($timestampnow - $row["u_lastcheck"]) > ($uw_checktime * 100) )
{
// if( $lines = file('http://www.dwd.de/de/WundK/Warnungen/zeige.php?ID='.$uw_landkreis.'#O') )
if( $lines = file('http://www.dwd.de/dyn/app/ws/html/reports/'.$uw_landkreis.'_warning_de.html') )
{
// Durchgehen des Arrays und Anzeigen des HTML Source inkl. Zeilennummern
if( is_array($lines) )
{
foreach( $lines as $line_num => $line )
{
if( $line_num == 34 && htmlspecialchars(substr($line, 75, 6)) )
{
$unwetter_aktiv = 1;
if( htmlspecialchars(substr($line, 75, 6)) == "D90202" ) { $unwetter_status = "Warnung vor extremem Unwetter"; $unwetter_farbe = "#D90202"; }
if( htmlspecialchars(substr($line, 75, 6)) == "FF0000" ) { $unwetter_status = "Unwetterwarnung"; $unwetter_farbe = "#FF6B39"; }
if( htmlspecialchars(substr($line, 75, 6)) == "FFB599" ) { $unwetter_status = "Vorwarnung zur Unwetterwarnung";$unwetter_farbe = "#FFB599"; }
if( htmlspecialchars(substr($line, 75, 6)) == "FA9600" ) { $unwetter_status = "Warnung vor markantem Wetter"; $unwetter_farbe = "#FFD553"; }
if( htmlspecialchars(substr($line, 75, 6)) == "FFFF00" ) { $unwetter_status = "Wetterwarnung"; $unwetter_farbe = "#F0F805"; }
if( htmlspecialchars(substr($line, 75, 6)) == "6F6FFF" ) { $unwetter_status = "Seewetterwarnung"; $unwetter_farbe = "#6F6FFF"; }
}
if( $unwetter_aktiv == 1 && $line_num > 36 && $line_num < 56 )
{
$unwetter_meldung .= $line;
}
// Zum Prüfen der Ausgabe deaktivieren
//echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br>\n";
}
// Text von HTML Tags reinigen
$unwetter_meldung = htmlCode_message($unwetter_meldung);
//$unwetter_meldung = clean_htmlCode($unwetter_meldung);
//$unwetter_meldung = stripslashes($unwetter_meldung);
//$unwetter_meldung = strip_tags($unwetter_meldung, '<br>');
//echo '<br>--------------<br>msg: '.$unwetter_meldung;
}
}
else
{
$unwetter_status = 'keine Verbindung !!!';
$unwetter_farbe = '#FFFFFF';
$unwetter_meldung = 'Verbindung zu dwd.de nicht möglich !';
}
// Wenn noch kein Eintrag in DB existiert
if( empty($row["u_lastcheck"]) )
{
mysql_query("INSERT INTO unwetter (id, u_meldung, u_text, u_farbe, u_lastchange) VALUES ('1', '$unwetter_status', '$unwetter_meldung', '$unwetter_farbe', '$timestampnow')") or die(mysql_error());
}
// Wenn bereits Eintrag vorhanden und Checktime erreicht
if( $unwetter_meldung == $row["u_text"] )
{
mysql_query("UPDATE unwetter SET u_lastcheck='$timestampnow' WHERE id = '1'") or die(mysql_error());
}
else
{
mysql_query("UPDATE unwetter SET u_meldung='$unwetter_status', u_text='$unwetter_meldung', u_farbe='$unwetter_farbe', u_lastcheck='$timestampnow', u_lastchange='$timestampnow' WHERE id = '1'") or die(mysql_error());
}
}
mysql_close($dbconn);
?>

348
config.inc.php Executable file
View File

@ -0,0 +1,348 @@
<?php
/*
* PHP Frontend for pocsag monitor
*
* Copyright (C) 2004-2005
* Manuel Weiser (manuelw@fire-devils.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
///////////////////////////////////////////////
// WICHTIG!!!!
//
// INFO, FRAGEN UND SONSTIGES ZUM FRONTEND UNTER
// http://board.fire-devils.org oder manuelw@fire-devils.org
//
// Damit auch alles in die DB gespeichert wird sollte man
// "index.php?nooutput=1" in einen Cron aller Minute einbinden.
//
// Die Status müssen in der .monrc folgendermaßen
// definiert sein. Wichtig ist das KFZ: bzw LST: voran steht.
// STATUS_F_KFZ 0 $KFZ: 0-Notruf
// STATUS_F_KFZ 1 KFZ: 1-einsatzbereit auf Funk
// STATUS_F_KFZ 2 KFZ: 2-einsatzbereit auf Wache
// STATUS_F_KFZ 3 KFZ: 3-Einsatzauftrag bernommen
// STATUS_F_KFZ 4 KFZ: 4-an Einsatzstelle
// STATUS_F_KFZ 5 KFZ: 5-Sprechwunsch
// STATUS_F_KFZ 6 KFZ: 6-nicht einsatzbereit
// STATUS_F_KFZ 7 KFZ: 7-Patient aufgenommen #Rckfahrt,nicht einsatzb.
// STATUS_F_KFZ 8 KFZ: 8-Ankunft mit Patient #Wache ein,nicht einsatzb.
// STATUS_F_KFZ 9 KFZ: 9-verstanden (Handquittung)
// STATUS_F_KFZ a KFZ: Standort
// STATUS_F_KFZ b $KFZ: B (Kfz)
// STATUS_F_KFZ c $KFZ: C (Kfz)
// STATUS_F_KFZ d $KFZ: D (Kfz)
// STATUS_F_KFZ e KFZ: Fahrzeugquittung
// STATUS_F_KFZ f KFZ: Sprechtaste
//
// STATUS_F_LST 0 LST: Statusabfrage
// STATUS_F_LST 1 LST: A-Sammelruf
// STATUS_F_LST 2 LST: E-Einrcken/Abbrechen
// STATUS_F_LST 3 LST: C-fr Einsatzbernahme melden
// STATUS_F_LST 4 LST: F-ber Telefon melden
// STATUS_F_LST 5 LST: H-Wache anfahren
// STATUS_F_LST 6 LST: J-Sprechaufforderung
// STATUS_F_LST 7 LST: L-Lagemeldung durchgeben
// STATUS_F_LST 8 LST: P-Fernwirken
// STATUS_F_LST 9 LST: U-Fernwirken II
// STATUS_F_LST a LST: Textbertragung
// STATUS_F_LST b LST: Zielort durchgeben
// STATUS_F_LST c LST: C (Lst)
// STATUS_F_LST d LST: D (Lst)
// STATUS_F_LST e LST: Bereitschaftsanfrage
// STATUS_F_LST f LST: automatische Quittung
////////////////////////////////////////////////////////////
setlocale(LC_TIME, 'de_DE');
// Webseiten konfig
$pagetitle = 'pocsag - ZVEI - FMS - Monitor';
$meta = '
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META NAME="author" CONTENT="Monitor - Manuel Weiser">
<META NAME="publisher" CONTENT="Monitor - Manuel Weiser">
<META NAME="copyright" CONTENT="Monitor - Manuel Weiser">
<META NAME="description" CONTENT="Monitor">
<link rel="SHORTCUT ICON" href="/favicon.ico" />
';
$css = '<link href="/monitor.css" rel="stylesheet" type="text/css">';
// URL deines Webinterface
$monitordomain = "http://monitor.fire-devils.org";
$monitoremail = "monitor@fire-devils.org";
// Login Info Text
$login_infotext = '<center><h3><b>Welcome back</b></h3></center>';
// Templates / Sprachen (nicht �dern)
$template_dir = '_html/';
// Updatefunktion fr bestehenden Eintr�e der monrc
// Sollen Namen und Text aus der monrc fr KFZ zB.
// bernommen werden
$update_adresse_monrc = 1;
// IP Bereich fr auto Login
$ip_start = '192.168.2.2';
$ip_ende = '192.168.2.50';
// UserID für IP
$ip_users = array(
"192.168.2.36" => 2,
"192.168.2.21" => 1,
"192.168.2.38" => 1,
);
// Alarmmails enable/disable
$amenable = 1;
// Pm Funktion
$pmenable = 1;
// Unwetter Funktion
$uw_checktime = 5; // aller wieviel min nach Meldungen schauen; 0 = aus
$uw_landkreis = 'TON'; //'LLK'; // Der "Landkreise-Unwetter.txt" Datei entnehmen
// Spaltenbreiten
$pocsag_sp[1] = '60'; //Zeitspalte
$pocsag_sp[2] = '80'; //Organisation
$pocsag_sp[3] = '170'; //Kenner
$pocsag_sp[5] = '250'; //Kurzinfo
// Status Farben
$status_bg = '#FFECB3';
$status_size = '11';
$status_color[1] = '#008000'; //green
$status_format[1] = 'bold';
$status_color[2] = 'FFA500'; //orange
$status_format[2] = 'bold';
$status_color[3] = '#FF0000'; //red
$status_format[3] = 'bold';
$status_color[4] = '#CC0099';
$status_format[4] = 'bold';
$status_color[5] = '#808080'; //gray
$status_format[5] = 'normal';
$status_color[6] = '#0000FF'; //blue
$status_format[6] = 'normal';
$status_color[7] = '#0000FF'; //'#FF6666';
$status_format[7] = 'bold';
$status_color[8] = '#6699CC';
$status_format[8] = 'bold';
$status_color[9] = '#FF0000'; //'black';
$status_format[9] = 'normal';
$status_color[15] = '#808080'; //gray
$status_format[15] = 'normal';
// Status korrektur
$korr_kenner = 1; //Status l�chen wenn Fahrzeugkenner keine Ziffern sind (zb 02F3)
$korr_status = 1; //Korrektur ein = 1 aus = 0
// Alle LST Ausgaben anzeigen (aut.Q)
$aq = 0; // 1 anzeigen, 0 filtern
// Zeit die zwischen dem letzen Status und dem zu berichtigendem sein muss,
// das also nich 3aut.Q hintereinandern, welche sicher 1 Status bedeuten sollen
// in 3 fortlaufende Status ge�dert werden
$korr_status_zeit = 2; //in min
// Grunddaten fr die Datenbankverbindung
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "";
$dbname = "monitor";
// Status definieren
$status_kfz[0] = 'KFZ: 0-Notruf';
$status_kfz[1] = 'KFZ: 1-einsatzbereit auf Funk';
$status_kfz[2] = 'KFZ: 2-einsatzbereit auf Wache';
$status_kfz[3] = 'KFZ: 3-Einsatzauftrag bernommen';
$status_kfz[4] = 'KFZ: 4-an Einsatzstelle';
$status_kfz[5] = 'KFZ: 5-Sprechwunsch';
$status_kfz[6] = 'KFZ: 6-nicht einsatzbereit';
$status_kfz[7] = 'KFZ: 7-Patient aufgenommen';
$status_kfz[8] = 'KFZ: 8-Ankunft mit Patient';
//$status_kfz[9] = 'KFZ: 9-verstanden (Handquittung)';
//$status_kfz[9] = 'KFZ: 9-Quittung, Anmeldung in fremden SprFuVerKr';
$status_kfz[9] = 'KFZ: 9-Notarzt aufgenommen';
$status_kfz[15] = 'KFZ: Sprechtaste';
// Organisation
$bos_org = array(
0 => '---',
1 => 'POL',
2 => 'BGS',
3 => 'BKA',
4 => 'KATS',
5 => 'Zoll',
6 => 'FW',
7 => 'THW',
8 => 'ASB',
9 => 'DRK',
'A' => 'JUH',
'B' => 'MHD',
'C' => 'DLRG',
'D' => 'RD',
'E' => 'ZS',
'F' => 'FERN'
);
// Bundesland
$bos_bdl = array(
0 => 'Sac',
1 => 'Bun',
2 => 'BW',
3 => 'By1',
4 => 'Ber',
5 => 'HB',
6 => 'HH',
7 => 'Hes',
8 => 'NS',
9 => 'NRW',
'A' => 'RPf',
'B' => 'SH',
'C' => 'SL',
'D' => 'By2',
'E' => 'MV/SA',
'F' => 'Bra/Th'
);
// Ort
$bos_ort = array(
#Sachsen
"014" => 'Sac Z', #Zwickau
"015" => 'Sac C', #Chemnitz
"016" => 'Sac PL', #Plauen
"017" => 'Sac Z', #Zwickau
"018" => 'Sac ANA', #Annaberg
"019" => 'Sac ASZ', #Aue-Schwarzenberg
"020" => 'Sac Lfs', #Landesfeuerwehrschule Nardt
"021" => 'Sac V', #Vogtlandkreis
"022" => 'Sac FBG', #Freiberg (Brand-Erbisdorf)
"023" => 'Sac STL', #Chemnitzer Land (Stollberg)
"024" => 'Sac FBG', #Freiberg (Fl�a)
"025" => 'Sac FBG', #Freiberg
"026" => 'Sac GC', #Chemnitzer Land (Glauchau)
"027" => 'Sac MIW', #Mittweida (Hainichen)
"028" => 'Sac HOT', #Chemnitzer Land (Hohenstein-E.)
"029" => 'Sac V', #Vogtlandkreis (Klingenthal)
"031" => 'Sac MEK', #Mittlerer Erzgebirgskreis (Marienbg.)
"032" => 'Sac V', #Vogtlandkreis (Oelsnitz)
"033" => 'Sac V', #Vogtlandkreis (Plauen)
"034" => 'Sac MIW', #Mittweida (Rochlitz)
"035" => 'Sac ASZ', #Aue-Schwarzenberg
"037" => 'Sac WDA', #Zwickauer Land (Werdau)
"038" => 'Sac MEK', #Mittlerer Erzgebirgskreis (Tschopau)
"039" => 'Sac Z', #Zwickauer Land (Zwickau)
"040" => 'Sac RPC', #Regierungsprsidium Chemnitz
"041" => 'Sac V', #Vogtlandkreis (Reichenbach)
"042" => 'Sac Z', #Zwickauer Land (Zwickau)
"043" => 'Sac Z', #Zwickauer Land (Zwickau)
"044" => 'Sac C', #Chemnitzer Land (Chemnitz)
"051" => 'Sac DD', #Dresden
"052" => 'Sac GR', #Grlitz
"053" => 'Sac BZ', #Bautzen
"054" => 'Sac BZ', #Bautzen-Land
"055" => 'Sac BIW', #Bautzen-Land (Bischofswerda)
"056" => 'Sac DPW', #Weieritzkreis (Dippoldiswalde)
"057" => 'Sac MEI', #Meien-Radebeul
"058" => 'Sac FTL', #Weieritzkreis (Freital)
"059" => 'Sac NOK', #Niederschlesischer Oberlausitzkreis
"060" => 'Sac RPD', #Regierungsprsidium Dresden
"061" => 'Sac RG', #Riesa-Groenhain (Groenhain)
"062" => 'Sac KM', #Kamenz
"063" => 'Sac KM', #Kamenz
"064" => 'Sac LB', #L�au-Zittau (Lbau)
"065" => 'Sac MEI', #Meien-Radebeul (Radebeul)
"066" => 'Sac NOK', #Niederschlesischer Oberlausitzkreis
"067" => 'Sac PIR', #Schsische Schweiz (Pirna)
"068" => 'Sac RG', #Riesa-Groenhain (Riesa)
"069" => 'Sac SEB', #Schsische Schweiz (Sebnitz)
"071" => 'Sac NOK', #Niederschlesischer Oberlausitzkreis
"072" => 'Sac ZI', #Lbau-Zittau (Zittau)
"073" => 'Sac HY', #Hoyerswerda
"080" => 'Sac RPL', #Regierungsprsidium Leipzig
"081" => 'Sac L', #Leipzig
"082" => 'Sac L-B', #Leipziger Land (Borna)
"083" => 'Sac DZ', #Delitzsch
"084" => 'Sac DBL', #D�eln
"085" => 'Sac EIL', #Delitzsch (Eilenburg)
"086" => 'Sac GHA', #Leipziger Land (Geithain)
"087" => 'Sac GRM', #Muldentalkreis (Grimma)
"088" => 'Sac L-L', #Leipziger Land (Leipzig)
"089" => 'Sac ToO', #Torgau-Oschatz (Oschatz)
"091" => 'Sac ToT', #Torgau-Oschatz (Torgau)
"092" => 'Sac WUR' #Muldentalkreis (Wurzen)
);
// Farben fr Organisationen
$orgcolor["4"] = 'purple'; // Kats
$orgcolor["6"] = 'red'; // FW
$orgcolor["7"] = 'blue'; // THW
$orgcolor["8"] = 'green'; // RD ASB
$orgcolor["9"] = 'green'; // RD DRK
$orgcolor["A"] = 'green'; // RD JUH
$orgcolor["B"] = 'green'; // RD MHD
$orgcolor["C"] = 'green'; // RD DLRG
$orgcolor["D"] = 'green'; // RD sonstige
//
// Datenbankserververbindung aufbauen und Datenbank auswhlen
//
$dbconn = mysql_connect($dbhost, $dbuser, $dbpass) or die (mysql_error());
$dbselect = mysql_select_db($dbname, $dbconn) or die (mysql_error());
//
// Sessions starten
//
//session_start();
/////////////////
// Requires
/////////////////
require_once('functions.inc.php');
require_once('loginfunctions.inc.php');
//if( $pmenable == '1' && $_GET["nooutput"] != '1' && $_SESSION["pmallow"] == '1' ) require_once('pmfunctions.inc.php');
//if( $uw_checktime > 0 ) require_once('uw_check.inc.php');
///////////////////
// User online
///////////////////
if( $_SESSION["name"] )
{
$tn = date("YmdHis");
$_SESSION["last_seen"] = $tn;
mysql_query("UPDATE admin_users SET last_seen='$tn' WHERE id='$_SESSION[userid]'");
}
// Navigationsleiste
$nav_menu = '<a href="index.php">Home</a>&nbsp;|&nbsp;';
//$nav_menu .= '<a href="suche.php">Suche</a>&nbsp;|&nbsp;';
//$nav_menu .= '<a href="kfz.php">Fahrzeuge</a>&nbsp;|&nbsp;';
$nav_menu .= '<a href="profile.php">Profil</a>&nbsp;|&nbsp;';
//$nav_menu .= '<a href="stats.php">Stats</a>&nbsp;|&nbsp;';
//$nav_menu .= '<a href="http://board.fire-devils.org" target="_blank"><b>FORUM</b></a>&nbsp;|&nbsp;';
$nav_menu .= '<a href="javascript:oeffnefenster(\'pmfunctions.inc.php?pmdo=write\');">PM</a>&nbsp;|&nbsp;';
// Wenn User Adminrechte hat
if( $_SESSION["admin"] == 1 ) $nav_menu .= '<a href="admin.php">ADMIN</a>&nbsp;|&nbsp;';
if( $_SERVER["PHP_SELF"] == '/kfz.php' ) $java_script .= '<script type="text/javascript" src="overlibmws.js"></script><div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000"></div>';
if( $_SERVER["SCRIPT_NAME"] == "/index.php" ) {
$body_html = '<body onload="macheRequest(999999999); macheSecondaryRequest(); toggleindicator();">';
} else {
$body_html = '<body>';
}
?>

BIN
favicon.ico Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

559
functions.inc.php Executable file
View File

@ -0,0 +1,559 @@
<?php
/*
* PHP Frontend for pocsag monitor
*
* Copyright (C) 2004-2005
* Manuel Weiser (manuelw@fire-devils.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
// Status prüfen, berichtigen, ersetzen
function repair_status($kennung, $zeit_neu, $status_alt, $zeit_alt) {
global $korr_status_zeit, $status_kfz;
$spanne = mktime(substr($zeit_neu,8,2), substr($zeit_neu,10,2), substr($zeit_neu,12,2), substr($zeit_neu,4,2), substr($zeit_neu,6,2), substr($zeit_neu,0,4)) - mktime(substr($zeit_alt,8,2), substr($zeit_alt,10,2), 0, substr($zeit_alt,4,2), substr($zeit_alt,6,2), substr($zeit_alt,0,4));
$spanne = (int)($spanne / 60);
if( $spanne > $korr_status_zeit )
{
// Wenn FW
if( substr($kennung,0,1) == '6' )
{
if( $status_alt == '1' ) $neu["status"] = '2';
if( $status_alt == '2' ) $neu["status"] = '3';
if( $status_alt == '3' ) $neu["status"] = '4';
if( $status_alt == '9' ) $neu["status"] = '4';
if( $status_alt == '4' ) $neu["status"] = '1';
if( $status_alt == '6' ) $neu["status"] = '2';
}
// Wenn RD
else
{
if( $status_alt == '1' ) $neu["status"] = '2';
if( $status_alt == '2' ) $neu["status"] = '3';
if( $status_alt == '3' ) $neu["status"] = '4';
if( $status_alt == '9' ) $neu["status"] = '4';
if( $status_alt == '4' ) $neu["status"] = '7';
if( $status_alt == '6' ) $neu["status"] = '2';
if( $status_alt == '7' ) $neu["status"] = '8';
if( $status_alt == '8' ) $neu["status"] = '1';
}
$neu["text"] = $status_kfz[$neu["status"]].' (R)';
$neu["db"] = 1;
}
else
{
$neu["status"] = '15';
$neu["text"] = 'LST: automatische Quittung (R)';
$neu["db"] = 0;
//$show_stats = 0;
}
return $neu;
}
function check_stiwo($stiwo, $text) {
$stiwo = explode(",", $stiwo);
if( is_array($stiwo) )
{
foreach( $stiwo AS $v )
{
if( eregi($v, $text) )
{
$do = "hit";
}
}
}
return $do;
}
// Datum auslesen
function get_date($time) {
$jahr = substr($time,0,4);
$monat = substr($time,4,2);
$tag = substr($time,6,2);
$time = strftime("%d.%m.%Y", mktime(0,0,0, $monat,$tag,$jahr));
return $time;
}
// Datum lang auslesen
function get_date_long($time) {
$jahr = substr($time,0,4);
$monat = substr($time,4,2);
$tag = substr($time,6,2);
$time = strftime("%A, %d.%m.%Y", mktime(0,0,0, $monat,$tag,$jahr));
return $time;
}
// Stunde:Minute:Sekunde aus Timestamp lesen
function get_time($time) {
$h = substr($time,-6,2);
$m = substr($time,-4,2);
$s = substr($time,12,2);
$time = $h.':'.$m.':'.$s;
return $time;
}
function get_timestamp($time) {
$jahr = substr($time,0,4);
$monat = substr($time,4,2);
$tag = substr($time,6,2);
$h = substr($time,-6,2);
$m = substr($time,-4,2);
$s = substr($time,12,2);
$time = mktime($h, $m, $s, $monat, $tag, $jahr);
return $time;
}
// Tag auslesen
function get_day($time) {
$day = substr($time,6,2);
return $day;
}
// Filter Zeit errechnen
function filter_zeit($filter) {
$filter = date("YmdHis", mktime(date("G")-$filter,date("i"),date("s"), date("m"),date("d"),date("Y")));
return $filter;
}
function get_org($kennung) {
global $bos_org, $bos_ort;
$org = substr($kennung,0,1);
$ort = substr($kennung,1,3);
$bos = $bos_org[$org].' '.$bos_ort[$ort]; //.' <font color="black"> | </font>';
return $bos;
//return $bos_org[$org].' '.$bos_ort[$ort].' <font color="black"> | </font>';
}
function search_time_small($time) {
list($stunde, $minute) = explode(":", $time);
$time = $stunde.$minute;
return $time;
}
function get_hour($time) {
list($stunde, $minute, $sekunde) = explode(":", $time);
return $stunde;
}
function ip2str($ip) {
$ip = preg_replace("/(\d{1,3})\.?/e", 'sprintf("%03d", \1)', $ip);
return (string)$ip;
}
####################################################
#function get_day($feld) {
# if ($feld == 1) return 'Montag';
# if ($feld == 2) return 'Dienstag';
# if ($feld == 3) return 'Mittwoch';
# if ($feld == 4) return 'Donnerstag';
# if ($feld == 5) return 'Freitag';
# if ($feld == 6) return 'Samstag';
# if ($feld == 7) return 'Sonntag';
#}
function check_url ($url) {
if (!$url)
{
$url = 'http://';
}
else
{
list($http, $www) = explode(":", $url);
if ($http != 'http') $url = 'http://'.$url;
}
return $url;
}
function span2min($from,$to) {
list($f_stunde, $f_minute, $f_sek) = explode(":", $from);
list($t_stunde, $t_minute, $t_sek) = explode(":", $to);
$stunden = ($t_stunde - $f_stunde) * 60;
$minuten = ($f_minute - $t_minute);
$span = ($stunden - $minuten);
return $span;
}
function span2hour($from,$to) {
list($f_stunde, $f_minute, $f_sek) = explode(":", $from);
list($t_stunde, $t_minute, $t_sek) = explode(":", $to);
//if ($t_stunde == '00') $t_stunde = '24';
if ($t_stunde < $f_stunde) $t_stunde = (24 + $t_stunde);
if ($t_minute >= $f_minute)
{
$stunden = ($t_stunde - $f_stunde);
$minuten = ($t_minute - $f_minute);
}
else
{
$stunden = ($t_stunde - $f_stunde) -1;
$minuten = 60 - ($f_minute - $t_minute);
}
if ($stunden != 1) { $h_text = ' Stunden '; } else { $h_text = ' Stunde '; }
if ($minuten != 1) { $m_text = ' Minuten '; } else { $m_text = ' Minute '; }
return ('<b>'.$stunden.'</b>'.$h_text.'<b>'.$minuten.'</b>'.$m_text);
}
function span2hour_short($from,$to) {
list($f_stunde, $f_minute, $f_sek) = explode(":", $from);
list($t_stunde, $t_minute, $t_sek) = explode(":", $to);
//if ($t_stunde == '00') $t_stunde = '24';
if ($t_stunde < $f_stunde) $t_stunde = (24 + $t_stunde);
if ($t_minute >= $f_minute)
{
$stunden = ($t_stunde - $f_stunde);
$minuten = ($t_minute - $f_minute);
}
else
{
$stunden = ($t_stunde - $f_stunde) -1;
$minuten = 60 - ($f_minute - $t_minute);
}
if ($stunden != 1) { $h_text = ' Stunden '; } else { $h_text = ' Stunde '; }
if ($minuten != 1) { $m_text = ' Minuten '; } else { $m_text = ' Minute '; }
return ($stunden.':'.$minuten);
}
function add_span2db ($span,$dbspan) {
list($new_stunden, $new_minuten) = explode(":", $span);
list($old_stunden, $old_minuten) = explode(":", $dbspan);
$stunden = ($new_stunden + $old_stunden);
$minuten = ($new_minuten + $old_minuten);
if ($minuten > 60)
{
$minuten = $minuten - 60;
$stunden = $stunden + 1;
}
return (doublenum($stunden).':'.doublenum($minuten));
}
function del_span2db ($span,$dbspan) {
list($del_stunden, $del_minuten) = explode(":", $span);
list($old_stunden, $old_minuten) = explode(":", $dbspan);
$stunden = ($old_stunden - $del_stunden);
$minuten = ($old_minuten - $del_minuten);
if ($minuten < 0)
{
$minuten = 60 + $minuten;
$stunden = $stunden - 1;
}
return (doublenum($stunden).':'.doublenum($minuten));
}
function split_time($split) {
list($stunde, $minute) = explode(":", $split);
if ($stunde != 1) { $h_text = ' Stunden '; } else { $h_text = ' Stunde '; }
if ($minute != 1) { $m_text = ' Minuten '; } else { $m_text = ' Minute '; }
return ('<b>'.$stunde.'</b>'.$h_text.'<b>'.$minute.'</b>'.$m_text);
}
function split_year($split) {
list($jahr, $monat, $tag) = explode("-", $split);
return $jahr;
}
function split_month($split) {
list($jahr, $monat, $tag) = explode("-", $split);
return $monat;
}
function split_day($split) {
list($jahr, $monat, $tag) = explode("-", $split);
return $tag;
}
function split_kfz($kfz) {
$kfz = explode(",", $kfz);
return $kfz;
}
function count_total($tocount) {
$result = mysql_query("SELECT Count(*) as $tocount FROM $tocount");
$result = mysql_fetch_array($result);
return $result[$tocount];
}
function minimize($num) {
$wert = 40 * $num / 100;
$wert = $num - $wert;
return $wert;
}
function doublenum($num) {
if($num < 10) $num = '0'.$num;
return $num;
}
function gettemplate($template,$endung="html") {
return str_replace("\"","\\\"",implode("",file($template.".".$endung)));
}
function dooutput($template) {
echo $template;
}
function banner_typ($typ) {
list($bild, $typ) = explode(".", $typ);
return $typ;
}
function date_format_fw($setdate) {
list($jahr, $monat, $tag) = explode("-", $setdate);
return sprintf("%02d.%02d.%04d", $tag, $monat, $jahr);
}
function date_long_format($setdate) {
list($jahr, $monat, $tag) = explode("-", $setdate);
//return sprintf("%02d.%02d.%04d", $tag, $monat, $jahr);
return strftime("%A, %d. %B %Y", mktime(0,0,0, date($monat),date($tag),date($jahr)));
}
function date_dbformat($setdate) {
list($tag, $monat, $jahr) = explode(".", $setdate);
return sprintf("%04d-%02d-%02d", $jahr, $monat, $tag);
}
function time_format($settime) {
list($stunde, $minute, $sek) = explode(":", $settime);
return sprintf("%02d:%02d", $stunde, $minute);
}
function compile_db_string($data) {
$field_names = "";
$field_values = "";
foreach ($data as $k => $v) {
$v = preg_replace( "/'/", "\\'", $v );
$field_names .= "$k,";
$field_values .= "'$v',";
}
$field_names = preg_replace( "/,$/" , "" , $field_names );
$field_values = preg_replace( "/,$/" , "" , $field_values );
return array( 'FIELD_NAMES' => $field_names,
'FIELD_VALUES' => $field_values,
);
}
function pass_erstellen ($wert) {
$i = 0;
while($i < $wert) {
mt_srand((double)microtime()*1000000);
$zahl = mt_rand(1,20);
if ($zahl == 4) {
$zahl = mt_rand(0,9);
$pass = $pass.$zahl;
} else {
$zahl = mt_rand(97,122);
$zufall = mt_rand(1,2);
if ($zufall == 2) {
$pass = $pass.strtoupper(chr($zahl));
} else {
$pass = $pass.chr($zahl);
}
}
$i++;
}
return $pass;
}
function no_access($text) {
return '<br>
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr background="images/box_back.gif">
<td colspan="2" background="images/box_back.gif">
<font color="#FF0000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>&nbsp;No Access</strong></font>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td class="text_normal">
<br><div align="center">'.$text.'</div><br>
</td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF">
<div align="center"><a href="javascript:history.back()">zurck</a></div>
</td>
</tr>
</table>';
}
function gohome($goto) {
$refresh = '<meta http-equiv="refresh" content="1;URL='.$goto.'">';
return $refresh;
}
function clean_htmlCode($text) {
$text = stripslashes($text);
$text = strip_tags($text, '<br>');
return $text;
}
function htmlCode_message($post) {
$post = str_replace("ä","&auml;",$post);
$post = str_replace("ö","&ouml;",$post);
$post = str_replace("ü","&uuml;",$post);
$post = str_replace("ß","&szlig;",$post);
$post = str_replace("Ö","&Ouml;",$post);
$post = str_replace("Ä","&Auml;",$post);
$post = str_replace("Ü","&Uuml;",$post);
$post = str_replace("</div>","",$post);
$post= stripslashes($post);
return $post;
}
function mail_message_header($post) {
$post = str_replace(utf8_decode("ä"),"ae",$post);
$post = str_replace(utf8_decode("Ä"),"AE",$post);
$post = str_replace(utf8_decode("ö"),"oe",$post);
$post = str_replace(utf8_decode("Ö"),"OE",$post);
$post = str_replace(utf8_decode("ü"),"ue",$post);
$post = str_replace(utf8_decode("Ü"),"UE",$post);
$post = str_replace(utf8_decode("ß"),"sz",$post);
$post= stripslashes($post);
return $post;
}
function mail_message_body($post) {
$post = str_replace(utf8_decode("ä"),"ae",$post);
$post = str_replace(utf8_decode("Ä"),"Ae",$post);
$post = str_replace(utf8_decode("ö"),"oe",$post);
$post = str_replace(utf8_decode("Ö"),"Oe",$post);
$post = str_replace(utf8_decode("ü"),"ue",$post);
$post = str_replace(utf8_decode("Ü"),"Ue",$post);
$post = str_replace(utf8_decode("ß"),"sz",$post);
$post= stripslashes($post);
return $post;
}
function mail_pass($email,$pass) {
global $monitordomain, $monitoremail;
$body = ("--------------------------------------------------------\n"
."Login zur Pocsag Seite\n"
."--------------------------------------------------------\n\n"
."Ãœber folgenden Link kannst du die Pocsag Seite besuchen: \n"
."$monitordomain?login=$pass \n\n"
."ACHTUNG: Der Link ist nur einmal gültig! \n\n"
."--------------------------------------------------------\n"
."Dies ist eine automatische EMail auf eine Loginanfrage. \n"
."--------------------------------------------------------");
$xtra = "From: $monitoremail (Monitor)\n";
$xtra .= "Content-Type: text/plain; charset=UTF-8\n";
$xtra .= "MIME-Version: 1.0\n";
$xtra .= "Content-Transfer-Encoding: 8bit\n";
$xtra .= "X-Mailer: PHP ". phpversion();
mail("$email", "Monitor Loginanfrage", utf8_decode($body), $xtra);
}
function mail_alarm($datum,$zeit,$email,$org,$org_name,$bezeichnung,$text) {
global $monitoremail;
$body = ("--------------------------------------------------------\n"
."Alarmauslösung für $org $org_name \n"
."--------------------------------------------------------\n\n"
."Datum: $datum, $zeit \n"
."Bezeichnung: $bezeichnung \n\n"
."Info: $text \n\n"
."--------------------------------------------------------\n"
."Dies ist eine automatische Info-EMail. \n"
."--------------------------------------------------------");
$xtra = "From: $monitoremail (Monitor)\n";
$xtra .= "Content-Type: text/plain; charset=UTF-8\n";
$xtra .= "MIME-Version: 1.0\n";
$xtra .= "Content-Transfer-Encoding: 8bit\n";
$xtra .= "X-Mailer: PHP ". phpversion();
mail("$email", "Monitor Alarm: $org ".mail_message_header($org_name), utf8_decode($body), $xtra);
}
function mail_alarm_sms($datum,$zeit,$email,$org,$org_name,$text) {
global $monitoremail;
$body = ("$datum, $zeit");
$xtra = "From: $monitoremail (Monitor)\n";
$xtra .= "Content-Type: text/plain; charset=UTF-8\n";
$xtra .= "MIME-Version: 1.0\n";
$xtra .= "Content-Transfer-Encoding: 8bit\n";
$xtra .= "X-Mailer: PHP ". phpversion();
mail("$email", "$org ".mail_message_header($org_name).": ".mail_message_body($text), utf8_decode($body), $xtra);
}
$timestampnow = date("YmdHis");
$timestamp_date_now = date("Ymd");
$datnow = date("Y-m-d", mktime(0,0,0, date("m"),date("d"),date("Y")));
$dat2month = date("Y-m-d", mktime(0,0,0, date("m")-2,date("d"),date("Y")));
$dat3month = date("Y-m-d", mktime(0,0,0, date("m")-3,date("d"),date("Y")));
$datshownow = date_format_fw(date("Y-m-d", mktime(0,0,0, date("m"),date("d"),date("Y"))));
$datlargenow = strftime("%A, %d.%m.%Y", mktime(0,0,0, date("m"),date("d"),date("Y")));
$yearnow = date("Y", mktime(0,0,0, date("m"),date("d"),date("Y")));
$monthnow = date("m", mktime(0,0,0, date("m"),date("d"),date("Y")));
$timenow = date("G:i");
$timenowlong = date("G:i:s");
$useronlinetime = date("Y-m-d H:i:s", mktime(date("H"),date("i")-5,date("s"), date("m"),date("d"),date("Y")));
?>

240
get.php Executable file
View File

@ -0,0 +1,240 @@
<?php
/*
* PHP Frontend for pocsag monitor
*
* Copyright (C) 2004-2005
* Manuel Weiser (manuelw@fire-devils.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
require('config.inc.php');
if( $_SERVER['QUERY_STRING'] != $_SESSION["querystring"] )
{
//$_SESSION["lastupdate"] = "";
$_SESSION["online_users"] = "";
$_SESSION["querystring"] = $_SERVER['QUERY_STRING'];
}
// Filter Datum/Zeit erstellen
if( !$_GET["filter"] || $_GET["filter"] == 1 )
{
$show_filter = 1;
}
else
{
$filter = $_GET["filter"];
}
if( $show_filter == 1 && $_SESSION["lastupdate"] == "" && !$_GET["clean"] ) {
$show_filter = filter_zeit(1);
$show_filter = " WHERE a.zeit > '$show_filter' ";
}
elseif( $show_filter == 1 && $_SESSION["lastupdate"] != "" && !$_GET["clean"] )
{
$show_filter = " WHERE a.num > ".$_SESSION["lastupdate"];
}
elseif( $show_filter == 1 && $_GET["clean"] == "yes" )
{
$show_filter = filter_zeit(1);
$show_filter = " WHERE a.zeit > '$show_filter' ";
}
elseif( $show_filter != 1 )
{
$show_filter = filter_zeit($filter);
$show_filter = " WHERE a.zeit > '$show_filter' ";
}
/////////
if( $_GET["org_filter"] == 'ff' )
{
$sql_org_filter = 'AND (org = "BF" OR org = "FF" OR org = "THW")';
}
elseif ( $_GET["org_filter"] == 'rd' )
{
$sql_org_filter = 'AND org = "RD"';
}
else
{
$sql_org_filter = '';
}
$_SESSION["orgfiltered"] = $sql_org_filter;
$show_filter = $show_filter.' '.$sql_org_filter;
//
// Daten f¸r Formatierung holen und in array->session schreiben
if( !$_SESSION["formatierung"] && !$_GET["nooutput"] )
{
$result = mysql_query("SELECT id, bg_farbe, text_farbe, text_format, text_groesse, text_groesse_text FROM formatierung ORDER BY id ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$formatierung[$row["id"]] = array(
"bg_farbe" => $row["bg_farbe"],
"text_farbe" => $row["text_farbe"],
"text_format" => $row["text_format"],
"text_groesse" => $row["text_groesse"],
"text_groesse_text" => $row["text_groesse_text"]
);
$_SESSION["formatierung"] = $formatierung;
}
} else {
$formatierung = $_SESSION["formatierung"];
}
//
// Auslesen pocsag
//
$result = mysql_query("SELECT a.num, a.adresse AS adresse_neu, a.bezeichnung AS bezeichnung_neu, a.text, DATE_FORMAT(a.zeit, '%Y%m%d%H%i%s') AS zeit, a.funktion, a.REC_TYP, a.done,
b.adresse, b.formatierung_id, b.bezeichnung,
d.id AS org_id, d.org_name, d.org, d.alarm_count, d.last_alarm
FROM dme a
LEFT JOIN ric_zvei b ON b.adresse = a.adresse
LEFT JOIN organisation d ON d.id = b.org_id
$show_filter
ORDER BY a.zeit DESC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
if( !$_GET["filter"] || $_GET["filter"] == 1 || $_GET["clean"] == "yes" )
{
if( $row["num"] > $_SESSION["lastupdate"] ) $_SESSION["lastupdate"] = $row["num"];
}
$bezeichnung = $row["bezeichnung"];
// Tageswechsel ausgeben
if( get_date($row["zeit"]) != $lastday && $lastday )
{
$tageswechsel = get_timestamp(str_replace("-","",date_dbformat($lastday))."000000");
//$nextday = '
$show[$tageswechsel] .= '
<tr>
<td colspan="5" bgcolor="black"><span style="color:white;font-size:16;font-weight:bold">&nbsp;Tageswechsel: '.get_date_long($row["zeit"]).'</span></td>
</tr>
';
}
else
{
$nextday = '';
}
$lastday = get_date($row["zeit"]);
// Eintragen der Bezeichnung wenn Bezeichnung in monrc vorhanden und update 1
if( $update_adresse_monrc && !$bezeichnung )
{
// prfen ob die ric schon vorhanden ist, wenn nicht eintragen
$result_check = mysql_query("SELECT id FROM ric_zvei WHERE adresse=".$row["adresse_neu"]);
$row_check = mysql_fetch_array($result_check);
if( !$row_check["id"] )
{
$result_check = mysql_query("INSERT INTO ric_zvei (adresse, bezeichnung, rec_typ, formatierung_id) VALUES ('$row[adresse_neu]', '$row[bezeichnung_neu]', '$row[REC_TYP]', '0')") or die(mysql_error());
$bezeichnung = $row["bezeichnung_neu"];
}
}
// Wenn unbekannte Ric Wert setzen
if( !$bezeichnung && !$row["org_name"] ) $bezeichnung = 'Unbekannt';
if( !$row["org_name"] ) $row["org_name"] = $row["adresse_neu"];
// Wenn ZVEI
if( $row["REC_TYP"] == 'ZVEI' ) $row["funktion"] = $row["text"];
$row["bg_farbe"] = $formatierung[$row["formatierung_id"]]["bg_farbe"];
$row["text_farbe"] = $formatierung[$row["formatierung_id"]]["text_farbe"];
$row["text_farbe_text"] = $formatierung[$row["formatierung_id"]]["text_farbe_text"];
$row["bg_farbe_text"] = $formatierung[$row["formatierung_id"]]["bg_farbe_text"];
$row["text_groesse"] = $formatierung[$row["formatierung_id"]]["text_groesse"];
$row["text_groesse_text"] = $formatierung[$row["formatierung_id"]]["text_groesse_text"];
$row["text_format"] = $formatierung[$row["formatierung_id"]]["text_format"];
// default Farben bestimmen
if( !$row["bg_farbe"] ) $row["bg_farbe"] = 'white';
if( !$row["text_farbe"] ) $row["text_farbe"] = 'black';
if( !$row["text_farbe_text"] ) $row["text_farbe_text"] = 'black';
if( !$row["bg_farbe_text"] ) $row["bg_farbe_text"] = '#CCCCCC';
if( !$row["text_groesse"] ) $row["text_groesse"] = '13';
if( !$row["text_groesse_text"] ) $row["text_groesse_text"] = '12';
// pocsag in Array schreiben
//$thisday = $nextday.'
$thisday = '
<tr bgcolor="'.$row["bg_farbe"].'">
<td width="'.$pocsag_sp[1].'" align="center"><span style="color:white;font-size:'.$status_size.';font-weight:bold">'.get_time($row["zeit"]).'&nbsp;</span></td>
<td width="'.$pocsag_sp[2].'" align="center"><span style="color:'.$row["text_farbe"].';font-size:'.$row["text_groesse"].';font-weight:'.$row["text_format"].'"> '.$row["org"].'</span></td>
<td width="'.$pocsag_sp[3].'" align="center"><span style="color:'.$row["text_farbe"].';font-size:'.$row["text_groesse"].';font-weight:'.$row["text_format"].'">'.$bezeichnung.'</span></td>
<td><span title="'.$row["adresse"].'" style="color:'.$row["text_farbe"].';font-size:'.$row["text_groesse"].';font-weight:'.$row["text_format"].'"> &nbsp;&nbsp;'.$row["org_name"].'</span></td>
<td width="'.$pocsag_sp[5].'">
<span style="color:'.$row["text_farbe"].';font-size:'.$row["text_groesse"].';font-weight:'.$row["text_format"].'">&nbsp;'.$row["funktion"].'</span>
</td>
</tr>
';
// wenn das ne ZVEI ist keine Textzeile ausgeben
if( $row["REC_TYP"] != "ZVEI" )
{
$thisday .= '
<tr bgcolor="'.$row["bg_farbe_text"].'">
<td colspan="5">
<span style="color:'.$row["text_farbe_text"].';font-size:'.$row["text_groesse_text"].'">'.$row["text"].'</span>
</td>
</tr>
';
}
// Falls sich Zeit letzter Status mit pocsag berschneiden um eins erhÔøΩen
$show_time = get_timestamp($row["zeit"]);
if( $show )
{
while( array_key_exists($show_time, $show) )
{
$show_time = ($show_time+1);
}
}
$show[$show_time] = $thisday;
}
/**************************/
// Datenbank schliessen
//
mysql_close($dbconn);
// Ausgabe für Ajax
echo "
<html>
";
//if ($new_unwetter == 1) echo '<meta http-equiv="refresh" content="1">';
if ( $show )
{
echo '<table width="98%" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000" valign="top">';
foreach ( $show as $item )
{
echo $item;
}
echo '</table>';
}
echo "
</html>
";
?>

55
get_other.php Executable file
View File

@ -0,0 +1,55 @@
<?php
require_once("config.inc.php");
// Check User online
$result = mysql_query("SELECT id, a_name, real_name FROM admin_users where last_seen > '$useronlinetime' ORDER BY a_name ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$show_online_users .= '<a href="javascript:oeffnefenster(\'pmfunctions.inc.php?pmdo=write&msg_to='.$row["id"].'\');" title="Nachricht an: '.$row["real_name"].'"><i>'.$row["a_name"].'</i></a>,';
}
// Check Wetter
$result = mysql_query("SELECT u_meldung, u_text, u_farbe, DATE_FORMAT(u_lastcheck, '%Y%m%d%H%i%s') AS u_lastcheck, DATE_FORMAT(u_lastchange, '%Y%m%d%H%i%s') AS u_lastchange FROM unwetter WHERE id = '1'") or die (mysql_error());
$row = mysql_fetch_array($result);
if( !empty($row["u_meldung"]) )
{
$uw_show_link = '<a href="javascript:animatedcollapse.toggle(\'wetter\')"><font style="background-color:#FFFFFF;"> &nbsp;toggle </font></a>';
$uw_warntime = time_format(get_time($row["u_lastchange"]));
$uw_text = $row["u_text"];
// Neu markieren wenn ungelesen
if( $_SESSION["last_seen"] <= $row["u_lastchange"] ) $_SESSION["uw_isnew"] = 'neu';
eval ("\$unwetter_field .= \"".gettemplate($template_dir."body_unwetter")."\";");
}
// Check PM
$result = mysql_query("SELECT a.*, DATE_FORMAT(a.pm_date, '%Y%m%d%H%i%s') AS date, b.real_name
FROM messages a
LEFT JOIN admin_users b ON b.id = a.userid_from
WHERE a.userid_to = '$_SESSION[userid]' ORDER BY pm_date ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$msg_date = get_date_long($row["date"])." / ".get_time($row["date"]);
$msg_text = nl2br($row["message"]);
eval ("\$message_field .= \"".gettemplate($template_dir."body_message")."\";");
}
// Ausgabe
echo "<html>";
if( $_SESSION["online_users"] != $show_online_users ) echo $show_online_users;
echo "|";
if( !empty($uw_text) ) echo $unwetter_field."@".$uw_text;
echo "|";
if( !empty($msg_date) ) echo $message_field;
echo "</html>";
// Sessions füllen
$_SESSION["online_users"] = $show_online_users;
?>

313
index.php Executable file
View File

@ -0,0 +1,313 @@
<?php
require_once("config.inc.php");
// Filter Datum/Zeit erstellen
if( !$_GET["filter"] && !$_SESSION["filter"] )
{
$filter = 1;
}
elseif( !$_GET["filter"] && $_SESSION["filter"] )
{
$filter = $_SESSION["filter"];
}
elseif( $_GET["filter"] )
{
$filter = $_GET["filter"];
$_SESSION["filter"] = $_GET["filter"];
}
// Filter organisation
if( !$_GET["org_filter"] && !$_SESSION["org_filter"] )
{
$org_filter = '';
}
elseif( !$_GET["org_filter"] && $_SESSION["org_filter"] )
{
if( $_SESSION["org_filter"] == 'AND (org = "BF" OR org = "FF")' )
{
$org_filter = 'ff';
}
else
{
$org_filter = $_SESSION["org_filter"];
}
}
elseif( $_GET["org_filter"] && $_GET["org_filter"] != 'all' )
{
$org_filter = $_GET["org_filter"];
$_SESSION["org_filter"] = $_GET["org_filter"];
}
elseif( $_GET["org_filter"] == 'all' )
{
$org_filter = '';
$_SESSION["org_filter"] = '';
}
// Filter Status anzeigen
if( $_GET["stat"] == '' && !$_SESSION["stat"] )
{
$stat = '0';
}
elseif( $_GET["stat"] == '' && $_SESSION["stat"] )
{
$stat = $_SESSION["stat"];
}
elseif( $_GET["stat"] != '' )
{
$stat = $_GET["stat"];
$_SESSION["stat"] = $_GET["stat"];
}
// Wenn Aktualisierung ohne Ausgabe
if( $_GET["nooutput"] ) { $filter = 1; $stat = 1; }
$show_filter = filter_zeit($filter);
$show_filter = " WHERE a.zeit > '$show_filter' ";
$refresh = '
<input type=button name="refresh" value="Aktualisieren" onClick="history.go()">
';
$nav_org_filter = '
<select name="org_filter" onChange="MM_jumpMenu(\'parent\',this,0)">
<option value="'.$_SERVER["php_self"].'?filter='.$filter.'&org_filter=ff&stat=0"'; if( $org_filter == 'ff' && $stat == '0' ) $nav_org_filter .= 'selected'; $nav_org_filter .= '>Feuerwehr</option>
<option value="'.$_SERVER["php_self"].'?filter='.$filter.'&org_filter=rd&stat=0"'; if( $org_filter == 'rd' && $stat == '0' ) $nav_org_filter .= 'selected'; $nav_org_filter .= '>Rettungsdienst</option>
<option value="'.$_SERVER["php_self"].'?filter='.$filter.'&org_filter=all&stat=0"'; if( !$org_filter && $stat == '0' ) $nav_org_filter .= 'selected'; $nav_org_filter .= '>FW und RD</option>
</select>
';
$nav_filter = '
<select id="filter" name="filter" onChange="MM_jumpMenu(\'parent\',this,0)">
<option value="'.$_SERVER["php_self"].'?filter=48&org_filter='.$org_filter.'&stat='.$stat.'&aq='.$aq.'"'; if( $filter == 48 ) $nav_filter .= 'selected'; $nav_filter .= '>48</option>
<option value="'.$_SERVER["php_self"].'?filter=24&org_filter='.$org_filter.'&stat='.$stat.'&aq='.$aq.'"'; if( $filter == 24 ) $nav_filter .= 'selected'; $nav_filter .= '>24</option>
<option value="'.$_SERVER["php_self"].'?filter=10&org_filter='.$org_filter.'&stat='.$stat.'&aq='.$aq.'"'; if( $filter == 10 ) $nav_filter .= 'selected'; $nav_filter .= '>10</option>
<option value="'.$_SERVER["php_self"].'?filter=5&org_filter='.$org_filter.'&stat='.$stat.'&aq='.$aq.'"'; if( $filter == 5 ) $nav_filter .= 'selected'; $nav_filter .= '>5</option>
<option value="'.$_SERVER["php_self"].'?filter=2&org_filter='.$org_filter.'&stat='.$stat.'&aq='.$aq.'"'; if( $filter == 2 ) $nav_filter .= 'selected'; $nav_filter .= '>2</option>
<option value="'.$_SERVER["php_self"].'?filter=1&org_filter='.$org_filter.'&stat='.$stat.'&aq='.$aq.'"'; if( $filter == 1 ) $nav_filter .= 'selected'; $nav_filter .= '>1</option>
</select>
';
$java_script .= "
<script type=\"text/javascript\" language=\"javascript\">
function trim(txt){
return txt.replace(/^\s+|\s+$/g,\"\");
}
function toggleindicator(status){
//Diese Variable definiert wie lange der Indicator mindestens da sein soll.
var timetowait = 2100;
if(status=='off') {
window.setTimeout(toggleindicator(\"dooff\"),2100);
}else if (status=='dooff'){
document.getElementById(\"loading-indicator\").style.display='none';
} else {
document.getElementById(\"loading-indicator\").style.display='';
document.getElementById(\"loading-indicator\").style.position='absolute';
document.getElementById(\"loading-indicator\").style.left='40%';
document.getElementById(\"loading-indicator\").style.top='100px';
time = new Date().getTime();
}
}
var http_request = false;
var http_request2 = false;
function macheRequest(cleanCounter) {
var doreload = '5' // Realod in sek
var cleanIt = '600'; // Wann soll neu geladen werden in sek
autoclean = cleanIt / doreload;
doreload = doreload * 1000;
if( cleanCounter > 99999999) {
doreload = 5000;
}
if( cleanCounter >= autoclean ) {
var url = 'get.php?".$_SERVER['QUERY_STRING']."&clean=yes';
} else {
var url = 'get.php?".$_SERVER['QUERY_STRING']."';
}
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject(\"Msxml2.XMLHTTP\");
} catch (e) {
try {
http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");
} catch (e) {}
}
}
if (!http_request) {
alert('Ende :( Kann keine XMLHTTP-Instanz erzeugen');
return false;
}
http_request.open('GET', url, true);
if( cleanCounter >= autoclean ) {
http_request.onreadystatechange = alertInhaltClean;
var cleanCounter = 1;
} else {
http_request.onreadystatechange = alertInhalt;
var cleanCounter = cleanCounter + 1;
}
http_request.send(null);
if (document.getElementById(\"filter\").options[5].selected == true) {
window.setTimeout(function() {macheRequest(cleanCounter);},doreload);
}
}
function alertInhalt() {
if (http_request.readyState == 4) {
var answer = http_request.responseText;
var answer = answer.replace(\"<html>\", \"\");
var answer = answer.replace(\"</html>\", \"\");
if (answer != '') {
if(document.getElementById(\"inhalt\").innerHTML != answer){
document.getElementById(\"inhalt\").innerHTML = answer + document.getElementById(\"inhalt\").innerHTML;
}
}
if(document.getElementById(\"loading-indicator\").style.display=='')
{
toggleindicator(\"off\");
}
}
}
function alertInhaltClean() {
if (http_request.readyState == 4) {
var answer = http_request.responseText;
var answer = answer.replace(\"<html>\", \"\");
var answer = answer.replace(\"</html>\", \"\");
if (answer != '') {
if(document.getElementById(\"inhalt\").innerHTML != answer){
document.getElementById(\"inhalt\").innerHTML = answer;
}
}
if(document.getElementById(\"loading-indicator\").style.display=='')
{
toggleindicator(\"off\");
}
}
}
/// second Request
function macheSecondaryRequest() {
var url = 'get_other.php';
http_request2 = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request2 = new XMLHttpRequest();
} else if (window.ActiveXObject) { // IE
try {
http_request2 = new ActiveXObject(\"Msxml2.XMLHTTP\");
} catch (e) {
try {
http_request2 = new ActiveXObject(\"Microsoft.XMLHTTP\");
} catch (e) {}
}
}
if (!http_request2) {
alert('Ende :( Kann keine XMLHTTP-Instanz erzeugen');
return false;
}
http_request2.open('GET', url, true);
http_request2.onreadystatechange = alertSecondaryInhalt;
http_request2.send(null);
window.setTimeout(\"macheSecondaryRequest()\",5000);
}
function alertSecondaryInhalt() {
if (http_request2.readyState == 4) {
var answer = http_request2.responseText;
if (answer != '') {
var answer = answer.replace(\"<html>\", \"\");
var answer = answer.replace(\"</html>\", \"\");
var answerContents = answer.split(\"|\");
var answer_OnlUsers = trim(answerContents[0]);
var answer_Unwetter = trim(answerContents[1]);
var answer_Unwetter = answer_Unwetter.split(\"@\");
var answer_UserPM = trim(answerContents[2]);
if(document.getElementById(\"onlUsers\").innerHTML != answer_OnlUsers && answer_OnlUsers != \"\"){
document.getElementById(\"onlUsers\").innerHTML = answer_OnlUsers;
}
if(document.getElementById(\"Unwetter\").innerHTML != answer_Unwetter[1] && answer_Unwetter[1] != \"\"){
document.getElementById(\"Unwetter\").innerHTML = answer_Unwetter[0];
document.getElementById(\"UnwetterContent\").innerHTML = answer_Unwetter[1];
}
if(document.getElementById(\"PrivateMessage\").innerHTML != answer_UserPM && answer_UserPM != \"\"){
document.getElementById(\"PrivateMessage\").innerHTML = answer_UserPM;
} else {
document.getElementById(\"PrivateMessage\").innerHTML = \"\";
}
} else {
document.getElementById(\"onlUsers\").innerHTML = \"\";
}
}
}
// SQL ausfuehren
function execSQL(url) {
http_request2 = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request2 = new XMLHttpRequest();
} else if (window.ActiveXObject) { // IE
try {
http_request2 = new ActiveXObject(\"Msxml2.XMLHTTP\");
} catch (e) {
try {
http_request2 = new ActiveXObject(\"Microsoft.XMLHTTP\");
} catch (e) {}
}
}
if (!http_request2) {
alert('Ende :( Kann keine XMLHTTP-Instanz erzeugen');
return false;
}
http_request2.open('POST', url, true);
// http_request2.onreadystatechange = alert(\"Geloescht, bitte kurz warten!\");
http_request2.send(null);
}
function doSQL(what, pk) {
if( what == \"deletepm\" ) {
url = \"pmfunctions.inc.php?pmdo=deletepm&msg_id=\"+pk;
// document.getElementById(\"PrivateMessage\").innerHTML = '<br>Wird gel&ouml;scht';
}
execSQL(url);
}
</script>
";
eval ("dooutput(\"".gettemplate($template_dir."rahmen")."\");");
?>

211
index.php.bak Executable file
View File

@ -0,0 +1,211 @@
<?php
require_once("config.inc.php");
// Filter Datum/Zeit erstellen
if( !$_GET["filter"] && !$_SESSION["filter"] )
{
$filter = 1;
}
elseif( !$_GET["filter"] && $_SESSION["filter"] )
{
$filter = $_SESSION["filter"];
}
elseif( $_GET["filter"] )
{
$filter = $_GET["filter"];
$_SESSION["filter"] = $_GET["filter"];
}
// Filter organisation
if( !$_GET["org_filter"] && !$_SESSION["org_filter"] )
{
$org_filter = '';
}
elseif( !$_GET["org_filter"] && $_SESSION["org_filter"] )
{
if( $_SESSION["org_filter"] == 'AND (org = "BF" OR org = "FF")' )
{
$org_filter = 'ff';
}
else
{
$org_filter = $_SESSION["org_filter"];
}
}
elseif( $_GET["org_filter"] && $_GET["org_filter"] != 'all' )
{
$org_filter = $_GET["org_filter"];
$_SESSION["org_filter"] = $_GET["org_filter"];
}
elseif( $_GET["org_filter"] == 'all' )
{
$org_filter = '';
$_SESSION["org_filter"] = '';
}
// Filter Status anzeigen
if( $_GET["stat"] == '' && !$_SESSION["stat"] )
{
$stat = '0';
}
elseif( $_GET["stat"] == '' && $_SESSION["stat"] )
{
$stat = $_SESSION["stat"];
}
elseif( $_GET["stat"] != '' )
{
$stat = $_GET["stat"];
$_SESSION["stat"] = $_GET["stat"];
}
// Wenn Aktualisierung ohne Ausgabe
if( $_GET["nooutput"] ) { $filter = 1; $stat = 1; }
$show_filter = filter_zeit($filter);
$show_filter = " WHERE a.zeit > '$show_filter' ";
$refresh = '
<input type=button name="refresh" value="Aktualisieren" onClick="history.go()">
';
$nav_org_filter = '
<select name="org_filter" onChange="MM_jumpMenu(\'parent\',this,0)">
<option value="'.$_SERVER["php_self"].'?filter='.$filter.'&org_filter=ff&stat=0"'; if( $org_filter == 'ff' && $stat == '0' ) $nav_org_filter .= 'selected'; $nav_org_filter .= '>Feuerwehr</option>
<option value="'.$_SERVER["php_self"].'?filter='.$filter.'&org_filter=rd&stat=0"'; if( $org_filter == 'rd' && $stat == '0' ) $nav_org_filter .= 'selected'; $nav_org_filter .= '>Rettungsdienst</option>
<option value="'.$_SERVER["php_self"].'?filter='.$filter.'&org_filter=all&stat=0"'; if( !$org_filter && $stat == '0' ) $nav_org_filter .= 'selected'; $nav_org_filter .= '>FW und RD</option>
</select>
';
$nav_filter = '
<select id="filter" name="filter" onChange="MM_jumpMenu(\'parent\',this,0)">
<option value="'.$_SERVER["php_self"].'?filter=48&org_filter='.$org_filter.'&stat='.$stat.'&aq='.$aq.'"'; if( $filter == 48 ) $nav_filter .= 'selected'; $nav_filter .= '>48</option>
<option value="'.$_SERVER["php_self"].'?filter=24&org_filter='.$org_filter.'&stat='.$stat.'&aq='.$aq.'"'; if( $filter == 24 ) $nav_filter .= 'selected'; $nav_filter .= '>24</option>
<option value="'.$_SERVER["php_self"].'?filter=10&org_filter='.$org_filter.'&stat='.$stat.'&aq='.$aq.'"'; if( $filter == 10 ) $nav_filter .= 'selected'; $nav_filter .= '>10</option>
<option value="'.$_SERVER["php_self"].'?filter=5&org_filter='.$org_filter.'&stat='.$stat.'&aq='.$aq.'"'; if( $filter == 5 ) $nav_filter .= 'selected'; $nav_filter .= '>5</option>
<option value="'.$_SERVER["php_self"].'?filter=2&org_filter='.$org_filter.'&stat='.$stat.'&aq='.$aq.'"'; if( $filter == 2 ) $nav_filter .= 'selected'; $nav_filter .= '>2</option>
<option value="'.$_SERVER["php_self"].'?filter=1&org_filter='.$org_filter.'&stat='.$stat.'&aq='.$aq.'"'; if( $filter == 1 ) $nav_filter .= 'selected'; $nav_filter .= '>1</option>
</select>
';
$java_script .= "
<script type=\"text/javascript\" language=\"javascript\">
var http_request = false;
var http_request2 = false;
function toggleindicator(status){
//Diese Variable definiert wie lange der Indicator mindestens da sein soll.
var timetowait = 2100;
if(status=='off') {
var vergangen = new Date().getTime() - time
if( vergangen >=timetowait) {
document.getElementById(\"loading-indicator\").style.display='none';
} else {
setTimeout(toggleindicator(\"off\"),timetowait - vergangen);
}
} else {
document.getElementById(\"loading-indicator\").style.display='';
document.getElementById(\"loading-indicator\").style.position='absolute';
document.getElementById(\"loading-indicator\").style.left='40%';
document.getElementById(\"loading-indicator\").style.top='100px';
time = new Date().getTime();
}
}
/// second Request
function macheSecondaryRequest() {
var url = 'get_other.php';
http_request2 = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request2 = new XMLHttpRequest();
} else if (window.ActiveXObject) { // IE
try {
http_request2 = new ActiveXObject(\"Msxml2.XMLHTTP\");
} catch (e) {
try {
http_request2 = new ActiveXObject(\"Microsoft.XMLHTTP\");
} catch (e) {}
}
}
if (!http_request2) {
alert('Ende :( Kann keine XMLHTTP-Instanz erzeugen');
return false;
}
http_request2.open('GET', url, true);
http_request2.onreadystatechange = alertSecondaryInhalt;
http_request2.send(null);
window.setTimeout(\"macheSecondaryRequest()\",60000);
}
function alertSecondaryInhalt() {
if (http_request2.readyState == 4) {
var answer = http_request2.responseText;
if(document.getElementById(\"onlUsers\").innerHTML != answer){
document.getElementById(\"onlUsers\").innerHTML = answer;
}
else{
document.getElementById(\"onlUsers\").innerHTML = \"\";
}
}
}
function macheRequest() {
var url = 'get.php?".$_SERVER['QUERY_STRING']."';
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject(\"Msxml2.XMLHTTP\");
} catch (e) {
try {
http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");
} catch (e) {}
}
}
if (!http_request) {
alert('Ende :( Kann keine XMLHTTP-Instanz erzeugen');
return false;
}
http_request.open('GET', url, true);
http_request.onreadystatechange = alertInhalt;
http_request.send(null);
if (document.getElementById(\"filter\").options[5].selected == true) {
window.setTimeout(\"macheRequest()\",10000);
}
}
function alertInhalt() {
if (http_request.readyState == 4) {
var answer = http_request.responseText;
if(document.getElementById(\"inhalt\").innerHTML != answer){
document.getElementById(\"inhalt\").innerHTML = answer;
}
else{
document.getElementById(\"inhalt\").innerHTML = \"\";
}
if(document.getElementById(\"loading-indicator\").style.display=='')
{
toggleindicator(\"off\");
}
}
}
</script>
";
eval ("dooutput(\"".gettemplate($template_dir."rahmen")."\");");
?>

19
jquery.min.js vendored Executable file

File diff suppressed because one or more lines are too long

310
loginfunctions.inc.php Executable file
View File

@ -0,0 +1,310 @@
<?php
/*
* PHP Frontend for pocsag monitor
*
* Copyright (C) 2004-2005
* Manuel Weiser (manuelw@fire-devils.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
// Erlaubnis nach IP
if ( (ip2str($ip_start) <= ip2str($_SERVER["REMOTE_ADDR"]) && ip2str($_SERVER["REMOTE_ADDR"]) <= ip2str($ip_ende)) && empty($_SESSION["name"]) )
{
//$_SESSION["userid"] = '1';
$_SESSION["admin"] = '1';
$_SESSION["mail"] = 'root@localhost';
$_SESSION["pmallow"] = '1';
if( array_key_exists($_SERVER["REMOTE_ADDR"], $ip_users) )
{
$_SESSION["userid"] = $ip_users[$_SERVER["REMOTE_ADDR"]];
}
$zack = $ip_users[$_SERVER["REMOTE_ADDR"]];
$result = mysql_query("SELECT a_name, DATE_FORMAT(last_seen, '%Y%m%d%H%i%s') AS last_seen FROM admin_users WHERE id = '$zack'") or die (mysql_error());
$row = mysql_fetch_array($result);
$_SESSION["name"] = $row["a_name"];
$_SESSION["last_seen"] = ($row["last_seen"] - 200 );
}
elseif ( $_GET["iam"] == "manuelw" )
{
//$_SESSION["userid"] = '1';
$_SESSION["admin"] = '1';
$_SESSION["mail"] = 'root@localhost';
$_SESSION["pmallow"] = '1';
$_SESSION["userid"] = 1;
$result = mysql_query("SELECT a_name, DATE_FORMAT(last_seen, '%Y%m%d%H%i%s') AS last_seen FROM admin_users WHERE id = '1'") or die (mysql_error());
$row = mysql_fetch_array($result);
$_SESSION["name"] = $row["a_name"];
$_SESSION["last_seen"] = ($row["last_seen"] - 200 );
$filter=1;
}
elseif( $wap == 1 )
{
////////////////////////
// Login per Wap
////////////////////////
if (!$_SESSION["name"] && $_GET["mode"] != 'login')
{
echo '
<html>
<head>
<title>Wapsag</title>
'.$meta.'
</head>
<body>
<br><br>
<form name="form1" method="post" action="'.$PHP_SELF.'?mode=login">
<table width="300" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="table_news_head">&nbsp;Login</td>
</tr>
<tr>
<td class="table_news_body">
<table width="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>&nbsp;Username:</td>
<td width="20">&nbsp;</td>
<td><input name="a_name" type="text" id="a_name"></td>
</tr>
<tr>
<td>&nbsp;Passwort:</td>
<td>&nbsp;</td>
<td><input name="a_pass" type="password" id="a_pass"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>
<input type="submit" name="Submit" value="Einloggen">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
';
exit;
}
elseif (!$_SESSION["name"] && $_GET["mode"] == 'login' && $_REQUEST["a_name"] && $_REQUEST["a_pass"])
{
$result = mysql_query("SELECT id, a_name, a_admin, a_mail, real_name, wap_show, wap_rows, wap_def_orgfilter, wap_def_statfilter, wap_handy, login_count FROM admin_users WHERE a_name = '$_REQUEST[a_name]' AND wap_pass = '$_REQUEST[a_pass]'") or die (mysql_error());
$row = mysql_fetch_array($result);
if( !$row["wap_handy"] )
{
$result = mysql_query("UPDATE admin_users SET wap_handy='$HTTP_USER_AGENT' WHERE a_name = '$_REQUEST[a_name]' AND wap_pass = '$_REQUEST[a_pass]'");
}
else
{
//if( $row["wap_handy"] != $HTTP_USER_AGENT) $row["a_name"] = '';
}
if( $row["a_name"] && $row["a_admin"] != '2' )
{
$_SESSION["userid"] = $row["id"];
$_SESSION["name"] = $row["a_name"];
$_SESSION["admin"] = $row["a_admin"];
$_SESSION["mail"] = $row["a_mail"];
$_SESSION["filter"] = $row["wap_show"];
$_SESSION["limit_to"] = $row["wap_rows"];
$_SESSION["org_filter"] = $row["wap_def_orgfilter"];
$_SESSION["stat"] = $row["wap_def_statfilter"];
$_SESSION["pmallow"] = '0';
$login = 1;
$datnow = date("Y-m-d", mktime(0,0,0, date("m"),date("d"),date("Y")));
$timenow = date("G:i");
$ip = $_SERVER["REMOTE_ADDR"];
$agent = $HTTP_USER_AGENT;
$result = mysql_query("INSERT INTO pocsag_logins (name, zeit, datum, ip, agent) VALUES ('$row[real_name]', '$timenow', '$datnow', '$ip', '$agent')");
$row["login_count"]++;
$result = mysql_query("UPDATE admin_users SET login_count = '$row[login_count]' WHERE id = '$row[id]' ") or die(mysql_error());
}
else
{
echo '
<html>
<head>
<title>Wapsag</title>
'.$meta.'
</head>
<body>
Login falsch!<br><a href="javascript:history.back()">zurück</a>
</body>
</html>';
exit;
}
}
}
else
{
////////////////////////
// Sicherheitsabfrage
////////////////////////
if ( !$_SESSION["name"] && $_GET["mode"] != 'login' && !$_GET["login"] )
{
echo '
<br><br>
'.$login_infotext.'<br><br>
<form name="form1" method="post" action="'.$PHP_SELF.'?mode=login">
<table width="300" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="table_news_head">&nbsp;<b>Login</b></td>
</tr>
<tr>
<td class="table_news_body">
<table width="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>&nbsp;Username:</td>
<td width="20">&nbsp;</td>
<td><input name="a_name" type="text" id="a_name"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><input type="submit" name="Submit" value="Zugang anfordern"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
';
exit;
}
elseif (!$_SESSION["name"] && $_GET["mode"] == 'login')
{
$result = mysql_query("SELECT id, a_name, a_admin, a_mail FROM admin_users WHERE a_name = '$_POST[a_name]'") or die (mysql_error());
$row = mysql_fetch_array($result);
if( $row[a_name] && $row["a_admin"] != '2' )
{
//$_SESSION["name"] = $_REQUEST["a_name"];
//$_SESSION["admin"] = $row["a_admin"];
$login = 1;
$pass = pass_erstellen(8);
mail_pass($row["a_mail"], $pass);
$result = mysql_query("UPDATE admin_users SET login_pass='$pass' WHERE id='$row[id]'") or die(mysql_error());
echo'<center><br><br><br>Eine EMail mit deinem Zugang wurde an <b>'.$row[a_mail].'</b> versand.';
exit;
}
else
{
echo 'Login falsch!<br><a href="javascript:history.back()">zurück</a>';
exit;
}
}
elseif (!$_SESSION["name"] && $_GET["mode"] == 'register')
{
echo '
<br><br>
<form name="form1" method="post" action="'.$PHP_SELF.'?mode=doregister">
<table width="300" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="table_news_head">&nbsp;Erlaubnis anfordern</td>
</tr>
<tr>
<td class="table_news_body">
<table width="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>&nbsp;Username:</td>
<td width="20">&nbsp;</td>
<td><input name="a_name" type="text" id="a_name"></td>
</tr>
<tr>
<td>&nbsp;EMail:</td>
<td>&nbsp;</td>
<td><input name="a_mail" type="text" id="a_mail"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><input type="submit" name="Submit" value="Erlaubnis anfordern"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
';
exit;
}
if( !empty($_GET["login"]) )
{
$result = mysql_query("SELECT id, a_name, a_admin, a_mail, real_name, login_count, pm_allow, DATE_FORMAT(last_seen, '%Y%m%d%H%i%s') AS last_seen FROM admin_users WHERE login_pass = '$_GET[login]'") or die (mysql_error());
$row = mysql_fetch_array($result);
if( !empty($row["a_name"]) )
{
$_SESSION["userid"] = $row["id"];
$_SESSION["name"] = $row["a_name"];
$_SESSION["admin"] = $row["a_admin"];
$_SESSION["mail"] = $row["a_mail"];
$_SESSION["pmallow"] = $row["pm_allow"];
$_SESSION["last_seen"] = ($row["last_seen"] - 200 );
$login = 1;
$datnow = date("Y-m-d", mktime(0,0,0, date("m"),date("d"),date("Y")));
$timenow = date("G:i");
$ip = $_SERVER["REMOTE_ADDR"];
$agent = $HTTP_USER_AGENT;
$result = mysql_query("INSERT INTO pocsag_logins (name, zeit, datum, ip, agent) VALUES ('$row[real_name]', '$timenow', '$datnow', '$ip', '$agent')");
$row["login_count"]++;
$result = mysql_query("UPDATE admin_users SET login_pass='', login_count='$row[login_count]' WHERE id='$row[id]'") or die(mysql_error());
echo gohome("index.php");
}
else
{
echo'<center><br><br><br>Falscher oder schon benutzer Logincode.';
exit;
}
}
}
?>

88
monitor.css Executable file
View File

@ -0,0 +1,88 @@
/* Scrollbar Color and HR */
body
{
background-image: url(_img/bg.gif);
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
font-family: Verdana;
font-size: 11px;
font-style: normal;
font-variant: normal;
font-weight: normal;
color: black;
}
.nav_box
{
border-style: dashed dashed dashed dashed;
border-color: Black;
border: 1px dashed Black;
background-color: #FFB2B2;
font-size : 13px;
}
.msg_box
{
border-style: dashed dashed dashed dashed;
border-color: Black;
border: 1px dashed Black;
background-color: #FFE9B2;
font-size : 13px;
}
.uw_box
{
border-style: dashed dashed dashed dashed;
border-color: Black;
border: 1px dashed Black;
font-size : 13px;
}
.kfz_trennung
{
border-color: Black;
border: 1px Black;
border-right-style: dotted;
}
/* Link Properties */
a { text-decoration: none; font-size: 12px; color: red; font-family: Arial; font-style: normal; font-weight: normal; }
a:link { text-decoration: none; font-size: 12px; color: red; font-family: Arial; font-style: normal; font-weight: normal; }
a:visited { text-decoration: none; font-size: 12px; color: red; font-family: Arial; font-style: normal; font-weight: normal; }
a:active { text-decoration: none; font-size: 12px; color: red; font-family: Arial; font-style: normal; font-weight: normal; }
a:hover { text-decoration: underline; font-size: 12px; color: red; font-family: Arial; font-style: normal; font-weight: normal; }
/* Form elements */
button
{
color : red;
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size : 12px;
background-color: #FFEA6E;
border: 1px none;
border-style: solid solid solid solid;
}
textarea, select
{
color : red;
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size : 12px;
background-color: #FFEA6E;
border: 1px none;
border-style: dashed dashed dashed dashed;
}
input
{
color : red;
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size : 12px;
background-color: #FFEA6E;
border: 1px none;
border-style: dashed dashed dashed dashed;
}

99
pmfunctions.inc.php Executable file
View File

@ -0,0 +1,99 @@
<?php
/*
* PHP Frontend for pocsag monitor
*
* Copyright (C) 2004-2005
* Manuel Weiser (manuelw@fire-devils.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
require_once("config.inc.php");
if( $_GET["pmdo"] == "reply" )
{
$result = mysql_query("SELECT real_name FROM admin_users WHERE id = '$_GET[to]'") or die (mysql_error());
$row = mysql_fetch_array($result);
eval ("\$message_field .= \"".gettemplate($template_dir."body_message_reply")."\";");
echo $message_field;
}
elseif( $_GET["pmdo"] == "doreply" )
{
$result = mysql_query("INSERT INTO messages (userid_from, userid_to, message) VALUES ('$_SESSION[userid]', '$_REQUEST[userid_to]', '$_REQUEST[msg_text]')");
$result = mysql_query("DELETE FROM messages WHERE id = '$_REQUEST[msg_id]'")or die(mysql_error());
echo gohome($_SERVER["PHP_SELF"]);
}
elseif( $_GET["pmdo"] == "write" )
{
$select_msg_to = '
<select name="userid_to" id="userid_to">
<option value="0">Empfänger</option>
<option>--------------------</option>
<option value="0">Alle</option>';
$result = mysql_query("SELECT id, real_name FROM admin_users WHERE pm_allow = '1' ORDER BY real_name ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
if( $_GET["msg_to"] == $row["id"] ) { $selected = 'selected'; $can_pm = '1'; } else { $selected = ''; }
$select_msg_to .= '
<option value="'.$row["id"].'" '.$selected.'>'.$row["real_name"].'</option>
';
}
$select_msg_to .= '
</select>
';
if( $_GET["msg_to"] && empty($can_pm) )
{
// pm_allow ist auf 0
$message_field .= "<b><font color=\"red\"><br>Der User darf keine PM Empfangen/Senden</font></b><br><br>";
}
else
{
//pm_allow ist auf 1
eval ("\$message_field .= \"".gettemplate($template_dir."body_message_write")."\";");
}
echo $message_field;
}
elseif( $_GET["pmdo"] == "dowrite" )
{
if( $_REQUEST["userid_to"] != '0' )
{
// an einen bestimmten User
$result = mysql_query("INSERT INTO messages (userid_from, userid_to, message) VALUES ('$_SESSION[userid]', '$_REQUEST[userid_to]', '$_REQUEST[msg_text]')");
}
else
{
// an alle User die PM dürfen
$result = mysql_query("SELECT id FROM admin_users WHERE pm_allow = '1'") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$result_msg = mysql_query("INSERT INTO messages (userid_from, userid_to, message) VALUES ('$_SESSION[userid]', '$row[id]', '$_REQUEST[msg_text]')");
}
}
echo gohome($_SERVER["PHP_SELF"]);
}
elseif( $_GET["pmdo"] == "deletepm" )
{
$result = mysql_query("DELETE FROM messages WHERE id = '$_GET[msg_id]'")or die(mysql_error());
}
?>

225
profile.php Executable file
View File

@ -0,0 +1,225 @@
<?php
/*
* PHP Frontend for pocsag monitor
*
* Copyright (C) 2004-2005
* Manuel Weiser (manuelw@fire-devils.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
require('config.inc.php');
$_SESSION["load_complete"] = "";
$_SESSION["lastupdate"] = "";
$_SESSION["online_users"] = "";
/**************************/
// Seite zusammenstellen
//
//
// Startseite
if( !$_GET["do"] )
{
$result = mysql_query("SELECT a_alarmmail, a_alarmmail2sms, wap_pass, wap_show, wap_rows, wap_def_orgfilter, wap_def_statfilter FROM admin_users WHERE id = '$_SESSION[userid]'") or die (mysql_error());
$row = mysql_fetch_array($result);
$wap_pass = $row["wap_pass"];
if( $row["a_alarmmail2sms"] == 1 ) $checked = 'checked';
$mailform_checkbox = '<input type="checkbox" name="mail2sms" value="1" '.$checked.'>';
$mailform_mail = '<input name="alarmmail" type="text" id="alarmmail" value="'.$row["a_alarmmail"].'">';
$select_wap_show = '
<select name="wap_show" id="wap_show">
<option value="0"'; if( $row["wap_show"] == '0' ) $select_wap_show .= 'selected'; $select_wap_show .= '>aktueller Tag</option>
<option value="1"'; if( $row["wap_show"] == '1' ) $select_wap_show .= 'selected'; $select_wap_show .= '>&nbsp;&nbsp;1 Stunde</option>
<option value="6"'; if( $row["wap_show"] == '6' ) $select_wap_show .= 'selected'; $select_wap_show .= '>&nbsp;&nbsp;6 Stunden</option>
<option value="12"'; if( $row["wap_show"] == '12' ) $select_wap_show .= 'selected'; $select_wap_show .= '>12 Stunden</option>
<option value="18"'; if( $row["wap_show"] == '18' ) $select_wap_show .= 'selected'; $select_wap_show .= '>18 Stunden</option>
<option value="24"'; if( $row["wap_show"] == '24' ) $select_wap_show .= 'selected'; $select_wap_show .= '>24 Stunden</option>
<option value="48"'; if( $row["wap_show"] == '48' ) $select_wap_show .= 'selected'; $select_wap_show .= '>48 Stunden</option>
</select>
';
$select_wap_rows = '
<select name="wap_rows" id="wap_rows">
<option value="5"'; if( $row["wap_rows"] == '5' ) $select_wap_rows .= 'selected'; $select_wap_rows .= '>&nbsp;&nbsp;5 Meldungen</option>
<option value="10"'; if( $row["wap_rows"] == '10' ) $select_wap_rows .= 'selected'; $select_wap_rows .= '>10 Meldungen</option>
<option value="15"'; if( $row["wap_rows"] == '15' ) $select_wap_rows .= 'selected'; $select_wap_rows .= '>15 Meldungen</option>
<option value="20"'; if( $row["wap_rows"] == '20' ) $select_wap_rows .= 'selected'; $select_wap_rows .= '>20 Meldungen</option>
<option value="25"'; if( $row["wap_rows"] == '25' ) $select_wap_rows .= 'selected'; $select_wap_rows .= '>25 Meldungen</option>
<option value="30"'; if( $row["wap_rows"] == '30' ) $select_wap_rows .= 'selected'; $select_wap_rows .= '>30 Meldungen</option>
</select>
';
$select_wap_orgfilter = '
<select name="wap_orgfilter" id="wap_orgfilter">
<option value="all"'; if( $row["wap_def_orgfilter"] == 'all' ) $select_wap_orgfilter .= 'selected'; $select_wap_orgfilter .= '>Alles</option>
<option value="ff"'; if( $row["wap_def_orgfilter"] == 'ff' ) $select_wap_orgfilter .= 'selected'; $select_wap_orgfilter .= '>Feuerwehr</option>
<option value="rd"'; if( $row["wap_def_orgfilter"] == 'rd' ) $select_wap_orgfilter .= 'selected'; $select_wap_orgfilter .= '>Rettungsdienst</option>
</select>
';
$select_wap_statfilter = '
<select name="wap_statfilter" id="wap_statfilter">
<option value="0"'; if( $row["wap_def_statfilter"] == '0' ) $select_wap_statfilter .= 'selected'; $select_wap_statfilter .= '>Status aus</option>
<option value="1"'; if( $row["wap_def_statfilter"] == '1' ) $select_wap_statfilter .= 'selected'; $select_wap_statfilter .= '>Status ein</option>
</select>
';
$select_search_ric = '
<select name="search_ric" id="search_ric">'
;
$result = mysql_query("SELECT id, org_name, org FROM organisation WHERE org != '' ORDER BY org ASC, org_name ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$select_search_ric .= '
<option value="'.$row["id"].'">'.$row["org"].' &nbsp;&nbsp;'.$row["org_name"].'</option>
';
}
$select_search_ric .= '
</select>
';
$result = mysql_query("SELECT a.*,
b.adresse, b.formatierung_id, b.bezeichnung, b.rec_typ,
c.bg_farbe, c.text_farbe, c.text_format, c.text_groesse, c.text_groesse_text,
d.org_name, d.org
FROM alarm2mail a
LEFT JOIN ric_zvei b ON b.adresse = a.adresse
LEFT JOIN formatierung c ON c.id = b.formatierung_id
LEFT JOIN organisation d ON d.id = b.org_id
WHERE a.userid = '$_SESSION[userid]' ORDER BY org ASC, org_name ASC, rec_typ ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
// Zeitfunktion
if( $row["time_from"] == '0' && $row["time_to"] == '0' )
{
$zeitfilter = 'immer';
}
else
{
$zeitfilter = time_format( $row["time_from"] ).' bis '.time_format( $row["time_to"] ).' Uhr';
}
if( !empty($row["stiwo"]) ) { $stiwo = "<span title=\"$row[stiwo]\">Stiwo</span>"; } else { $stiwo = ""; }
$abos .= '<tr>
<td bgcolor="'.$row["bg_farbe"].'" style="border-bottom-style:solid;border-bottom-width:thin;"><span style="font-family:Verdana;color:'.$row["text_farbe"].';font-size:'.$row["text_groesse"].' px;font-weight:'.$row["text_format"].'">&nbsp; '.$row["org"].' '.$row["org_name"].' '.$row["bezeichnung"].' - '.$row["rec_typ"].'</span></td>
<td align="center" bgcolor="'.$row["bg_farbe"].'" style="border-bottom-style:solid;border-bottom-width:thin;">'.$stiwo.' &nbsp;</td>
<td align="center" bgcolor="'.$row["bg_farbe"].'" style="border-bottom-style:solid;border-bottom-width:thin;"><b>'.$zeitfilter.'</b></td>
<td style="border-bottom-style:solid;border-bottom-width:thin;">&nbsp; <a href="'.$_SERVER["PHP_SELF"].'?do=abodel&id='.$row["id"].'">&nbsp;l&ouml;schen</a></td>
</tr>
';
}
// Seiteninhalt ausgeben
eval ("\$page_middle .= \"".gettemplate($template_dir."body_profil_alarmmail")."\";");
}
// Ric zum Abo wählen
elseif( $_GET["do"] == 'abodet' )
{
for( $stunde = 0; $stunde <= 24; $stunde++ )
{
$select_time_filter .= '
<option value="'.$stunde.'">'.$stunde.':00</option>
';
}
$result = mysql_query("SELECT id, org_name, org FROM organisation WHERE id = '$_REQUEST[search_ric]'") or die (mysql_error());
$row = mysql_fetch_array($result);
$org_id = $row["id"];
$org = $row["org"];
$org_name = $row["org_name"];
$result = mysql_query("SELECT id, adresse, bezeichnung, rec_typ FROM ric_zvei WHERE org_id = '$org_id'") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$select_ric .= '<input name="abo_ric['.$i++.']" type="checkbox" value="'.$row["adresse"].'"> <b>'.$org.' '.$org_name.' '.$row["bezeichnung"].'</b> - '.$row["rec_typ"].'<br>';
}
// Seiteninhalt ausgeben
eval ("\$page_middle .= \"".gettemplate($template_dir."body_profil_alarmmail_select")."\";");
}
// Abo eintragen
elseif( $_GET["do"] == 'aboins' )
{
foreach( $_REQUEST["abo_ric"] AS $v )
{
// prüfen ob der User diese Ric bereits Abonniert hat
$result = mysql_query("SELECT id FROM alarm2mail WHERE userid = '$_SESSION[userid]' AND adresse = '$v'") or die (mysql_error());
$row = mysql_fetch_array($result);
if( empty($row["id"]) )
{
$result = mysql_query("INSERT INTO alarm2mail (adresse, userid, time_from, time_to, stiwo) VALUES ('$v', '$_SESSION[userid]', '$_REQUEST[alarm_time_filter_from]', '$_REQUEST[alarm_time_filter_to]', '$_REQUEST[alarm_stiwo]')") or die(mysql_error());
}
}
echo gohome($_SERVER["PHP_SELF"]);
}
// Abo löschen
elseif( $_GET["do"] == 'abodel' )
{
$result = mysql_query("DELETE FROM alarm2mail WHERE id = '$_GET[id]' AND userid = '$_SESSION[userid]'") or die(mysql_error());
echo gohome($_SERVER["PHP_SELF"]);
}
// Alarmmail Form setzen
elseif( $_GET["do"] == 'setmailform' )
{
if( $_REQUEST["mail2sms"] == 1 ) { $setto = 1; } else { $setto = 0; }
$result = mysql_query("UPDATE admin_users SET a_alarmmail2sms='$setto', a_alarmmail='$_REQUEST[alarmmail]' WHERE id = '$_SESSION[userid]'") or die(mysql_error());
echo gohome($_SERVER["PHP_SELF"]);
}
// Wap Einstellungen speichern
elseif( $_GET["do"] == 'setwap' )
{
$result = mysql_query("UPDATE admin_users SET wap_show='$_REQUEST[wap_show]', wap_rows='$_REQUEST[wap_rows]', wap_pass='$_REQUEST[wap_pass]', wap_def_orgfilter='$_REQUEST[wap_orgfilter]', wap_def_statfilter='$_REQUEST[wap_statfilter]' WHERE id = '$_SESSION[userid]'") or die(mysql_error());
echo gohome($_SERVER["PHP_SELF"]);
}
/**************************/
// Ausgabe Rahmen
//
eval ("dooutput(\"".gettemplate($template_dir."rahmen")."\");");
/**************************/
// Datenbank schliessen
//
mysql_close($dbconn);
?>

264
suche.php Executable file
View File

@ -0,0 +1,264 @@
<?php
/*
* PHP Frontend for pocsag monitor
*
* Copyright (C) 2004-2005
* Manuel Weiser (manuelw@fire-devils.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
require('config.inc.php');
/**************************/
// Seite zusammenstellen
//
// Selects
$select_search_what1 = '<input name="search_what" type="radio" value="word"'; if($_REQUEST["search_what"]=='word' || !$_REQUEST["search_what"]) {$select_search_what1.=' checked';}else{$select_search_what1.='';}$select_search_what1.='>';
$select_search_what2 = '<input name="search_what" type="radio" value="ric"'; if($_REQUEST["search_what"]=='ric') {$select_search_what2.=' checked';}else{$select_search_what2.='';}$select_search_what2.='>';
$select_search_org = '
<select name="search_org" id="search_org">
<option value="0"'; if($_REQUEST["search_org"]=='0') {$select_search_org.=' selected';}else{$select_search_org.='';} $select_search_org.='>Alles</option>
<option value="FF"'; if($_REQUEST["search_org"]=='FF') {$select_search_org.=' selected';}else{$select_search_org.='';} $select_search_org.='>FF</option>
<option value="BF"'; if($_REQUEST["search_org"]=='BF') {$select_search_org.=' selected';}else{$select_search_org.='';} $select_search_org.='>BF</option>
<option value="RD"'; if($_REQUEST["search_org"]=='RD') {$select_search_org.=' selected';}else{$select_search_org.='';} $select_search_org.='>RD</option>
<option value="THW"'; if($_REQUEST["search_org"]=='THW') {$select_search_org.=' selected';}else{$select_search_org.='';} $select_search_org.='>THW</option>
<option value="KBM"'; if($_REQUEST["search_org"]=='KBM') {$select_search_org.=' selected';}else{$select_search_org.='';} $select_search_org.='>KBM</option>
<option value="RLS"'; if($_REQUEST["search_org"]=='RLS') {$select_search_org.=' selected';}else{$select_search_org.='';} $select_search_org.='>RLS</option>
</select>
';
$select_search_ric = '
<select name="search_ric" id="search_ric">';
$result = mysql_query("SELECT id, org_name, org FROM organisation WHERE org != '' ORDER BY org ASC, org_name ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$select_search_ric .= '
<option value="'.$row["id"].'"'; if($_REQUEST["search_ric"]==$row["id"]) {$select_search_ric.=' selected';}else{$select_search_ric.='';} $select_search_ric.='>'.$row["org"].' &nbsp;&nbsp;'.$row["org_name"].'</option>
';
}
$select_search_ric .= '
</select>
';
$select_max_results = '
<select name="search_max_results" id="search_max_results">
<option value="20"'; if(!$_REQUEST["search_max_results"] || $_REQUEST["search_max_results"]=='20') {$select_max_results.=' selected';}else{$select_max_results.='';} $select_max_results.='>20</option>
<option value="50"'; if($_REQUEST["search_max_results"]=='50') {$select_max_results.=' selected';}else{$select_max_results.='';} $select_max_results.='>50</option>
<option value="100"'; if($_REQUEST["search_max_results"]=='100') {$select_max_results.=' selected';}else{$select_max_results.='';} $select_max_results.='>100</option>
<option value="300"'; if($_REQUEST["search_max_results"]=='300') {$select_max_results.=' selected';}else{$select_max_results.='';} $select_max_results.='>300</option>
<option value="500"'; if($_REQUEST["search_max_results"]=='500') {$select_max_results.=' selected';}else{$select_max_results.='';} $select_max_results.='>500</option>
</select>
';
$checkbox_time = '
<input name="search_time" type="checkbox" id="search_time" value="1"'; if($_REQUEST["search_time"]=='1') $checkbox_time.=' checked';$checkbox_time.='>
';
// Tage erzeugen
$select_tag_from = '<select name="select_tag_from" id="select_tag_from">';
for($i=1;$i<32;$i++)
{
if (!$_REQUEST["Submit"] && doublenum($i) == date("d", mktime(0,0,0, date("m"),date("d")-7,date("Y"))) || doublenum($i) == $_REQUEST["select_tag_from"] ) {$selected='selected';}else{$selected='';}
$select_tag_from .= '<option value="'.doublenum($i).'" '.$selected.'>'.doublenum($i).'</option>';
}
$select_tag_from .= '</select>';
// Monate erzeugen
$select_monat_from = '<select name="select_monat_from" id="select_monat_from">';
for($i=1;$i<13;$i++)
{
if (!$_REQUEST["Submit"] && doublenum($i) == date("m", mktime(0,0,0, date("m"),date("d"),date("Y"))) || doublenum($i) == $_REQUEST["select_monat_from"] ) {$selected='selected';}else{$selected='';}
$select_monat_from .= '<option value="'.doublenum($i).'" '.$selected.'>'.strftime("%B", mktime(0,0,0,doublenum($i),1,2000)).'</option>';
}
$select_monat_from .= '</select>';
// Tage erzeugen
$select_tag_to = '<select name="select_tag_to" id="select_tag_to">';
for($i=1;$i<32;$i++)
{
if (!$_REQUEST["Submit"] && doublenum($i) == date("d", mktime(0,0,0, date("m"),date("d"),date("Y"))) || doublenum($i) == $_REQUEST["select_tag_to"] ) {$selected='selected';}else{$selected='';}
$select_tag_to .= '<option value="'.doublenum($i).'" '.$selected.'>'.doublenum($i).'</option>';
}
$select_tag_to .= '</select>';
// Monate erzeugen
$select_monat_to = '<select name="select_monat_to" id="select_monat_to">';
for($i=1;$i<13;$i++)
{
if (!$_REQUEST["Submit"] && doublenum($i) == date("m", mktime(0,0,0, date("m"),date("d"),date("Y"))) || doublenum($i) == $_REQUEST["select_monat_to"] ) {$selected='selected';}else{$selected='';}
$select_monat_to .= '<option value="'.doublenum($i).'" '.$selected.'>'.strftime("%B", mktime(0,0,0,doublenum($i),1,2000)).'</option>';
}
$select_monat_to .= '</select>';
if( !$_REQUEST["search_time_from"] ) { $search_time_from = '00:00'; } else { $search_time_from = $_REQUEST["search_time_from"]; }
if( !$_REQUEST["search_time_to"] ) { $search_time_to = '00:00'; } else { $search_time_to = $_REQUEST["search_time_to"]; }
// Wenn User Adminrechte hat
if( $_SESSION["admin"] == 1 ) $nav_menu .= '<a href="admin.php">ADMIN</a>&nbsp;|&nbsp;';
// Filter
if( $_REQUEST["search_what"] == 'word' )
{
if( $_REQUEST["search_word"] )
{
$show_filter = 'WHERE a.text LIKE "%'.$_REQUEST[search_word].'%"';
if( $_REQUEST["search_word_org"] )
{
$show_filter .= 'AND d.org_name LIKE "%'.$_REQUEST[search_word_org].'%"';
}
}
else{
$show_filter = 'WHERE d.org_name LIKE "%'.$_REQUEST[search_word_org].'%"';
}
}
else{
$show_filter = 'WHERE d.id = "'.$_REQUEST[search_ric].'"';
}
if( $_REQUEST["search_org"] != '0' )
{
$show_filter .= ' AND d.org = "'.$_REQUEST["search_org"].'"';
}
if( $_REQUEST["search_time"] == '1' )
{
if( $_REQUEST["select_monat_from"] > $_REQUEST["select_monat_to"] ) { $year_from = $yearnow-1; } else { $year_from = $yearnow; }
//if( $search_time_to == '00:00' && $_REQUEST["search_time"] == '1' ) $_REQUEST["select_tag_to"] = $_REQUEST["select_tag_to"]+1;
$time_from = $year_from.$_REQUEST["select_monat_from"].$_REQUEST["select_tag_from"].search_time_small($_REQUEST["search_time_from"]).'00';
$time_to = $yearnow.$_REQUEST["select_monat_to"].$_REQUEST["select_tag_to"].search_time_small($_REQUEST["search_time_to"]).'00';
$show_filter .= ' AND zeit > "'.$time_from.'" AND zeit < "'.$time_to.'"';
}
// Auslesen pocsag
if( $_REQUEST["search_what"] == 'ric' && $_REQUEST["search_ric"] != '' || $_REQUEST["search_what"] == 'word' && $_REQUEST["search_word"] != '' || $_REQUEST["search_what"] == 'word' && $_REQUEST["search_word_org"] != '' )
{
$result = mysql_query("SELECT a.adresse AS adresse_neu, a.bezeichnung AS bezeichnung_neu, a.rec_typ, a.text, DATE_FORMAT(a.zeit, '%Y%m%d%H%i%s') AS zeit, a.funktion,
b.adresse, b.formatierung_id, b.bezeichnung,
c.id, c.bg_farbe, c.text_farbe, c.text_format, c.text_groesse, c.text_groesse_text,
d.org_name, d.org
FROM dme a
LEFT JOIN ric_zvei b ON b.adresse = a.adresse
LEFT JOIN formatierung c ON c.id = b.formatierung_id
LEFT JOIN organisation d ON d.id = b.org_id
$show_filter
ORDER BY a.zeit DESC LIMIT 0,$_REQUEST[search_max_results]") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$bezeichnung = $row["bezeichnung"];
// Tageswechsel ausgeben
if( get_day($row["zeit"]) != $lastday )
{
$nextday = '
<tr>
<td colspan="5" bgcolor="black"><span style="color:white;font-size:16;font-weight:bold">&nbsp;'.get_date_long($row["zeit"]).'</span></td>
</tr>
';
}
else
{
$nextday = '';
}
$lastday = get_day($row["zeit"]);
// Wenn unbekannte Ric Wert setzen
if( !$bezeichnung && !$row["org_name"] ) $bezeichnung = 'Unbekannt';
// default Farben bestimmen
if( !$row["bg_farbe"] ) $row["bg_farbe"] = 'white';
if( !$row["text_farbe"] ) $row["text_farbe"] = 'black';
if( !$row["text_farbe_text"] ) $row["text_farbe_text"] = 'black';
if( !$row["bg_farbe_text"] ) $row["bg_farbe_text"] = '#CCCCCC';
if( !$row["text_groesse"] ) $row["text_groesse"] = '13';
if( !$row["text_groesse_text"] )$row["text_groesse_text"] = '12';
/* // pocsag in Array schreiben
$thisday = $nextday.'
<tr bgcolor="'.$row["bg_farbe"].'">
<td width="60"><span style="color:'.$row["text_farbe"].';font-size:'.$row["text_groesse"].';font-weight:'.$row["text_format"].'">&nbsp;'.get_time($row["zeit"]).'</span></td>
<td width="70%" height="2"><span style="color:'.$row["text_farbe"].';font-size:'.$row["text_groesse"].';font-weight:'.$row["text_format"].'">&nbsp;'.$row["org"].'</span><span style="font-size:'.$row["text_groesse"].'"> | </span><span style="color:'.$row["text_farbe"].';font-size:'.$row["text_groesse"].';font-weight:'.$row["text_format"].'">'.$row["org_name"].'</span><span style="font-size:'.$row["text_groesse"].'"> | </span><span style="color:'.$row["text_farbe"].';font-size:'.$row["text_groesse"].';font-weight:'.$row["text_format"].'">'.$bezeichnung.'</span></td>
<td width="250"><span style="color:'.$row["text_farbe"].';font-size:'.$row["text_groesse"].';font-weight:'.$row["text_format"].'">&nbsp;'.$row["funktion"].'</span></td>
</tr>
';
// wenn das ne ZVEI ist keine Textzeile ausgeben
if( $row["rec_typ"] != "ZVEI" )
{
$thisday .= '
<tr bgcolor="'.$row["bg_farbe_text"].'">
<td colspan="3"><span style="color:'.$row["text_farbe_text"].';font-size:'.$row["text_groesse_text"].'">'.$row["text"].'</span></td>
</tr>
';
}
*/
// pocsag in Array schreiben
$thisday = $nextday.'
<tr bgcolor="'.$row["bg_farbe"].'">
<!-- <td width="60"><span style="color:'.$row["text_farbe"].';font-size:'.$row["text_groesse"].';font-weight:'.$row["text_format"].'">&nbsp;'.get_time($row["zeit"]).'</span></td> -->
<td width="60"><span style="color:'.$row["text_farbe"].';font-size:'.$status_size.';font-weight:bold">&nbsp;'.get_time($row["zeit"]).'</span></td>
<td width="80" height="2" align="center"><span style="color:'.$row["text_farbe"].';font-size:'.$row["text_groesse"].';font-weight:'.$row["text_format"].'">&nbsp;'.$row["org"].'</span></td>
<td width="100" align="center"><span style="color:'.$row["text_farbe"].';font-size:'.$row["text_groesse"].';font-weight:'.$row["text_format"].'">'.$bezeichnung.'</span></td>
<td><span style="color:'.$row["text_farbe"].';font-size:'.$row["text_groesse"].';font-weight:'.$row["text_format"].'"> &nbsp;'.$row["org_name"].'</span></td>
<td width="250"><span style="color:'.$row["text_farbe"].';font-size:'.$row["text_groesse"].';font-weight:'.$row["text_format"].'">&nbsp;'.$row["funktion"].'</span></td>
</tr>
';
// wenn das ne ZVEI ist keine Textzeile ausgeben
if( $row["rec_typ"] != "ZVEI" )
{
$thisday .= '
<tr bgcolor="'.$row["bg_farbe_text"].'">
<td colspan="5"><span style="color:'.$row["text_farbe_text"].';font-size:'.$row["text_groesse_text"].'">'.$row["text"].'</span></td>
</tr>
';
}
$show[$row["zeit"]] = $thisday;
}
}
// Array sortieren und Zeiger auf Anfang setzen
if( $show )
{
krsort($show);
reset($show);
// Array in Variable fr Ausgabe schreiben
while(list($k, $v) = each ($show))
{
$show_all .= $v;
}
}
// Seiteninhalt ausgeben
eval ("\$page_middle .= \"".gettemplate($template_dir."body_suche")."\";");
/**************************/
// Ausgabe Rahmen
//
eval ("dooutput(\"".gettemplate($template_dir."rahmen")."\");");
/**************************/
// Datenbank schliessen
//
mysql_close($dbconn);
?>

103
uw_check.inc.php Executable file
View File

@ -0,0 +1,103 @@
<?php
/*
* PHP Frontend for pocsag monitor
*
* Copyright (C) 2004-2005
* Manuel Weiser (manuelw@fire-devils.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
$result = mysql_query("SELECT u_meldung, u_text, u_farbe, DATE_FORMAT(u_lastcheck, '%Y%m%d%H%i%s') AS u_lastcheck, DATE_FORMAT(u_lastchange, '%Y%m%d%H%i%s') AS u_lastchange FROM unwetter WHERE id = '1'") or die (mysql_error());
$row = mysql_fetch_array($result);
if( ($timestampnow - $row["u_lastcheck"]) > ($uw_checktime * 100) && $_GET["nooutput"] == 1 )
{
// if( $lines = file('http://www.dwd.de/de/WundK/Warnungen/zeige.php?ID='.$uw_landkreis.'#O') )
if( $lines = file('http://www.dwd.de/dyn/app/ws/html/reports/'.$uw_landkreis.'_warning_de.html') )
{
// Durchgehen des Arrays und Anzeigen des HTML Source inkl. Zeilennummern
if( is_array($lines) )
{
foreach( $lines as $line_num => $line )
{
if( $line_num == 34 && htmlspecialchars(substr($line, 75, 6)) )
{
$unwetter_aktiv = 1;
if( htmlspecialchars(substr($line, 75, 6)) == "D90202" ) { $unwetter_status = "Warnung vor extremem Unwetter"; $unwetter_farbe = "#D90202"; }
if( htmlspecialchars(substr($line, 75, 6)) == "FF0000" ) { $unwetter_status = "Unwetterwarnung"; $unwetter_farbe = "#FF6B39"; }
if( htmlspecialchars(substr($line, 75, 6)) == "FFB599" ) { $unwetter_status = "Vorwarnung zur Unwetterwarnung";$unwetter_farbe = "#FFB599"; }
if( htmlspecialchars(substr($line, 75, 6)) == "FA9600" ) { $unwetter_status = "Warnung vor markantem Wetter"; $unwetter_farbe = "#FFD553"; }
if( htmlspecialchars(substr($line, 75, 6)) == "FFFF00" ) { $unwetter_status = "Wetterwarnung"; $unwetter_farbe = "#F0F805"; }
if( htmlspecialchars(substr($line, 75, 6)) == "6F6FFF" ) { $unwetter_status = "Seewetterwarnung"; $unwetter_farbe = "#6F6FFF"; }
}
if( $unwetter_aktiv == 1 && $line_num > 36 && $line_num < 56 )
{
$unwetter_meldung .= $line;
}
// Zum Prüfen der Ausgabe deaktivieren
//echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br>\n";
}
// Text von HTML Tags reinigen
$unwetter_meldung = htmlCode_message($unwetter_meldung);
//$unwetter_meldung = clean_htmlCode($unwetter_meldung);
//$unwetter_meldung = stripslashes($unwetter_meldung);
//$unwetter_meldung = strip_tags($unwetter_meldung, '<br>');
//echo '<br>--------------<br>msg: '.$unwetter_meldung;
}
}
else
{
$unwetter_status = 'keine Verbindung !!!';
$unwetter_farbe = '#FFFFFF';
$unwetter_meldung = 'Verbindung zu dwd.de nicht möglich !';
}
// Wenn noch kein Eintrag in DB existiert
if( empty($row["u_lastcheck"]) )
{
mysql_query("INSERT INTO unwetter (id, u_meldung, u_text, u_farbe, u_lastchange) VALUES ('1', '$unwetter_status', '$unwetter_meldung', '$unwetter_farbe', '$timestampnow')") or die(mysql_error());
}
// Wenn bereits Eintrag vorhanden und Checktime erreicht
if( $unwetter_meldung == $row["u_text"] )
{
mysql_query("UPDATE unwetter SET u_lastcheck='$timestampnow' WHERE id = '1'") or die(mysql_error());
}
else
{
mysql_query("UPDATE unwetter SET u_meldung='$unwetter_status', u_text='$unwetter_meldung', u_farbe='$unwetter_farbe', u_lastcheck='$timestampnow', u_lastchange='$timestampnow' WHERE id = '1'") or die(mysql_error());
}
}
// Ausgabe für User erzeugen
if( !empty($row["u_meldung"]) && $_GET["nooutput"] != '1' )
{
$uw_show_link = '<a href="javascript:animatedcollapse.toggle(\'wetter\')"><font style="background-color:#FFFFFF;"> &nbsp;toggle </font></a>';
$uw_warntime = time_format(get_time($row["u_lastchange"]));
$uw_text = $row["u_text"];
// Neu markieren wenn ungelesen
if( $_SESSION["last_seen"] <= $row["u_lastchange"] ) $_SESSION["uw_isnew"] = 'neu';
eval ("\$unwetter_field .= \"".gettemplate($template_dir."body_unwetter")."\";");
}
?>