rendered paste body{config_load file="config.conf"}
{include file="header.tpl"}
{include file="navigation.tpl"}
<div id="col_right">
<h3>A<small>DMIN</small></h3>
<div id="news_aticle">
<h4><a href="?p=news">Add News</a></h4>
<form action="addnews.php" name="addnews" method="post">
{php}
$results = mysql_query("SELECT * FROM `news` ORDER BY `newsID` DESC");
echo "<p><input type=\"text\" name=\"query1\" value=\"title\" onclick=\"this.value='';this.onclick='';\" /></p>\n";
echo "<p><textarea name=\"query2\" cols=\"42\" rows=\"8\"></textarea></p>\n";
echo '<input type="hidden" name="addnews" value="'.$addnews.'" />' . "\n";
echo "<p><input name=\"submit\" type=\"submit\" value=\"Submit\" /></p>\n";
echo "</form>\n";
{/php}
<h4><a href="?p=news">Delete News</a></h4>
{php}
echo "<form action=\"'.$_SERVER['PHP_SELF'].'\" id=\"action\" name=\"action\" method=\"post\">\n";
while ($output = mysql_fetch_array($results)) {
echo "<div id='news_aticle'>\n";
echo "<h4><a href='#'>" .$output[title]. "</a></h4>\n";
echo "<p>" .$output[description]. "</p>\n";
echo "<p>posted by: <a class='user_name' href='#'>" .$output[user]. "</a> @ " .$output[timestamp]. "</p>\n";
echo '<p><input name="'.$row[newsID].'" type='checkbox' id="'.$row[newsID].'" value="'.$row[newsID].'" /></p>\n';
echo "</div>\n\n";
}
echo '<input type='hidden' name='delnews' value="'.$delnews.'" />' . "\n";
echo "<p><input name='perform' id='perform' type='submit' value='DELETE' /></p>\n";
echo "</form>";
if($_POST['perform']) {
foreach($_POST as $id) {
mysql_query("DELETE FROM news WHERE newsID='$id' LIMIT 1");
}
}
{/php}
</div>
</div>
{include file="footer.tpl"}