D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
novonote
/
adm
/
app
/
gre
/
Controllers
/
Filename :
OrcamentoCadastrar_1.php
back
Copy
<?php namespace App\gre\Controllers; if (!defined('URL')) { header("Location: /"); exit(); } class OrcamentoCadastrar { private $Dados; private $Encerrou; private $DadosCab; public function cadOrcamento() { $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT); // var_dump($this->Dados); if (!empty($this->Dados['CadOrcamento']) XOR !empty($this->Dados['Encerra'])) { if(!empty($this->Dados['CadOrcamento'])) { $this->Encerrou = 'N'; }else{ unset($_SESSION['form']); $this->Encerrou = 'S'; } unset($this->Dados['CadOrcamento']); unset($this->Dados['Encerra']); $cadOrcamento = new \App\gre\Models\Orcamento\ModCadastrarOrcamento(); $cadOrcamento->cadOrcamento($this->Dados); // var_dump($this->Encerrou); // die; if ($cadOrcamento->getResultado()) { if($this->Encerrou == 'S') { unset($this->Dados['CadOrcamento']); $UrlDestino = URLADM . 'orcamento/listar'; header("Location: $UrlDestino"); }else{ $this->Dados['form'] = $cadOrcamento->getResultado(); $this->cadOrcamentoViewPriv(); } } else { $this->DadosCab['form'] = $this->Dados; $this->cadOrcamentoViewPriv(); } } else { unset($_SESSION['form']); $this->cadOrcamentoViewPriv(); } } private function cadOrcamentoViewPriv() { $listarSelect = new \App\gre\Models\Orcamento\ModCadastrarOrcamento(); $this->Dados['select'] = $listarSelect->listarCadastrar(); $botao = ['lis_orcamento' => ['menu_controller' => 'orcamento', 'menu_metodo' => 'listar'], 'vis_orcamento' => ['menu_controller' => 'orcamento-ver', 'menu_metodo' => 'ver-orcamento'], 'edit_orcamento' => ['menu_controller' => 'orcamento-editar', 'menu_metodo' => 'edit-orcamento'], 'ordem_produto' => ['menu_controller' => 'produto-alt-ordem', 'menu_metodo' => 'alt-ordem-produto'], 'apaga_orcamento' => ['menu_controller' => 'orcamento_apagar', 'menu_metodo' => 'apagar-orcamento']]; $listarBotao = new \App\adms\Models\AdmsBotao(); $this->Dados['botao'] = $listarBotao->valBotao($botao); $listarBotao = new \App\adms\Models\AdmsBotao(); $this->Dados['botao'] = $listarBotao->valBotao($botao); $listarMenu = new \App\adms\Models\AdmsMenu(); $this->Dados['menu'] = $listarMenu->itemMenu(); // var_dump($this->Dados['form']); // die; $carregarView = new \Core\ConfigView("gre/Views/Orcamento/VieCadastrarOrcamento", $this->Dados); $carregarView->renderizar(); } }