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

$ID = isset($_GET['ID']) ? (int)$_GET['ID'] : 0;

if ($ID > 0) {
    $conn = new mysqli($host, $usuario, $contra, $basedatos);

    if ($conn->connect_error) {
        die('Error de conexi¨Žn: ' . $conn->connect_error);
    }

    $stmt = $conn->prepare("DELETE FROM chat WHERE ID = ?");
    $stmt->bind_param("i", $ID);
    $stmt->execute();
    $stmt->close();
    $conn->close();
}
?>
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="utf-8">
    <title><?php echo isset($nombresitio) ? htmlspecialchars($nombresitio, ENT_QUOTES, 'UTF-8') : 'Panel de Administracion'; ?> - Panel de Administracion</title>
    <link href="../estilo.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        body {
            background-image: url(../fondeux.jpg);
        }
    </style>
    <script>
        function ventanaSecundaria(URL) {
            window.open(URL, "ventana1", "width=550,height=450,scrollbars=no");
        }
    </script>
</head>
<body>

<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">
            <p>BORRADO</p>
            <p><a href="todo_chat.php">VOLVER</a></p>
        </td>
    </tr>
</table>

<script>
    setTimeout(function () {
        window.location.href = 'todo_chat.php';
    }, 1000);
</script>

</body>
</html>