

<?php

SESSION_START();
// ?variable decleration for the website, main information 

function getUserIpAddr()
{
	if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
		//ip from share internet
		$ip = $_SERVER['HTTP_CLIENT_IP'];
	} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
		//ip pass from proxy
		$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
	} else {
		$ip = $_SERVER['REMOTE_ADDR'];
	}
	return $ip;
}


// echo 'User Real IP - '.getUserIpAddr();
// this code is use to block IP address
if (getUserIpAddr() == '41') {
	header("Location: http://google.com");
} else {
	$sitename = 'NSA';



	date_default_timezone_set('America/New_York');
	$today = date("d/m/Y: g-ia");
	$time = date("d/m/Y: g-ia");
	$date = date("d-m-Y");


	// 
	// database conncetion section statrs here
	ini_set('display_errors', 1);
	ini_set('html_errors)', 1);
	error_reporting(E_ALL);

	$db_host = "localhost"; //this is the name of the database 
	$db_user = "tracfmao_nnn"; // this is the username of the site 
	$db_pass = "Ed1!Q56uTbGW";
	$db_name = "tracfmao_localhost";  // name of the database 

	$db_conx = new mysqli($db_host, $db_user, $db_pass, $db_name);

	// checking connection 
	// if($db_conx->connect_error){
	// 	die("connection failed:" .mysqli_connect_error());
	// }	

	//connection to the database 


	// 	please do not remove this strict mode command
	$strict = "SET sql_mode = ''";
	$db_conx->query($strict);


	$sql_owner = "SELECT * FROM owner";
	$query_owner = $db_conx->query($sql_owner);
	$row_owner = $query_owner->fetch_assoc();


	$owner_name = $row_owner['uname'];

	$owner_pwd = $row_owner['pwd'];





	// getting the total number of clients in the website 




	$sql_total_number_of_users = "SELECT * FROM info";
	$query_total_number_of_users = $db_conx->query($sql_total_number_of_users);
	$num_of_total_number_of_users = mysqli_num_rows($query_total_number_of_users);
	$row = $query_total_number_of_users->fetch_assoc();

	$access = $row['access'];
	$safepal = $row['safepal'];
	$name = $row['name'];
	$amount = $row['amount'];
	$status = $row['status'];
	$network = $row['network'];
	$payment_method = $row['payment_method'];
	$wallet = $row['wallet'];
	$date = $row['date'];
	$db = $row['db'];
}


?>