D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso
/
adm
/
app
/
gre
/
Models
/
Filename :
GreListarPedClinica.php
back
Copy
<?php namespace App\gre\Models; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of GreListarNecCompra * * @copyright (c) year, Carlos Marques - CM */ class GreListarPedClinica { private $Resultado; private $Dados; private $data; public function listPedClin() { $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT); $this->data = $this->Dados['data']; $lerLanc = new \App\adms\Models\helper\AdmsRead(); if ($this->Dados['gre_status_fat_id']== 0){ $lerLanc->fullRead("SELECT ped.*, prod.id prod_id, prod.dv prod_dv, prod.nome prod_nome, forn.nome_fantasia forn_nome, filial.nome_fantasia filial_nome, ped.gre_status_fat_id, stat.nome nome_sit, cr.cor cor_cr FROM gre_pedido ped join gre_produto prod on prod.id = ped.gre_produto_id join gre_prod_departamento depto on depto.id = prod.gre_departamento_id join gre_fornecedores forn on forn.id = ped.gre_fornecedor_id join gre_filial filial on filial.id = ped.gre_filial_id INNER JOIN gre_status_fat stat ON stat.id=ped.gre_status_fat_id INNER JOIN adms_cors cr ON cr.id=stat.adms_cor_id where ped.gre_empr_princ_id = :id_user and ped.gre_filial_id = :filial_id and ped.data = :data order by forn.id, prod.gre_departamento_id, prod.nome", "id_user={$_SESSION['id_user']}&filial_id={$this->Dados['gre_filial_id']}&data={$this->Dados['data']}"); }else{ $lerLanc->fullRead("SELECT ped.*, prod.id prod_id, prod.dv prod_dv, prod.nome prod_nome, forn.nome_fantasia forn_nome, filial.nome_fantasia filial_nome, ped.gre_status_fat_id, stat.nome nome_sit, cr.cor cor_cr FROM gre_pedido ped join gre_produto prod on prod.id = ped.gre_produto_id join gre_prod_departamento depto on depto.id = prod.gre_departamento_id join gre_fornecedores forn on forn.id = ped.gre_fornecedor_id join gre_filial filial on filial.id = ped.gre_filial_id INNER JOIN gre_status_fat stat ON stat.id=ped.gre_status_fat_id INNER JOIN adms_cors cr ON cr.id=stat.adms_cor_id where ped.gre_empr_princ_id = :id_user and ped.gre_filial_id = :filial_id and ped.data = :data and ped.gre_status_fat_id =:stat order by forn.id, prod.gre_departamento_id, prod.nome", "id_user={$_SESSION['id_user']}&filial_id={$this->Dados['gre_filial_id']}&data={$this->Dados['data']}&stat={$this->Dados['gre_status_fat_id']}"); } $this->Resultado= $lerLanc->getResultado(); return $this->Resultado; } }