D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso
/
adm
/
app
/
gre
/
Models
/
Filename :
GreEditarEmailIntercorrencia.php
back
Copy
<?php namespace App\gre\Models; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of GreEditarEmailIntercorrencia * * @copyright (c) year, Carlos Marques - CM */ class GreEditarEmailIntercorrencia { private $Resultado; private $Dados; private $DadosId; function getResultado() { return $this->Resultado; } public function verEmailIntercor($DadosId) { $this->DadosId = (int) $DadosId; $verEmailIntercor = new \App\adms\Models\helper\AdmsRead(); $verEmailIntercor->fullRead("Select intercor.*, resid.apelido resid_nome, contr.nome contr_nome, contr.email contr_email FROM gre_intercorrencia intercor join gre_residente resid on resid.id = intercor.gre_residente_id join gre_contratante contr on contr.id = intercor.gre_contratante_id WHERE intercor.id = :id LIMIT :limit", "id=" . $this->DadosId . "&limit=1"); $this->Resultado = $verEmailIntercor->getResultado(); return $this->Resultado; } public function altEmailIntercor(array $Dados) { $this->Dados = $Dados; $this->Dados['modified'] = date("Y-m-d H:i:s"); $upAltEmailIntercor = new \App\adms\Models\helper\AdmsUpdate(); $upAltEmailIntercor->exeUpdate("gre_intercorrencia", $this->Dados, "WHERE id =:id", "id=" . $this->Dados['id']); if ($upAltEmailIntercor->getResultado()) { $_SESSION['msg'] = "<div class='alert alert-success' role='alert'> Email atualizado com sucesso! <button type='button' class='close' data-dismiss='alert' aria-label='Close'> <span aria-hidden='true'>×</span></button> </div>"; $this->Resultado = true; } else { $_SESSION['msg'] = "<div class='alert alert-danger' role='alert'> Erro: Email não foi atualizado! <button type='button' class='close' data-dismiss='alert' aria-label='Close'> <span aria-hidden='true'>×</span></button> </div>"; $this->Resultado = false; } } public function listarCadastrar() { $listar = new \App\adms\Models\helper\AdmsRead(); $listar->fullRead("SELECT id id_sit, nome nome_sit FROM adms_sits ORDER BY nome ASC"); $registro['sit'] = $listar->getResultado(); $this->Resultado = ['sit' => $registro['sit']]; return $this->Resultado; } }