<?php

if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1" || $_SERVER["REMOTE_ADDR"] == "::1" || str_contains($_SERVER["HTTP_HOST"], "localhost")) {
	$DB_HOST = "192.168.2.166";
	$DB_NAME = "goiintra_db";
	$DB_USER = "goiintra_root";
	$DB_PASSWORD = "L0C2CKN5GHHY";
	
	if ($pdo = new PDO('mysql:host=192.168.2.166;dbname=goiintra_db', $DB_USER, $DB_PASSWORD))
	{echo "";}else{echo "bad news";}	

}
else if ($_SERVER['HTTP_HOST'] == "goi.ifreshy.com") {
	$DB_HOST = "localhost";
	$DB_NAME = "ifreshy_goi";
	$DB_USER = "ifreshy_goi";
	$DB_PASSWORD = "L0C2CKN5GHHY";
	
	if ($pdo = new PDO('mysql:host=localhost;dbname=ifreshy_goi', $DB_USER, $DB_PASSWORD))
	{echo "";}else{echo "bad news";}	
}
else if ($_SERVER['HTTP_HOST'] == "www.goiintranet.com"|| $_SERVER['HTTP_HOST'] == "goiintranet.com") {
	$DB_HOST = "localhost";
	$DB_NAME = "goiintra_db";
	$DB_USER = "goiintra_root";
	$DB_PASSWORD = "L0C2CKN5GHHY";
	
	if ($pdo = new PDO('mysql:host=localhost;dbname=goiintra_db', $DB_USER, $DB_PASSWORD))
	{echo "";}else{echo "bad news";}	
}
else {
	echo "[DB Error. Please contact administrator.]";
	exit;
}
	

$pdo-> exec("set names utf8");


?>