diff --git a/admin/news.php b/admin/news.php index 12d5e140..7c501751 100755 --- a/admin/news.php +++ b/admin/news.php @@ -7,7 +7,7 @@ include ("./inc/funktion_db_list.php"); include ("./inc/funktion_user.php"); -if (!IsSet($action)) { +if (!IsSet($_GET["action"])) { $SQL = "SELECT * from News order by Datum DESC"; $Erg = mysql_query($SQL, $con); @@ -44,51 +44,62 @@ echo ""; } else { -switch ($action) { +switch ($_GET["action"]) +{ case 'change': - $SQL = "SELECT * from News where (Datum='$date')"; + $SQL = "SELECT * from News where (Datum='". $_GET["date"]. "')"; $Erg = mysql_query($SQL, $con); - echo "
\n"; + echo "\n"; echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; echo "
Datum
Betreff
Text
Engel
Treffen
Datum
Betreff
Text
Engel
Treffen
"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
"; echo "
\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
"; - break; case 'change_save': - $chsql="update News set Betreff = '$eBetreff', Text = '$eText', Treffen = '$eTreffen' where (Datum = '$date') limit 1"; + $chsql="UPDATE News set Betreff = \"". $_GET["eBetreff"]. "\", Text = \"". $_GET["eText"]. + "\", Treffen=". $_GET["eTreffen"]. " where (Datum = '". $_GET["date"]. "') limit 1"; break; case 'delete': - $chsql="delete from News where Datum = '$date' limit 1"; + $chsql="DELETE from News where Datum = '". $_POST["date"]. "' limit 1"; break; } if (IsSet($chsql)) { // SQL-Statement ausführen... $Erg = mysql_query($chsql, $con); - If ($Erg == 1){ + If ($Erg == 1) + { echo "Änderung erfolgreich gesichert..."; - } else { - echo "Ein Fehler ist aufgetreten... probiere es am besten nocheinmal... :)"; + } + else + { + echo "Ein Fehler ist aufgetreten... probiere es am besten nocheinmal... :)

\n"; + echo mysql_error($con); + echo "

\n[$chsql]"; } }