D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso
/
adm
/
app
/
gre
/
Models
/
Filename :
GreEntrarPedido.php
back
Copy
<?php namespace App\gre\Models; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of GrsFecharPedido * * @copyright (c) year, Carlos Marques - CM */ class GreEntrarPedido { private $DadosId; private $Resultado; private $Dados; private $DadosTbl; function getResultado() { return $this->Resultado; } public function fecPed(array $DadosId) { $this->DadosTbl= $DadosId; $this->DadosId['filial_id'] = $this->DadosTbl['tbl'][0]['gre_filial_id']; $this->DadosId['data'] = $this->DadosTbl['tbl'][0]['data']; $this->DadosId['depto'] = $this->DadosTbl['tbl'][0]['gre_prod_departamento_id']; $this->Dados['modified'] = date("Y-m-d H:i:s"); $this->Dados['gre_status_fat_id'] = 7; var_dump($this->DadosId); var_dump($this->Dados); $upAltPedido = new \App\adms\Models\helper\AdmsUpdate(); $upAltPedido->exeUpdate("gre_pedido", $this->Dados, "WHERE gre_empr_princ_id = {$_SESSION['id_user']} and gre_filial_id = {$this->DadosId['filial_id']} and data = '{$this->DadosId['data']}' and gre_departamento_id = {$this->DadosId['depto']}"); if ($upAltPedido->getResultado()) { $_SESSION['msg'] = "<div class='alert alert-success' role='alert'> Pedido atualizado com sucesso! <button type='button' class='close' data-dismiss='alert' aria-label='Close'> <span aria-hidden='true'>×</span></button> </div>"; $this->Resultado = true; } else { $_SESSION['msg'] = "<div class='alert alert-danger' role='alert'> Erro: Pedido não foi atualizado! <button type='button' class='close' data-dismiss='alert' aria-label='Close'> <span aria-hidden='true'>×</span></button> </div>"; $this->Resultado = false; } } }