<?php 
session_start();
include_once dirname( __DIR__ ) . '/crmturismo/config/configuration.php';

define('DB_SERVER', DB_HOST);
define('DB_USERNAME', DB_USER);
define('DB_PASSWORD', DB_PASS);
define('DB_DATABASE', DB_NAME);
function getDB() 
{
	$dbhost=DB_SERVER;
	$dbuser=DB_USERNAME;
	$dbpass=DB_PASSWORD;
	$dbname=DB_DATABASE;
	try {
	$dbConnection = new PDO("mysql:host=$dbhost;dbname=$dbname", $dbuser, $dbpass);	
	$dbConnection->exec("set names utf8");
	$dbConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
	return $dbConnection;
    }
    catch (PDOException $e) {
    echo 'Connection failed: ' . $e->getMessage();
	}

}
?>