D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso
/
adm
/
app
/
gre
/
Models
/
Filename :
GreSelecionarCliniListEstLanc.php
back
Copy
<?php namespace App\gre\Models; if (!defined('URL')) { header("Location: /"); exit();} /** * Description of GreCadastrarEstoqueResidente * * @copyright (c) year,Carlos Marques CM */ class GreSelecionarCliniListEstLanc{ private $Resultado; private $Dados; private $ResidId; private $idResidLanc; private $idUser; private $UltimoResidLanc; private $substituicao = array( ' ' => '', '_' => '', '-' => '', '/' => '', '.' => '', ',' => '.', '(' => '', ')' => ''); function getResultado() { return $this->Resultado; } public function listarCadastrar() { $listar = new \App\adms\Models\helper\AdmsRead(); if($_SESSION['filial']== 0) { $listar->fullRead("SELECT prod.* FROM gre_produto prod join gre_estoque_clinica est on est.gre_produto_id = prod.id where est.gre_empr_princ_id= " . $_SESSION['id_user'] . " group by prod.id order by prod.nome"); $registro['produtos'] = $listar->getResultado(); $listar->fullRead("SELECT filial.id filial_id, filial.nome_fantasia filial_nome FROM gre_filial filial where filial.gre_empr_princ_id = " . $_SESSION['id_user']); $registro['filial'] = $listar->getResultado(); }else{ $listar->fullRead("SELECT prod.* FROM gre_produto prod join gre_estoque_clinica est on est.gre_produto_id = prod.id where est.gre_empr_princ_id= " . $_SESSION['id_user'] . " AND est.gre_filial_id = " . $_SESSION['filial'] . " order by prod.nome"); $registro['produtos'] = $listar->getResultado(); $listar->fullRead("SELECT filial.id filial_id, filial.nome_fantasia filial_nome FROM gre_filial filial where filial.gre_empr_princ_id = " . $_SESSION['id_user'] . " AND filial.id = " . $_SESSION['filial']); $registro['filial'] = $listar->getResultado(); } $this->Resultado = [ 'produtos' => $registro['produtos'], 'filial' => $registro['filial']]; return $this->Resultado; } }