<?php

		try {

		
		define("SERVER","localhost");
		define("DB","govfacil_site");
		define("USER","govfacil_site");
		define("PWD","GFacil20!%");
		
		/*
		define("SERVER","localhost");
		define("DB","govfacil");
		define("USER","root");
		define("PWD","root");
		*/
		

		$pdo = new PDO ("mysql:host=".SERVER.";dbname=".DB,USER,PWD);


	} catch (PDOException $e) {
		echo "<div class='alert alert-danger'>Erro ao conectar no banco de dados: " . $e->getMessage()."</div>";
		exit;
	}

	$sql = "select * from configuracao limit 1";
	$consulta = $pdo->prepare($sql);
	$consulta->execute();

	$config = $consulta->fetch(PDO::FETCH_OBJ);
	$description = $config->descricao;
	
	
	
function slugify($text){

	// assume $str esteja em UTF-8
	$map = array(
		'á' => 'a',
		'à' => 'a',
		'ã' => 'a',
		'â' => 'a',
		'é' => 'e',
		'ê' => 'e',
		'í' => 'i',
		'ó' => 'o',
		'ô' => 'o',
		'õ' => 'o',
		'ú' => 'u',
		'ü' => 'u',
		'ç' => 'c',
		'Á' => 'A',
		'À' => 'A',
		'Ã' => 'A',
		'Â' => 'A',
		'É' => 'E',
		'Ê' => 'E',
		'Í' => 'I',
		'Ó' => 'O',
		'Ô' => 'O',
		'Õ' => 'O',
		'Ú' => 'U',
		'Ü' => 'U',
		'Ç' => 'C'
	);
	 
	$text = strtr($text, $map);
	

	// replace non letter or digits by -
	$text = preg_replace('~[^\pL\d]+~u', '-', $text);

	// transliterate
	$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);

	// remove unwanted characters
	$text = preg_replace('~[^-\w]+~', '', $text);

	// trim
	$text = trim($text, '-');

	// remove duplicated - symbols
	$text = preg_replace('~-+~', '-', $text);

	// lowercase
	$text = strtolower($text);

	if (empty($text)) {
	  return 'n-a';
	}

	return $text;
}


function UrlAtual(){
	$dominio= $_SERVER['HTTP_HOST'];
	$url = "http://" . $dominio. $_SERVER['REQUEST_URI'];
	return $url;
	}
