D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
crsys_ant
/
adm
/
app
/
gre
/
Controllers
/
Filename :
OS.php
back
Copy
<?php namespace App\gre\Controllers; if (!defined('URL')) { header("Location: /"); exit(); } class OS { 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']); $cadOS = new \App\gre\Models\OS\ModCadastrarOS(); $cadOS->cadOS($this->Dados); } // var_dump($this->Dados); //die; $listarOS = new \App\gre\Models\OS\ModListarOS(); $this->Dados['select'] = $listarOS->listarCadastrar(); $carregarView = new \Core\ConfigView("gre/Views/OS/VieOS", $this->Dados); $carregarView->renderizar(); } }