<?php
ob_start();
// session_status é a partir do php 5.4
if (!function_exists ( 'session_status' )) {
  define (PHP_SESSION_NONE, false);
  define (PHP_SESSION_ACTIVE, true);
  function session_status() {
    return session_id() !== '';
  }
}
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

define ('AMBIENTE', in_array(gethostname(), array('admin-81e04261c', 'Code-Dev-PC01')) ? 'des' : (gethostname() === 'Eduardo-Archon' ? 'des-edu' : 'prd'));

$host = "";
$user = "";
$pass = "";
$database = "";

if (AMBIENTE == 'prd') {
	// Produção
	//echo "estou em PRD";
	$host = "localhost";
	$user = "rainhacapinhas";
	$pass = "satcode2017";
	$database = "rainhaca_siscap_erpc_code";
} else if (AMBIENTE == 'des-edu') {
	// escritório/eduardo
	$host = "localhost";
	$user = "root";
	$pass = "";
	$database = "sgpsi";
} else {

  /* CONEXAO LOCAL NA MINHA MAQUINA*/
	$host = "localhost";
	$user = "root";
	$pass = "root";
	$database = "erpc_code";
//
}

$conexao = mysqli_connect($host, $user, $pass, $database) or die(mysqli_error($conexao));
mysqli_select_db($conexao, $database) or die (mysqli_error($conexao));
mysqli_set_charset($conexao, 'utf8');

include_once("inc/functions.php");

?>
