D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
crsys_ant
/
adm
/
app
/
gre
/
Controllers
/
Filename :
AmbienteCadastrar.php
back
Copy
<?php namespace App\gre\Controllers; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of CadastrarAmbiente * */ class AmbienteCadastrar { private $Dados; public function cadAmbiente() { $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT); if (!empty($this->Dados['CadAmbiente'])) { unset($this->Dados['CadAmbiente']); $cadAmbiente = new \App\gre\Models\Ambiente\ModCadastrarAmbiente(); $cadAmbiente->cadAmbiente($this->Dados); if ($cadAmbiente->getResultado()) { $UrlDestino = URLADM . 'ambiente/listar'; header("Location: $UrlDestino"); } else { $this->Dados['form'] = $this->Dados; $this->cadambienteViewPriv(); } } else { $this->cadAmbienteViewPriv(); } } private function cadAmbienteViewPriv() { $botao = ['lis_ambiente' => ['menu_controller' => 'ambiente', '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/Ambiente/VieCadastrarAmbiente", $this->Dados); $carregarView->renderizar(); } }