update for php7

This commit is contained in:
Manuel Weiser 2018-08-04 11:33:52 +02:00
parent 63e29ff70a
commit 8495e84989
12 changed files with 185 additions and 185 deletions

148
admin.php
View File

@ -27,7 +27,7 @@ $_SESSION["load_complete"] = "";
$_SESSION["lastupdate"] = "";
$_SESSION["online_users"] = "";
// Prüfen ob admin
// Pr<EFBFBD>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 .= '
<tr bgcolor="#FFFFFF">
<td align="center">'.$row["rec_typ"].'</td>
<td>&nbsp;<b>'.$row["adresse"].'</b> / '.$row["bezeichnung"].'</td>
<td align="center">&nbsp;<a href="'.$_SERVER["php_self"].'?show=dme&do=update&id='.$row["id"].'">zuordnen</a>&nbsp;</td>
<td align="center">&nbsp;<a href="'.$_SERVER["php_self"].'?show=dme&do=delete&id='.$row["id"].'">löschen</a>&nbsp;</td>
<td align="center">&nbsp;<a href="'.$_SERVER["php_self"].'?show=dme&do=delete&id='.$row["id"].'">l<EFBFBD>schen</a>&nbsp;</td>
</tr>
';
}
@ -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 .= '<option value="'.$row["id"].'" '.$selected.'>'.$row["org"].' '.$row["org_name"].'</option>';
}
// Zusammenstellung der Formatierungen
$result = mysql_query("SELECT id, beschreibung FROM formatierung ORDER BY beschreibung ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
$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 .= '<option value="'.$row["id"].'" '.$selected.'>'.$row["beschreibung"].'</option>';
}
// Abfrage des verlangten Datensatzes
$result = mysql_query("SELECT id, adresse, bezeichnung, rec_typ FROM ric_zvei WHERE id = '$_GET[id]'") or die (mysql_error());
$row = mysql_fetch_array($result);
$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<EFBFBD>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<EFBFBD>fen ob noch weitere Eintr<74>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<EFBFBD>hren
elseif( $_GET["show"] == 'dme' && $_GET["do"] == 'setupdate' )
{
// Schauen ob neue oder bestehende Organistaion gewählt wurde
// Schauen ob neue oder bestehende Organistaion gew<EFBFBD>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<EFBFBD>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<EFBFBD>fen ob noch weitere Eintr<74>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 .= '
<tr bgcolor="#FFFFFF">
<td>&nbsp;'.$row["bezeichnung"].'</td>
<td align="center">&nbsp;<a href="'.$_SERVER["php_self"].'?show=kfz&do=update&id='.$row["id"].'">zuordnen</a>&nbsp;</td>
<td align="center">&nbsp;<a href="'.$_SERVER["php_self"].'?show=kfz&do=delete&id='.$row["id"].'">löschen</a>&nbsp;</td>
<td align="center">&nbsp;<a href="'.$_SERVER["php_self"].'?show=kfz&do=delete&id='.$row["id"].'">l<EFBFBD>schen</a>&nbsp;</td>
</tr>
';
}
@ -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 .= '<option value="'.$row["id"].'" '.$selected.'>'.$row["org"].' '.$row["org_name"].'</option>';
}
// Abfrage des verlangten Datensatzes
$result = mysql_query("SELECT id, bezeichnung FROM kfz_fms WHERE id = '$_GET[id]'") or die (mysql_error());
$row = mysql_fetch_array($result);
$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<EFBFBD>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<EFBFBD>fen ob noch weitere Eintr<74>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<EFBFBD>fen ob noch weitere Eintr<74>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 = '<b>(User)</b> ';
elseif( $row["a_admin"] == '1' ) $status = '<b>(Admin)</b> ';
@ -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<EFBFBD>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
<select name="search_org" id="search_org">
<option value="">--- w&auml;hle Org. zum bearbeiten ---</option>';
$result = mysql_query("SELECT id, org_name, org FROM organisation WHERE org != '' ORDER BY org ASC, org_name ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
$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
</select>
';
// Ausgabe zusammenstellen wenn org zum bearbeiten gewählt
// Ausgabe zusammenstellen wenn org zum bearbeiten gew<EFBFBD>hlt
if( $_REQUEST["search_org"] )
{
$show_ric = '--- <b>RIC/ZVEI</b> ----------<br>';
$result = mysql_query("SELECT id, adresse, bezeichnung, rec_typ, org_id, formatierung_id FROM ric_zvei WHERE org_id = '$_REQUEST[search_org]' ORDER BY rec_typ ASC, adresse ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
$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 .= '&nbsp;<a href="'.$_SERVER["PHP_SELF"].'?do=update&id='.$row["id"].'&show=dme&org='.$row["org_id"].'&form='.$row["formatierung_id"].'">'.$row["adresse"].'</a> | '.$row["rec_typ"].' | '.$row["bezeichnung"].'<br>';
}
$show_ric .= '<br>--- <b>KFZ/FMS</b> ----------<br>';
$result = mysql_query("SELECT id, kennung, bezeichnung, org_id FROM kfz_fms WHERE org_id = '$_REQUEST[search_org]' ORDER BY kennung ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
$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 .= '&nbsp;<a href="'.$_SERVER["PHP_SELF"].'?do=update&id='.$row["id"].'&show=kfz&org='.$row["org_id"].'">'.$row["kennung"].'</a> | '.$row["bezeichnung"].'<br>';
}
@ -434,5 +434,5 @@ eval ("dooutput(\"".gettemplate($template_dir."rahmen")."\");");
/**************************/
// Datenbank schliessen
//
mysql_close($dbconn);
mysqli_close($dbconn);
?>

View File

@ -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<EFBFBD>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());
}
?>

View File

@ -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 #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br>\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<EFBFBD>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);
?>

View File

@ -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

View File

@ -20,7 +20,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
// Status prüfen, berichtigen, ersetzen
// Status pr<EFBFBD>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];
}

18
get.php
View File

@ -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 "

View File

@ -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 .= '<a href="javascript:oeffnefenster(\'pmfunctions.inc.php?pmdo=write&msg_to='.$row["id"].'\');" title="Nachricht an: '.$row["real_name"].'"><i>'.$row["a_name"].'</i></a>,';
}
// Check Wetter
$result = mysql_query("SELECT u_meldung, u_text, u_farbe, DATE_FORMAT(u_lastcheck, '%Y%m%d%H%i%s') AS u_lastcheck, DATE_FORMAT(u_lastchange, '%Y%m%d%H%i%s') AS u_lastchange FROM unwetter WHERE id = '1'") or die (mysql_error());
$row = mysql_fetch_array($result);
$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"]);

View File

@ -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 )
</head>
<body>
Login falsch!<br><a href="javascript:history.back()">zurück</a>
Login falsch!<br><a href="javascript:history.back()">zurück</a>
</body>
</html>';
exit;
@ -207,8 +207,8 @@ else
}
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);
$result = mysqli_query("SELECT id, a_name, a_admin, a_mail FROM admin_users WHERE a_name = '$_POST[a_name]'") or die (mysqli_error());
$row = mysqli_fetch_array($result);
if( $row[a_name] && $row["a_admin"] != '2' )
{
@ -219,7 +219,7 @@ else
mail_pass($row["a_mail"], $pass);
$result = mysql_query("UPDATE admin_users SET login_pass='$pass' WHERE id='$row[id]'") or die(mysql_error());
$result = mysqli_query("UPDATE admin_users SET login_pass='$pass' WHERE id='$row[id]'") or die(mysqli_error());
echo'<center><br><br><br>Eine EMail mit deinem Zugang wurde an <b>'.$row[a_mail].'</b> versand.';
@ -274,8 +274,8 @@ 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);
$result = mysqli_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 (mysqli_error());
$row = mysqli_fetch_array($result);
if( !empty($row["a_name"]) )
{
@ -291,10 +291,10 @@ exit;
$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_pass='', login_count='$row[login_count]' WHERE id='$row[id]'") or die(mysql_error());
$result = mysqli_query("UPDATE admin_users SET login_pass='', login_count='$row[login_count]' WHERE id='$row[id]'") or die(mysqli_error());
echo gohome("index.php");
}

View File

@ -24,16 +24,16 @@ require_once("config.inc.php");
if( $_GET["pmdo"] == "reply" )
{
$result = mysql_query("SELECT real_name FROM admin_users WHERE id = '$_GET[to]'") or die (mysql_error());
$row = mysql_fetch_array($result);
$result = mysqli_query("SELECT real_name FROM admin_users WHERE id = '$_GET[to]'") or die (mysqli_error());
$row = mysqli_fetch_array($result);
eval ("\$message_field .= \"".gettemplate($template_dir."body_message_reply")."\";");
echo $message_field;
}
elseif( $_GET["pmdo"] == "doreply" )
{
$result = mysql_query("INSERT INTO messages (userid_from, userid_to, message) VALUES ('$_SESSION[userid]', '$_REQUEST[userid_to]', '$_REQUEST[msg_text]')");
$result = mysql_query("DELETE FROM messages WHERE id = '$_REQUEST[msg_id]'")or die(mysql_error());
$result = mysqli_query("INSERT INTO messages (userid_from, userid_to, message) VALUES ('$_SESSION[userid]', '$_REQUEST[userid_to]', '$_REQUEST[msg_text]')");
$result = mysqli_query("DELETE FROM messages WHERE id = '$_REQUEST[msg_id]'")or die(mysqli_error());
echo gohome($_SERVER["PHP_SELF"]);
}
@ -42,12 +42,12 @@ elseif( $_GET["pmdo"] == "write" )
{
$select_msg_to = '
<select name="userid_to" id="userid_to">
<option value="0">Empfänger</option>
<option value="0">Empf<EFBFBD>nger</option>
<option>--------------------</option>
<option value="0">Alle</option>';
$result = mysql_query("SELECT id, real_name FROM admin_users WHERE pm_allow = '1' ORDER BY real_name ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
$result = mysqli_query("SELECT id, real_name FROM admin_users WHERE pm_allow = '1' ORDER BY real_name ASC") or die (mysqli_error());
while($row = mysqli_fetch_array($result))
{
if( $_GET["msg_to"] == $row["id"] ) { $selected = 'selected'; $can_pm = '1'; } else { $selected = ''; }
$select_msg_to .= '
@ -77,15 +77,15 @@ 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]')");
$result = mysqli_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))
// an alle User die PM d<EFBFBD>rfen
$result = mysqli_query("SELECT id FROM admin_users WHERE pm_allow = '1'") or die (mysqli_error());
while($row = mysqli_fetch_array($result))
{
$result_msg = mysql_query("INSERT INTO messages (userid_from, userid_to, message) VALUES ('$_SESSION[userid]', '$row[id]', '$_REQUEST[msg_text]')");
$result_msg = mysqli_query("INSERT INTO messages (userid_from, userid_to, message) VALUES ('$_SESSION[userid]', '$row[id]', '$_REQUEST[msg_text]')");
}
}
@ -94,6 +94,6 @@ elseif( $_GET["pmdo"] == "dowrite" )
elseif( $_GET["pmdo"] == "deletepm" )
{
$result = mysql_query("DELETE FROM messages WHERE id = '$_GET[msg_id]'")or die(mysql_error());
$result = mysqli_query("DELETE FROM messages WHERE id = '$_GET[msg_id]'")or die(mysqli_error());
}
?>

View File

@ -35,8 +35,8 @@ $_SESSION["online_users"] = "";
if( !$_GET["do"] )
{
$result = mysql_query("SELECT a_alarmmail, a_alarmmail2sms, wap_pass, wap_show, wap_rows, wap_def_orgfilter, wap_def_statfilter FROM admin_users WHERE id = '$_SESSION[userid]'") or die (mysql_error());
$row = mysql_fetch_array($result);
$result = mysqli_query("SELECT a_alarmmail, a_alarmmail2sms, wap_pass, wap_show, wap_rows, wap_def_orgfilter, wap_def_statfilter FROM admin_users WHERE id = '$_SESSION[userid]'") or die (mysqli_error());
$row = mysqli_fetch_array($result);
$wap_pass = $row["wap_pass"];
@ -86,8 +86,8 @@ if( !$_GET["do"] )
<select name="search_ric" id="search_ric">'
;
$result = mysql_query("SELECT id, org_name, org FROM organisation WHERE org != '' ORDER BY org ASC, org_name ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
$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))
{
$select_search_ric .= '
<option value="'.$row["id"].'">'.$row["org"].' &nbsp;&nbsp;'.$row["org_name"].'</option>
@ -98,7 +98,7 @@ if( !$_GET["do"] )
</select>
';
$result = mysql_query("SELECT a.*,
$result = mysqli_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
@ -106,8 +106,8 @@ if( !$_GET["do"] )
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))
WHERE a.userid = '$_SESSION[userid]' ORDER BY org ASC, org_name ASC, rec_typ ASC") or die (mysqli_error());
while($row = mysqli_fetch_array($result))
{
// Zeitfunktion
if( $row["time_from"] == '0' && $row["time_to"] == '0' )
@ -135,7 +135,7 @@ if( !$_GET["do"] )
}
// Ric zum Abo wählen
// Ric zum Abo w<EFBFBD>hlen
elseif( $_GET["do"] == 'abodet' )
{
@ -146,15 +146,15 @@ elseif( $_GET["do"] == 'abodet' )
';
}
$result = mysql_query("SELECT id, org_name, org FROM organisation WHERE id = '$_REQUEST[search_ric]'") or die (mysql_error());
$row = mysql_fetch_array($result);
$result = mysqli_query("SELECT id, org_name, org FROM organisation WHERE id = '$_REQUEST[search_ric]'") or die (mysqli_error());
$row = mysqli_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))
$result = mysqli_query("SELECT id, adresse, bezeichnung, rec_typ FROM ric_zvei WHERE org_id = '$org_id'") or die (mysqli_error());
while($row = mysqli_fetch_array($result))
{
$select_ric .= '<input name="abo_ric['.$i++.']" type="checkbox" value="'.$row["adresse"].'"> <b>'.$org.' '.$org_name.' '.$row["bezeichnung"].'</b> - '.$row["rec_typ"].'<br>';
}
@ -170,13 +170,13 @@ 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);
// pr<EFBFBD>fen ob der User diese Ric bereits Abonniert hat
$result = mysqli_query("SELECT id FROM alarm2mail WHERE userid = '$_SESSION[userid]' AND adresse = '$v'") or die (mysqli_error());
$row = mysqli_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());
$result = mysqli_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(mysqli_error());
}
}
@ -184,11 +184,11 @@ elseif( $_GET["do"] == 'aboins' )
}
// Abo löschen
// Abo l<EFBFBD>schen
elseif( $_GET["do"] == 'abodel' )
{
$result = mysql_query("DELETE FROM alarm2mail WHERE id = '$_GET[id]' AND userid = '$_SESSION[userid]'") or die(mysql_error());
$result = mysqli_query("DELETE FROM alarm2mail WHERE id = '$_GET[id]' AND userid = '$_SESSION[userid]'") or die(mysqli_error());
echo gohome($_SERVER["PHP_SELF"]);
@ -199,7 +199,7 @@ 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());
$result = mysqli_query("UPDATE admin_users SET a_alarmmail2sms='$setto', a_alarmmail='$_REQUEST[alarmmail]' WHERE id = '$_SESSION[userid]'") or die(mysqli_error());
echo gohome($_SERVER["PHP_SELF"]);
@ -208,7 +208,7 @@ elseif( $_GET["do"] == 'setmailform' )
// 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());
$result = mysqli_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(mysqli_error());
echo gohome($_SERVER["PHP_SELF"]);
}
@ -221,5 +221,5 @@ eval ("dooutput(\"".gettemplate($template_dir."rahmen")."\");");
/**************************/
// Datenbank schliessen
//
mysql_close($dbconn);
mysqli_close($dbconn);
?>

View File

@ -44,8 +44,8 @@ require('config.inc.php');
$select_search_ric = '
<select name="search_ric" id="search_ric">';
$result = mysql_query("SELECT id, org_name, org FROM organisation WHERE org != '' ORDER BY org ASC, org_name ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
$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))
{
$select_search_ric .= '
<option value="'.$row["id"].'"'; if($_REQUEST["search_ric"]==$row["id"]) {$select_search_ric.=' selected';}else{$select_search_ric.='';} $select_search_ric.='>'.$row["org"].' &nbsp;&nbsp;'.$row["org_name"].'</option>
@ -153,7 +153,7 @@ require('config.inc.php');
// 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,
$result = mysqli_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
@ -162,8 +162,8 @@ if( $_REQUEST["search_what"] == 'ric' && $_REQUEST["search_ric"] != '' || $_REQU
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))
ORDER BY a.zeit DESC LIMIT 0,$_REQUEST[search_max_results]") or die (mysqli_error());
while($row = mysqli_fetch_array($result))
{
$bezeichnung = $row["bezeichnung"];
@ -260,5 +260,5 @@ eval ("dooutput(\"".gettemplate($template_dir."rahmen")."\");");
/**************************/
// Datenbank schliessen
//
mysql_close($dbconn);
mysqli_close($dbconn);
?>

View File

@ -20,8 +20,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
$result = mysql_query("SELECT u_meldung, u_text, u_farbe, DATE_FORMAT(u_lastcheck, '%Y%m%d%H%i%s') AS u_lastcheck, DATE_FORMAT(u_lastchange, '%Y%m%d%H%i%s') AS u_lastchange FROM unwetter WHERE id = '1'") or die (mysql_error());
$row = mysql_fetch_array($result);
$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) && $_GET["nooutput"] == 1 )
{
@ -50,7 +50,7 @@ if( ($timestampnow - $row["u_lastcheck"]) > ($uw_checktime * 100) && $_GET["noou
$unwetter_meldung .= $line;
}
// Zum Prüfen der Ausgabe deaktivieren
// Zum Pr<EFBFBD>fen der Ausgabe deaktivieren
//echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br>\n";
}
@ -67,27 +67,27 @@ if( ($timestampnow - $row["u_lastcheck"]) > ($uw_checktime * 100) && $_GET["noou
{
$unwetter_status = 'keine Verbindung !!!';
$unwetter_farbe = '#FFFFFF';
$unwetter_meldung = 'Verbindung zu dwd.de nicht möglich !';
$unwetter_meldung = 'Verbindung zu dwd.de nicht m<EFBFBD>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());
}
}
// Ausgabe für User erzeugen
// Ausgabe f<EFBFBD>r User erzeugen
if( !empty($row["u_meldung"]) && $_GET["nooutput"] != '1' )
{
$uw_show_link = '<a href="javascript:animatedcollapse.toggle(\'wetter\')"><font style="background-color:#FFFFFF;"> &nbsp;toggle </font></a>';