*/ public function poirelatedeventIndoAction() { $this->getResponse()->setHeader('Content-Type', 'text/xml'); $event_id = $this->_getParam('eventid'); $table_poitoevent = new Model_DbTable_PoiToEvent(); $poi_list = $table_poitoevent->getAllPoiNameByEventId($event_id); $this->view->poi_list = $poi_list; $this->render('poirelatedevent'); }
/** * IS: Parameter id terdeklarasi * FS: Mengirimkan ke viewer: form, parent * Desc: Mengatur aksi yang dilakukan untuk halaman edit */ public function editAction() { $language_id = $this->_getParam('lang'); $activity_id = $this->_getParam('id'); $form = new Admin_Form_ActivityForm(); $form->setCategoryParent($language_id); $table_category = new Model_DbTable_Category(); $table_category_desc = new Model_DbTable_CategoryDescription(); $table_categorytopoi = new Model_DbTable_CategoryToPoi(); //if this is a POST request if ($this->getRequest()->isPost()) { if ($form->isValid($_POST)) { if ($language_id != 1) { $indo = $table_category_desc->checkForIndo($activity_id); if ($indo) { $data = array('category_id' => $activity_id, 'name' => $_POST['categoryName'], 'description' => $_POST['categoryDescription']); $table_category_desc->updateCategory($data, $activity_id, 2); } else { $data = array('category_id' => $activity_id, 'language_id' => $language_id, 'name' => $_POST['categoryName'], 'description' => $_POST['categoryDescription']); $table_category_desc->insertCategory($data); } } else { $data = array('parent_id' => $_POST['categoryParent'], 'image' => $_POST['categoryPicture']); $table_category->updateCategory($data, $activity_id); $data2 = array('category_id' => $activity_id, 'name' => $_POST['categoryName'], 'description' => $_POST['categoryDescription']); $table_category_desc->updateCategory($data2, $activity_id, 1); } $this->loggingaction('activity', 'edit', $activity_id, $language_id); $this->_flash->addMessage('1\\Activity Update Success!'); $this->_redirect($this->view->rootUrl('/admin/activity/')); } } //get the activity data if ($language_id != 1) { $indo = $table_category_desc->checkForIndo($activity_id); if ($indo) { $category_data = $table_category->getAllWithDescByIdLang($activity_id, $language_id); } } else { $category_data = $table_category->getAllWithDescByIdLang($activity_id, $language_id); } //set element value $form->categoryParent->setValue($category_data['parent_id']); $form->categoryName->setValue($category_data['name']); $form->categoryPicture->setValue($category_data['image']); $form->categoryDescription->setValue($category_data['description']); //send variables to the view $this->view->parent = $category_data['parent_id']; $this->view->form = $form; $this->view->langId = $language_id; }
/** * IS: Parameter id terdeklarasi * FS: Mengirimkan ke viewer: pageTitle * Desc: Fungsi untuk generate breadcrumb */ protected function _generateBreadcrumb() { if ($this->_hasParam('id')) { // Param $categoryId = $this->_getParam('id'); $parentCategoryTitle = null; $parentCategoryId = null; // Model $catDescDb = new Model_DbTable_CategoryDescription(); // Data $activityTitle = $catDescDb->getNameByLang($categoryId, $this->_languageId); $activityTitle = $activityTitle['name']; } if ($this->_hasParam('parentid')) { $parentCategoryId = $this->_getParam('parentid'); // Model $catDescDb = new Model_DbTable_CategoryDescription(); // Data $parentCategoryTitle = $catDescDb->getNameByLang($parentCategoryId, $this->_languageId); $parentCategoryTitle = $parentCategoryTitle['name']; } $texthomelink = $this->view->translate('id_menu_home'); $links = null; switch ($this->_request->getActionName()) { case 'index': default: $title = $this->view->translate('Category'); $links = array($texthomelink => $this->view->baseUrl('/'), $title => ''); $this->view->pageTitle = $title; break; case 'detail': $links = array($texthomelink => $this->view->baseUrl('/'), $activityTitle => ''); } Zend_Registry::set('breadcrumb', $links); }