commit 0f09a883f49cefc124ffbfb3a621947deaa1db3a Author: Manuel Date: Sat Aug 4 10:53:24 2018 +0200 Initial commit diff --git a/.DS_Store b/.DS_Store new file mode 100755 index 0000000..ac98131 Binary files /dev/null and b/.DS_Store differ diff --git a/_html/body_admin_dme-kfz_update.html b/_html/body_admin_dme-kfz_update.html new file mode 100755 index 0000000..3952cee --- /dev/null +++ b/_html/body_admin_dme-kfz_update.html @@ -0,0 +1,4 @@ +
zurück zur Admin-Übersicht
+ + $show_all +
diff --git a/_html/body_admin_dme2org.html b/_html/body_admin_dme2org.html new file mode 100755 index 0000000..f32c892 --- /dev/null +++ b/_html/body_admin_dme2org.html @@ -0,0 +1,65 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
neue Organisation/Ort + + + +/ + +
oder Organisation auswählen + +
  
Zusatz:
Formatierung: + +
+  
+
+ diff --git a/_html/body_admin_index.html b/_html/body_admin_index.html new file mode 100755 index 0000000..179859d --- /dev/null +++ b/_html/body_admin_index.html @@ -0,0 +1,32 @@ + + + + +
Suche
+
+ + + + + + + + + + + + + +
 $num_dme DME/ZVEI ohne Organisation
 $num_kfz Fahrzeuge ohne Organisation
 $num_user User im System, $num_new_user davon neu
+

+ + + + +$show_to_edit +
+
+  $select_search_org + +
+
diff --git a/_html/body_admin_kfz2org.html b/_html/body_admin_kfz2org.html new file mode 100755 index 0000000..1cb9dd0 --- /dev/null +++ b/_html/body_admin_kfz2org.html @@ -0,0 +1,46 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
neue Organisation/Ort + +/ + +
oder Organisation auswählen + +
  
Fahrzeug:
 
+
+ diff --git a/_html/body_index.html b/_html/body_index.html new file mode 100755 index 0000000..e804cf8 --- /dev/null +++ b/_html/body_index.html @@ -0,0 +1,3 @@ + + $show_all +
diff --git a/_html/body_kfz_uebersicht.html b/_html/body_kfz_uebersicht.html new file mode 100755 index 0000000..e09e627 --- /dev/null +++ b/_html/body_kfz_uebersicht.html @@ -0,0 +1,3 @@ + + $show_all +
diff --git a/_html/body_message.html b/_html/body_message.html new file mode 100755 index 0000000..6845e33 --- /dev/null +++ b/_html/body_message.html @@ -0,0 +1,14 @@ + + + + + + + +
+ Nachricht von: $row[real_name] ($msg_date)
+ $msg_text +
+ antworten - löschen    +
+
\ No newline at end of file diff --git a/_html/body_message_reply.html b/_html/body_message_reply.html new file mode 100755 index 0000000..c048c97 --- /dev/null +++ b/_html/body_message_reply.html @@ -0,0 +1,21 @@ + +
+ + + + + + + + + + +
+ Nachricht an: $row[real_name]
+ +
+    +
+ +
+ \ No newline at end of file diff --git a/_html/body_message_write.html b/_html/body_message_write.html new file mode 100755 index 0000000..5986a79 --- /dev/null +++ b/_html/body_message_write.html @@ -0,0 +1,19 @@ + +
+ + + + + + + + +
+ Nachricht an: $select_msg_to
+ +
+    +
+ +
+ diff --git a/_html/body_profil_alarmmail.html b/_html/body_profil_alarmmail.html new file mode 100755 index 0000000..d7aff5e --- /dev/null +++ b/_html/body_profil_alarmmail.html @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $abos +
 
+
EMail Einstellung +
+ Alarm an EMailadresse senden + (Wenn leer an deine Loginmail):
+ EMail: $mailform_mail +
+ Alarmmail in Kurzform (zB für SMS): + $mailform_checkbox + +
+
+
 
+ + + + +
+
RIC's Abonnieren + Wähle eine Organisation die du Abonnieren möchtest: +
+ $select_search_ric + +
+
+
  
Bestehende Abos
+ +

 

diff --git a/_html/body_profil_alarmmail_select.html b/_html/body_profil_alarmmail_select.html new file mode 100755 index 0000000..853f2e3 --- /dev/null +++ b/_html/body_profil_alarmmail_select.html @@ -0,0 +1,51 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ In welchem Zeitraum möchtest du Meldungen empfangen: + +
Alarm zwischen + + und + + senden +

Nur bei Stichworten: +
Stichworte mit einem Komma trennen (vu,vku,brand). Leer = immer +
 
+ Wähle eine Adresse die du Abonieren möchtest: + +
+ $select_ric + +  
+
\ No newline at end of file diff --git a/_html/body_stats.html b/_html/body_stats.html new file mode 100755 index 0000000..0135dd5 --- /dev/null +++ b/_html/body_stats.html @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + +
Feuerwehr
Rettungsdienst
RIC
$count_ff_dme
$count_rd_dme
ZVEI
$count_ff_zvei
$count_rd_zvei
Fahrzeuge
$count_ff_kfz
$count_rd_kfz
+

 

+ + + + + + + + + + + + + + + + +
+ + + + + + + + $stats_ff +
 Organisation
Alarme
letzter
+ +
+ + + + + + + + $stats_rd +
 Organisation
Alarme
letzter
+ +
+ + + + + + + + $stats_thw +
 Organisation
Alarme
letzter
+ +
+ + + + + + + + $stats_kat +
 Organisation
Alarme
letzter
+ +
diff --git a/_html/body_suche.html b/_html/body_suche.html new file mode 100755 index 0000000..67dcfb6 --- /dev/null +++ b/_html/body_suche.html @@ -0,0 +1,90 @@ +
+ + + + +
+
+ + + $show_all +
diff --git a/_html/body_unwetter.html b/_html/body_unwetter.html new file mode 100755 index 0000000..012c224 --- /dev/null +++ b/_html/body_unwetter.html @@ -0,0 +1,10 @@ + + + + + +
+ Unwetterstand ($uw_warntime)$_SESSION[uw_isnew] : $row[u_meldung]
+
+ $uw_show_link   +
diff --git a/_html/rahmen.html b/_html/rahmen.html new file mode 100755 index 0000000..9697d47 --- /dev/null +++ b/_html/rahmen.html @@ -0,0 +1,134 @@ + + +$pagetitle +$meta +$css + + + + + + + + + +$java_script + + +$body_html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ + + + + + + + + +
+ +
+ + +
+ + +
+ + +
+ + + + + + +
+ +
+ + + +
+ + $page_middle + +
 
+ + diff --git a/_html/rss.html b/_html/rss.html new file mode 100755 index 0000000..eb64b4b --- /dev/null +++ b/_html/rss.html @@ -0,0 +1,21 @@ + + + + +Monitor RSS Feed +http://monitor.intern +FF Monitor RSS Feed +de-de +2006 ManuelW + + + $show_all + + + \ No newline at end of file diff --git a/_img/ajax-loader.gif b/_img/ajax-loader.gif new file mode 100755 index 0000000..5100d89 Binary files /dev/null and b/_img/ajax-loader.gif differ diff --git a/_img/bg.gif b/_img/bg.gif new file mode 100755 index 0000000..d3d7f97 Binary files /dev/null and b/_img/bg.gif differ diff --git a/_img/foot.gif b/_img/foot.gif new file mode 100755 index 0000000..3c5102c Binary files /dev/null and b/_img/foot.gif differ diff --git a/_img/hidden.png b/_img/hidden.png new file mode 100755 index 0000000..aec06f0 Binary files /dev/null and b/_img/hidden.png differ diff --git a/_img/top_1.gif b/_img/top_1.gif new file mode 100755 index 0000000..a8db25e Binary files /dev/null and b/_img/top_1.gif differ diff --git a/_img/top_2.gif b/_img/top_2.gif new file mode 100755 index 0000000..d2f6673 Binary files /dev/null and b/_img/top_2.gif differ diff --git a/admin.php b/admin.php new file mode 100755 index 0000000..256f280 --- /dev/null +++ b/admin.php @@ -0,0 +1,438 @@ + + '.$row["rec_typ"].' +  '.$row["adresse"].' / '.$row["bezeichnung"].' +  zuordnen  +  löschen  + + '; + } + + // 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 .= ''; + } + + // 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 .= ''; + } + + // 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 .= ' + +  '.$row["bezeichnung"].' +  zuordnen  +  löschen  + + '; + } + + // 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 .= ''; + } + + // 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 = '(User) '; + elseif( $row["a_admin"] == '1' ) $status = '(Admin) '; + elseif( $row["a_admin"] == '2' ) $status = '(New) '; + elseif( $row["a_admin"] == '3' ) $status = '(Closed) '; + + if( $row["a_admin"] != '1') { + $show_del_button = 'löschen'; + } else { + $show_del_button = ""; + } + + $show_all .= ' + +  '.$status.$row["real_name"].' +  '.$row["a_mail"].' + + '.$row["a_name"].' +  '.$show_del_button.'  + + '; + } + + // Benutzer eintragen + $show_all .= ' + +

Neuer User + + + Vorname / Name + EMail + + +
+ + + + + +
+ '; + + // 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 = ' + + '; + + // Ausgabe zusammenstellen wenn org zum bearbeiten gewählt + if( $_REQUEST["search_org"] ) + { + $show_ric = '--- RIC/ZVEI ----------
'; + + $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 .= ' '.$row["adresse"].' | '.$row["rec_typ"].' | '.$row["bezeichnung"].'
'; + } + + $show_ric .= '
--- KFZ/FMS ----------
'; + + $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 .= ' '.$row["kennung"].' | '.$row["bezeichnung"].'
'; + } + + $show_to_edit = ' + '.$show_ric.' + '; + } + + // Seiteninhalt ausgeben + eval ("\$page_middle .= \"".gettemplate($template_dir."body_admin_index")."\";"); +} + +/**************************/ +// Ausgabe Rahmen +// +eval ("dooutput(\"".gettemplate($template_dir."rahmen")."\");"); + +/**************************/ +// Datenbank schliessen +// +mysql_close($dbconn); +?> diff --git a/alarmmail.inc.php b/alarmmail.inc.php new file mode 100755 index 0000000..086c100 --- /dev/null +++ b/alarmmail.inc.php @@ -0,0 +1,96 @@ + $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()); +} +?> \ No newline at end of file diff --git a/animatedcollapse.js b/animatedcollapse.js new file mode 100755 index 0000000..774605a --- /dev/null +++ b/animatedcollapse.js @@ -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; i1 && (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; i0){ + 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; i0){ + preloadimages[preloadimages.length]=new Image() + preloadimages[preloadimages.length-1].src=arguments[i] + } + } +} + +} \ No newline at end of file diff --git a/autocheck.php b/autocheck.php new file mode 100755 index 0000000..e3c8bdd --- /dev/null +++ b/autocheck.php @@ -0,0 +1,134 @@ + ($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 #{$line_num} : " . htmlspecialchars($line) . "
\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, '
'); + //echo '
--------------
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); +?> diff --git a/config.inc.php b/config.inc.php new file mode 100755 index 0000000..86ab7f5 --- /dev/null +++ b/config.inc.php @@ -0,0 +1,348 @@ + + + + + + +'; +$css = ''; + +// URL deines Webinterface +$monitordomain = "http://monitor.fire-devils.org"; +$monitoremail = "monitor@fire-devils.org"; + +// Login Info Text +$login_infotext = '

Welcome back

'; + +// 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 = 'Home | '; +//$nav_menu .= 'Suche | '; +//$nav_menu .= 'Fahrzeuge | '; +$nav_menu .= 'Profil | '; +//$nav_menu .= 'Stats | '; +//$nav_menu .= 'FORUM | '; +$nav_menu .= 'PM | '; +// Wenn User Adminrechte hat +if( $_SESSION["admin"] == 1 ) $nav_menu .= 'ADMIN | '; + +if( $_SERVER["PHP_SELF"] == '/kfz.php' ) $java_script .= ''; + +if( $_SERVER["SCRIPT_NAME"] == "/index.php" ) { + $body_html = ''; +} else { + $body_html = ''; +} +?> diff --git a/favicon.ico b/favicon.ico new file mode 100755 index 0000000..8590757 Binary files /dev/null and b/favicon.ico differ diff --git a/functions.inc.php b/functions.inc.php new file mode 100755 index 0000000..3c63c7f --- /dev/null +++ b/functions.inc.php @@ -0,0 +1,559 @@ + $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]; //.' | '; + + return $bos; + + //return $bos_org[$org].' '.$bos_ort[$ort].' | '; +} + +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 (''.$stunden.''.$h_text.''.$minuten.''.$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 (''.$stunde.''.$h_text.''.$minute.''.$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 '
+ + + + + + + + + + +
+  No Access +
+
'.$text.'

+
+ +
'; +} + +function gohome($goto) { + $refresh = ''; + return $refresh; +} + +function clean_htmlCode($text) { + $text = stripslashes($text); + $text = strip_tags($text, '
'); + return $text; +} + +function htmlCode_message($post) { + $post = str_replace("ä","ä",$post); + $post = str_replace("ö","ö",$post); + $post = str_replace("ü","ü",$post); + $post = str_replace("ß","ß",$post); + $post = str_replace("Ö","Ö",$post); + $post = str_replace("Ä","Ä",$post); + $post = str_replace("Ãœ","Ü",$post); + + $post = str_replace("","",$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"))); + +?> diff --git a/get.php b/get.php new file mode 100755 index 0000000..f9f9f4a --- /dev/null +++ b/get.php @@ -0,0 +1,240 @@ + '$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] .= ' + +  Tageswechsel: '.get_date_long($row["zeit"]).' + + '; + } + 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 = ' + + '.get_time($row["zeit"]).'  + '.$row["org"].' + '.$bezeichnung.' +   '.$row["org_name"].' + +  '.$row["funktion"].' + + + '; + // wenn das ne ZVEI ist keine Textzeile ausgeben + if( $row["REC_TYP"] != "ZVEI" ) + { + $thisday .= ' + + + '.$row["text"].' + + + '; + } + + // 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 " + +"; + +//if ($new_unwetter == 1) echo ''; + +if ( $show ) +{ + echo ''; + foreach ( $show as $item ) + { + echo $item; + } + echo '
'; +} + +echo " + +"; +?> diff --git a/get_other.php b/get_other.php new file mode 100755 index 0000000..d4da974 --- /dev/null +++ b/get_other.php @@ -0,0 +1,55 @@ + '$useronlinetime' ORDER BY a_name ASC") or die (mysql_error()); + while($row = mysql_fetch_array($result)) + { + $show_online_users .= ''.$row["a_name"].','; + } + +// 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 = '  toggle '; + $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 ""; + +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 ""; + +// Sessions füllen +$_SESSION["online_users"] = $show_online_users; +?> \ No newline at end of file diff --git a/index.php b/index.php new file mode 100755 index 0000000..f222181 --- /dev/null +++ b/index.php @@ -0,0 +1,313 @@ + '$show_filter' "; + + $refresh = ' + + '; + + $nav_org_filter = ' + + '; + + $nav_org_filter = ' + "]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/loginfunctions.inc.php b/loginfunctions.inc.php new file mode 100755 index 0000000..a73883c --- /dev/null +++ b/loginfunctions.inc.php @@ -0,0 +1,310 @@ + + + + + Wapsag + + '.$meta.' + + + + +

+
+ + + + + + + +
 Login
+ + + + + + + + + + + + + + + + +
 Username: 
 Passwort: 
   + +
+
+ +
+ + +'; + 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 ' + + + + + Wapsag + + '.$meta.' + + + + Login falsch!
zurück + + '; + exit; + } + } +} +else +{ + + //////////////////////// + // Sicherheitsabfrage + //////////////////////// + if ( !$_SESSION["name"] && $_GET["mode"] != 'login' && !$_GET["login"] ) + { + echo ' +

+'.$login_infotext.'

+
+ + + + + + + +
 Login
+ + + + + + + + + + + + +
 Username: 
  
+ +
+ +
+'; + 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'



Eine EMail mit deinem Zugang wurde an '.$row[a_mail].' versand.'; + + exit; + } + else + { + echo 'Login falsch!
zurück'; + exit; + } + } + + elseif (!$_SESSION["name"] && $_GET["mode"] == 'register') + { + echo ' +

+
+ + + + + + + +
 Erlaubnis anfordern
+ + + + + + + + + + + + + + + + + +
 Username: 
 EMail: 
  
+ +
+ +
+'; + +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'



Falscher oder schon benutzer Logincode.'; + + exit; + } + } + +} +?> diff --git a/monitor.css b/monitor.css new file mode 100755 index 0000000..4cae98a --- /dev/null +++ b/monitor.css @@ -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; +} + diff --git a/pmfunctions.inc.php b/pmfunctions.inc.php new file mode 100755 index 0000000..2ccfa38 --- /dev/null +++ b/pmfunctions.inc.php @@ -0,0 +1,99 @@ + + + + '; + + $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 .= ' + + '; + } + + $select_msg_to .= ' + + '; + + if( $_GET["msg_to"] && empty($can_pm) ) + { + // pm_allow ist auf 0 + $message_field .= "
Der User darf keine PM Empfangen/Senden


"; + } + 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()); +} +?> \ No newline at end of file diff --git a/profile.php b/profile.php new file mode 100755 index 0000000..df436b9 --- /dev/null +++ b/profile.php @@ -0,0 +1,225 @@ +'; + $mailform_mail = ''; + + $select_wap_show = ' + + '; + + $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 = "Stiwo"; } else { $stiwo = ""; } + + $abos .= ' +   '.$row["org"].' '.$row["org_name"].' '.$row["bezeichnung"].' - '.$row["rec_typ"].' + '.$stiwo.'   + '.$zeitfilter.' +    löschen + + '; + } + + // 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 .= ' + + '; + } + + $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 .= ' '.$org.' '.$org_name.' '.$row["bezeichnung"].' - '.$row["rec_typ"].'
'; + } + + // 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); +?> diff --git a/suche.php b/suche.php new file mode 100755 index 0000000..9cdda2e --- /dev/null +++ b/suche.php @@ -0,0 +1,264 @@ +'; + $select_search_what2 = ' + '; + } + + $select_search_ric .= ' + + '; + + $select_max_results = ' + '; + + // Monate erzeugen + $select_monat_from = ''; + + // Tage erzeugen + $select_tag_to = ''; + + // Monate erzeugen + $select_monat_to = ''; + + 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 .= 'ADMIN | '; + + // 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 = ' + +  '.get_date_long($row["zeit"]).' + + '; + } + 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.' + +  '.get_time($row["zeit"]).' +  '.$row["org"].' | '.$row["org_name"].' | '.$bezeichnung.' +  '.$row["funktion"].' + + '; + // wenn das ne ZVEI ist keine Textzeile ausgeben + if( $row["rec_typ"] != "ZVEI" ) + { + $thisday .= ' + + '.$row["text"].' + + '; + } +*/ + // pocsag in Array schreiben + $thisday = $nextday.' + + +  '.get_time($row["zeit"]).' +  '.$row["org"].' + '.$bezeichnung.' +  '.$row["org_name"].' +  '.$row["funktion"].' + + '; + // wenn das ne ZVEI ist keine Textzeile ausgeben + if( $row["rec_typ"] != "ZVEI" ) + { + $thisday .= ' + + '.$row["text"].' + + '; + } + + $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); +?> diff --git a/uw_check.inc.php b/uw_check.inc.php new file mode 100755 index 0000000..faf98ba --- /dev/null +++ b/uw_check.inc.php @@ -0,0 +1,103 @@ + ($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 #{$line_num} : " . htmlspecialchars($line) . "
\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, '
'); + //echo '
--------------
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 = '  toggle '; + $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")."\";"); + } + +?> \ No newline at end of file