<?php
/**
*
* @ This file is created by http://DeZender.Net
* @ deZender (PHP7 Decoder for SourceGuardian Encoder)
*
* @ Version			:	4.1.0.1
* @ Author			:	DeZender
* @ Release on		:	29.08.2020
* @ Official site	:	http://DeZender.Net
*
*/

function my_error_handler($code, $message)
{
	echo sprintf('sprintf', $code);
	echo 'sprintf';
	return 'sprintf';
}

function function_added_to_every_file()
{
}

function real_ip()
{
	$ip = 'undefined';

	if (isset($_SERVER)) {
		$ip = $_SERVER['REMOTE_ADDR'];

		if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
			$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
		}
		else if (isset($_SERVER['HTTP_CLIENT_IP'])) {
			$ip = $_SERVER['HTTP_CLIENT_IP'];
		}
	}
	else {
		$ip = getenv('REMOTE_ADDR');

		if (getenv('HTTP_X_FORWARDED_FOR')) {
			$ip = getenv('HTTP_X_FORWARDED_FOR');
		}
		else if (getenv('HTTP_CLIENT_IP')) {
			$ip = getenv('HTTP_CLIENT_IP');
		}
	}

	$ip = htmlspecialchars($ip, ENT_QUOTES, 'UTF-8');
	return $ip;
}

function getOS()
{
	global $user_agent;
	$os_platform = 'Unknown';
	$os_array = ['/okhttp/i' => 'ActiveTVOS', '/xiaomi/i' => 'Xiaomi', '/windows nt 10/i' => 'Windows', '/windows nt 6.3/i' => 'Windows', '/windows nt 6.2/i' => 'Windows', '/windows nt 6.1/i' => 'Windows', '/windows nt 6.0/i' => 'Windows', '/windows nt 5.2/i' => 'Windows', '/windows nt 5.1/i' => 'Windows', '/windows xp/i' => 'Windows', '/windows nt 5.0/i' => 'Windows', '/windows me/i' => 'Windows', '/win98/i' => 'Windows', '/win95/i' => 'Windows', '/win16/i' => 'Windows', '/macintosh|mac os x/i' => 'Mac OSX', '/mac_powerpc/i' => 'Mac OS', '/linux/i' => 'Linux', '/ubuntu/i' => 'Linux', '/iphone/i' => 'ios', '/ipod/i' => 'ios', '/ipad/i' => 'ios', '/android/i' => 'Android', '/blackberry/i' => 'BlackBerry', '/webos/i' => 'WebOS', '/SmartHub/i' => 'HubOS', '/Tizen/i' => 'TizenOS'];

	foreach ($os_array as $regex => $value) {
		if (preg_match($regex, $user_agent)) {
			$os_platform = $value;
		}
	}

	return $os_platform;
}

function getBrowser()
{
	global $user_agent;
	$browser = 'Unknown';
	$browser_array = ['/msie/i' => 'Internet Explorer', '/firefox/i' => 'Firefox', '/safari/i' => 'Safari', '/chrome/i' => 'Chrome', '/edge/i' => 'Edge', '/opera/i' => 'Opera', '/netscape/i' => 'Netscape', '/maxthon/i' => 'Maxthon', '/konqueror/i' => 'Konqueror', '/SamsungBrowser/i' => 'Mobile Browser', '/SamsungBrowser|TV Safari/i' => 'TV Samsung Browser', '/Mobile Safari/i' => 'Mobile Browser'];

	foreach ($browser_array as $regex => $value) {
		if (preg_match($regex, $user_agent)) {
			$browser = $value;
		}
	}

	return $browser;
}

function getAP()
{
	global $user_agent;
	$platform = 'Unknown';
	$os_array = ['/okhttp/i' => 'ACTIVE DEVICE', '/xiaomi/i' => 'XIAOMI', '/android/i' => 'ANDROID', '/A96/i' => 'TVBOX', '/A95/i' => 'TVBOX', '/TX9/i' => 'TVBOX', '/TX6/i' => 'TVBOX', '/TX3/i' => 'TVBOX', '/TX2/i' => 'TVBOX', '/MX9/i' => 'TVBOX', '/MXQ/i' => 'TVBOX', '/MX10/i' => 'TVBOX', '/V88/i' => 'TVBOX', '/Stick/i' => 'TVBOX', '/MiBox/i' => 'TVBOX', '/Dolamee/i' => 'TVBOX', '/windows nt/i' => 'CPU Windows NT', '/windows xp/i' => 'CPU Windows XP', '/windows me/i' => 'CPU Windows ME', '/win98/i' => 'CPU Windows 98', '/win95/i' => 'CPU Windows 95', '/win16/i' => 'CPU Windows CE', '/macintosh|mac os x/i' => 'CPU MacOSX', '/mac_powerpc/i' => 'CPU MacOS', '/ubuntu/i' => 'CPU Linux', '/iphone/i' => 'iPhone', '/ipod/i' => 'iPod', '/ipad/i' => 'iPad', '/blackberry/i' => 'BlackBerry', '/Mobile Safari/i' => 'Mobile', '/SamsungBrowser/i' => 'Mobile', '/moto/i' => 'Motorola', '/Galaxy/i' => 'Samsung Galaxy', '/webos/i' => 'LG TVSmart', '/SmartHub/i' => 'Samsung Hub TVSmart', '/Tizen/i' => 'Samsung Hub TVSmart', '/TV Safari/i' => 'AppleTV'];

	foreach ($os_array as $regex => $value) {
		if (preg_match($regex, $user_agent)) {
			$platform = $value;
		}
	}

	return $platform;
}

function call_api($api_link)
{
	$returnData = '0';
	global $httpcode;
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $api_link);
	curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-US) AppleWebKit/532.8 (KHTML, like Gecko) Chrome/4.0.302.2 Safari/532.8');
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
	curl_setopt($ch, CURLOPT_TIMEOUT, 10);
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
	curl_setopt($ch, CURLOPT_AUTOREFERER, true);
	$result = json_decode(curl_exec($ch));

	if (!empty($result)) {
		$returndata = $result;
		return ['result' => 'success', 'data' => $returndata];
	}
}

date_default_timezone_set('America/Sao_Paulo');
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$user_browser = getBrowser();
$date = date('d-m-Y H:i:s');
$ipaddress = real_ip();
$device = getAP();
$os = getOS();
$device_details = ' IP: ' . $ipaddress . ' | OS: ' . $os . ' | App: ' . $user_browser . ' | Aparelho: ' . $device;
$ipl = real_ip();
$details = json_decode(file_get_contents('https://ipinfo.io/' . $ipl . '/json'));
$country = $details->country;
$state = $details->region;
$city = $details->city;
$isp = $details->org;
$isp = preg_replace('/AS\\d{1,}\\s/', '', $isp);
$loc = $details->loc;

if (isset($_GET['activecode'])) {
	$Cactivecode = $_GET['activecode'];
}
else {
	$Cactivecode = 'Hacking Attempt';
}

if (isset($_GET['macAddress'])) {
	$CmacAddress = urldecode($_GET['macAddress']);
}
else if (isset($_GET['macid'])) {
	$CmacAddress = urldecode($_GET['macid']);
}
else {
	$CmacAddress = 'Hacking Attempt';
}

if (isset($_GET['app'])) {
	$Cappname = $_GET['app'];
}
else if (isset($_GET['number'])) {
	$Cappname = 'AppDual-' . $_GET['number'];
}
else {
	$Cappname = 'Hacking Attempt';
}

if (isset($_GET['uid'])) {
	$Cuid = $_GET['uid'];
}
else if (isset($_GET['macid'])) {
	$Cuid = urldecode($_GET['macid']);
}
else {
	$Cuid = 'Hacking Attempt';
}

$dbcc = new SQLite3('./data/.boxbr_conected.db');
$dbcc->exec('CREATE TABLE IF NOT EXISTS conected(id INTEGER PRIMARY KEY NOT NULL,' . "\r\n\t" . 'date VARCHAR(50),' . "\r\n\t" . 'device VARCHAR(50),' . "\r\n\t" . 'os VARCHAR(50),' . "\r\n\t" . 'activecode VARCHAR(50),' . "\r\n\t" . 'appname VARCHAR(50),' . "\r\n\t" . 'macAddress VARCHAR(50),' . "\r\n\t" . 'uid VARCHAR(50),' . "\r\n\t" . 'ipaddress VARCHAR(50),' . "\r\n\t" . 'isp VARCHAR(50),' . "\r\n\t" . 'state VARCHAR(50),' . "\r\n\t" . 'country VARCHAR(50),' . "\r\n\t" . 'block VARCHAR(50)' . "\r\n\t" . ')');
$rescc = $dbcc->query('SELECT * FROM conected');
$rowcc = $rescc->fetchArray();
$rescc2 = $dbcc->query('SELECT * FROM conected WHERE macAddress=\'' . $CmacAddress . '\'');
$rowcc2 = $rescc2->fetchArray();
$checkblock = $rowcc['block'];
$checkblock2 = $rowcc2['block'];
$db = new SQLite3('./data/.boxbr_info.db');
$db->exec('CREATE TABLE IF NOT EXISTS act(id INTEGER PRIMARY KEY NOT NULL,' . "\r\n\t" . 'title VARCHAR(50),' . "\r\n\t" . 'activecode VARCHAR(50),' . "\r\n\t" . 'macAddress VARCHAR(50),' . "\r\n\t" . 'uid VARCHAR(50),' . "\r\n\t" . 'username VARCHAR(50),' . "\r\n\t" . 'password VARCHAR(50),' . "\r\n\t" . 'url VARCHAR(50),' . "\r\n\t" . 'apptype VARCHAR(50),' . "\r\n\t" . 'appname VARCHAR(50),' . "\r\n\t" . 'status VARCHAR(50))');

if (empty($_GET['macAddress'])) {
	$macAddress2 = urldecode($_GET['macid']);
}
else {
	$macAddress2 = urldecode($_GET['macAddress']);
}
if (isset($_GET['activecode']) || isset($_POST['activecode'])) {
	$code = $_GET['activecode'];
	$res = $db->query('SELECT * FROM act WHERE activecode=\'' . $code . '\'');
	$row = $res->fetchArray();
	$resdns = $db->query('SELECT * FROM act');
	$username = $row['username'];
	$password = $row['password'];
	$macAddress = $row['macAddress'];
	$type = $row['apptype'];
	$status = $row['status'];
	$app = $row['appname'];
	$type = $row['apptype'];
	if (isset($username) && isset($password)) {
		$activecode = $code;
	}

	$arr = [];

	while ($row = $resdns->fetchArray(SQLITE3_ASSOC)) {
		$arr[] = $row['url'];

		foreach ($arr as $dns) {
			$api_link = $dns . ('/player_api.php?username=' . $username . '&password=' . $password);
			$api_req = call_api($api_link);
			$result = $api_req;

			if ($result['result'] == 'success') {
				if (isset($result['data']->user_info->auth)) {
					if ($result['data']->user_info->auth != 0) {
						if ($result['data']->user_info->status == 'Active') {
							$dns3 = $api_link;
						}
					}
				}
			}
		}
	}

	$timer = '10';
	$message = 'ActiveCode Valid - Wellcome';
	if (isset($_GET['activecode']) && empty($macAddress)) {
		if (isset($macAddress2)) {
			$db->exec('UPDATE act SET  macAddress=\'' . $macAddress2 . '\'' . "\r\n\t\t\t\t\t\t" . '  WHERE ' . "\r\n\t\t\t\t\t\t\t" . '  activecode=\'' . $code . '\'');
		}
	}
	if (isset($_GET['activecode']) && empty($uid)) {
		if (isset($_GET['uid'])) {
			$db->exec('UPDATE act SET uid=\'' . $_GET['uid'] . '\'' . "\r\n\t\t\t\t\t\t" . '  WHERE ' . "\r\n\t\t\t\t\t\t\t" . '  activecode=\'' . $code . '\'');
		}
	}
	if (isset($_GET['activecode']) && empty($app)) {
		if (isset($_GET['app'])) {
			$db->exec('UPDATE act SET  appname=\'' . $_GET['app'] . '\'' . "\r\n\t\t\t\t\t\t" . '  WHERE ' . "\r\n\t\t\t\t\t\t\t" . '  activecode=\'' . $code . '\'');
		}
	}
}
if (($_GET['activecode'] == $activecode) && ($macAddress == $macAddress2) && ($status == '1')) {
	$activeCode = 'valid';

	if ($checkblock2 == '0') {
		$dbcc->exec('UPDATE conected SET  ' . "\r\n" . 'date=\'' . $date . '\',' . "\r\n" . 'device=\'' . $device . '\',' . "\r\n" . 'os=\'' . $os . '\',' . "\r\n" . 'appname=\'' . $Cappname . '\',' . "\r\n" . 'ipaddress=\'' . $ipaddress . '\',' . "\r\n" . 'isp=\'' . $isp . '\',' . "\r\n" . 'state=\'' . $state . '\',' . "\r\n" . 'country=\'' . $country . '\',' . "\r\n" . 'block=\'0\'' . "\r\n\t\t\t\t\t\t" . '  WHERE ' . "\r\n\t\t\t\t\t\t\t" . '  macAddress=\'' . $CmacAddress . '\'');
	}
	else {
		$dbcc->exec('INSERT INTO conected(date, device, os, activecode, appname, macAddress, uid,ipaddress,isp,state,country,block)' . "\r\n" . ' VALUES(\'' . $date . '\', \'' . $device . '\', \'' . $os . '\', \'' . $Cactivecode . '\', \'' . $Cappname . '\', \'' . $CmacAddress . '\', \'' . $Cuid . '\', \'' . $ipaddress . '\', \'' . $isp . '\',  \'' . $state . '\', \'' . $country . '\', \'0\')');
	}
	if ((($activeCode == 'valid') && isset($_GET['get_short_epg'])) || (isset($_GET['get_simple_data_table']) && (($type == '1') || ($type == '0')))) {
		$id = $_REQUEST['stream_id'];
		$url = $dns3 . '&action=get_simple_data_table&stream_id=' . $_GET['stream_id'];
		header('Location: ' . $url);
		$db->close();
		$dbcc->close();
		exit();
	}
	else if (isset($_GET['vod_id']) && ($_GET['vod_id'] && ($activeCode == 'valid')) && (($type == '2') || ($type == '0'))) {
		$id = $_REQUEST['vod_id'];
		$url = $dns3 . '&action=get_vod_info&vod_id=' . $_GET['vod_id'];
		header('Location: ' . $url);
		$db->close();
		$dbcc->close();
		exit();
	}
	else if (isset($_GET['series_id']) && ($activeCode == 'valid') && (($type == '2') || ($type == '0'))) {
		$id = $_GET['series_id'];
		$url = $dns3 . '&action=get_series_info&series_id=' . $id;
		header('Location: ' . $url);
		$db->close();
		$dbcc->close();
		exit();
	}
	else if (($action !== '') && ($activeCode == 'valid') && (($type == '2') || ($type == '1') || ($type == '0'))) {
		$url = $dns3 . $getaction . $getcategory_id . $getstream_id;
		header('Location: ' . $url);
		$db->close();
		$dbcc->close();
		exit();
	}
	else if (empty($action) && ($activeCode == 'valid') && (($type == '2') || ($type == '1') || ($type == '0'))) {
		$url = $dns3;
		header('Location: ' . $url);
		$db->close();
		$dbcc->close();
		exit();
	}
	else {
		if ($checkblock2 == '0') {
			$dbcc->exec('UPDATE conected SET  date=\'' . $date . '\',' . "\r\n" . 'device=\'' . $device . '\',' . "\r\n" . 'os=\'' . $os . '\',' . "\r\n" . 'appname=\'' . $Cappname . '\',' . "\r\n" . 'ipaddress=\'' . $ipaddress . '\',' . "\r\n" . 'isp=\'' . $isp . '\',' . "\r\n" . 'state=\'' . $state . '\',' . "\r\n" . 'country=\'' . $country . '\',' . "\r\n" . 'block=\'0\'' . "\r\n\t\t\t\t\t\t" . '  WHERE ' . "\r\n\t\t\t\t\t\t\t" . '  macAddress=\'' . $CmacAddress . '\'');
		}
		else {
			$dbcc->exec('INSERT INTO conected(date, device, os, activecode, appname, macAddress, uid,ipaddress,isp,state,country,block)' . "\r\n" . ' VALUES(\'' . $date . '\', \'' . $device . '\', \'' . $os . '\', \'' . $Cactivecode . '\', \'' . $Cappname . '\', \'' . $CmacAddress . '\', \'' . $Cuid . '\', \'' . $ipaddress . '\', \'' . $isp . '\',  \'' . $state . '\', \'' . $country . '\', \'0\')');
		}

		echo '{"status":true,"data":true,"message":"' . $message . '"}';
		$db->close();
		$dbcc->close();
	}
}
else if (($checkblock == '0') && ($_GET['activecode'] == $activecode) && ($macAddress == !$macAddress2) && ($status == '1')) {
	if ($checkblock2 == '0') {
		$dbcc->exec('UPDATE conected SET  date=\'' . $date . '\',' . "\r\n" . 'device=\'' . $device . '\',' . "\r\n" . 'os=\'' . $os . '\',' . "\r\n" . 'appname=\'' . $Cappname . '\',' . "\r\n" . 'ipaddress=\'' . $ipaddress . '\',' . "\r\n" . 'isp=\'' . $isp . '\',' . "\r\n" . 'state=\'' . $state . '\',' . "\r\n" . 'country=\'' . $country . '\',' . "\r\n" . 'block=\'0\'' . "\r\n\t\t\t\t\t\t" . '  WHERE ' . "\r\n\t\t\t\t\t\t\t" . '  macAddress=\'' . $CmacAddress . '\'');
	}
	else {
		$dbcc->exec('INSERT INTO conected(date, device, os, activecode, appname, macAddress, uid,ipaddress,isp,state,country,block)' . "\r\n" . ' VALUES(\'' . $date . '\', \'' . $device . '\', \'' . $os . '\', \'' . $Cactivecode . '\', \'' . $Cappname . '\', \'' . $CmacAddress . '\', \'' . $Cuid . '\', \'' . $ipaddress . '\', \'' . $isp . '\',  \'' . $state . '\', \'' . $country . '\', \'0\')');
	}

	echo '{"status":"Recognizing the new user, try again!"}';
	$db->close();
	$dbcc->close();
	exit();
}
else if (($checkblock == '0') && ($_GET['activecode'] == $activecode) && ($macAddress == $macAddress2) && ($status == '0')) {
	if ($checkblock2 == '0') {
		$dbcc->exec('UPDATE conected SET  date=\'' . $date . '\',' . "\r\n" . 'device=\'' . $device . '\',' . "\r\n" . 'os=\'' . $os . '\',' . "\r\n" . 'appname=\'' . $Cappname . '\',' . "\r\n" . 'ipaddress=\'' . $ipaddress . '\',' . "\r\n" . 'isp=\'' . $isp . '\',' . "\r\n" . 'state=\'' . $state . '\',' . "\r\n" . 'country=\'' . $country . '\',block=\'0\'' . "\r\n\t\t\t\t\t\t" . '  WHERE ' . "\r\n\t\t\t\t\t\t\t" . '  macAddress=\'' . $CmacAddress . '\'');
	}
	else {
		$dbcc->exec('INSERT INTO conected(date, device, os, activecode, appname, macAddress, uid,ipaddress,isp,state,country,block)' . "\r\n" . ' VALUES(\'' . $date . '\', \'' . $device . '\', \'' . $os . '\', \'' . $Cactivecode . '\', \'' . $Cappname . '\', \'' . $CmacAddress . '\', \'' . $Cuid . '\', \'' . $ipaddress . '\', \'' . $isp . '\',  \'' . $state . '\', \'' . $country . '\', \'0\')');
	}

	echo '{"status":"Code Inactive! Please Contact Support."}';
	$db->close();
	$dbcc->close();
	exit();
}
else if ((($checkblock == '1') && empty($Cactivecode)) || empty($CmacAddress)) {
	if ($checkblock2 == '1') {
		$dbcc->exec('UPDATE conected SET  date=\'' . $date . '\',' . "\r\n" . 'device=\'' . $device . '\',' . "\r\n" . 'os=\'' . $os . '\',' . "\r\n" . 'appname=\'' . $Cappname . '\',' . "\r\n" . 'ipaddress=\'' . $ipaddress . '\',' . "\r\n" . 'isp=\'' . $isp . '\',' . "\r\n" . 'state=\'' . $state . '\',' . "\r\n" . 'country=\'' . $country . '\',block=\'1\'' . "\r\n\t\t\t\t\t\t" . '  WHERE ' . "\r\n\t\t\t\t\t\t\t" . '  macAddress=\'' . $CmacAddress . '\'');
	}
	else {
		$dbcc->exec('INSERT INTO conected(date, device, os, activecode, appname, macAddress, uid,ipaddress,isp,state,country,block)' . "\r\n" . ' VALUES(\'' . $date . '\', \'' . $device . '\', \'' . $os . '\', \'' . $Cactivecode . '\', \'' . $Cappname . '\', \'' . $CmacAddress . '\', \'' . $Cuid . '\', \'' . $ipaddress . '\', \'' . $isp . '\',  \'' . $state . '\', \'' . $country . '\', \'1\')');
	}

	echo '{"status":"Are you trying to hack this? is wasting time! even you are banned... ' . $device_details . '"}';
	$db->close();
	$dbcc->close();
	exit();
}
else if ($checkblock == '1') {
	if (($checkblock2 == '0') || ($checkblock2 == '1')) {
		$dbcc->exec('UPDATE conected SET  date=\'' . $date . '\',' . "\r\n" . 'device=\'' . $device . '\',' . "\r\n" . 'os=\'' . $os . '\',' . "\r\n" . 'appname=\'' . $Cappname . '\',' . "\r\n" . 'ipaddress=\'' . $ipaddress . '\',' . "\r\n" . 'isp=\'' . $isp . '\',' . "\r\n" . 'state=\'' . $state . '\',' . "\r\n" . 'country=\'' . $country . '\',block=\'1\'' . "\r\n\t\t\t\t\t\t" . '  WHERE ' . "\r\n\t\t\t\t\t\t\t" . '  macAddress=\'' . $CmacAddress . '\'');
	}
	else {
		$dbcc->exec('INSERT INTO conected(date, device, os, activecode, appname, macAddress, uid,ipaddress,isp,state,country,block)' . "\r\n" . ' VALUES(\'' . $date . '\', \'' . $device . '\', \'' . $os . '\', \'' . $Cactivecode . '\', \'' . $Cappname . '\', \'' . $CmacAddress . '\', \'' . $Cuid . '\', \'' . $ipaddress . '\', \'' . $isp . '\',  \'' . $state . '\', \'' . $country . '\', \'1\')');
	}

	echo '{"status":"Connection banned for misuse of the system!"}';
	$db->close();
	$dbcc->close();
	exit();
}
else if ((($checkblock == '0') && empty($Cactivecode)) || empty($CmacAddress)) {
	if (($checkblock2 == '0') || ($checkblock2 == '1')) {
		$dbcc->exec('UPDATE conected SET  date=\'' . $date . '\',' . "\r\n" . 'device=\'' . $device . '\',' . "\r\n" . 'os=\'' . $os . '\',' . "\r\n" . 'appname=\'' . $Cappname . '\',' . "\r\n" . 'ipaddress=\'' . $ipaddress . '\',' . "\r\n" . 'isp=\'' . $isp . '\',' . "\r\n" . 'state=\'' . $state . '\',' . "\r\n" . 'country=\'' . $country . '\',block=\'1\'' . "\r\n\t\t\t\t\t\t" . '  WHERE ' . "\r\n\t\t\t\t\t\t\t" . '  macAddress=\'' . $CmacAddress . '\'');
	}
	else {
		$dbcc->exec('INSERT INTO conected(date, device, os, activecode, appname, macAddress, uid,ipaddress,isp,state,country,block)' . "\r\n" . ' VALUES(\'' . $date . '\', \'' . $device . '\', \'' . $os . '\', \'' . $Cactivecode . '\', \'' . $Cappname . '\', \'' . $CmacAddress . '\', \'' . $Cuid . '\', \'' . $ipaddress . '\', \'' . $isp . '\',  \'' . $state . '\', \'' . $country . '\', \'1\')');
	}

	echo '{"status":"Are you trying to hack this? is wasting time!"}';
	$db->close();
	$dbcc->close();
	exit();
}
else {
	$dbcc->exec('INSERT INTO conected(date, device, os, activecode, appname, macAddress, uid,ipaddress,isp,state,country,block)' . "\r\n" . ' VALUES(\'' . $date . '\', \'' . $device . '\', \'' . $os . '\', \'' . $Cactivecode . '\', \'' . $Cappname . '\', \'' . $CmacAddress . '\', \'' . $Cuid . '\', \'' . $ipaddress . '\', \'' . $isp . '\',  \'' . $state . '\', \'' . $country . '\', \'0\')');
	$activeCode = 'invalid';
	echo '{"status":"Code Invalid"}';
	$db->close();
	$dbcc->close();
	exit();
}

?>