D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso_ant
/
adm
/
app
/
gre
/
Models
/
Filename :
GreListarAbremMes.php
back
Copy
<?php namespace App\gre\Models; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of GreListarAbremMes * * @copyright (c) year, Carlos Marques - CM */ class GreListarAbremMes { private $Dados; private $Resultado; private $PageId; public function listarAbrem($PageId = null, $Dados = null) { $this->Dados = $Dados; $listAbrem = new \App\adms\Models\helper\AdmsRead(); $listAbrem->fullRead("SELECT fat.docto id, resid.id resid_id, resid.nome resid_nome, fat.anomes anomesi, date_format(fat.anomes, '%d/%m/%Y') anomes, filial.nome_fantasia filial_nome, stat.nome nome_stat, cr.cor cor_cr FROM gre_cab_fatura fat join gre_filial filial on filial.id = fat.gre_filial_id join gre_residente resid on resid.id = fat.gre_residente_id INNER JOIN gre_status_fat stat ON stat.id= fat.gre_status_fat_id INNER JOIN adms_cors cr ON cr.id=stat.adms_cor_id WHERE fat.gre_filial_id = :gre_filial_id AND fat.gre_empr_princ_id = :id_user and fat.tipo_fechamento = 'M' and fat.gre_status_fat_id = 4 ORDER BY fat.docto", "gre_filial_id={$this->Dados['gre_filial_id']}&id_user={$_SESSION['id_user']}"); $this->Resultado = $listAbrem->getResultado(); //var_dump($this->Resultado); return $this->Resultado; } public function listarCadastrar() { $listar = new \App\adms\Models\helper\AdmsRead(); $listar->fullRead("SELECT fat.gre_filial_id filial_id, max(filial.nome_fantasia) filial_nome, max(e.tipo_fechamento) tipo_fechamento FROM gre_cab_fatura fat join gre_filial filial on filial.id = fat.gre_filial_id inner join gre_empresa e on e.id = fat.gre_empr_princ_id WHERE fat.gre_empr_princ_id =". $_SESSION['id_user'] . " and fat.tipo_fechamento = 'M' group by fat.gre_filial_id, filial.nome_fantasia order by filial.nome_fantasia"); $registro['filial'] = $listar->getResultado(); $listar->fullRead("SELECT id id_stat, nome nome_stat FROM gre_status_fat order by ordem"); $registro['stat'] = $listar->getResultado(); $this->Resultado = ['filial' => $registro['filial'], 'stat' => $registro['stat']]; return $this->Resultado; } }