|
|
|
@ -7,8 +7,8 @@ include ("./inc/funktion_db_list.php");
|
|
|
|
|
include ("./inc/funktion_user.php");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!IsSet($_GET["action"])) {
|
|
|
|
|
|
|
|
|
|
if (!IsSet($_GET["action"]))
|
|
|
|
|
{
|
|
|
|
|
$SQL = "SELECT * from News order by Datum DESC";
|
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
|
|
|
|
|
@ -29,7 +29,8 @@ hier herumzuspamen oder aus Versehen falsche Informationen zu hinterlegen :)<br>
|
|
|
|
|
</tr>
|
|
|
|
|
<?PHP
|
|
|
|
|
|
|
|
|
|
for ($i=0; $i < $rowcount; $i++) {
|
|
|
|
|
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>";
|
|
|
|
@ -40,17 +41,22 @@ for ($i=0; $i < $rowcount; $i++) {
|
|
|
|
|
echo "\t</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</table>";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
unSet($chsql);
|
|
|
|
|
|
|
|
|
|
switch ($_GET["action"])
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
case 'change':
|
|
|
|
|
if (isset($_GET["date"]))
|
|
|
|
|
{
|
|
|
|
|
$SQL = "SELECT * from News where (Datum='". $_GET["date"]. "')";
|
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
|
|
|
|
|
|
if( mysql_num_rows( $Erg)==1)
|
|
|
|
|
{
|
|
|
|
|
echo "<form action=\"./news.php\" method=\"GET\">\n";
|
|
|
|
|
|
|
|
|
|
echo "<table>\n";
|
|
|
|
@ -75,36 +81,43 @@ case 'change':
|
|
|
|
|
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 übergeben";
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'change_save':
|
|
|
|
|
if( isset($_GET["date"]) && isset($_GET["eBetreff"]) && isset($_GET["eText"]) )
|
|
|
|
|
$chsql="UPDATE News set Betreff = \"". $_GET["eBetreff"]. "\", Text = \"". $_GET["eText"].
|
|
|
|
|
"\", Treffen=". $_GET["eTreffen"]. " where (Datum = '". $_GET["date"]. "') limit 1";
|
|
|
|
|
else
|
|
|
|
|
echo "Fehler: nicht genügend parameter übergeben";
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'delete':
|
|
|
|
|
if (isset($_POST["date"]))
|
|
|
|
|
$chsql="DELETE from News where Datum = '". $_POST["date"]. "' limit 1";
|
|
|
|
|
else
|
|
|
|
|
echo "Fehler: \"date\" nicht übergeben";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
} //SWITCH
|
|
|
|
|
|
|
|
|
|
if (IsSet($chsql)) {
|
|
|
|
|
if (IsSet($chsql))
|
|
|
|
|
{
|
|
|
|
|
// SQL-Statement ausfü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";
|
|
|
|
|
echo mysql_error($con);
|
|
|
|
|
echo "<br><br>\n[$chsql]";
|
|
|
|
|
}
|
|
|
|
|
echo "Ein Fehler ist aufgetreten... probiere es am besten nocheinmal... :)<br><br>\n".
|
|
|
|
|
mysql_error($con). "<br><br>\n[$chsql]";
|
|
|
|
|
SetHeaderGo2Back();
|
|
|
|
|
}
|
|
|
|
|
}// IF-ELSE
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
include ("./inc/footer.php");
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|