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 mostraGrid()
 {
     $total_reg = "10";
     // número de registros por página
     $pagina = $_SESSION['pagina'];
     if (!$pagina) {
         $pc = "1";
     } else {
         $pc = $pagina;
     }
     $inicio = $pc - 1;
     $inicio = $inicio * $total_reg;
     //list all records
     $model_statusprod = new statusProdModel();
     $statusprod_res = $model_statusprod->getStatusLimit(null, $inicio, $total_reg);
     //Full table Scan :( or :)
     //send the records to template sytem
     $this->smarty->assign('liststatusprod', $statusprod_res);
     $query_total = $model_statusprod->getCountStatus();
     $total_registros = $query_total[0]['total'];
     //pega o valor
     $html = $this->paginador($pc, $total_registros, 'statusprod');
     return $html;
 }