D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso_ant
/
adm
/
app
/
gre
/
Controllers
/
Filename :
CadastrarParentesco.php
back
Copy
<?php namespace App\gre\Controllers; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of CadastrarParentesco * * @copyright (c) year, Carlos Marques - CM */ class CadastrarParentesco { private $Dados; public function cadParentesco() { $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT); if (!empty($this->Dados['CadParentesco'])) { unset($this->Dados['CadParentesco']); $cadParentesco = new \App\gre\Models\GreCadastrarParentesco(); $cadParentesco->cadParentesco($this->Dados); if ($cadParentesco->getResultado()) { $UrlDestino = URLADM . 'parentesco/listar'; header("Location: $UrlDestino"); } else { $this->Dados['form'] = $this->Dados; $this->cadParentescoViewPriv(); } } else { $this->cadParentescoViewPriv(); } } private function cadParentescoViewPriv() { $listarSelect = new \App\gre\Models\GreCadastrarParentesco(); $this->Dados['select'] = $listarSelect->listarCadastrar(); $botao = ['list_parentesco' => ['menu_controller' => 'parentesco', '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 \Core\ConfigView("gre/Views/Parentesco/cadParentesco", $this->Dados); $carregarView->renderizar(); } }