<?php include 'sesion.php';?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $nombresitio ?> - Panel de Administracion</title>
<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>

<?php include 'concha.php';?>

<link href="../estilo.css" rel="stylesheet" type="text/css" />
  
</head>

<body>






<?php 


  $IP = $_GET['IP'];?>
<table width="900" border="0" align="center" cellpadding="4" cellspacing="0">
      <tr>
      <td bgcolor="#F1F2ED"><?php include 'menu.php';?></td>
    </tr>
  
    <tr>
      <td bgcolor="#FFFFFF"><div align="center" class="Estilo41">
       
        <table width="100%" border="0" cellpadding="0" cellspacing="6" bordercolor="#D4D0C8" bgcolor="#0066CC">
          <tr>
            <td><div align="center" class="Estilo44">BLOQUEAR IP</div></td>
          </tr>
        </table>
        <p>&nbsp;</p>
        <p>
        
        
        
        

<?php 
if ($IP == '') {} else {
include('concha.php');
mysql_connect("$host","$usuario","$contra");
mysql_db_query("$basedatos","INSERT INTO `$basedatos`.`ip_bloq` (`ID`,`IP`,`comentario`,`fecha`) VALUES (NULL,'$IP','$comentario',CURRENT_TIMESTAMP);");
 };

?>
        </p>
        <hr>&nbsp;</p>
        IP´s BLOQUEADAS <br />
<br />

        <table width="100%" border="1" cellpadding="10">
        
          <tr>
    <td width="28%">IP</td>
    <td width="30%">Fecha</td>
    <td width="42%">Comentario</td>
  </tr>



   <?



mysql_connect ("$host", "$usuario", "$contra");

mysql_select_db ("$basedatos");



$sql = "SELECT * 
FROM  `ip_bloq` ";



$consulta = mysql_query ($sql);

while ($row = mysql_fetch_array($consulta))

{

$ID = $row["ID"];
$IP = $row["IP"];
$fecha = $row["fecha"];
$comentario = $row["comentario"];
?>


  <tr>
    <td><?php echo $IP ?></td>
    <td><?php echo $fecha ?></td>
    <td>
      <form id="form2" name="form2" method="post" action="form_comentario_ip_bloc.php">
        <textarea name="comentario" id="comentario" cols="45" rows="2"><?php echo $comentario ?></textarea>
            <br />
               <input name="ID" type="hidden" value="<?php echo $ID ?>" />
               
            <input type="submit" name="button" id="button" value="Enviar" />
         
      </form>
      </td>
  </tr>



<?
}

mysql_free_result($consulta);

?>
     </table>
      </div></td>
  </tr>
  </table>

</body>
</html>
