<?php

class core extends Core_connect   {
			
function __construct($Cache = null) {
	    !session_start();
		$this->metodo_pag_include();
		$this->create_define_pag();
}

public function metodo_pag_include() {
	
define("url", filter_input(INPUT_GET, "url"));
		   
} 
	
public function create_define_pag(){
	
$pag = url;

$r  = explode("/",$pag);
$rs = $r[count($r) -  1];
$like = "%$pag";

$this->ExeRead(" * ", "pd_paginas", "WHERE pag_slug LIKE '$like'", "pag_slug LIKE {$like}");

if ($this->getResult()):

foreach ($this->getResult() as $rest):

return define("pag_title", $rest['pag_title']) . define("pag_description", $rest['pag_description']) . define("pag_author", $rest['pag_author']) . define("pag_link", $rest['pag_link']) . define('pag_id', $rs);
endforeach;

else:

$pag = "404";
$this->ExeRead(" * ", "pd_paginas", "WHERE pag_slug = '$pag'", "pag_slug={$pag}");
	
if ($this->getResult()):

foreach ($this->getResult() as $rest):
return define("pag_title", $rest['pag_title']) . define("pag_description", $rest['pag_description']) . define("pag_author", $rest['pag_author']) . define("pag_link", $rest['pag_link']) . define('pag_id', $pag);
endforeach;

else:

WSErro('O site pode estar nesse momento em manutenção!', WS_INFOR);
return define("pag_title", "O site pode estar nesse momento em manutenção!") . define("pag_description", "") . define("pag_author", "") . define("pag_link", "") . define('pag_id', "");
	
endif;
endif;

}	
	
}
	
?>