D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
rosario
/
adm
/
app
/
gre
/
Controllers
/
Filename :
ConPsaudeCadastrar.php
back
Copy
<?php namespace App\gre\Controllers; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of ConPsaudeCadastrar * * @copyright (c) year, Carlos Marques - CM */ class ConPsaudeCadastrar { private $Dados; public function cadPsaude() { $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT); if (!empty($this->Dados['CadPsaude'])) { unset($this->Dados['CadPsaude']); $cadPsaude= new \App\gre\Models\ModPsaudeCadastrar(); $cadPsaude->cadPsaude($this->Dados); if ($cadPsaude->getResultado()) { $UrlDestino = URLADM . 'con-psaude/listar'; header("Location: $UrlDestino"); } else { $this->Dados['form'] = $this->Dados; $this->cadPsaudeViewPriv(); } } else { $this->cadPsaudeViewPriv(); } } private function cadPsaudeViewPriv() { $listarSelect = new \App\gre\Models\ModPsaudeCadastrar(); $this->Dados['select'] = $listarSelect->listarCadastrar(); $botao = ['list_psaude' => ['menu_controller' => 'con-psaude', '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/ProgramaSaude/ViePsaudeCadastrar", $this->Dados); $carregarView->renderizarGre(); } }