D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso
/
adm
/
app
/
gre
/
Controllers
/
Filename :
EditarFormaPagto.php
back
Copy
<?php namespace App\gre\Controllers; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of EditarFormaPagto * * @copyright (c) year, Carlos Marques - CM */ class EditarFormaPagto { private $Dados; private $DadosId; public function editFormaPagto($DadosId = null) { $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT); $this->DadosId = (int) $DadosId; if (!empty($this->DadosId)) { $this->editFormaPagtoPriv(); } else { $_SESSION['msg'] = "<div class='alert alert-danger'>Erro: Forma de Pagamento não encontrada!</div>"; $UrlDestino = URLADM . 'forma-pagto/listar'; header("Location: $UrlDestino"); } } private function editFormaPagtoPriv() { if (!empty($this->Dados['EditFormaPagto'])) { unset($this->Dados['EditFormaPagto']); $editarFormaPagto = new \App\gre\Models\GreEditarFormaPagto(); $editarFormaPagto->altFormaPagto($this->Dados); if ($editarFormaPagto->getResultado()) { $UrlDestino = URLADM . 'ver-forma-pagto/ver-forma-pagto/' . $this->Dados['id']; header("Location: $UrlDestino"); } else { $this->Dados['form'] = $this->Dados; $this->editFormaPagtoViewPriv(); } } else { $verFormaPagto = new \App\gre\Models\GreEditarFormaPagto(); $this->Dados['form'] = $verFormaPagto->verFormaPagto($this->DadosId); $this->editFormaPagtoViewPriv(); } } private function editFormaPagtoViewPriv() { if ($this->Dados['form']) { $listarSelect = new \App\gre\Models\GreEditarFormaPagto(); $this->Dados['select'] = $listarSelect->listarCadastrar(); $botao = ['vis_forma_pagto' => ['menu_controller' => 'ver-forma-pagto', 'menu_metodo' => 'ver-forma-pagto']]; $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 \App\gre\core\ConfigView("gre/Views/FormaPagamento/editarFormaPagto", $this->Dados); $carregarView->renderizarGre(); } else { $_SESSION['msg'] = "<div class='alert alert-danger'>Erro: Forma de Pagamento não encontrada!</div>"; $UrlDestino = URLADM . 'forma-pagto/listar'; header("Location: $UrlDestino"); } } }