2005-09-10 19:25:43 +02:00
|
|
|
|
<?PHP
|
|
|
|
|
|
|
|
|
|
$title = "Newsverwaltung";
|
|
|
|
|
$header = "Verwaltung der News";
|
2008-09-10 20:30:16 +02:00
|
|
|
|
include ("../../includes/header.php");
|
|
|
|
|
include ("../../includes/funktion_db_list.php");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
|
2006-11-30 11:49:24 +01:00
|
|
|
|
if (!IsSet($_GET["action"]))
|
|
|
|
|
{
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$SQL = "SELECT * FROM `News` ORDER BY `Datum` DESC";
|
2006-11-30 11:49:24 +01:00
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2006-11-30 11:49:24 +01:00
|
|
|
|
$rowcount = mysql_num_rows($Erg);
|
|
|
|
|
?>
|
2005-11-30 23:13:38 +01:00
|
|
|
|
Hallo <?PHP echo $_SESSION['Nick'] ?>, <br>
|
2007-11-10 22:18:55 +01:00
|
|
|
|
hier kannst du die News säubern... falls jemand auf die Idee kommt,
|
2005-09-10 19:25:43 +02:00
|
|
|
|
hier herumzuspamen oder aus Versehen falsche Informationen zu hinterlegen :)<br><br>
|
|
|
|
|
|
|
|
|
|
<table width="100%" class="border" cellpadding="2" cellspacing="1">
|
|
|
|
|
<tr class="contenttopic">
|
|
|
|
|
<td>Datum</td>
|
|
|
|
|
<td>Betreff</td>
|
|
|
|
|
<td>Text</td>
|
|
|
|
|
<td>Erfasser</td>
|
|
|
|
|
<td>Engeltreff</td>
|
|
|
|
|
<td>Änd.</td>
|
|
|
|
|
</tr>
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<?PHP
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2006-11-30 11:49:24 +01:00
|
|
|
|
for ($i=0; $i < $rowcount; $i++)
|
|
|
|
|
{
|
|
|
|
|
echo "\t<tr class=\"content\">\n";
|
|
|
|
|
echo "\t <td>".mysql_result($Erg, $i, "Datum")."</td>";
|
|
|
|
|
echo "\t <td>".mysql_result($Erg, $i, "Betreff")."</td>";
|
|
|
|
|
echo "\t <td>".mysql_result($Erg, $i, "Text")."</td>";
|
|
|
|
|
echo "\t <td>".UID2Nick(mysql_result($Erg, $i, "UID"))."</td>";
|
|
|
|
|
echo "\t <td>".mysql_result($Erg, $i, "Treffen")."</td>";
|
|
|
|
|
echo "\t <td><a href=\"./news.php?action=change&date=".mysql_result($Erg, $i, "Datum")."\">XXX</a></td>";
|
|
|
|
|
echo "\t</tr>\n";
|
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "</table>";
|
2006-11-30 11:49:24 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2006-11-30 11:49:24 +01:00
|
|
|
|
unSet($chsql);
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2006-11-30 11:49:24 +01:00
|
|
|
|
switch ($_GET["action"])
|
2005-11-06 17:51:32 +01:00
|
|
|
|
{
|
2006-11-30 11:49:24 +01:00
|
|
|
|
case 'change':
|
|
|
|
|
if (isset($_GET["date"]))
|
|
|
|
|
{
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$SQL = "SELECT * FROM `News` WHERE (`Datum`='". $_GET["date"]. "')";
|
2006-11-30 11:49:24 +01:00
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
|
|
2006-12-29 21:26:18 +01:00
|
|
|
|
if( mysql_num_rows( $Erg)>0)
|
2006-11-30 11:49:24 +01:00
|
|
|
|
{
|
|
|
|
|
echo "<form action=\"./news.php\" method=\"GET\">\n";
|
|
|
|
|
|
|
|
|
|
echo "<table>\n";
|
|
|
|
|
echo " <tr><td>Datum</td><td><input type=\"text\" size=\"40\" name=\"date\" value=\"".
|
|
|
|
|
mysql_result($Erg, 0, "Datum")."\" disabled></td></tr>\n";
|
|
|
|
|
echo " <tr><td>Betreff</td><td><input type=\"text\" size=\"40\" name=\"eBetreff\" value=\"".
|
|
|
|
|
mysql_result($Erg, 0, "Betreff")."\"></td></tr>\n";
|
|
|
|
|
echo " <tr><td>Text</td><td><textarea rows=\"10\" cols=\"80\" name=\"eText\">".
|
|
|
|
|
mysql_result($Erg, 0, "Text")."</textarea></td></tr>\n";
|
|
|
|
|
echo " <tr><td>Engel</td><td><input type=\"text\" size=\"40\" name=\"eUser\" value=\"".
|
|
|
|
|
UID2Nick(mysql_result($Erg, 0, "UID"))."\" disabled></td></tr>\n";
|
|
|
|
|
echo " <tr><td>Treffen</td><td><input type=\"text\" size=\"40\" name=\"eTreffen\" value=\"".
|
|
|
|
|
mysql_result($Erg, 0, "Treffen")."\"></td></tr>\n";
|
|
|
|
|
echo "</table>";
|
|
|
|
|
|
|
|
|
|
echo "<input type=\"hidden\" name=\"date\" value=\"". $_GET["date"]. "\">\n";
|
|
|
|
|
echo "<input type=\"hidden\" name=\"action\" value=\"change_save\">\n";
|
|
|
|
|
echo "<input type=\"submit\" value=\"Abschicken...\">\n";
|
|
|
|
|
echo "</form>";
|
|
|
|
|
|
|
|
|
|
echo "<form action=\"./news.php?action=delete\" method=\"POST\">\n";
|
|
|
|
|
echo "<input type=\"hidden\" name=\"date\" value=\"". $_GET["date"]. "\">\n";
|
|
|
|
|
echo "<input type=\"submit\" value=\"löschen...\">\n";
|
|
|
|
|
echo "</form>";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
echo "FEHLER: Eintrag \"". $_GET["date"]. "\" nicht gefunden";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
echo "Fehler: \"date\" nicht <20>bergeben";
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'change_save':
|
|
|
|
|
if( isset($_GET["date"]) && isset($_GET["eBetreff"]) && isset($_GET["eText"]) )
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$chsql="UPDATE `News` SET `Betreff`='". $_GET["eBetreff"]. "', `Text`='". $_GET["eText"].
|
|
|
|
|
"', `Treffen`='". $_GET["eTreffen"]. "' WHERE (`Datum`='". $_GET["date"]. "') limit 1";
|
2006-11-30 11:49:24 +01:00
|
|
|
|
else
|
|
|
|
|
echo "Fehler: nicht gen<65>gend parameter <20>bergeben";
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'delete':
|
|
|
|
|
if (isset($_POST["date"]))
|
2006-12-17 21:58:53 +01:00
|
|
|
|
$chsql="DELETE FROM `News` WHERE `Datum`='". $_POST["date"]. "' LIMIT 1";
|
2006-11-30 11:49:24 +01:00
|
|
|
|
else
|
|
|
|
|
echo "Fehler: \"date\" nicht <20>bergeben";
|
|
|
|
|
break;
|
|
|
|
|
} //SWITCH
|
|
|
|
|
|
|
|
|
|
if (IsSet($chsql))
|
2005-11-06 17:51:32 +01:00
|
|
|
|
{
|
2006-11-30 11:49:24 +01:00
|
|
|
|
// SQL-Statement ausf<73>hren...
|
|
|
|
|
$Erg = mysql_query($chsql, $con);
|
|
|
|
|
If ($Erg == 1)
|
|
|
|
|
echo "Änderung erfolgreich gesichert...";
|
|
|
|
|
else
|
|
|
|
|
echo "Ein Fehler ist aufgetreten... probiere es am besten nocheinmal... :)<br><br>\n".
|
|
|
|
|
mysql_error($con). "<br><br>\n[$chsql]";
|
|
|
|
|
SetHeaderGo2Back();
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
2006-11-30 11:49:24 +01:00
|
|
|
|
}// IF-ELSE
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2008-09-10 20:30:16 +02:00
|
|
|
|
include ("../../includes/footer.php");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
?>
|
|
|
|
|
|