public function index_action()
 {
     $session = new session();
     $session->sessao_valida();
     $modelEvento = new eventoModel();
     $resEvento = $modelEvento->getEvento('stat<>0');
     //send the records to template sytem
     $this->smarty->assign('evento', $resEvento);
     $this->smarty->assign('title', 'Emissão de Crachá');
     $this->smarty->assign('listacliente', null);
     //call the smarty
     $this->smarty->display('cracha/index.tpl');
 }
 public function detalhes()
 {
     $id = $this->getParam('id_evento');
     $eventoModel = new eventoModel();
     $cidadeModel = new cidadeModel();
     $res = $eventoModel->getEvento('id_evento=' . $id . ' AND stat<>0');
     $resCidade = $cidadeModel->getCidade('id_cidade=' . $res[0]['id_cidade']);
     $model = new model();
     $produto = $model->readSQL('SELECT ep.id_evento, ep.id_produto, ep.qtd_produto, p.des_produto, e.des_evento 
         FROM evento_produto ep 
         LEFT JOIN produto p ON (p.id_produto = ep.id_produto)
         LEFT JOIN evento e ON (e.id_evento = ep.id_evento) WHERE ep.id_evento=' . $id . ' AND ep.stat<>0');
     //Full table Scan :( or :)
     $this->smarty->assign('registro', $res[0]);
     $this->smarty->assign('cidade', $resCidade[0]);
     $this->smarty->assign('title', 'Detalhe do evento');
     $this->smarty->assign('produto', $produto);
     $this->smarty->assign('title_produto', 'Evento Produto');
     //call the smarty
     $this->smarty->display('evento/detail.tpl');
 }
 public function edit()
 {
     //die();
     $id = $this->getParam('id');
     $modelevento = new eventoModel();
     $resevento = $modelevento->getEvento('e.codigo=' . $id);
     $this->smarty->assign('registro', $resevento[0]);
     $model_statuseventos = new statuseventoModel();
     $statuseventos_res = $model_statuseventos->getStatusEvento();
     //Full table Scan :( or :)
     //send the records to template sytem
     $this->smarty->assign('liststatusevento', $statuseventos_res);
     //list all records
     $model_cidade = new cidadeModel();
     $cidade_res = $model_cidade->getCidade();
     //Full table Scan :( or :)
     //send the records to template sytem
     $this->smarty->assign('listscidade', $cidade_res);
     $this->smarty->assign('title', 'Detalhes dos Eventos');
     //call the smarty
     $this->smarty->display('evento/edit.tpl');
 }
 public function edit()
 {
     //die();
     $id = $this->getParam('id');
     $modelprodutoevento = new produtoeventoModel();
     $resprodutoevento = $modelprodutoevento->getProdutoEvento('ep.codigo=' . $id);
     $this->smarty->assign('registro', $resprodutoevento[0]);
     //list all records
     $model_evento = new eventoModel();
     $evento_res = $model_evento->getEvento();
     //Full table Scan :( or :)
     //send the records to template sytem
     $this->smarty->assign('listevento', $evento_res);
     //list all records
     $model_produto = new produtoModel();
     $produto_res = $model_produto->getProduto();
     //Full table Scan :( or :)
     //send the records to template sytem
     $this->smarty->assign('listproduto', $produto_res);
     $this->smarty->assign('title', 'Detalhes dos ProdutoEventos');
     //call the smarty
     $this->smarty->display('produtoevento/edit.tpl');
 }
 public function edit()
 {
     //die();
     $id = $this->getParam('id');
     //list all records
     $modelparticipacao = new participacaoModel();
     $resparticipacao = $modelparticipacao->getParticipacao('p.codigo=' . $id);
     $this->smarty->assign('registro', $resparticipacao[0]);
     //list all records
     $model_cliente = new clienteModel();
     $cliente_res = $model_cliente->getCliente();
     //Full table Scan :( or :)
     //send the records to template sytem
     $this->smarty->assign('listcliente', $cliente_res);
     //list all records
     $model_evento = new eventoModel();
     $evento_res = $model_evento->getEvento();
     //Full table Scan :( or :)
     //send the records to template sytem
     $this->smarty->assign('listevento', $evento_res);
     //list all records
     $model_arquivo = new arquivoModel();
     $arquivo_res = $model_arquivo->getArquivo();
     //Full table Scan :( or :)
     //send the records to template sytem
     $this->smarty->assign('listarquivo', $arquivo_res);
     //list all records
     $model_foto = new fotoModel();
     $foto_res = $model_foto->getFoto();
     //Full table Scan :( or :)
     //send the records to template sytem
     $this->smarty->assign('listfoto', $foto_res);
     $this->smarty->assign('title', 'Detalhes dos Participações');
     //call the smarty
     $this->smarty->display('participacao/edit.tpl');
 }
 public function busca_cliente()
 {
     $model = new model();
     $resEventoCliente = $model->readSQL('' . ' SELECT ' . ' ec . *,' . ' c.nome_cliente,' . ' e.des_evento' . ' FROM evento_cliente ec' . ' LEFT JOIN cliente c ON (c.id_cliente = ec.id_cliente)' . ' LEFT JOIN evento e ON (e.id_evento = ec.id_evento)' . ' WHERE ec.stat <> 0');
     if ($this->getParam('id_cliente') != null) {
         $modelEvento = new eventoModel();
         $resEvento = $modelEvento->getEvento('stat<>0');
         $this->smarty->assign('paginador', $this->mostraGrid());
         $this->smarty->assign('evento', $resEvento);
         $this->smarty->assign('title', 'participacao');
         $this->smarty->assign('id_cliente', $this->getParam('id_cliente'));
         $this->smarty->display('participacao/index.tpl');
     } else {
         $this->smarty->assign('title', 'Busca Clientes');
         $this->smarty->assign('listacliente', null);
         if (isset($_POST['nome_cliente'])) {
             $modelCliente = new clienteModel();
             $nome_cliente = $_POST['nome_cliente'];
             $resCliente = $modelCliente->getCliente("nome_cliente like '%{$nome_cliente}%'");
             $this->smarty->assign('listacliente', $resCliente);
         }
         $this->smarty->display('participacao/busca_cliente.tpl');
     }
 }