コード例 #1
0
ファイル: back_slideshow.php プロジェクト: taryono/school
         $temp = $item->toArray();
         $temp['section'] = $item->getDepartment()->toArray();
         $items[] = $temp;
     }
     $output = array('success' => 1, 'data' => $items);
     $this->jsonwrapper->print_json($output);
 }
 public function getbannermenu($param)
 {
     if (empty($param['type_id'])) {
         $this->jsonwrapper->show_json_error('not found', 'Menu type tidak ditemukan.');
     }
     $menuType = WebMenuTypePeer::retrieveByPK($param['type_id']);
     if (!$menuType) {
         $this->jsonwrapper->show_json_error('not found', 'Menu type tidak ditemukan.');
     }
     /* Getting Image Category */
     $categoryCriteria = new Criteria();
     $categoryCriteria->add(WebSlideshowCategoryPeer::DEPARTMENT_ID, $menuType->getDepartmentId(), Criteria::EQUAL);
     $categoryCriteria->add(WebSlideshowCategoryPeer::INITIAL, 'banner-slideshow', Criteria::EQUAL);
     $category = WebSlideshowCategoryPeer::doSelectOne($categoryCriteria);
     $this->criteria->add(WebSlideshowPeer::SLIDESHOW_CATEGORY_ID, $category->getId(), Criteria::EQUAL);
     $imageTemp = WebSlideshowPeer::doSelect($this->criteria);
コード例 #2
0
ファイル: actions.class.php プロジェクト: taryono/school
 public function executeSlideshowitem()
 {
     $this->module = $this->getModuleName();
     $catId = $this->getRequestParameter('id');
     $department_id = $this->get_department_id();
     $departmentAvailable = $this->tools->departmentAvailable($department_id);
     $this->criteria->add(WebSlideshowCategoryPeer::ID, $catId, Criteria::EQUAL);
     $this->slideshowCategory = WebSlideshowCategoryPeer::doSelectOne($this->criteria);
     if (!$this->slideshowCategory) {
         echo 'Menu ' . $initial . ' not found';
     }
     $this->criteria->add(WebSlideshowCategoryPeer::DEPARTMENT_ID, $departmentAvailable, Criteria::IN);
     $this->slideshowCategory = WebSlideshowCategoryPeer::doSelectOne($this->criteria);
     if (!$this->slideshowCategory) {
         echo 'Maaf, anda tidak memiliki hak untuk mengakses halaman ini.';
     }
     $this->section = $this->get_section();
 }