D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso_ant
/
adm
/
app
/
gre
/
Controllers
/
Filename :
EditarEmailIntercorrencia.php
back
Copy
<?php namespace App\gre\Controllers; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of EditarEmailIntercorrencia * * @copyright (c) year, Carlos Marques - CM */ class EditarEmailIntercorrencia { private $Dados; private $DadosId; public function editEmailIntercor($DadosId = null) { $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT); $this->DadosId = (int) $DadosId; if (!empty($this->DadosId)) { $this->editEmailIntercorPriv(); } else { $_SESSION['msg'] = "<div class='alert alert-danger'>Erro: Fornecedor não encontrado!</div>"; $UrlDestino = URLADM . 'ver-email-intercorrencia/listar'; header("Location: $UrlDestino"); } } private function editEmailIntercorPriv() { if (!empty($this->Dados['EditEmailIntercor'])) { unset($this->Dados['EditEmailIntercor']); $editarEmailIntercor = new \App\gre\Models\GreEditarEmailIntercorrencia(); $editarEmailIntercor->altEmailIntercor($this->Dados); if ($editarEmailIntercor->getResultado()) { $UrlDestino = URLADM . 'ver-email-intercorrencia/ver-email-intercor/' . $this->Dados['id']; header("Location: $UrlDestino"); } else { $this->Dados['form'] = $this->Dados; $this->editEmailIntercorViewPriv(); } }else { $editarEmailIntercor = new \App\gre\Models\GreEditarEmailIntercorrencia(); $this->Dados['form'] = $editarEmailIntercor->verEmailIntercor($this->DadosId); $this->editEmailIntercorViewPriv(); } } private function editEmailIntercorViewPriv() { if ($this->Dados['form']) { $listarSelect = new \App\gre\Models\GreEditarEmailIntercorrencia(); $this->Dados['select'] = $listarSelect->listarCadastrar(); $botao = ['vis_email' => ['menu_controller' => 'ver-email-intercorrencia', 'menu_metodo' => 'ver-email-intercor']]; $listarBotao = new \App\adms\Models\AdmsBotao(); $this->Dados['botao'] = $listarBotao->valBotao($botao); $listarMenu = new \App\adms\Models\AdmsMenu(); $this->Dados['menu'] = $listarMenu->itemMenu(); $carregarView = new \Core\ConfigView("gre/Views/Intercorrencia/editarEmailIntercorrencia", $this->Dados); $carregarView->renderizar(); } else { $_SESSION['msg'] = "<div class='alert alert-danger'>Erro: Email não encontrado!</div>"; $UrlDestino = URLADM . 'envia-email-intercorrencia/listar'; header("Location: $UrlDestino"); } } }