public function edit()
 {
     $id = $this->getParam('id_produto');
     $modelProduto = new produtoModel();
     $resProduto = $modelProduto->getProduto('id_produto=' . $id);
     $departamento_model = new departamentoModel();
     $departamento_res = $departamento_model->getDepartamento('stat<>0');
     $this->smarty->assign('registro', $resProduto[0]);
     $this->smarty->assign('departamento', $departamento_res);
     $this->smarty->assign('id_choosen', $resProduto[0]['id_departamento']);
     $this->smarty->assign('title', 'Atualizar Produto');
     //call the smarty
     $this->smarty->display('produto/update.tpl');
 }
 public function edit()
 {
     //die();
     $id = $this->getParam('id');
     $modelproduto = new produtoModel();
     $resproduto = $modelproduto->getProduto('p.codigo=' . $id);
     $this->smarty->assign('registro', $resproduto[0]);
     //chama status
     $model_statusprod = new statusProdModel();
     $status_res = $model_statusprod->getStatus('');
     //Full table Scan :( or :)
     //send the records to template sytem
     $this->smarty->assign('listastatusprod', $status_res);
     //chama depto
     $model_deptoprod = new departamentoModel();
     $dpto_res = $model_deptoprod->getDepartamento('');
     $this->smarty->assign('listadeptoprod', $dpto_res);
     $this->smarty->assign('title', 'Editar Produto');
     //call the smarty
     $this->smarty->display('produto/edit.tpl');
 }
 public function produto_grid()
 {
     $id = $this->getParam('id_evento');
     $produto_model = new produtoModel();
     $resProduto = $produto_model->getProduto();
     $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.stat<>0 AND ep.id_evento=' . $id);
     //Full table Scan :( or :)
     $this->smarty->assign('produto_evento', $produto);
     $this->smarty->assign('title_produto', 'Evento Produto');
     $this->smarty->assign('produto', $resProduto);
     $this->smarty->assign('id_evento', $id);
     $this->smarty->assign('title', 'Cadastrar Produto');
     $this->smarty->display('evento/produto_grid.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');
 }