D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
novonote_ant
/
adm
/
app
/
gre
/
Controllers
/
Filename :
OrcamentoCadastrar.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($_SESSION['form']); //var_dump( $this->Dados); // die; if (isset($this->Dados['Limpar'])){ unset($_SESSION['form']); unset($_SESSION['numero']); unset($this->Dados['Limpar']); $this->cadOrcamentoViewPriv(); }else{ if (!empty($this->Dados['acao'])){ if(isset($_SESSION['form'])) { $this->Dados['nome_cliente'] = $_SESSION['form']['nome_cliente']; $this->Dados['contato'] = $_SESSION['form']['contato']; $this->Dados['celular'] = $_SESSION['form']['celular']; $this->Dados['email'] = $_SESSION['form']['email']; } unset($_SESSION['acao']); $cadOrcamento = new \App\gre\Models\Orcamento\ModCadastrarOrcamento(); $cadOrcamento->cadOrcamento($this->Dados); $this->cadOrcamentoViewPriv(); }else{ unset($_SESSION['numero']); $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(); } }