D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso
/
adm
/
app
/
gre
/
Models
/
Filename :
GreListarReaju.php
back
Copy
<?php namespace App\gre\Models; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of GreListarReaju * * @copyright (c) year, Carlos Marques - CM */ class GreListarReaju { private $Dados; private $Resultado; private $PageId; private $mes; private $ResultadoPg; function getResultadoPg() { return $this->ResultadoPg; } public function listarReaju($PageId = null, $Dados = null) { $this->PageId = (int) $PageId; $this->Dados = $Dados; $listarSelect = new \App\gre\Models\GreListarReaju(); $listarReaju = new \App\adms\Models\helper\AdmsRead(); if ($this->Dados['gre_filial_id'] <> 0) { $listarReaju->fullRead("select fili.nome_fantasia fili_nome, resid.id resid_id, resid.nome resid_nome, date_format(resid.data_acolhimento, '%d/%m') data_base, date_format(resid.ultimo_reajuste, '%d/%m/%Y') ultimo_reajuste from gre_residente resid inner join gre_filial fili on fili.id = resid.gre_filial_id and fili.gre_empr_princ_id = resid.gre_empr_princ_id where resid.gre_filial_id = :gre_filial_id AND resid.gre_empr_princ_id = :id_user and date_format(data_acolhimento, '%m') = :mes and resid.adms_sit_id = 1 ORDER BY fili.id ", "gre_filial_id={$this->Dados['gre_filial_id']}&mes={$this->Dados['mes']}&id_user={$_SESSION['id_user']}"); }else{ $listarReaju->fullRead("select fili.nome_fantasia fili_nome, resid.id resid_id, resid.nome resid_nome, date_format(resid.data_acolhimento, '%d/%m') data_base, date_format(resid.ultimo_reajuste, '%d/%m/%Y') ultimo_reajuste from gre_residente resid inner join gre_filial fili on fili.id = resid.gre_filial_id and fili.gre_empr_princ_id = resid.gre_empr_princ_id where resid.gre_empr_princ_id = :id_user and date_format(data_acolhimento, '%m') = :mes and resid.adms_sit_id = 1 ORDER BY fili.id ", "mes={$this->Dados['mes']}&id_user={$_SESSION['id_user']}"); } $this->Resultado = $listarReaju->getResultado(); return $this->Resultado; } public function listarCadastrar() { $listar = new \App\adms\Models\helper\AdmsRead(); if( $_SESSION['filial']==0){ $listar->fullRead("SELECT filial.id id_filial, filial.nome_fantasia nome_filial FROM gre_filial filial where filial.gre_empr_princ_id =". $_SESSION['id_user'] . " ORDER BY filial.id"); }else{ $listar->fullRead("SELECT filial.id id_filial, filial.nome_fantasia nome_filial FROM gre_filial filial where filial.gre_empr_princ_id =". $_SESSION['id_user'] . " AND filial.id = ". $_SESSION['filial']); } $registro['filial'] = $listar->getResultado(); $this->Resultado = ['filial' => $registro['filial']]; return $this->Resultado; } }