D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
rosario
/
adm
/
app
/
gre
/
Models
/
Cotacao
/
Filename :
ModCtCotacaoNegociarDescartar.php
back
Copy
<?php namespace App\gre\Models\Cotacao; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of GrsApagarEmpr * * @copyright (c) year, Carlos Marques - CM */ class ModCtCotacaoNegociarDescartar { private $DadosId; private $Resultado; private $Dados; function getResultado() { return $this->Resultado; } public function altDescartar($DadosId = null) { $this->DadosId = filter_input_array(INPUT_GET, FILTER_DEFAULT); // echo '<pre>'; // var_dump($this->DadosId); // echo '</pre>'; // die; if($this->DadosId['opcao'] == 'D'){ $status_id= 11; $data_cota = "'".$this->DadosId['data']."'"; $repres_id= $this->DadosId['repres_id']; $sugestao_id= $this->DadosId['sugestao_id']; $GravaStatus= new \App\adms\Models\helper\AdmsProcedure4; $GravaStatus->exeProcedure("ct_atualiza_status", $data_cota, $status_id, $sugestao_id, $repres_id); // $upAltCab = new \App\adms\Models\helper\AdmsUpdate(); // $upAltCab->exeUpdate("ct_cab_pedido", $this->Dados, "WHERE status_id = 6 and data =:data and repres_id = :repres_id", "data=" . $this->DadosId['data']. "&repres_id=" . $this->DadosId['repres_id']); // $upAltPed = new \App\adms\Models\helper\AdmsUpdate(); // $upAltPed->exeUpdate("ct_pedido", $this->Dados, "WHERE status_id = 6 and data_cotacao =:data and repres_id = :repres_id", "data=" . $this->DadosId['data']. "&repres_id=" . $this->DadosId['repres_id']); if ($GravaStatus->getResultado()) { $_SESSION['msg'] = "<div class='alert alert-info' role='alert'> Negociação Descartada 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: Negociação Não Descartada! <button type='button' class='close' data-dismiss='alert' aria-label='Close'> <span aria-hidden='true'>×</span></button> </div>"; $this->Resultado = false; } } if($this->DadosId['opcao'] == 'A'){ $status_id= 4; $data_cota = "'".$this->DadosId['data']."'"; $repres_id= $this->DadosId['repres_id']; $sugestao_id= $this->DadosId['sugestao_id']; $GravaStatus= new \App\adms\Models\helper\AdmsProcedure4; $GravaStatus->exeProcedure("ct_atualiza_status", $data_cota, $status_id, $sugestao_id, $repres_id); if ($GravaStatus->getResultado()) { $_SESSION['msg'] = "<div class='alert alert-info' role='alert'> Negociação Reativada 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: Negociação Não foi Reativada! <button type='button' class='close' data-dismiss='alert' aria-label='Close'> <span aria-hidden='true'>×</span></button> </div>"; $this->Resultado = false; } } } }