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