function addroomAction() { if ($this->getRequest()->isPost()) { $_data = $this->getRequest()->getPost(); $_dbmodel = new Global_Model_DbTable_DbRoom(); $roomid = $_dbmodel->addAjaxRoom($_data); print_r(Zend_Json::encode($roomid)); exit; } }
public function editRoomAction() { $id = $this->getRequest()->getParam("id"); $db = new Global_Model_DbTable_DbRoom(); $row = $db->getRoomById($id); if ($this->getRequest()->isPost()) { try { $data = $this->getRequest()->getPost(); $data["id"] = $id; $db = new Global_Model_DbTable_DbRoom(); $db->updateRoom($data); Application_Form_FrmMessage::Sucessfull("EDIT_SUCCESS", "/global/index/room-list"); } catch (Exception $e) { Application_Form_FrmMessage::message("EDIT_FAIL"); Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage()); } } $obj = new Global_Form_FrmAddClass(); $frm_room = $obj->FrmAddClass($row); $this->view->update_room = $frm_room; Application_Model_Decorator::removeAllDecorator($frm_room); }