<?php
date_default_timezone_set('Asia/Jakarta');
$server = "localhost";
$username = "root";
$password = "";
$database = "sppphpmu_midtrans";


mysql_connect($server,$username,$password);
mysql_select_db($database);

function anti_injection($data){
	$filter = mysql_real_escape_string(stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES))));
	return $filter;
}

function average($arr){
	if (!is_array($arr)) return false;
	return array_sum($arr)/count($arr);
}

function cek_session_admin(){
	$level = $_SESSION[level];
	if ($level != 'admin' AND $cekakses <= '0'){
		echo "<script>document.location='index.php';</script>";
	}
}



?>
