<?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()) {
	$server   = "localhost";
	$dbname   = "tei";
	$user     = "root";
	$password = "";
} else {
	$server   = "localhost";
	$dbname   = "t22648_kd-2022";
	$user 	  = "t22648_kd"; 
	$password = "OyRhY}3[(JRa"; 
}

if ($conn = mysqli_connect($server,$user,$password, $dbname)){
	$koneksi=1;
	//echo $dbname;
	mysqli_select_db($conn, $dbname); 
	mysqli_set_charset($conn, 'UTF8');
	include_once("getUrl.php");
} else {
	$koneksi=0;
	die("Tidak dapat melakukan koneksi ke ".$dbname.". Silahkan coba lagi.");
}
?>