From c3f45775b0306943ab98f17391c31dbeb1f36257 Mon Sep 17 00:00:00 2001 From: cookie Date: Sun, 6 Nov 2005 16:51:32 +0000 Subject: [PATCH] jetzt war news-verwaltung dran git-svn-id: svn://svn.cccv.de/engel-system@18 29ba0400-6e00-0410-a75a-ca02368028f8 --- admin/news.php | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) 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]"; } }