Example #1
0
// SE NÃO HOUVER SESSAO ORGAO - EXIT / INDEX.PHP
if (empty($_SESSION['orgao'])) {
    header('Location: ../index.php?un=clean');
    exit;
}
include ROOT . DS . 'config/Config.php';
include ROOT . DS . 'src/Controle.php';
include ROOT . DS . 'src/Servidor.php';
// include ROOT.DS.'src/Usuarios.php';
$log = new Servidor(new Config());
$log->protege();
// Montagem do Menu do Painel
$menuAdm = new Controle(new Config());
$arrMenuAdm = ['Contra-Cheque' => '?page=contracheque', 'Sair' => 'logout.php'];
// $arrMenuAdm = [ 'Painel'=>'?page=painel','Contra-Cheque'=>'?page=contracheque','Sair'=>'logout.php'];
$menuAdmin = $menuAdm->getMenu($arrMenuAdm);
// recebe a pagina que vai ser exibida, caso não venha utiliza uma padrão
$getPages = isset($_GET['page']) ? $_GET['page'] : 'contracheque';
$strAction = $getPages == 'usuarios' ? 'list' : 'painel';
$arrPages = ['contracheque', 'servidor'];
if (in_array($getPages, $arrPages)) {
    $strPage = ucfirst($getPages) . '.php';
    // Classe com metodos
    include ROOT . DS . 'src' . DS . $strPage;
    // Arquivo com função de Leitura dos dados - LIST
    // echo $getPages;die;
    include ROOT . DS . 'admin' . DS . $getPages . '.php';
    $strAction = 'list';
}
$getAction = isset($_GET['action']) ? $_GET['action'] : $strAction;
switch ($getAction) {