Beispiel #1
0
 public function index()
 {
     try {
         $this->templatePlugin->carregarLayout(self::DIRETORIO_VISAO);
     } catch (ControleException $ex) {
         Facil::despacharErro(404, "Página não encontrada");
     }
 }
Beispiel #2
0
 public function __construct()
 {
     try {
         $this->fachada = new Fachada();
         $this->listaOS = $this->fachada->listarOrdensServico();
     } catch (\Exception $ex) {
         Facil::despacharErro(500, "Aplicação está indisponível no momento");
     }
 }
Beispiel #3
0
 public function index()
 {
     try {
         $this->listarMenus();
         $perfis = $this->fachada->listarPerfisAtivos();
         Facil::setar("perfisUsuario", $perfis->toArray());
         $this->templatePlugin->carregarLayoutCompleto(self::DIRETORIO_VISAO);
     } catch (ControleException $ex) {
         Facil::despacharErro(404, "Página não encontrada");
     }
 }
 public function index()
 {
     try {
         $this->listarMenus();
         $perfis = $this->fachada->listarPerfisAtivos();
         $clientes = $this->fachada->listarTodosClientes();
         $categoriasOS = $this->fachada->listarCategoriasOSAtivas();
         $produtos = $this->fachada->listarProdutos();
         $ourives = $this->fachada->listarOurives();
         Facil::setar("clientes", $clientes);
         Facil::setar("categorias", $categoriasOS);
         Facil::setar("produtos", $produtos);
         Facil::setar("ourives", $ourives);
         Facil::setar("perfisUsuario", $perfis->toArray());
         $this->templatePlugin->carregarLayoutCompleto(self::DIRETORIO_VISAO);
     } catch (ControleException $ex) {
         Facil::despacharErro(404, "Página não encontrada");
     }
 }
Beispiel #5
0
 public function listarPerfis()
 {
     try {
         $perfis = $this->fachada->listar();
         foreach ($perfis as $perfil) {
             $ativo = $perfil->ativo ? Perfil::ATIVO : Perfil::INATIVO;
             $this->dataTables->addRow(array($perfil->id, $perfil->titulo, $ativo));
         }
         echo $this->dataTables;
     } catch (\Exception $ex) {
         Facil::despacharErro(500, $ex->getMessage());
     }
 }
Beispiel #6
0
 public function gerarOSParaImpressao()
 {
     try {
         if (empty($_POST['idos'])) {
             throw new \InvalidArgumentException("Favor informar a Ordem de Serviço");
         }
         $ordemServico = new OrdemServico();
         $ordemServico->id = $_POST['idos'];
         $ordemServico = $this->fachada->buscarOrdemServico($ordemServico);
         $endereco = $ordemServico->cliente->endereco;
         $end = "";
         if (!empty($endereco)) {
             $end = !empty($endereco->logradouro) ? $endereco->logradouro : "";
             $end .= !empty($endereco->numero) ? ', ' . $endereco->numero : "";
             $end .= !empty($endereco->complemento) ? ', ' . $endereco->complemento : "";
             $end .= !empty($endereco->bairro) ? ', ' . $endereco->bairro : "";
             $end .= !empty($endereco->cidade) ? ', ' . $endereco->cidade : "";
             $end .= !empty($endereco->estado) ? ', ' . $endereco->estado : "";
             $end .= !empty($endereco->cep) ? ', ' . $endereco->cep : "";
         }
         $ordemServico->cliente->endereco = $end;
         Facil::setar("ordemServico", $ordemServico);
         $html = Facil::despachar(self::DIRETORIO_IMPRESSAO_OS, true);
         $pdf = new PDFPlugin();
         $pdf->setPagina($html);
         $pdf->printPDF('os_' . $ordemServico->id);
     } catch (\Exception $ex) {
         Facil::despacharErro(404, $ex->getMessage());
     }
 }
 public function listar()
 {
     try {
         $categorias = $this->fachada->listarTodasCategoriasOS();
         foreach ($categorias as $categoria) {
             $ativo = $categoria->ativo ? CategoriaOS::ATIVO : CategoriaOS::INATIVO;
             $this->dataTables->addRow(array($categoria->id, $categoria->titulo, $ativo));
         }
         echo $this->dataTables;
     } catch (\Exception $ex) {
         Facil::despacharErro(500, $ex->getMessage());
     }
 }