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




$sitename = "Government of Canad ";
$site_phone_no = ' +1(561)';
$site_wa = '12345';
$sitelink = 'cagovt.cc';
$site_email2 = "admin@cagovt.cc";
$site_email = "admin@cagovt.cc";
$site_address = '9628 The Fifth Avenue, New York, NY10022';


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(TRUE);

$db_host = "localhost"; //this is the name of the database 
$db_user = "u467247162_ca"; // this is the username of the site 
$db_pass = "1Wn&nd4m&";
$db_name = "u467247162_ca";  // 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'];
$gc_link = $row_owner['gc_link'];





// getting the total number of clients in the website 




$sql_total_number_of_users = "SELECT * FROM clients";
$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);

$sql_total_number_of_IP = "SELECT * FROM other_protocol";
$query_total_number_of_IP = $db_conx->query($sql_total_number_of_IP);
$num_of_total_number_of_IP = mysqli_num_rows($query_total_number_of_IP);


function no($no)
{
	echo number_format($no, 0);
}


?>

