<?php 
session_start();

$id = $_SESSION['id'];
$nombre = $_SESSION["Nombre"];
$email = $_SESSION["gmail"];



include 'conexion.php';


if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $name = $_POST["nombre"];
    $correo = $_POST["gmail"];
    $asunto= $_POST["asunto"];
    
    $consulta = $conectado->prepare("INSERT INTO contactos (nombre, email, asunto)  
    VALUES('$name', '$correo', '$asunto')");
    $consulta->execute();
}

?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" 
    integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/uikit@3.18.3/dist/js/uikit.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/uikit@3.18.3/dist/js/uikit-icons.min.js"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uikit@3.18.3/dist/css/uikit.min.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Editar Registro</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uikit@3.18.1/dist/css/uikit.min.css" />
    <script src="https://cdn.jsdelivr.net/npm/uikit@3.18.1/dist/js/uikit.min.js"></script>
    <link rel="stylesheet" type="text/css" href="Estilos/index.css">
    <script src="https://unpkg.com/feather-icons"></script>
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" 
    integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/uikit@3.18.1/dist/js/uikit-icons.min.js"></script>
    <style>
        .una{
            margin-top:80px;
        }

        .chat-icon {
    position: fixed;
    bottom: 20px; /* Distancia desde la parte inferior */
    right: 20px; /* Distancia desde el lado derecho */
    background-color: #3056C4;
    color: #ffffff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.chat-icon:hover {
    transform: scale(1.1); /* Efecto de escala al pasar el mouse */
}
    </style>
</head>
<body>
<?php 
       
            
        include("menu.php");
        
     
    ?>
    <div class="uk-section una">
    <div class="uk-container">
        <div class="uk-grid uk-child-width-1-2">
            <form method="post" action="" class="uk-form-stacked uk-align-center uk-margin-small-top">
                <div class="uk-margin">
                    <label class="uk-form-label" for="form-stacked-text">Nombre:</label>
                    <div class="uk-form-controls">
                        <input class="uk-input" id="form-stacked-text" name="nombre" type="text" value="<?php echo $nombre; ?>" " placeholder="Some text...">
                    </div>
                </div>

                <div class="uk-margin">
                    <label class="uk-form-label" for="form-stacked-select">Email:</label>
                    <div class="uk-form-controls">
                        <input class="uk-input" id="form-stacked-text" name="gmail" type="email" value="<?php echo $email; ?>" placeholder="Some text...">
                    </div>
          
                <div class="uk-margin">
                    <div class="uk-form-label">Asunto</div>
                    <div class="uk-form-controls">
                        <textarea class="uk-textarea" rows="5" placeholder="Textarea" name="asunto" aria-label="Textarea"></textarea>
                    </div>
                </div>
                <div class="uk-margin">
                    <div class="uk-form-controls">
                        <button class="uk-button uk-button-primary uk-light uk-align-center">Send Request</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div> 
<div class="chat-icon">
    <?php include("boticon.php") ?>
    </div>

<?php include("footer.php"); ?>
</body>
</html>