public function edit() { //die(); $id = $this->getParam('id'); $modelestado = new estadoModel(); $resestado = $modelestado->getEstado('codigo=' . $id); $this->smarty->assign('registro', $resestado[0]); $this->smarty->assign('title', 'Editar Estado'); //call the smarty $this->smarty->display('estado/edit.tpl'); }
public function edit() { //die(); $id = $this->getParam('id_estado'); $modelEstado = new estadoModel(); $resEstado = $modelEstado->getEstado('id_estado=' . $id); $this->smarty->assign('registro', $resEstado[0]); $this->smarty->assign('title', 'Atualizar Estado'); //call the smarty $this->smarty->display('estado/update.tpl'); }
public function edit() { //die(); $id = $this->getParam('id_cidade'); $modelCidade = new cidadeModel(); $resCidade = $modelCidade->getCidade('id_cidade=' . $id); $estado_model = new estadoModel(); $estado_res = $estado_model->getEstado('stat<>0'); $this->smarty->assign('registro', $resCidade[0]); $this->smarty->assign('estado', $estado_res); $this->smarty->assign('id_choosen', $resCidade[0]['id_estado']); $this->smarty->assign('title', 'Atualizar Cidade'); //call the smarty $this->smarty->display('cidade/update.tpl'); }
public function edit() { //die(); $id = $this->getParam('id'); $modelcidade = new cidadeModel(); $rescidade = $modelcidade->getCidade('c.codigo=' . $id); $this->smarty->assign('registro', $rescidade[0]); //chama estado $model_estados = new estadoModel(); $estados_res = $model_estados->getEstado(''); //Full table Scan :( or :) //send the records to template sytem $this->smarty->assign('listestado', $estados_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 Cidade'); //call the smarty $this->smarty->display('cidade/edit.tpl'); }
public function edit() { $model_estado = new estadoModel(); $model_cidade = new cidadeModel(); $model = new clienteModel(); $id = $this->getParam('id_cliente'); $res = $model->getCliente('id_cliente=' . $id . ' AND stat<>0'); $resEstado = $model_estado->getEstado('stat<>0'); $resCidade = $model_cidade->getCidade('stat<>0'); $this->smarty->assign('cliente', $res[0]); $this->smarty->assign('cidade', $resCidade); $this->smarty->assign('estado', $resEstado); $this->smarty->assign('id_choosen_cidade', $res[0]['id_cidade']); $this->smarty->assign('id_choosen_estado', $res[0]['id_estado']); $this->smarty->assign('title', 'Atualizar cliente'); //call the smarty $this->smarty->display('cliente/update.tpl'); }