D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
crsys
/
adm
/
app
/
gre
/
Controllers
/
Filename :
Orcamento.php
back
Copy
<?php namespace App\gre\Controllers; if (!defined('URL')) { header("Location: /"); exit(); } class Orcamento { private $Dados; public function listar($PageId = null) { $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT); // var_dump($this->Dados ); // die; if(isset($this->Dados['grava_cabecalho'])) { foreach ($this->Dados as $key => $value) { if (strpos($key, 'cab_') === 0) { unset($this->Dados[$key]); } } foreach ($this->Dados as $key => $value) { if (strpos($key, 'neg_') === 0) { unset($this->Dados[$key]); } } foreach ($this->Dados as $key => $value) { if (strpos($key, 'res_') === 0) { unset($this->Dados[$key]); } } foreach ($this->Dados as $key => $value) { if (strpos($key, 'ind_') === 0) { unset($this->Dados[$key]); } } foreach ($this->Dados as $chave => $valor) { if (strpos($chave, 'item_') === 0) { $novaChave = substr($chave, 4); $this->Dados[$novaChave] = $valor; unset($this->Dados[$chave]); } } foreach ($this->Dados as $key => $value) { if (strpos($key, 'vlr_') === 0) { unset($this->Dados[$key]); } } unset($this->Dados['grava_cabecalho']); unset($this->Dados['id']); $_SESSION['form_data'] = $_POST; // var_dump($_SESSION['form_data']); $cadOrcamento = new \App\gre\Models\Orcamento\ModCadastrarOrcamento(); $cadOrcamento->cadOrcamento($this->Dados); } // var_dump($this->Dados); //die; $listarOrcamento = new \App\gre\Models\Orcamento\ModListarOrcamento(); $this->Dados['select'] = $listarOrcamento->listarCadastrar(); $carregarView = new \Core\ConfigView("gre/Views/Orcamento/VieOrcamento", $this->Dados); $carregarView->renderizar(); } }