D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso_ant
/
adm
/
app
/
gre
/
Controllers
/
Filename :
CadastrarIntercorrencia.php
back
Copy
<?php namespace App\gre\Controllers; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of CadastrarIntercorrencia * * @copyright (c) year, Carlos Marques - CM */ class CadastrarIntercorrencia { private $Dados; private $DadosLer; public function cadIntercor() { $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT); $this->DadosLer = filter_input_array(INPUT_GET, FILTER_DEFAULT); if (!empty($this->Dados['CadIntercor'])) { unset($this->Dados['CadIntercor']); // var_dump($this->Dados); // die; $cadIntercor = new \App\gre\Models\GreCadastrarIntercorrencia(); $cadIntercor->cadIntercor($this->Dados); if ($cadIntercor->getResultado()) { $UrlDestino = URLADM . 'cadastrar-intercorrencia/cad-intercor/?id='.$this->Dados['gre_residente_id']; header("Location: $UrlDestino"); } else { $this->Dados['form'] = $this->Dados; $this->cadIntercorViewPriv(); } } else { $this->cadIntercorViewPriv(); } } private function cadIntercorViewPriv() { $listarSelect = new \App\gre\Models\GreCadastrarIntercorrencia(); $this->Dados['select'] = $listarSelect->listarCadastrar(); $botao = ['list_intercor' => ['menu_controller' => 'listar-intercorrencia', 'menu_metodo' => 'listar'], 'vol_intercor' => ['menu_controller' => 'carregar-intercorrencia-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/Intercorrencia/cadIntercorrencia", $this->Dados); $carregarView->renderizarGre(); } }