<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="css.css" />  
<?
include("config.php");
	header("Content-Type: text/html;  charset=ISO-8859-1",true);
if(!$_SESSION['paineladm']){ include("logar.php"); die(); }
?>
<? 

  	if(!empty($_GET["delete"]))
{
  $del		=		$_GET["delete"];
mssql_query("DELETE FROM noticias WHERE id='" .$del. "'");
}
?>
<div align="center">
 <?
 $q		=	mssql_query("SELECT * FROM noticias order by data desc");
if(mssql_num_rows($q) <=0){ die("<center>N&atilde; h&aacute; noticias cadastradas no banco de dados (BD)</center>"); }
 ?>   <table width="400" border="0" cellspacing="0" cellpadding="0">
      
      <tr>
        <td width="15"><div align="center">#</div></td>
        <td width="350"><div align="center">Not&iacute;cia</div></td>
        <td width="35"><div align="center">Deletar</div></td>
      </tr>
      <tr><? 
	   for($i=1;$i<=mssql_num_rows($q);$i++){
		
	   $a		=	mssql_fetch_array($q);
	   ?>
		<td width="15"><?=$i;?></td>
       <td width="350"><div align="center"><?=$a['titulo'];?></div></td>
        <td width="35"><div align="center"><input type="submit" value="Del n&deg;(<?=$a['id'];?>)" onClick="javascript: Carregar('deletar_noticia.php?delete=<?=$a['id'];?>','padmin');"></div></td>
      </tr>
	  <? } ?>
    </table>
	<div align="center" id="result_rem"></div>
</div>

