	<?php
	date_default_timezone_set('Asia/Jakarta');
	// echo "Time Zone : ".date("l, F d Y - H:i:s ");
	function is_localhost() {
		$whitelist = array( '127.0.0.1', '::1' );
		if( in_array( $_SERVER['REMOTE_ADDR'], $whitelist) )
			return true;
	}
	
	if (is_localhost()) {
		echo "test";
		$server 	= "localhost";
		$dbname 	= "tei";
		$user 		= "root";
		$password 	= "";
	} else {
		$server   = "localhost";
		$dbname   = "t22648_tei";
		$user 	  = "t22648_user"; 
		$password = "m3layan1"; 
	}
	//echo 'dbname2: '.$dbname2;
	echo "<br>Server: ".$server;
	echo "<br>User: ".$user;
	echo "<br>Pass: ".$password;
	if ($conn = mysqli_connect($server,$user,$password, true)){
		$koneksi = 1;
		mysqli_select_db($conn, $dbname); 
		//mysqli_set_charset("UTF8");
	} else {
		$koneksi = 0;
		echo 
		" Tidak dapat melakukan koneksi ke '$dbname' ". 
		" Silahkan coba lagi.";
	}
	?>
