D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso_ant
/
adm
/
app
/
gre
/
Controllers
/
Filename :
CadastrarTempoPrescricao.php
back
Copy
<?php namespace App\gre\Controllers; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of CadastrarTempoPrescricao * * @copyright (c) year, Carlos Marques - CM */ class CadastrarTempoPrescricao { private $Dados; public function cadTempoPrescr() { $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT); if (!empty($this->Dados['CadTempoPrescr'])) { unset($this->Dados['CadTempoPrescr']); $cadTempoPrescr = new \App\gre\Models\GreCadastrarTempoPrescricao(); $cadTempoPrescr->cadTempoPrescr($this->Dados); if ($cadTempoPrescr->getResultado()) { $UrlDestino = URLADM . 'tempo-prescricao/listar'; header("Location: $UrlDestino"); } else { $this->Dados['form'] = $this->Dados; $this->cadTempoPrescrViewPriv(); } } else { $this->cadTempoPrescrViewPriv(); } } private function cadTempoPrescrViewPriv() { $listarSelect = new \App\gre\Models\GreCadastrarTempoPrescricao(); $this->Dados['select'] = $listarSelect->listarCadastrar(); $botao = ['list_tempo_prescr' => ['menu_controller' => 'tempo-prescricao', 'menu_metodo' => 'listar']]; $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/Prescricao/cadTempoPrescricao", $this->Dados); $carregarView->renderizarGre(); } }