D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso_ant
/
adm
/
app
/
cpgre
/
Controllers
/
Filename :
CarregarPrescrResidJs.php
back
Copy
<?php namespace App\cpgre\Controllers; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of CarregarPrescrResidJs * * @copyright (c) year, Carlos Marques - */ class CarregarPrescrResidJs { private $Dados; private $PageId; private $TipoResultado; private $PesqResid; private $PesqFilial; public function listar($PageId = null) { $this->TipoResultado = filter_input(INPUT_GET, 'tiporesult'); $this->PageId = (int) $PageId ? $PageId : 1; $botao = ['cad_prescr_resid' => ['menu_controller' => 'cadastrar-prescricao-residente', 'menu_metodo' => 'cad-prescr-resid'], 'vis_prescr_resid' => ['menu_controller' => 'ver-prescricao-residente', 'menu_metodo' => 'ver-prescr-resid'], 'imp_prescr_resid' => ['menu_controller' => 'imprime-prescricao-residente', 'menu_metodo' => 'listar'], 'lis_prescr_resid' => ['menu_controller' => 'listar-prescricao-residente', 'menu_metodo' => 'listar'], 'vol_prescr_resid' => ['menu_controller' => 'carregar-prescr-resid-js', 'menu_metodo' => 'listar'], 'edit_prescr_resid' => ['menu_controller' => 'editar-prescr-resid', 'menu_metodo' => 'edit-prescr-resid'], 'del_prescr_resid' => ['menu_controller' => 'apagar-prescr-resid', 'menu_metodo' => 'apagar-prescr-resid']]; $listarBotao = new \App\adms\Models\AdmsBotao(); $this->Dados['botao'] = $listarBotao->valBotao($botao); if (!empty($this->TipoResultado) AND ( $this->TipoResultado == 1)) { $this->PesqResid = filter_input(INPUT_POST, 'palavraPesq'); $this->PesqFilial = filter_input(INPUT_POST, 'pesqfilial'); // echo $this->pesqPrescrResid; $this->pesqPrescrResidPriv(); } elseif (!empty($this->TipoResultado) AND ( $this->TipoResultado == 2)) { $this->PesqResid = filter_input(INPUT_POST, 'palavraPesq'); $this->PesqFilial = filter_input(INPUT_POST, 'pesqfilial'); // echo $this->pesqPrescrResid; // print_r($_POST); $this->pesqPrescrResidPriv(); } else { $listarMenu = new \App\adms\Models\AdmsMenu(); $this->Dados['menu'] = $listarMenu->itemMenu(); $listarSelect = new \App\cpgre\Models\CpGreListarPrescrResid(); $this->Dados['select'] = $listarSelect->listarCadastrar(); $carregarView = new \App\cpgre\core\ConfigView("cpgre/Views/PrescricaoResidente/carregarPrescrResidJs", $this->Dados); $carregarView->renderizar(); } } private function listarPrescrResidPriv() { $listarPrescrResid = new \App\cpgre\Models\CpGreListarPrescrResid(); $this->Dados['listPrescrResid'] = $listarPrescrResid->listarPrescrResid($this->PesqFilial,$this->PageId); $this->Dados['paginacao'] = $listarPrescrResid->getResultadoPg(); $carregarView = new \App\cpgre\core\ConfigView("cpgre/Views/PrescricaoResidente/listarPrescrResidJs", $this->Dados); $carregarView->renderizarListar(); } private function pesqPrescrResidPriv() { $listarPrescrResid = new \App\cpgre\Models\CpGrePesqPrescrResid(); $this->Dados['listPrescrResid'] = $listarPrescrResid->pesqPrescrResid($this->PesqResid, $this->PesqFilial ); $this->Dados['paginacao'] = $listarPrescrResid->getResultadoPg(); $carregarView = new \App\cpgre\core\ConfigView("cpgre/Views/PrescricaoResidente/listarPrescrResidJs", $this->Dados); $carregarView->renderizarListar(); } }