当前位置: 首页>>代码示例>>PHP>>正文


PHP ActivityModel::updateInfo方法代码示例

本文整理汇总了PHP中ActivityModel::updateInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP ActivityModel::updateInfo方法的具体用法?PHP ActivityModel::updateInfo怎么用?PHP ActivityModel::updateInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ActivityModel的用法示例。


在下文中一共展示了ActivityModel::updateInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: editInfo

 public function editInfo($post_id = NULL)
 {
     if (in_array(Auth::getCapability(), array(CAPABILITY_ADMINISTRATOR))) {
         Model::autoloadModel('activity');
         $model = new ActivityModel($this->db);
         $this->para = new stdClass();
         if (isset($_POST['activity'])) {
             $this->para->post_id = $_POST['activity'];
         } elseif (isset($post_id) && !is_null($post_id)) {
             $this->para->post_id = $post_id;
         }
         if (isset($this->para->post_id)) {
             if (isset($_POST['action']) && $_POST['action'] == "update") {
                 $this->para->action = $_POST['action'];
                 if (isset($_POST['post_title'])) {
                     $this->para->post_title = trim($_POST['post_title']);
                 }
                 if (isset($_POST['country_id']) && isset($_POST['country_id']) != "" && $_POST['country_id'] != "0") {
                     $this->para->country_id = $_POST['country_id'];
                 }
                 if (isset($_POST['city_id'])) {
                     $this->para->city_id = $_POST['city_id'];
                 }
                 if (isset($_POST['current_rating'])) {
                     $this->para->current_rating = $_POST['current_rating'];
                 }
                 if (isset($_POST['vote_times'])) {
                     $this->para->vote_times = $_POST['vote_times'];
                 }
                 if (isset($_POST['tag_list'])) {
                     $this->para->tag_list = $_POST['tag_list'];
                 }
                 if (isset($_POST['post_content'])) {
                     $this->para->post_content = trim($_POST['post_content']);
                 }
                 if (isset($_FILES['image']) && isset($_FILES['image']['name']) && $_FILES['image']['name'] != '') {
                     $this->para->image = $_FILES['image'];
                 }
                 $result = $model->updateInfo($this->para);
                 if (!$result) {
                     $this->view->para = $this->para;
                 } else {
                     $update_success = TRUE;
                 }
             }
             $this->view->activityBO = $model->get($this->para->post_id);
             Model::autoloadModel('taxonomy');
             $taxonomyModel = new TaxonomyModel($this->db);
             $this->view->countryList = new SplDoublyLinkedList();
             $taxonomyModel->getAllSorted($this->view->countryList, $taxonomyModel->buildTree($taxonomyModel->getAll("country")), -1);
             $this->view->cityList = new SplDoublyLinkedList();
             if (isset($this->view->activityBO->country_id) && $this->view->activityBO->country_id != "0") {
                 $taxonomyModel->getAllSorted($this->view->cityList, $taxonomyModel->buildTree($taxonomyModel->getByMetaData("city", "country", $this->view->activityBO->country_id)), -1);
             }
             if (isset($this->view->para) && isset($this->view->para->country_id)) {
                 $taxonomyModel->getAllSorted($this->view->cityList, $taxonomyModel->buildTree($taxonomyModel->getByMetaData("city", "country", $this->view->para->country_id)), -1);
             }
             if (isset($post_id) && !is_null($post_id)) {
                 $this->view->renderAdmin(RENDER_VIEW_ACTIVITY_EDIT);
             } else {
                 $this->view->renderAdmin(RENDER_VIEW_ACTIVITY_EDIT, TRUE);
             }
         } else {
             header('location: ' . URL . CONTEXT_PATH_ACTIVITY_INDEX);
         }
     } else {
         $this->login();
     }
 }
开发者ID:khanhdnhut,项目名称:tours,代码行数:69,代码来源:activity_ctrl.php


注:本文中的ActivityModel::updateInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。