D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso
/
adm
/
app
/
gre
/
Models
/
Filename :
GreVerAcolhimento.php
back
Copy
<?php namespace App\gre\Models; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of GreVerAcolhimento * * @copyright (c) year, Carlos Marques */ class GreVerAcolhimento { private $Resultado; private $DadosId; public function verAcolh($DadosId) { $this->DadosId = (int) $DadosId; $verAcolh = new \App\adms\Models\helper\AdmsRead(); $verAcolh->fullRead("SELECT acolh.*, resid.nome resid_nome, TIMESTAMPDIFF (YEAR, resid.data_nasc, curdate()) idade, TRUNCATE((((TIMESTAMPDIFF (DAY, resid.data_nasc, curdate())/365.25) - (TIMESTAMPDIFF (YEAR, resid.data_nasc, curdate()))) * 12), 0) idade_meses, filial.nome_fantasia filial_nome, colab.apelido colab_nome, acomo.nome acomo_nome, tipoacomo.nome tipoacomo_nome, alas.nome alas_nome, unid.nome unid_nome, sit.nome nome_sit, cr.cor cor_cr FROM gre_acolhimento acolh INNER JOIN gre_residente resid on resid.id = acolh.gre_residente_id INNER JOIN gre_unidade unid ON unid.id= acolh.gre_unidade_id INNER JOIN adms_usuarios colab ON colab.id= acolh.gre_colaborador_id INNER JOIN gre_alas alas on alas.id = acolh.gre_alas_id INNER JOIN gre_filial filial ON filial.id= acolh.gre_filial_id INNER JOIN gre_tipo_acomodacao tipoacomo ON tipoacomo.id= acolh.gre_tipo_acomodacao_id INNER JOIN gre_acomodacao acomo ON acomo.id= acolh.gre_acomodacao_id INNER JOIN adms_sits sit ON sit.id= acolh.adms_sit_id INNER JOIN adms_cors cr ON cr.id= sit.adms_cor_id WHERE acolh.id =:id LIMIT :limit", "id=".$this->DadosId."&limit=1"); $this->Resultado= $verAcolh->getResultado(); return $this->Resultado; } }