示例#1
0
 public function view($productid_Num = 0)
 {
     $data = $this->data;
     if (empty($productid_Num)) {
         $productid_Num = $this->input->get('productid');
     }
     if (!empty($productid_Num)) {
         $data['ProductShop'] = new ProductShop(['db_where_Arr' => array('productid_Num' => $productid_Num)]);
     }
     if (empty($data['ProductShop']->productid_Num)) {
         $Message = $this->load->model('Message', nrnum());
         $Message->show(array('message' => '產品連結輸入錯誤', 'url' => 'product'));
     }
     //global
     $data['global']['style'][] = 'temp/global.css';
     $data['global']['style'][] = 'temp/header_bar.css';
     $data['global']['style'][] = 'temp/footer_bar.css';
     $data['global']['style'][] = 'shop/product/view.css';
     //temp
     $data['temp']['header_up'] = $this->load->view('temp/header_up', $data, TRUE);
     $data['temp']['header_down'] = $this->load->view('temp/header_down', $data, TRUE);
     $data['temp']['header_bar'] = $this->load->view('temp/header_bar', $data, TRUE);
     $data['temp']['footer_bar'] = $this->load->view('temp/footer_bar', $data, TRUE);
     $data['temp']['body_end'] = $this->load->view('temp/body_end', $data, TRUE);
     //輸出模板
     $this->load->view('shop/product/view', $data);
 }
示例#2
0
 public function tablelist()
 {
     $data = $this->data;
     //取得公用數據
     $data = array_merge($data, $this->AdminModel->get_data(array('child4_name_Str' => 'tablelist')));
     $limitstart_Num = $this->input->get('limitstart');
     $limitcount_Num = $this->input->get('limitcount');
     $limitcount_Num = empty($limitcount_Num) ? 20 : $limitcount_Num;
     $limitcount_Num = $limitcount_Num > 100 ? 100 : $limitcount_Num;
     $data['search_class_slug_Str'] = $this->input->get('class_slug');
     $data['search_title_Str'] = $this->input->get('title');
     $data['search_fileid_Num'] = $this->input->get('fileid');
     $class_ClassMeta = new ClassMeta();
     $class_ClassMeta->construct_db(array('db_where_Arr' => array('uid_Str' => $data['User']->uid_Num, 'slug_Str' => $data['search_class_slug_Str']), 'db_where_deletenull_Bln' => FALSE));
     $data['filelist_FileList'] = new ObjList();
     $data['filelist_FileList']->construct_db(array('db_where_Arr' => array('fileid_Num' => $data['search_fileid_Num'], 'uid_Num' => $data['User']->uid_Num), 'db_where_like_Arr' => array('title_Str' => $data['search_title_Str']), 'db_where_or_Arr' => array('classids_Str' => array($class_ClassMeta->classid_Num)), 'db_where_deletenull_Bln' => TRUE, 'model_name_Str' => 'FileObj', 'db_orderby_Arr' => array('prioritynum' => 'DESC', 'updatetime' => 'DESC'), 'limitstart_Num' => $limitstart_Num, 'limitcount_Num' => $limitcount_Num));
     $data['file_links'] = $data['filelist_FileList']->create_links(array('base_url_Str' => "admin/base/file/file/tablelist/?class_slug={$data['search_class_slug_Str']}"));
     $data['file_ClassMetaList'] = $this->load->model('ObjList', nrnum());
     $data['file_ClassMetaList']->construct_db(array('db_where_Arr' => array('uid_Num' => $data['User']->uid_Num, 'modelname' => 'file'), 'db_where_deletenull_Bln' => TRUE, 'model_name_Str' => 'ClassMeta', 'db_orderby_Arr' => array(array('prioritynum', 'DESC'), array('updatetime', 'DESC')), 'limitstart_Num' => 0, 'limitcount_Num' => 100));
     //global
     $data['global']['style'][] = 'admin/global.css';
     $data['global']['js'][] = 'admin.js';
     //temp
     $data['temp']['header_up'] = $this->load->view('temp/header_up', $data, TRUE);
     $data['temp']['header_down'] = $this->load->view('temp/header_down', $data, TRUE);
     $data['temp']['admin_header_bar'] = $this->load->view('admin/temp/admin_header_bar', $data, TRUE);
     $data['temp']['admin_footer_bar'] = $this->load->view('admin/temp/admin_footer_bar', $data, TRUE);
     $data['temp']['body_end'] = $this->load->view('temp/body_end', $data, TRUE);
     //輸出模板
     $this->load->view('admin/' . $data['admin_child_url_Str'], $data);
 }
示例#3
0
 public function tablelist()
 {
     $data = $this->data;
     //取得公用數據
     $data = array_merge($data, $this->AdminModel->get_data(array('child4_name_Str' => 'tablelist')));
     $limitstart_Num = $this->input->get('limitstart');
     $limitcount_Num = $this->input->get('limitcount');
     $limitcount_Num = !empty($limitcount_Num) ? $limitcount_Num : 30;
     $data['search_class_slug_Str'] = $this->input->get('class_slug');
     $data['search_title_Str'] = $this->input->get('title');
     $data['search_picid_Num'] = $this->input->get('picid');
     $data['search_username_Str'] = $this->input->get('username');
     $class_ClassMeta = new ClassMeta();
     $class_ClassMeta->construct_db(array('db_where_Arr' => array('slug_Str' => $data['search_class_slug_Str']), 'db_where_deletenull_Bln' => FALSE));
     $User = new User();
     $User->construct_db(array('db_where_Arr' => array('username' => $data['search_username_Str'])));
     $data['UserGroup_Num'] = $data['User']->group_UserGroupList->obj_Arr[0]->groupid_Num;
     $construct_Arr = ['db_where_Arr' => ['picid' => $data['search_picid_Num'], 'upload_status !=' => 3], 'db_where_like_Arr' => array('title' => $data['search_title_Str']), 'db_where_or_Arr' => array('classids' => array($class_ClassMeta->classid_Num)), 'db_where_deletenull_Bln' => TRUE, 'model_name_Str' => 'PicObj', 'db_orderby_Arr' => array('prioritynum' => 'DESC', 'updatetime' => 'DESC'), 'limitstart_Num' => $limitstart_Num, 'limitcount_Num' => $limitcount_Num];
     //搜尋upload_status=2的待分類圖片
     if ($data['search_class_slug_Str'] == 'unclassified') {
         $construct_Arr['db_where_Arr']['upload_status'] = 2;
     } else {
         if ($data['search_class_slug_Str'] == 'hidden') {
             $construct_Arr['db_where_Arr']['upload_status'] = 3;
         }
     }
     if ($data['UserGroup_Num'] == 100) {
         $construct_Arr['db_where_Arr']['uid'] = $data['User']->uid_Num;
     }
     // ec($construct_Arr);
     $data['piclist_PicList'] = new ObjList($construct_Arr);
     $data['pic_links'] = $data['piclist_PicList']->create_links(array('base_url_Str' => "admin/base/pic/pic/tablelist/?class_slug={$data['search_class_slug_Str']}"));
     // ec($data['piclist_PicList']);
     if ($data['UserGroup_Num'] == 100) {
         $data['pic_ClassMetaList'] = $this->load->model('ObjList', nrnum());
         $data['pic_ClassMetaList']->construct_db(array('db_where_Arr' => array('uid_Num' => $data['User']->uid_Num, 'modelname' => 'pic'), 'db_where_deletenull_Bln' => TRUE, 'model_name_Str' => 'ClassMeta', 'db_orderby_Arr' => array(array('prioritynum', 'DESC'), array('updatetime', 'DESC')), 'limitstart_Num' => 0, 'limitcount_Num' => 100));
     } else {
         $data['pic_ClassMetaList'] = $this->load->model('ObjList', nrnum());
         $data['pic_ClassMetaList']->construct_db(array('db_where_Arr' => array('modelname' => 'pic'), 'db_where_deletenull_Bln' => TRUE, 'model_name_Str' => 'ClassMeta', 'db_orderby_Arr' => array(array('prioritynum', 'DESC'), array('updatetime', 'DESC')), 'limitstart_Num' => 0, 'limitcount_Num' => 100));
     }
     //global
     $data['global']['style'][] = 'admin/global.css';
     $data['global']['js'][] = 'admin.js';
     //temp
     $data['temp']['header_up'] = $this->load->view('temp/header_up', $data, TRUE);
     $data['temp']['header_down'] = $this->load->view('temp/header_down', $data, TRUE);
     $data['temp']['admin_header_bar'] = $this->load->view('admin/temp/admin_header_bar', $data, TRUE);
     $data['temp']['admin_footer_bar'] = $this->load->view('admin/temp/admin_footer_bar', $data, TRUE);
     $data['temp']['body_end'] = $this->load->view('temp/body_end', $data, TRUE);
     //輸出模板
     $this->load->view('admin/' . $data['admin_child_url_Str'], $data);
 }