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