diff --git a/admin.php b/admin.php
index 256f280..83e3c87 100755
--- a/admin.php
+++ b/admin.php
@@ -27,7 +27,7 @@ $_SESSION["load_complete"] = "";
$_SESSION["lastupdate"] = "";
$_SESSION["online_users"] = "";
-// Prüfen ob admin
+// Pr�fen ob admin
if( $_SESSION["admin"] != 1 ) exit;
/**************************/
@@ -39,15 +39,15 @@ if( $_SESSION["admin"] != 1 ) exit;
if( $_GET["show"] == 'dme' && !$_GET["do"] )
{
// Alle DME ohne Organisation holen
- $result = mysql_query("SELECT id, adresse, bezeichnung, rec_typ FROM ric_zvei WHERE org_id = '0' ORDER BY bezeichnung ASC") or die (mysql_error());
- while($row = mysql_fetch_array($result))
+ $result = mysqli_query("SELECT id, adresse, bezeichnung, rec_typ FROM ric_zvei WHERE org_id = '0' ORDER BY bezeichnung ASC") or die (mysqli_error());
+ while($row = mysqli_fetch_array($result))
{
$show_all .= '
'.$row["rec_typ"].'
'.$row["adresse"].' / '.$row["bezeichnung"].'
zuordnen
- löschen
+ l�schen
';
}
@@ -61,48 +61,48 @@ if( $_GET["show"] == 'dme' && !$_GET["do"] )
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))
+ $result = mysqli_query("SELECT id, org_name, org FROM organisation ORDER BY org ASC, org_name ASC") or die (mysqli_error());
+ while($row = mysqli_fetch_array($result))
{
if( $_REQUEST["org"] == $row["id"] ) { $selected = 'selected'; } else { $selected = ''; }
$option_org .= ''.$row["org"].' '.$row["org_name"].' ';
}
// 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))
+ $result = mysqli_query("SELECT id, beschreibung FROM formatierung ORDER BY beschreibung ASC") or die (mysqli_error());
+ while($row = mysqli_fetch_array($result))
{
if( $_REQUEST["form"] == $row["id"] ) { $selected = 'selected'; } else { $selected = ''; }
$option_format .= ''.$row["beschreibung"].' ';
}
// 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);
+ $result = mysqli_query("SELECT id, adresse, bezeichnung, rec_typ FROM ric_zvei WHERE id = '$_GET[id]'") or die (mysqli_error());
+ $row = mysqli_fetch_array($result);
// Seiteninhalt ausgeben
eval ("\$page_middle .= \"".gettemplate($template_dir."body_admin_dme2org")."\";");
}
//
-// Wenn dme löschen
+// 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());
+ $result = mysqli_query("DELETE FROM ric_zvei WHERE id = '$_GET[id]'") or die (mysqli_error());
+ $result = mysqli_query("DELETE FROM alarm2mail WHERE adresse = '$_GET[adresse]'") or die (mysqli_error());
- // Prüfen ob noch weitere Einträge zur Org da sind, wenn nicht löschen
+ // 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
+ $result = mysqli_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);
+ WHERE a.org_id = '$_GET[org]' OR b.org_id = '$_GET[org]'") or die (mysqli_error());
+ $row = mysqli_fetch_array($result);
if( !$row["dme_id"] && !$row["kfz_id"] )
{
- $result = mysql_query("DELETE FROM organisation WHERE id = '$_GET[org]'") or die (mysql_error());
+ $result = mysqli_query("DELETE FROM organisation WHERE id = '$_GET[org]'") or die (mysqli_error());
}
}
@@ -118,17 +118,17 @@ elseif( $_GET["show"] == 'dme' && $_GET["do"] == 'delete' )
}
//
-// dme Update ausführen
+// dme Update ausf�hren
elseif( $_GET["show"] == 'dme' && $_GET["do"] == 'setupdate' )
{
- // Schauen ob neue oder bestehende Organistaion gewählt wurde
+ // 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);
+ // Pr�fen ob die Org schon existiert, wenn ja update kein eintrag
+ $result = mysqli_query("SELECT id FROM organisation WHERE org_name = '$_REQUEST[new_org]' AND org = '$_REQUEST[new_org_typ]'") or die (mysqli_error());
+ $row = mysqli_fetch_array($result);
if( $row["id"] )
{
@@ -137,9 +137,9 @@ elseif( $_GET["show"] == 'dme' && $_GET["do"] == 'setupdate' )
if( !$org_id )
{
- $result = mysql_query("INSERT INTO organisation (org_name, org) VALUES ('$_REQUEST[new_org]', '$_REQUEST[new_org_typ]')");
+ $result = mysqli_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");
+ $result = mysqli_query("SELECT MAX(id) as new_id FROM organisation");
$row = mysql_fetch_row($result);
$org_id = $row[0];
}
@@ -149,20 +149,20 @@ elseif( $_GET["show"] == 'dme' && $_GET["do"] == 'setupdate' )
$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());
+ $result = mysqli_query("UPDATE ric_zvei SET bezeichnung = '$_REQUEST[bezeichnung]', formatierung_id = '$_REQUEST[formatierung]', org_id = '$org_id' WHERE id='$_REQUEST[id]'") or die (mysqli_error());
- // Prüfen ob noch weitere Einträge zur Org da sind, wenn nicht löschen
+ // 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
+ $result = mysqli_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);
+ WHERE a.org_id = '$_REQUEST[old_org]' OR b.org_id = '$_REQUEST[old_org]'") or die (mysqli_error());
+ $row = mysqli_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());
+ $result = mysqli_query("DELETE FROM organisation WHERE id = '$_REQUEST[old_org]'") or die (mysqli_error());
}
}
@@ -174,14 +174,14 @@ elseif( $_GET["show"] == 'dme' && $_GET["do"] == 'setupdate' )
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))
+ $result = mysqli_query("SELECT id, bezeichnung FROM kfz_fms WHERE org_id = '0' ORDER BY bezeichnung ASC") or die (mysqli_error());
+ while($row = mysqli_fetch_array($result))
{
$show_all .= '
'.$row["bezeichnung"].'
zuordnen
- löschen
+ l�schen
';
}
@@ -195,39 +195,39 @@ elseif( $_GET["show"] == 'kfz' && !$_GET["do"] )
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))
+ $result = mysqli_query("SELECT id, org_name, org FROM organisation ORDER BY org ASC, org_name ASC") or die (mysqli_error());
+ while($row = mysqli_fetch_array($result))
{
if( $_REQUEST["org"] == $row["id"] ) { $selected = 'selected'; } else { $selected = ''; }
$option_org .= ''.$row["org"].' '.$row["org_name"].' ';
}
// 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);
+ $result = mysqli_query("SELECT id, bezeichnung FROM kfz_fms WHERE id = '$_GET[id]'") or die (mysqli_error());
+ $row = mysqli_fetch_array($result);
// Seiteninhalt ausgeben
eval ("\$page_middle .= \"".gettemplate($template_dir."body_admin_kfz2org")."\";");
}
//
-// Wenn kfz löschen
+// 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());
+ $result = mysqli_query("DELETE FROM kfz_fms WHERE id = '$_GET[id]'") or die (mysqli_error());
- // Prüfen ob noch weitere Einträge zur Org da sind, wenn nicht löschen
+ // 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
+ $result = mysqli_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);
+ WHERE a.org_id = '$_GET[org]' OR b.org_id = '$_GET[org]'") or die (mysqli_error());
+ $row = mysqli_fetch_array($result);
if( !$row["dme_id"] && !$row["kfz_id"] )
{
- $result = mysql_query("DELETE FROM organisation WHERE id = '$_GET[org]'") or die (mysql_error());
+ $result = mysqli_query("DELETE FROM organisation WHERE id = '$_GET[org]'") or die (mysqli_error());
}
}
@@ -250,9 +250,9 @@ elseif( $_GET["show"] == 'kfz' && $_GET["do"] == 'setupdate' )
if( $_REQUEST["new_org"] )
{
$organisation = $_REQUEST["new_org"];
- $result = mysql_query("INSERT INTO organisation (org_name, org) VALUES ('$organisation', '$_REQUEST[new_org_typ]')");
+ $result = mysqli_query("INSERT INTO organisation (org_name, org) VALUES ('$organisation', '$_REQUEST[new_org_typ]')");
- $result = mysql_query("SELECT MAX(id) as new_id FROM organisation");
+ $result = mysqli_query("SELECT MAX(id) as new_id FROM organisation");
$row = mysql_fetch_row($result);
$organisation = $row[0];
}
@@ -261,20 +261,20 @@ elseif( $_GET["show"] == 'kfz' && $_GET["do"] == 'setupdate' )
$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());
+ $result = mysqli_query("UPDATE kfz_fms SET bezeichnung = '$_REQUEST[bezeichnung]', org_id = '$organisation' WHERE id='$_REQUEST[id]'") or die (mysqli_error());
- // Prüfen ob noch weitere Einträge zur Org da sind, wenn nicht löschen
+ // 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
+ $result = mysqli_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);
+ WHERE a.org_id = '$_REQUEST[old_org]' OR b.org_id = '$_REQUEST[old_org]'") or die (mysqli_error());
+ $row = mysqli_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());
+ $result = mysqli_query("DELETE FROM organisation WHERE id = '$_REQUEST[old_org]'") or die (mysqli_error());
}
}
@@ -286,8 +286,8 @@ elseif( $_GET["show"] == 'kfz' && $_GET["do"] == 'setupdate' )
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))
+ $result = mysqli_query("SELECT id, a_name, real_name, a_admin, a_mail FROM admin_users ORDER BY a_admin DESC, a_name ASC") or die (mysqli_error());
+ while($row = mysqli_fetch_array($result))
{
if( $row["a_admin"] == '0' ) $status = '(User) ';
elseif( $row["a_admin"] == '1' ) $status = '(Admin) ';
@@ -340,23 +340,23 @@ 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);
+ $result = mysqli_query("SELECT id FROM admin_users WHERE a_name = '$ins_user_name'");
+ $row = mysqli_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);
+ $result = mysqli_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(mysqli_error);
echo gohome($_SERVER["PHP_SELF"].'?show=user');
}
//
-// Wenn user löschen
+// 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());
+ $result = mysqli_query("DELETE FROM messages WHERE userid_to = '$_GET[id]'") or die (mysqli_error());
+ $result = mysqli_query("DELETE FROM alarm2mail WHERE userid = '$_GET[id]'") or die (mysqli_error());
+ $result = mysqli_query("DELETE FROM admin_users WHERE id = '$_GET[id]'") or die (mysqli_error());
echo gohome($_SERVER["PHP_SELF"].'?show=user');
}
@@ -366,18 +366,18 @@ elseif( $_GET["show"] == 'user' && $_GET["do"] == 'delete' )
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());
+ $result = mysqli_query("SELECT id FROM ric_zvei WHERE org_id = '0'") or die (mysqli_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());
+ $result = mysqli_query("SELECT id FROM kfz_fms WHERE org_id = '0'") or die (mysqli_error());
$num_kfz = mysql_num_rows($result);
// Wir schauen nach der Userzahl
- $result = mysql_query("SELECT id FROM admin_users") or die (mysql_error());
+ $result = mysqli_query("SELECT id FROM admin_users") or die (mysqli_error());
$num_user = mysql_num_rows($result);
- $result = mysql_query("SELECT id FROM admin_users WHERE a_admin = '2'") or die (mysql_error());
+ $result = mysqli_query("SELECT id FROM admin_users WHERE a_admin = '2'") or die (mysqli_error());
$num_new_user = mysql_num_rows($result);
// Ausklappmenu erstellen
@@ -385,8 +385,8 @@ else
--- wähle Org. zum bearbeiten --- ';
- $result = mysql_query("SELECT id, org_name, org FROM organisation WHERE org != '' ORDER BY org ASC, org_name ASC") or die (mysql_error());
- while($row = mysql_fetch_array($result))
+ $result = mysqli_query("SELECT id, org_name, org FROM organisation WHERE org != '' ORDER BY org ASC, org_name ASC") or die (mysqli_error());
+ while($row = mysqli_fetch_array($result))
{
if( $_REQUEST["search_org"] == $row["id"] ) { $selected = 'selected'; } else { $selected = ''; }
$select_search_org .= '
@@ -398,21 +398,21 @@ else
';
- // Ausgabe zusammenstellen wenn org zum bearbeiten gewählt
+ // 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))
+ $result = mysqli_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 (mysqli_error());
+ while($row = mysqli_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))
+ $result = mysqli_query("SELECT id, kennung, bezeichnung, org_id FROM kfz_fms WHERE org_id = '$_REQUEST[search_org]' ORDER BY kennung ASC") or die (mysqli_error());
+ while($row = mysqli_fetch_array($result))
{
$show_ric .= ' '.$row["kennung"].' | '.$row["bezeichnung"].' ';
}
@@ -434,5 +434,5 @@ eval ("dooutput(\"".gettemplate($template_dir."rahmen")."\");");
/**************************/
// Datenbank schliessen
//
-mysql_close($dbconn);
+mysqli_close($dbconn);
?>
diff --git a/alarmmail.inc.php b/alarmmail.inc.php
index 086c100..7afb833 100755
--- a/alarmmail.inc.php
+++ b/alarmmail.inc.php
@@ -21,21 +21,21 @@
*/
// Done in Haupttabelle updaten
-$result_check_ins = mysql_query("UPDATE dme SET zeit='$row[zeit]', done='1' WHERE num='$row[num]'") or die (mysql_error());
+$result_check_ins = mysqli_query("UPDATE dme SET zeit='$row[zeit]', done='1' WHERE num='$row[num]'") or die (mysqli_error());
if( trim($row["funktion"]) != 'Klartext' && trim($row["funktion"]) != 'Info' && $amenable == 1 )
{
- $result_alarm_mail = mysql_query("SELECT a.userid, a.time_from, a.time_to, a.stiwo, b.id, b.a_mail, b.a_alarmmail, b.a_alarmmail2sms, b.amail_count, b.ft_allow
+ $result_alarm_mail = mysqli_query("SELECT a.userid, a.time_from, a.time_to, a.stiwo, b.id, b.a_mail, b.a_alarmmail, b.a_alarmmail2sms, b.amail_count, b.ft_allow
FROM alarm2mail a
LEFT JOIN admin_users b ON b.id = a.userid
- WHERE adresse=".$row["adresse_neu"]) or die(mysql_error());
- while( $row_alarm_mail = mysql_fetch_array($result_alarm_mail) )
+ WHERE adresse=".$row["adresse_neu"]) or die(mysqli_error());
+ while( $row_alarm_mail = mysqli_fetch_array($result_alarm_mail) )
{
// Alarmmail Counter
$amail_count = $row_alarm_mail["amail_count"]+1;
- // schauen ob für Alarm extra Mailadresse
+ // schauen ob f�r Alarm extra Mailadresse
if( $row_alarm_mail["a_alarmmail"] ) $row_alarm_mail["a_mail"] = $row_alarm_mail["a_alarmmail"];
// schauen ob Alarm im Zeitfenster liegt
@@ -61,7 +61,7 @@ if( trim($row["funktion"]) != 'Klartext' && trim($row["funktion"]) != 'Info' &&
}
// Mailcounter
- $result_counter = mysql_query("UPDATE admin_users SET amail_count='$amail_count' WHERE id='$row_alarm_mail[id]'");
+ $result_counter = mysqli_query("UPDATE admin_users SET amail_count='$amail_count' WHERE id='$row_alarm_mail[id]'");
}
// Meldung im SMSformat senden
@@ -80,7 +80,7 @@ if( trim($row["funktion"]) != 'Klartext' && trim($row["funktion"]) != 'Info' &&
}
// Mailcounter
- $result_counter = mysql_query("UPDATE admin_users SET amail_count='$amail_count' WHERE id='$row_alarm_mail[id]'");
+ $result_counter = mysqli_query("UPDATE admin_users SET amail_count='$amail_count' WHERE id='$row_alarm_mail[id]'");
}
}
@@ -91,6 +91,6 @@ if( trim($row["funktion"]) != 'Klartext' && trim($row["funktion"]) != 'Info' &&
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());
+ $result_check_ins = mysqli_query("UPDATE organisation SET alarm_count='$alarmcount', last_alarm='$row[zeit]' WHERE id='$row[org_id]'") or die (mysqli_error());
}
?>
\ No newline at end of file
diff --git a/autocheck.php b/autocheck.php
index e3c8bdd..8229a4f 100755
--- a/autocheck.php
+++ b/autocheck.php
@@ -24,15 +24,15 @@ require('config.inc.php');
$show_filter = ' Where a.done = "0" ';
- $result = mysql_query("SELECT a.num, a.adresse AS adresse_neu, a.bezeichnung AS bezeichnung_neu, a.text, DATE_FORMAT(a.zeit, '%Y%m%d%H%i%s') AS zeit, a.funktion, a.REC_TYP, a.done,
+ $result = mysqli_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))
+ ORDER BY a.zeit DESC") or die (mysqli_error());
+ while($row = mysqli_fetch_array($result))
{
if( $row["done"] == '0' )
@@ -46,12 +46,12 @@ require('config.inc.php');
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);
+ $result_check = mysqli_query("SELECT id FROM ric_zvei WHERE adresse=".$row["adresse_neu"]);
+ $row_check = mysqli_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());
+ $result_check = mysqli_query("INSERT INTO ric_zvei (adresse, bezeichnung, rec_typ, formatierung_id) VALUES ('$row[adresse_neu]', '$row[bezeichnung_neu]', '$row[REC_TYP]', '0')") or die(mysqli_error());
$bezeichnung = $row["bezeichnung_neu"];
}
}
@@ -63,8 +63,8 @@ require('config.inc.php');
}
// Unwetter Check
-$result = mysql_query("SELECT u_meldung, u_text, u_farbe, DATE_FORMAT(u_lastcheck, '%Y%m%d%H%i%s') AS u_lastcheck, DATE_FORMAT(u_lastchange, '%Y%m%d%H%i%s') AS u_lastchange FROM unwetter WHERE id = '1'") or die (mysql_error());
-$row = mysql_fetch_array($result);
+$result = mysqli_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 (mysqli_error());
+$row = mysqli_fetch_array($result);
if( ($timestampnow - $row["u_lastcheck"]) > ($uw_checktime * 100) )
{
@@ -93,7 +93,7 @@ if( ($timestampnow - $row["u_lastcheck"]) > ($uw_checktime * 100) )
$unwetter_meldung .= $line;
}
- // Zum Prüfen der Ausgabe deaktivieren
+ // Zum Prüfen der Ausgabe deaktivieren
//echo "Line #{$line_num} : " . htmlspecialchars($line) . " \n";
}
@@ -110,25 +110,25 @@ if( ($timestampnow - $row["u_lastcheck"]) > ($uw_checktime * 100) )
{
$unwetter_status = 'keine Verbindung !!!';
$unwetter_farbe = '#FFFFFF';
- $unwetter_meldung = 'Verbindung zu dwd.de nicht möglich !';
+ $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());
+ mysqli_query("INSERT INTO unwetter (id, u_meldung, u_text, u_farbe, u_lastchange) VALUES ('1', '$unwetter_status', '$unwetter_meldung', '$unwetter_farbe', '$timestampnow')") or die(mysqli_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());
+ mysqli_query("UPDATE unwetter SET u_lastcheck='$timestampnow' WHERE id = '1'") or die(mysqli_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());
+ mysqli_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(mysqli_error());
}
}
-mysql_close($dbconn);
+mysqli_close($dbconn);
?>
diff --git a/config.inc.php b/config.inc.php
index 02aeb02..3bcffbb 100755
--- a/config.inc.php
+++ b/config.inc.php
@@ -96,8 +96,8 @@ $template_dir = '_html/';
$update_adresse_monrc = 1;
// IP Bereich fr auto Login
-$ip_start = '192.168.2.2';
-$ip_ende = '192.168.2.50';
+$ip_start = '192.168.1.2';
+$ip_ende = '192.168.1.250';
// UserID für IP
$ip_users = array(
@@ -301,8 +301,8 @@ $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());
+$dbconn = mysqli_connect($dbhost, $dbuser, $dbpass) or die (mysqli_error());
+$dbselect = mysqli_select_db($dbname, $dbconn) or die (mysqli_error());
//
// Sessions starten
@@ -324,7 +324,7 @@ if( $_SESSION["name"] )
{
$tn = date("YmdHis");
$_SESSION["last_seen"] = $tn;
- mysql_query("UPDATE admin_users SET last_seen='$tn' WHERE id='$_SESSION[userid]'");
+ mysqli_query("UPDATE admin_users SET last_seen='$tn' WHERE id='$_SESSION[userid]'");
}
// Navigationsleiste
diff --git a/functions.inc.php b/functions.inc.php
index 3c63c7f..73a781b 100755
--- a/functions.inc.php
+++ b/functions.inc.php
@@ -20,7 +20,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-// Status prüfen, berichtigen, ersetzen
+// Status pr�fen, berichtigen, ersetzen
function repair_status($kennung, $zeit_neu, $status_alt, $zeit_alt) {
global $korr_status_zeit, $status_kfz;
@@ -326,8 +326,8 @@ function split_kfz($kfz) {
}
function count_total($tocount) {
- $result = mysql_query("SELECT Count(*) as $tocount FROM $tocount");
- $result = mysql_fetch_array($result);
+ $result = mysqli_query("SELECT Count(*) as $tocount FROM $tocount");
+ $result = mysqli_fetch_array($result);
return $result[$tocount];
}
diff --git a/get.php b/get.php
index f9f9f4a..fc8969c 100755
--- a/get.php
+++ b/get.php
@@ -81,8 +81,8 @@ elseif( $show_filter != 1 )
// 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))
+ $result = mysqli_query("SELECT id, bg_farbe, text_farbe, text_format, text_groesse, text_groesse_text FROM formatierung ORDER BY id ASC") or die (mysqli_error());
+ while($row = mysqli_fetch_array($result))
{
$formatierung[$row["id"]] = array(
"bg_farbe" => $row["bg_farbe"],
@@ -101,15 +101,15 @@ elseif( $show_filter != 1 )
//
// 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,
+ $result = mysqli_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))
+ ORDER BY a.zeit DESC") or die (mysqli_error());
+ while($row = mysqli_fetch_array($result))
{
if( !$_GET["filter"] || $_GET["filter"] == 1 || $_GET["clean"] == "yes" )
@@ -141,12 +141,12 @@ elseif( $show_filter != 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);
+ $result_check = mysqli_query("SELECT id FROM ric_zvei WHERE adresse=".$row["adresse_neu"]);
+ $row_check = mysqli_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());
+ $result_check = mysqli_query("INSERT INTO ric_zvei (adresse, bezeichnung, rec_typ, formatierung_id) VALUES ('$row[adresse_neu]', '$row[bezeichnung_neu]', '$row[REC_TYP]', '0')") or die(mysqli_error());
$bezeichnung = $row["bezeichnung_neu"];
}
}
@@ -215,7 +215,7 @@ elseif( $show_filter != 1 )
/**************************/
// Datenbank schliessen
//
-mysql_close($dbconn);
+mysqli_close($dbconn);
// Ausgabe für Ajax
echo "
diff --git a/get_other.php b/get_other.php
index d4da974..7526acd 100755
--- a/get_other.php
+++ b/get_other.php
@@ -2,15 +2,15 @@
require_once("config.inc.php");
// Check User online
- $result = mysql_query("SELECT id, a_name, real_name FROM admin_users where last_seen > '$useronlinetime' ORDER BY a_name ASC") or die (mysql_error());
- while($row = mysql_fetch_array($result))
+ $result = mysqli_query("SELECT id, a_name, real_name FROM admin_users where last_seen > '$useronlinetime' ORDER BY a_name ASC") or die (mysqli_error());
+ while($row = mysqli_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);
+ $result = mysqli_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 (mysqli_error());
+ $row = mysqli_fetch_array($result);
if( !empty($row["u_meldung"]) )
{
@@ -25,11 +25,11 @@ require_once("config.inc.php");
}
// Check PM
- $result = mysql_query("SELECT a.*, DATE_FORMAT(a.pm_date, '%Y%m%d%H%i%s') AS date, b.real_name
+ $result = mysqli_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))
+ WHERE a.userid_to = '$_SESSION[userid]' ORDER BY pm_date ASC") or die (mysqli_error());
+ while($row = mysqli_fetch_array($result))
{
$msg_date = get_date_long($row["date"])." / ".get_time($row["date"]);
$msg_text = nl2br($row["message"]);
diff --git a/loginfunctions.inc.php b/loginfunctions.inc.php
index a73883c..f1d4e70 100755
--- a/loginfunctions.inc.php
+++ b/loginfunctions.inc.php
@@ -33,8 +33,8 @@ if ( (ip2str($ip_start) <= ip2str($_SERVER["REMOTE_ADDR"]) && ip2str($_SERVER["R
$_SESSION["userid"] = $ip_users[$_SERVER["REMOTE_ADDR"]];
}
$zack = $ip_users[$_SERVER["REMOTE_ADDR"]];
- $result = mysql_query("SELECT a_name, DATE_FORMAT(last_seen, '%Y%m%d%H%i%s') AS last_seen FROM admin_users WHERE id = '$zack'") or die (mysql_error());
- $row = mysql_fetch_array($result);
+ $result = mysqli_query("SELECT a_name, DATE_FORMAT(last_seen, '%Y%m%d%H%i%s') AS last_seen FROM admin_users WHERE id = '$zack'") or die (mysqli_error());
+ $row = mysqli_fetch_array($result);
$_SESSION["name"] = $row["a_name"];
$_SESSION["last_seen"] = ($row["last_seen"] - 200 );
}
@@ -47,8 +47,8 @@ elseif ( $_GET["iam"] == "manuelw" )
$_SESSION["userid"] = 1;
- $result = mysql_query("SELECT a_name, DATE_FORMAT(last_seen, '%Y%m%d%H%i%s') AS last_seen FROM admin_users WHERE id = '1'") or die (mysql_error());
- $row = mysql_fetch_array($result);
+ $result = mysqli_query("SELECT a_name, DATE_FORMAT(last_seen, '%Y%m%d%H%i%s') AS last_seen FROM admin_users WHERE id = '1'") or die (mysqli_error());
+ $row = mysqli_fetch_array($result);
$_SESSION["name"] = $row["a_name"];
$_SESSION["last_seen"] = ($row["last_seen"] - 200 );
$filter=1;
@@ -111,12 +111,12 @@ elseif( $wap == 1 )
}
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);
+ $result = mysqli_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 (mysqli_error());
+ $row = mysqli_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]'");
+ $result = mysqli_query("UPDATE admin_users SET wap_handy='$HTTP_USER_AGENT' WHERE a_name = '$_REQUEST[a_name]' AND wap_pass = '$_REQUEST[a_pass]'");
}
else
{
@@ -140,10 +140,10 @@ elseif( $wap == 1 )
$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')");
+ $result = mysqli_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());
+ $result = mysqli_query("UPDATE admin_users SET login_count = '$row[login_count]' WHERE id = '$row[id]' ") or die(mysqli_error());
}
else
{
@@ -158,7 +158,7 @@ elseif( $wap == 1 )
- Login falsch!zurück
+ Login falsch!zurück