D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso_ant
/
adm
/
app
/
gre
/
Controllers
/
Filename :
CadastrarPrescricaoResidente.php
back
Copy
<?php namespace App\gre\Controllers; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of CadastrarPrescricaoResidente * * @copyright (c) year, Carlos Marques - CM */ class CadastrarPrescricaoResidente { private $Dados; private $DadosGuarda; private $DadosGet; public function cadPrescrResid() { $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT); $this->DadosGet = filter_input_array(INPUT_GET, FILTER_DEFAULT); if (!empty($this->Dados['CadPrescrResid'])) { unset($this->Dados['CadPrescrResid']); $cadPrescrResid = new \App\gre\Models\GreCadastrarPrescricaoResidente(); $cadPrescrResid->cadPrescrResid($this->Dados); $this->DadosGuarda = $this->Dados; if ($cadPrescrResid->getResultado()) { $UrlDestino = URLADM . 'cadastrar-prescricao-residente/cad-prescr-resid/?id='.$this->Dados['gre_residente_id']; header("Location: $UrlDestino"); } else { $this->Dados['form'] = $this->Dados; $this->cadPrescrResidViewPriv(); } } else { $this->cadPrescrResidViewPriv(); } } private function cadPrescrResidViewPriv() { $listarSelect = new \App\gre\Models\GreCadastrarPrescricaoResidente(); $this->Dados['select'] = $listarSelect->listarCadastrar($this->DadosGet['id']); $botao = ['list_prescr_resid' => ['menu_controller' => 'listar-prescricao-residente', 'menu_metodo' => 'listar'], 'vol_prescr_resid' => ['menu_controller' => 'carregar-prescr-resid-js', 'menu_metodo' => 'listar']]; $listarBotao = new \App\adms\Models\AdmsBotao(); $this->Dados['botao'] = $listarBotao->valBotao($botao); $listarMenu = new \App\adms\Models\AdmsMenu(); $this->Dados['menu'] = $listarMenu->itemMenu(); $carregarView = new \App\gre\core\ConfigView("gre/Views/PrescricaoResidente/cadPrescricaoResidente", $this->Dados); $carregarView->renderizarGre(); } }