D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso
/
adm
/
app
/
gre
/
Controllers
/
Filename :
CadastrarCargos.php
back
Copy
<?php namespace App\gre\Controllers; if (!defined('URL')) { header("Location: /"); exit(); } /** * Description of CadastrarCargos * * @copyright (c) year, Carlos Marques - CM */ class CadastrarCargos { private $Dados; public function cadCargos() { $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT); if (!empty($this->Dados['CadCargos'])) { unset($this->Dados['CadCargos']); $cadCargos = new \App\gre\Models\GreCadastrarCargos(); $cadCargos->cadCargos($this->Dados); if ($cadCargos->getResultado()) { $UrlDestino = URLADM . 'cargos/listar'; header("Location: $UrlDestino"); } else { $this->Dados['form'] = $this->Dados; $this->cadCargosViewPriv(); } } else { $this->cadCargosViewPriv(); } } private function cadCargosViewPriv() { $listarSelect = new \App\gre\Models\GreCadastrarCargos(); $this->Dados['select'] = $listarSelect->listarCadastrar(); $botao = ['list_cargos' => ['menu_controller' => 'cargos', '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 \Core\ConfigView("gre/Views/Colaborador/cadCargos", $this->Dados); $carregarView->renderizar(); } }