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 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_statuseventos = new statuseventoModel(); $statuseventos_res = $model_statuseventos->getStatusEventoLimit(null, $inicio, $total_reg); //Full table Scan :( or :) //send the records to template sytem $this->smarty->assign('liststatusevento', $statuseventos_res); $query_total = $model_statuseventos->getCountStatusEvento(); $total_registros = $query_total[0]['total']; //pega o valor $html = $this->paginador($pc, $total_registros, 'statusevento'); return $html; }