D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
crsys_ant
/
adm
/
app
/
gre
/
Models
/
Beneficiamento
/
Filename :
ModInativarBeneficiamento.php
back
Copy
<?php namespace App\gre\Models\Beneficiamento; if (!defined('URL')) { header("Location: /"); exit(); } class ModInativarBeneficiamento { private $DadosId; private $Resultado; function getResultado() { return $this->Resultado; } public function inatBeneficiamento($DadosId = null) { $this->DadosId = $DadosId; if($this->DadosId['opcao'] == 'I') { $this->Dados['gre_sit_id'] = 2; }else{ $this->Dados['gre_sit_id'] = 1; } date_default_timezone_set ("America/Sao_Paulo"); $this->Dados['modified'] = date("Y-m-d H:i:s"); $this->Dados['usu_modified'] = $_SESSION['usuario_id']; $upAltCargo = new \App\adms\Models\helper\AdmsUpdate(); $upAltCargo->exeUpdate("gre_beneficiamentos", $this->Dados, "WHERE id =:id", "id=" . $this->DadosId['id']); if ($upAltCargo->getResultado()) { if($this->DadosId['opcao'] == 'I') { $_SESSION['msg'] = "<div class='alert alert-success alert-dismissible fade show' role='alert'> Beneficiamento inativado com sucesso! <button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close'> </button> </div>"; }else{ $_SESSION['msg'] = "<div class='alert alert-success alert-dismissible fade show' role='alert'> Beneficiamento Ativado com sucesso! <button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close'> </button> </div>"; } $this->Resultado = true; } else { if($this->DadosId['opcao'] == 'I') { $_SESSION['msg'] = "<div class='alert alert-success alert-dismissible fade show' role='alert'> Erro: Beneficiamento não foi inativado! <button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close'> </button> </div>"; $this->Resultado = false; }else{ $_SESSION['msg'] = "<div class='alert alert-success alert-dismissible fade show' role='alert'> Erro: Beneficiamento não foi ativado! <button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close'> </button> </div>"; } } } }