<?php
echo "<h2>Poll bearbeiten</h2><br>";
$table = 'poll';
$ID = (isset($ID)) ? abs((int)$ID) : 0;
$limit = 6;
$resultID = mysql_query("SELECT COUNT(ID) FROM ".$table);
$total = mysql_result($resultID,0);
$ID = ($ID >= $total) ? $total - $limit : $ID;
$query = "SELECT ID,Frage FROM ".$table." ORDER BY ID DESC LIMIT ".$ID.",".$limit;
$resultID = mysql_query($query);
while ($data = mysql_fetch_array($resultID)) {
echo "<font color=\"blue\">ID-Nummer: </font>";
echo "<font color=\"red\"><b>";
echo $data['ID'];
echo "</b></font><br>";
echo "<font color=\"blue\">Frage: </font>";
echo "<font color=\"FF000\"><b>";
echo $data['Frage'];
echo "</b></font><br><hr>";
}
if($ID > 0) {
$newID = ($ID - $limit < 0) ? 0 : ($ID-$limit);
echo "<a href=".$_SERVER['PHP_SELF']."?section=admin&action=intern&acp_action=edit_poll&ID=".$newID."><< zurück</a> ";
}
if($ID + $limit < $total) {
$newID = $ID + $limit;
echo " <a href=".$_SERVER['PHP_SELF']."?section=admin&action=intern&acp_action=edit_poll&ID=".$newID.">vor >></a>";
}
echo "<br><form name=\"updID\" action=\"index.php?section=admin&action=intern&acp_action=8gr_420g348&acp_status=poll_upd_selected\" method=\"POST\">";
echo "<br>Bitte wählen sie die ID-Nummer des Polls aus, den sie bearbeiten wollen: <br>";
echo "<input type=\"text\" name=\"upd_id\" size=\"4\"><br><br>";
echo "<font face=\"Verdana\" size=\"2\"><a href=\"index.php?section=admin&action=intern&acp_action=8gr_420g348&acp_status=poll_upd_selected\" onclick=\"window.document.forms['updID'].submit(); return false;\" style=\"text-decoration: none\"><font color=\"black\">Bearbeiten</font></a><br>";
echo "</form>";
?>