D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso_ant
/
adm
/
app
/
gre
/
Controllers
/
Filename :
CadastrarEstoqueResidente.php
back
Copy
<?php namespace App\gre\Controllers; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of CadastrarEstoqueResidente * * @copyright (c) year, Carlos Marques - CM */ class CadastrarEstoqueResidente { private $Dados; private $DadosGet; public function cadEstResid() { $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT); $this->DadosGet = filter_input_array(INPUT_GET, FILTER_DEFAULT); if (!empty($this->Dados['CadEstResid'])) { unset($this->Dados['CadEstResid']); $cadEstResid = new \App\gre\Models\GreCadastrarEstoqueResidente(); $cadEstResid->cadEstResid($this->Dados); if ($cadEstResid->getResultado()) { $UrlDestino = URLADM . 'cadastrar-estoque-residente/cad-est-resid/?id='.$this->Dados['gre_residente_id']; header("Location: $UrlDestino"); } else { $this->Dados['form'] = $this->Dados; $this->cadEstResidViewPriv(); } } else { $this->cadEstResidViewPriv(); } } private function cadEstResidViewPriv() { $listarSelect = new \App\gre\Models\GreCadastrarEstoqueResidente(); $this->Dados['select'] = $listarSelect->listarCadastrar($this->DadosGet['id']); $botao = ['lis_est_resid' => ['menu_controller' => 'carregar-prod-est-js', 'menu_metodo' => 'listar'], 'vol_est_resid' => ['menu_controller' => 'carregar-prod-est-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/LancamentoResidente/cadEstoqueResidente", $this->Dados); $carregarView->renderizarGre(); } }