예제 #1
0
$from_record_num = $records_per_page * $page - $records_per_page;
//Inclui funções e parâmetros essenciais para a página.
include_once 'include/config.php';
include_once 'include/evento.php';
include_once 'include/ambiente.php';
include_once 'include/categoria.php';
//Instância do banco de dados.
$database = new Config();
$db = $database->getConnection();
//Instância das funções do módulo atual.
$evento = new Evento($db);
$ambiente = new Ambiente($db);
$categoria = new TipoCategoria($db, 'evento');
//Condicional para exibir todos os registros com e sem a pesquisa.
if ($_POST) {
    $stmt = $evento->searchAll($page, $from_record_num, $records_per_page, $_GET['ordem'], $_POST['pesquisa']);
    $num = $evento->countSearchAll($_POST['pesquisa']);
} else {
    $stmt = $evento->readAll($page, $from_record_num, $records_per_page, $_GET['ordem']);
    $num = $evento->countAll();
}
//Atalho da página raíz do módulo.
$url = 'eventos.php?ordem=1';
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->
        <title>Área Restrita - Eventos</title>
        <meta name="keywords" content="" />