D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso
/
adm
/
app
/
gre
/
Models
/
Filename :
GreAutorizaAcolhimento.php
back
Copy
<?php namespace App\gre\Models; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of GreEditarForn * * @copyright (c) year, Carlos Marques - CM */ class GreAutorizaAcolhimento { private $Resultado; private $Dados; private $DadosId; private $DadosAco; private $substituicao = array( ' ' => '', '_' => '', '-' => '', '/' => '', '.' => '', ',' => '', '(' => '', ')' => '' ); function getResultado() { return $this->Resultado; } public function AutAcolh($DadosId) { $this->DadosId= $DadosId; var_dump($this->DadosId); $this->pega_acolhimento(); date_default_timezone_set ("America/Sao_Paulo"); $this->Dados['modified'] = date("Y-m-d H:i:s"); $this->Dados['adms_sit_id'] = 1; // var_dump($this->Dados); // die; $upAltResid = new \App\adms\Models\helper\AdmsUpdate(); $upAltResid->exeUpdate("gre_residente", $this->Dados, "WHERE id =:id", "id=" . $this->Dados['id']); if ($upAltResid->getResultado()) { $_SESSION['msg'] = "<div class='alert alert-success' role='alert'> Acolhimento 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: Acolhimento 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; } } private function pega_acolhimento() { $listarAcolh = new \App\adms\Models\helper\AdmsRead(); $listarAcolh->fullRead("select id gre_acolhimento_id, gre_alas_id, gre_tipo_acomodacao_id, gre_residente_id, gre_acomodacao_id, valor_acomodacao from gre_acolhimento where id = {$this->DadosId}"); $this->DadosAco = $listarAcolh->getResultado(); $this->Dados['id'] = $this->DadosAco[0]['gre_residente_id']; $this->Dados['gre_acolhimento_id'] = $this->DadosAco[0]['gre_acolhimento_id']; $this->Dados['gre_alas_id'] = $this->DadosAco[0]['gre_alas_id']; $this->Dados['gre_tipo_acomodacao_id'] = $this->DadosAco[0]['gre_tipo_acomodacao_id']; $this->Dados['gre_acomodacao_id'] = $this->DadosAco[0]['gre_acomodacao_id']; $this->Dados['valor_acomodacao'] = $this->DadosAco[0]['valor_acomodacao']; // var_dump($this->Dados); } }