D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso
/
adm
/
app
/
cpgre
/
Controllers
/
Filename :
CarregarCboJs.php
back
Copy
<?php namespace App\cpgre\Controllers; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of CpGreListarCbo * * @copyright (c) year, Carlos Marques - */ class CarregarCboJs { private $Dados; private $PageId; private $TipoResultado; private $PesqCbo; public function listar($PageId = null) { $this->TipoResultado = filter_input(INPUT_GET, 'tiporesult'); $this->PageId = (int) $PageId ? $PageId : 1; $botao = ['cad_cbo' => ['menu_controller' => 'cadastrar-cbo', 'menu_metodo' => 'cad-cad-cbo'], 'vis_cbo' => ['menu_controller' => 'ver-cd-dez-modal', 'menu_metodo' => 'ver-cbo'], 'edit_cbo' => ['menu_controller' => 'editar-cbo', 'menu_metodo' => 'edit-cbo'], 'del_cbo' => ['menu_controller' => 'apagar-cbo', 'menu_metodo' => 'apagar-cbo']]; $listarBotao = new \App\adms\Models\AdmsBotao(); $this->Dados['botao'] = $listarBotao->valBotao($botao); if (!empty($this->TipoResultado) AND ( $this->TipoResultado == 1)) { $this->listarCboPriv(); } elseif (!empty($this->TipoResultado) AND ( $this->TipoResultado == 2)) { $this->PesqCbo = filter_input(INPUT_POST, 'palavraPesq'); // echo $this->pesqCbo; $this->pesqCboPriv(); } else { $listarMenu = new \App\adms\Models\AdmsMenu(); $this->Dados['menu'] = $listarMenu->itemMenu(); $carregarView = new \App\cpgre\core\ConfigView("cpgre/Views/CBO/carregarCboJs", $this->Dados); $carregarView->renderizar(); } } private function listarCboPriv() { $listarCbo = new \App\cpgre\Models\CpGreListarCbo(); $this->Dados['listCbo'] = $listarCbo->listarCbo($this->PageId); $this->Dados['paginacao'] = $listarCbo->getResultadoPg(); $carregarView = new \App\cpgre\core\ConfigView("cpgre/Views/CBO/listarCboJs", $this->Dados); $carregarView->renderizarListar(); } private function pesqCboPriv() { $listarCbo = new \App\cpgre\Models\CpGrePesqCbo(); $this->Dados['listCbo'] = $listarCbo->pesqCbo($this->PesqCbo); $this->Dados['paginacao'] = $listarCbo->getResultadoPg(); $carregarView = new \App\cpgre\core\ConfigView("cpgre/Views/CBO/listarCboJs", $this->Dados); $carregarView->renderizarListar(); } }