Esempio n. 1
1
 /**
  * 图片裁剪
  *
  */
 public function pic_cutOp()
 {
     Uk86Language::uk86_read('admin_common');
     $lang = Uk86Language::uk86_getLangContent();
     uk86_import('function.thumb');
     if (uk86_chksubmit()) {
         $thumb_width = $_POST['x'];
         $x1 = $_POST["x1"];
         $y1 = $_POST["y1"];
         $x2 = $_POST["x2"];
         $y2 = $_POST["y2"];
         $w = $_POST["w"];
         $h = $_POST["h"];
         $scale = $thumb_width / $w;
         $src = str_ireplace(UPLOAD_SITE_URL, BASE_UPLOAD_PATH, $_POST['url']);
         if (strpos($src, '..') !== false || strpos($src, BASE_UPLOAD_PATH) !== 0) {
             exit;
         }
         if (!empty($_POST['filename'])) {
             // 				$save_file2 = BASE_UPLOAD_PATH.'/'.$_POST['filename'];
             $save_file2 = str_ireplace(UPLOAD_SITE_URL, BASE_UPLOAD_PATH, $_POST['filename']);
         } else {
             $save_file2 = str_replace('_small.', '_sm.', $src);
         }
         $cropped = uk86_resize_thumb($save_file2, $src, $w, $h, $x1, $y1, $scale);
         @unlink($src);
         $pathinfo = pathinfo($save_file2);
         exit($pathinfo['basename']);
     }
     $save_file = str_ireplace(UPLOAD_SITE_URL, BASE_UPLOAD_PATH, $_GET['url']);
     $_GET['resize'] = $_GET['resize'] == '0' ? '0' : '1';
     Tpl::output('height', uk86_get_height($save_file));
     Tpl::output('width', uk86_get_width($save_file));
     Tpl::showpage('common.pic_cut', 'null_layout');
 }
Esempio n. 2
0
 /**
  * 性能优化
  */
 public function performOp()
 {
     if ($_GET['type'] == 'clear') {
         $lang = Uk86Language::uk86_getLangContent();
         $cache = Cache::getInstance(C('cache.type'));
         $cache->clear();
         uk86_showMessage($lang['nc_common_op_succ']);
     }
     Tpl::showpage('setting.perform_opt');
 }
Esempio n. 3
0
 /**
  * 分类列表
  */
 public function indexOp()
 {
     Uk86Language::uk86_read('home_category_index');
     $lang = Uk86Language::uk86_getLangContent();
     //导航
     $nav_link = array('0' => array('title' => $lang['homepage'], 'link' => SHOP_SITE_URL), '1' => array('title' => $lang['category_index_goods_class']));
     Tpl::output('nav_link_list', $nav_link);
     Tpl::output('html_title', C('site_name') . ' - ' . Uk86Language::uk86_get('category_index_goods_class'));
     Tpl::showpage('category');
 }
Esempio n. 4
0
 /**
  * 清理缓存
  */
 public function clearOp()
 {
     if (!uk86_chksubmit()) {
         Tpl::showpage('cache.clear');
         return;
     }
     $lang = Uk86Language::uk86_getLangContent();
     // 清理所有缓存
     if ($_POST['cls_full'] == 1) {
         foreach ($this->cacheItems as $i) {
             uk86_dkcache($i);
         }
         // 表主键
         Model::dropTablePkArrayCache();
         // 商品分类
         uk86_dkcache('gc_class');
         uk86_dkcache('all_categories');
         uk86_dkcache('goods_class_seo');
         uk86_dkcache('class_tag');
         // 广告
         Model('adv')->makeApAllCache();
         // 首页
         Model('web_config')->getWebHtml('index', 1);
         uk86_delCacheFile('index');
     } else {
         $todo = (array) $_POST['cache'];
         foreach ($this->cacheItems as $i) {
             if (in_array($i, $todo)) {
                 uk86_dkcache($i);
             }
         }
         // 表主键
         if (in_array('table', $todo)) {
             Model::dropTablePkArrayCache();
         }
         // 商品分类
         if (in_array('goodsclass', $todo)) {
             uk86_dkcache('gc_class');
             uk86_dkcache('all_categories');
             uk86_dkcache('goods_class_seo');
             uk86_dkcache('class_tag');
         }
         // 广告
         if (in_array('adv', $todo)) {
             Model('adv')->makeApAllCache();
         }
         // 首页
         if (in_array('index', $todo)) {
             Model('web_config')->getWebHtml('index', 1);
             uk86_delCacheFile('index');
         }
     }
     $this->log(L('cache_cls_operate'));
     uk86_showMessage($lang['cache_cls_ok']);
 }
Esempio n. 5
0
 public function indexOp()
 {
     $lang = Uk86Language::uk86_getLangContent();
     $model = Model('express');
     if (preg_match('/^[A-Z]$/', $_GET['letter'])) {
         $model->where(array('e_letter' => $_GET['letter']));
     }
     $list = $model->page(10)->order('e_order,e_state desc,id')->select();
     Tpl::output('page', $model->showpage());
     Tpl::output('list', $list);
     Tpl::showpage('express.index');
 }
Esempio n. 6
0
 /**
  * 用户中心右边,小导航
  *
  * @param string	$menu_type	导航类型
  * @param string 	$menu_key	当前导航的menu_key
  * @param array 	$array		附加菜单
  * @return
  */
 private function profile_menu($menu_key = '', $array = array())
 {
     Uk86Language::uk86_read('member_layout');
     $lang = Uk86Language::uk86_getLangContent();
     $menu_array = array();
     $menu_array = array(1 => array('menu_key' => 'points', 'menu_name' => $lang['nc_member_path_points'], 'menu_url' => 'index.php?act=member_points'), 2 => array('menu_key' => 'orderlist', 'menu_name' => Uk86Language::uk86_get('member_pointorder_list_title'), 'menu_url' => 'index.php?act=member_pointorder&op=orderlist'));
     if (!empty($array)) {
         $menu_array[] = $array;
     }
     Tpl::output('member_menu', $menu_array);
     Tpl::output('menu_key', $menu_key);
 }
Esempio n. 7
0
 /**
  * 登录操作
  *
  */
 public function indexOp()
 {
     $lang = Uk86Language::uk86_getLangContent();
     $model_member = Model('member');
     //检查登录状态
     $model_member->checkloginMember();
     $script = "document.getElementsByName('codeimage')[0].src='" . APP_SITE_URL . "/index.php?act=seccode&op=makecode&nchash='+NC_HASH+'&t=' + Math.random();";
     $result = uk86_chksubmit(true, true, 'num');
     if ($result !== false) {
         if ($result === -11) {
             showDialog(L('login_index_login_illegal'), '', 'error', $script, 2);
         } elseif ($result === -12) {
             showDialog(L('login_index_wrong_checkcode'), '', 'error', $script, 2);
         }
         if (Uk86process::uk86_islock('login')) {
             showDialog(L('login_index_op_repeat'), APP_SITE_URL);
         }
         $array = array();
         $array['member_name'] = $_POST['user_name'];
         $array['member_passwd'] = md5($_POST['password']);
         $member_info = $model_member->infoMember($array);
         if (is_array($member_info) and !empty($member_info)) {
             if (!$member_info['member_state']) {
                 showDialog($lang['login_index_account_stop']);
             }
         } else {
             Uk86process::uk86_addprocess('login');
             showDialog($lang['login_index_login_fail'], '', 'error', $script, 2);
         }
         $model_member->createSession($member_info);
         Uk86process::uk86_clear('login');
         // cookie中的cart存入数据库
         Model('cart')->mergecart($member_info, $_SESSION['store_id']);
         // cookie中的浏览记录存入数据库
         Model('goods_browse')->mergebrowse($_SESSION['member_id'], $_SESSION['store_id']);
         //添加会员U币
         $model_member->addPoint($member_info);
         showDialog(L('login_index_login_success'), 'reload', 'succ', '', 2);
     }
     if (empty($_GET['ref_url'])) {
         $_GET['ref_url'] = uk86_getReferer();
     }
     Tpl::output('html_title', C('site_name') . ' - ' . $lang['login_index_login']);
     Tpl::output('nchash', uk86_getNchash());
     if ($_GET['inajax'] == 1) {
         Tpl::showpage('login_inajax', 'null_layout');
     } else {
         return false;
     }
 }
Esempio n. 8
0
 public function indexOp()
 {
     $lang = Uk86Language::uk86_getLangContent();
     if ($_GET['code'] == '') {
         uk86_showMessage($lang['para_error'], '', 'html', 'error');
         //'缺少参数:文章标识'
     }
     $model_doc = Model('document');
     $doc = $model_doc->getOneByCode($_GET['code']);
     Tpl::output('doc', $doc);
     /**
      * 分类导航
      */
     $nav_link = array(array('title' => $lang['homepage'], 'link' => SHOP_SITE_URL), array('title' => $doc['doc_title']));
     Tpl::output('nav_link_list', $nav_link);
     Tpl::showpage('document.index');
 }
Esempio n. 9
0
 /**
  * 商品管理
  */
 public function fleaOp()
 {
     $lang = Uk86Language::uk86_getLangContent();
     $model_goods = Model('flea');
     /**
      * 推荐,编辑,删除
      */
     if ($_POST['form_submit'] == 'ok') {
         if (!empty($_POST['del_id'])) {
             $model_goods->dropGoods(implode(',', $_POST['del_id']));
             uk86_showMessage($lang['goods_index_del_succ']);
         } else {
             uk86_showMessage($lang['goods_index_choose_del']);
         }
         uk86_showMessage($lang['goods_index_argument_invalid']);
     }
     /**
      * 排序
      */
     $condition['keyword'] = trim($_GET['search_goods_name']);
     $condition['like_member_name'] = trim($_GET['search_store_name']);
     //店铺名称
     $condition['brand_id'] = intval($_GET['search_brand_id']);
     $condition['gc_id'] = intval($_GET['cate_id']);
     /**
      * 分页
      */
     $page = new Uk86Page();
     $page->uk86_setEachNum(10);
     $page->uk86_setStyle('admin');
     $goods_list = $model_goods->listGoods($condition, $page);
     /**
      * 商品类别
      */
     /**
      * 商品分类
      */
     $model_class = Model('flea_class');
     $goods_class = $model_class->getTreeClassList(1);
     Tpl::output('search', $_GET);
     Tpl::output('goods_class', $goods_class);
     Tpl::output('goods_list', $goods_list);
     Tpl::output('page', $page->uk86_show());
     Tpl::showpage('flea.index');
 }
Esempio n. 10
0
 /**
  * 新增/编辑发货地址
  */
 public function daddress_addOp()
 {
     Uk86Language::uk86_read('member_member_index');
     $lang = Uk86Language::uk86_getLangContent();
     $model_daddress = Model('daddress');
     if (uk86_chksubmit()) {
         //保存 新增/编辑 表单
         $obj_validate = new Uk86Validate();
         $obj_validate->validateparam = array(array("input" => $_POST["seller_name"], "require" => "true", "message" => $lang['store_daddress_receiver_null']), array("input" => $_POST["area_id"], "require" => "true", "validator" => "Number", "message" => $lang['store_daddress_wrong_area']), array("input" => $_POST["city_id"], "require" => "true", "validator" => "Number", "message" => $lang['store_daddress_wrong_area']), array("input" => $_POST["area_info"], "require" => "true", "message" => $lang['store_daddress_area_null']), array("input" => $_POST["address"], "require" => "true", "message" => $lang['store_daddress_address_null']), array("input" => $_POST['telphone'], 'require' => 'true', 'message' => $lang['store_daddress_phone_and_mobile']));
         $error = $obj_validate->uk86_validate();
         if ($error != '') {
             uk86_showValidateError($error);
         }
         $data = array('store_id' => $_SESSION['store_id'], 'seller_name' => $_POST['seller_name'], 'area_id' => $_POST['area_id'], 'city_id' => $_POST['city_id'], 'area_info' => $_POST['area_info'], 'address' => $_POST['address'], 'telphone' => $_POST['telphone'], 'company' => $_POST['company']);
         $address_id = intval($_POST['address_id']);
         if ($address_id > 0) {
             $condition = array();
             $condition['address_id'] = $address_id;
             $condition['store_id'] = $_SESSION['store_id'];
             $update = $model_daddress->editAddress($data, $condition);
             if (!$update) {
                 showDialog($lang['store_daddress_modify_fail'], '', 'error');
             }
         } else {
             $insert = $model_daddress->addAddress($data);
             if (!$insert) {
                 showDialog($lang['store_daddress_add_fail'], '', 'error');
             }
         }
         showDialog($lang['nc_common_op_succ'], 'reload', 'succ', 'CUR_DIALOG.close()');
     } elseif (is_numeric($_GET['address_id']) > 0) {
         //编辑
         $condition = array();
         $condition['address_id'] = intval($_GET['address_id']);
         $condition['store_id'] = $_SESSION['store_id'];
         $address_info = $model_daddress->getAddressInfo($condition);
         if (empty($address_info) && !is_array($address_info)) {
             uk86_showMessage($lang['store_daddress_wrong_argument'], 'index.php?act=store_deliver_set&op=daddress_list', 'html', 'error');
         }
         Tpl::output('address_info', $address_info);
     }
     Tpl::showpage('store_deliver_set.daddress_add', 'null_layout');
 }
Esempio n. 11
0
 /**
  * 设置
  */
 public function flea_class_indexOp()
 {
     /**
      * 加载语言包
      */
     $lang = Uk86Language::uk86_getLangContent();
     /**
      * 实例化商品分类模型
      */
     $model_class = Model('flea_class');
     $goods_class = $model_class->getTreeClassList(1);
     Tpl::output('goods_class', $goods_class);
     /**
      * 获取设置信息
      */
     $fc_index = $model_class->getFleaIndexClass(array());
     if (is_array($fc_index) && !empty($fc_index)) {
         foreach ($fc_index as $value) {
             Tpl::output($value['fc_index_code'], $value);
         }
     }
     if ($_POST['form_submit'] == 'ok') {
         $a = $model_class->setFleaIndexClass(array('fc_index_code' => 'shuma', 'fc_index_id1' => $_POST['shuma_cid1'], 'fc_index_id2' => $_POST['shuma_cid2'], 'fc_index_id3' => $_POST['shuma_cid3'], 'fc_index_id4' => $_POST['shuma_cid4']));
         $b = $model_class->setFleaIndexClass(array('fc_index_code' => 'zhuangban', 'fc_index_id1' => $_POST['zhuangban_cid1'], 'fc_index_id2' => $_POST['zhuangban_cid2'], 'fc_index_id3' => $_POST['zhuangban_cid3'], 'fc_index_id4' => $_POST['zhuangban_cid4']));
         $c = $model_class->setFleaIndexClass(array('fc_index_code' => 'jujia', 'fc_index_id1' => $_POST['jujia_cid1'], 'fc_index_id2' => $_POST['jujia_cid2'], 'fc_index_id3' => $_POST['jujia_cid3'], 'fc_index_id4' => $_POST['jujia_cid4']));
         $d = $model_class->setFleaIndexClass(array('fc_index_code' => 'xingqu', 'fc_index_id1' => $_POST['xingqu_cid1'], 'fc_index_id2' => $_POST['xingqu_cid2'], 'fc_index_id3' => $_POST['xingqu_cid3'], 'fc_index_id4' => $_POST['xingqu_cid4']));
         $e = $model_class->setFleaIndexClass(array('fc_index_code' => 'muying', 'fc_index_id1' => $_POST['muying_cid1'], 'fc_index_id2' => $_POST['muying_cid2'], 'fc_index_id3' => $_POST['muying_cid3'], 'fc_index_id4' => $_POST['muying_cid4']));
         if ($a && $b && $c && $d && e) {
             $a = $model_class->setFleaIndexClass(array('fc_index_code' => 'shuma', 'fc_index_name1' => $_POST['shuma_cname1'], 'fc_index_name2' => $_POST['shuma_cname2'], 'fc_index_name3' => $_POST['shuma_cname3'], 'fc_index_name4' => $_POST['shuma_cname4']));
             $b = $model_class->setFleaIndexClass(array('fc_index_code' => 'zhuangban', 'fc_index_name1' => $_POST['zhuangban_cname1'], 'fc_index_name2' => $_POST['zhuangban_cname2'], 'fc_index_name3' => $_POST['zhuangban_cname3'], 'fc_index_name4' => $_POST['zhuangban_cname4']));
             $c = $model_class->setFleaIndexClass(array('fc_index_code' => 'jujia', 'fc_index_name1' => $_POST['jujia_cname1'], 'fc_index_name2' => $_POST['jujia_cname2'], 'fc_index_name3' => $_POST['jujia_cname3'], 'fc_index_name4' => $_POST['jujia_cname4']));
             $d = $model_class->setFleaIndexClass(array('fc_index_code' => 'xingqu', 'fc_index_name1' => $_POST['xingqu_cname1'], 'fc_index_name2' => $_POST['xingqu_cname2'], 'fc_index_name3' => $_POST['xingqu_cname3'], 'fc_index_name4' => $_POST['xingqu_cname4']));
             $e = $model_class->setFleaIndexClass(array('fc_index_code' => 'muying', 'fc_index_name1' => $_POST['muying_cname1'], 'fc_index_name2' => $_POST['muying_cname2'], 'fc_index_name3' => $_POST['muying_cname3'], 'fc_index_name4' => $_POST['muying_cname4']));
             if ($a && $b && $c && $d && e) {
                 uk86_showMessage(Uk86Language::uk86_get('flea_class_setting_ok'));
             }
         } else {
             uk86_showMessage(Uk86Language::uk86_get('flea_class_setting_error'));
         }
     }
     Tpl::showpage('flea_class_index');
 }
Esempio n. 12
0
 function flea_indexOp()
 {
     /**
      * 读取语言包
      */
     $lang = Uk86Language::uk86_getLangContent();
     /**
      * 实例化模型
      */
     $model_setting = Model('setting');
     /**
      * 保存信息
      */
     if ($_POST['form_submit'] == 'ok') {
         $update_array = array();
         $update_array['flea_site_name'] = trim($_POST['flea_site_name']);
         $update_array['flea_site_title'] = trim($_POST['flea_site_title']);
         $update_array['flea_site_description'] = trim($_POST['flea_site_description']);
         $update_array['flea_site_keywords'] = trim($_POST['flea_site_keywords']);
         $update_array['flea_hot_search'] = str_replace(',', ',', trim($_POST['flea_hot_search']));
         $result = $model_setting->updateSetting($update_array);
         if ($result === true) {
             uk86_showMessage($lang['nc_common_save_succ']);
         } else {
             uk86_showMessage($lang['nc_common_save_fail']);
         }
     }
     /**
      * 读取设置内容 $list_setting
      */
     $list_setting = $model_setting->getListSetting();
     /**
      * 模板输出
      */
     Tpl::output('list_setting', $list_setting);
     Tpl::showpage('setting.flea_index');
 }
Esempio n. 13
0
 /**
  * 店铺二级域名列表
  */
 public function store_domain_listOp()
 {
     $lang = Uk86Language::uk86_getLangContent();
     $condition = array();
     $condition['store_state'] = array('neq', 2);
     if (trim($_GET['store_name']) != '') {
         $condition['store_name'] = array('like', '%' . trim($_GET['store_name']) . '%');
     }
     if (trim($_GET['store_domain']) != '') {
         $condition['store_domain'] = array(array('neq', ''), array('like', '%' . trim($_GET['store_domain']) . '%'), 'and');
     } else {
         $condition['store_domain'] = array('neq', '');
     }
     $model_store = Model('store');
     $store_list = $model_store->where($condition)->order('store_sort asc')->page(10)->select();
     if (!empty($store_list)) {
         foreach ($store_list as $k => $v) {
             $store_list[$k]['state'] = $v['store_state'] == 1 ? $lang['open'] : $lang['close'];
         }
     }
     Tpl::output('store_list', $store_list);
     Tpl::output('page', $model_store->showpage('2'));
     Tpl::showpage('store_domain.index');
 }
Esempio n. 14
0
 /**
  * 搜索设置
  */
 public function searchOp()
 {
     if (uk86_chksubmit()) {
         $lang = Uk86Language::uk86_getLangContent();
         $model_setting = Model('setting');
         /**
          * 转码  防止GBK下用中文逗号截取不正确
          */
         $comma = ',';
         if (strtoupper(CHARSET) == 'GBK') {
             $comma = Uk86Language::uk86_getGBK($comma);
         }
         $result = $model_setting->updateSetting(array('hot_search' => str_replace($comma, ',', $_POST['hot_search'])));
         if ($result) {
             uk86_showMessage($lang['nc_common_save_succ']);
         } else {
             uk86_showMessage($lang['nc_common_save_fail']);
         }
     }
     $model_setting = Model('setting');
     $list_setting = $model_setting->getListSetting();
     Tpl::output('list_setting', $list_setting);
     Tpl::showpage('setting.search');
 }
Esempio n. 15
0
 /**
  * 所有品牌
  */
 public function brand_allOp()
 {
     //读取语言包
     Uk86Language::uk86_read('home_store_class_index');
     $lang = Uk86Language::uk86_getLangContent();
     //店铺类目快速搜索
     $class_list = ($h = F('store_class')) ? $h : uk86_rkcache('store_class', true, 'file');
     if (!key_exists($_GET['cate_id'], $class_list)) {
         $_GET['cate_id'] = 0;
     }
     Tpl::output('class_list', $class_list);
     //店铺搜索
     $model = Model();
     $condition = array();
     $keyword = trim($_GET['keyword']);
     if (C('fullindexer.open') && !empty($keyword)) {
         //全文搜索
         $condition = $this->full_search($keyword);
     } else {
         if ($keyword != '') {
             $condition['store_name|store_zy'] = array('like', '%' . $keyword . '%');
         }
         if ($_GET['user_name'] != '') {
             $condition['member_name'] = trim($_GET['user_name']);
         }
     }
     if (!empty($_GET['area_info'])) {
         $condition['area_info'] = array('like', '%' . $_GET['area_info'] . '%');
     }
     if ($_GET['cate_id'] > 0) {
         $child = array_merge((array) $class_list[$_GET['cate_id']]['child'], array($_GET['cate_id']));
         $condition['sc_id'] = array('in', $child);
     }
     $condition['store_state'] = 1;
     if (!in_array($_GET['order'], array('desc', 'asc'))) {
         unset($_GET['order']);
     }
     if (!in_array($_GET['key'], array('store_sales', 'store_credit'))) {
         unset($_GET['key']);
     }
     $order = 'store_sort asc';
     if (isset($condition['store.store_id'])) {
         $condition['store_id'] = $condition['store.store_id'];
         unset($condition['store.store_id']);
     }
     $model_store = Model('store');
     $store_list = $model_store->where($condition)->order($order)->page(10)->select();
     //获取店铺商品数,推荐商品列表等信息
     $store_list = $model_store->getStoreSearchList($store_list);
     //print_r($store_list);exit();
     //信用度排序
     if ($_GET['key'] == 'store_credit') {
         if ($_GET['order'] == 'desc') {
             $store_list = sortClass::sortArrayDesc($store_list, 'store_credit_average');
         } else {
             $store_list = sortClass::sortArrayAsc($store_list, 'store_credit_average');
         }
     } else {
         if ($_GET['key'] == 'store_sales') {
             //销量排行
             if ($_GET['order'] == 'desc') {
                 $store_list = sortClass::sortArrayDesc($store_list, 'num_sales_jq');
             } else {
                 $store_list = sortClass::sortArrayAsc($store_list, 'num_sales_jq');
             }
         }
     }
     Tpl::output('store_list', $store_list);
     Tpl::output('show_page', $model->showpage(2));
     //当前位置
     if (intval($_GET['cate_id']) > 0) {
         $nav_link[1]['link'] = 'index.php?act=shop_search';
         $nav_link[1]['title'] = $lang['site_search_store'];
         $nav = $class_list[$_GET['cate_id']];
         //如果有父级
         if ($nav['sc_parent_id'] > 0) {
             $tmp = $class_list[$nav['sc_parent_id']];
             //存入父级
             $nav_link[] = array('title' => $tmp['sc_name'], 'link' => "index.php?act=store_list&cate_id=" . $nav['sc_parent_id']);
         }
         //存入当前级
         $nav_link[] = array('title' => $nav['sc_name']);
     } else {
         $nav_link[1]['link'] = 'index.php';
         $nav_link[1]['title'] = $lang['homepage'];
         $nav_link[2]['title'] = $lang['site_search_store'];
     }
     $purl = $this->getParam();
     Tpl::output('nav_link_list', $nav_link);
     Tpl::output('purl', uk86_urlShop($purl['act'], $purl['op'], $purl['param']));
     //SEO
     Model('seo')->type('index')->show();
     Tpl::output('html_title', (empty($_GET['keyword']) ? '' : $_GET['keyword'] . ' - ') . C('site_name') . $lang['nc_common_search']);
     Tpl::showpage('brand_all');
 }
Esempio n. 16
0
 /**
  * 测试邮件发送
  *
  * @param
  * @return
  */
 public function email_testingOp()
 {
     /**
      * 读取语言包
      */
     $lang = Uk86Language::uk86_getLangContent();
     $email_host = trim($_POST['email_host']);
     $email_port = trim($_POST['email_port']);
     $email_addr = trim($_POST['email_addr']);
     $email_id = trim($_POST['email_id']);
     $email_pass = trim($_POST['email_pass']);
     $email_test = trim($_POST['email_test']);
     $subject = $lang['test_email'];
     $site_url = SHOP_SITE_URL;
     $site_title = C('site_name');
     $message = '<p>' . $lang['this_is_to'] . "<a href='" . $site_url . "' target='_blank'>" . $site_title . '</a>' . $lang['test_email_send_ok'] . '</p>';
     // 		if ($email_type == '1'){
     $obj_email = new Uk86Email();
     $obj_email->uk86_set('email_server', $email_host);
     $obj_email->uk86_set('email_port', $email_port);
     $obj_email->uk86_set('email_user', $email_id);
     $obj_email->uk86_set('email_password', $email_pass);
     $obj_email->uk86_set('email_from', $email_addr);
     $obj_email->uk86_set('site_name', $site_title);
     $result = $obj_email->uk86_send($email_test, $subject, $message);
     // 		}else {
     // 			$result = @mail($email_test,$subject,$message);
     // 		}
     if ($result === false) {
         $message = $lang['test_email_send_fail'];
         if (strtoupper(CHARSET) == 'GBK') {
             $message = Uk86Language::uk86_getUTF8($message);
         }
         uk86_showMessage($message, '', 'json');
     } else {
         $message = $lang['test_email_send_ok'];
         if (strtoupper(CHARSET) == 'GBK') {
             $message = Uk86Language::uk86_getUTF8($message);
         }
         uk86_showMessage($message, '', 'json');
     }
 }
Esempio n. 17
0
 /**
  * 上传图片
  *
  * @param
  * @return
  */
 public function swfuploadOp()
 {
     /**
      * 读取语言包
      */
     Uk86Language::uk86_read('sns_home');
     $lang = Uk86Language::uk86_getLangContent();
     $member_id = $_SESSION['member_id'];
     $class_id = intval($_POST['category_id']);
     if ($member_id <= 0 && $class_id <= 0) {
         echo json_encode(array('state' => 'false', 'message' => Uk86Language::uk86_get('sns_upload_pic_fail'), 'origin_file_name' => $_FILES["file"]["name"]));
         exit;
     }
     $model = Model();
     // 验证图片数量
     $count = $model->table('sns_albumpic')->where(array('member_id' => $member_id))->count();
     if (C('malbum_max_sum') != 0 && $count >= C('malbum_max_sum')) {
         echo json_encode(array('state' => 'false', 'message' => Uk86Language::uk86_get('sns_upload_img_max_num_error'), 'origin_file_name' => $_FILES["file"]["name"]));
         exit;
     }
     /**
      * 上传图片
      */
     $upload = new Uk86UploadFile();
     $upload_dir = ATTACH_MALBUM . DS . $member_id . DS;
     $upload->uk86_set('default_dir', $upload_dir . $upload->getSysSetPath());
     $thumb_width = '240,1024';
     $thumb_height = '2048,1024';
     $upload->uk86_set('max_size', C('image_max_filesize'));
     $upload->uk86_set('thumb_width', $thumb_width);
     $upload->uk86_set('thumb_height', $thumb_height);
     $upload->uk86_set('fprefix', $member_id);
     $upload->uk86_set('thumb_ext', '_240,_1024');
     $result = $upload->uk86_upfile('file');
     if (!$result) {
         echo json_encode(array('state' => 'false', 'message' => Uk86Language::uk86_get('sns_upload_pic_fail'), 'origin_file_name' => $_FILES["file"]["name"]));
         exit;
     }
     $img_path = $upload->getSysSetPath() . $upload->file_name;
     list($width, $height, $type, $attr) = getimagesize(BASE_UPLOAD_PATH . DS . ATTACH_MALBUM . DS . $member_id . DS . $img_path);
     $image = explode('.', $_FILES["file"]["name"]);
     if (strtoupper(CHARSET) == 'GBK') {
         $image['0'] = Uk86Language::uk86_getGBK($image['0']);
     }
     $insert = array();
     $insert['ap_name'] = $image['0'];
     $insert['ac_id'] = $class_id;
     $insert['ap_cover'] = $img_path;
     $insert['ap_size'] = intval($_FILES['file']['size']);
     $insert['ap_spec'] = $width . 'x' . $height;
     $insert['upload_time'] = time();
     $insert['member_id'] = $member_id;
     $result = $model->table('sns_albumpic')->insert($insert);
     $data = array();
     $data['file_id'] = $result;
     $data['file_name'] = $img_path;
     $data['origin_file_name'] = $_FILES["file"]["name"];
     $data['file_path'] = $img_path;
     $data['file_url'] = uk86_snsThumb($img_path, 240);
     $data['state'] = 'true';
     /**
      * 整理为json格式
      */
     $output = json_encode($data);
     echo $output;
 }
Esempio n. 18
0
 /**
  * 用户中心右边,小导航
  *
  * @param string	$menu_type	导航类型
  * @param string 	$menu_key	当前导航的menu_key
  * @param array 	$array		附加菜单
  * @return
  */
 private function profile_menu($menu_key = '', $array = array())
 {
     Uk86Language::uk86_read('member_layout');
     $lang = Uk86Language::uk86_getLangContent();
     $menu_array = array();
     $menu_array = array(1 => array('menu_key' => 'qq_bind', 'menu_name' => $lang['nc_member_path_qq_bind'], 'menu_url' => 'index.php?act=member_connect&op=qqbind'), 2 => array('menu_key' => 'sina_bind', 'menu_name' => $lang['nc_member_path_sina_bind'], 'menu_url' => 'index.php?act=member_connect&op=sinabind'));
     if (!empty($array)) {
         $menu_array[] = $array;
     }
     Tpl::output('member_menu', $menu_array);
     Tpl::output('menu_key', $menu_key);
 }
Esempio n. 19
0
 /**
  * 写入文件
  *
  * @param int $id 记录ID
  * @return array $rs_row 返回数组形式的查询结果
  */
 public function writeBackFile()
 {
     Uk86Language::uk86_read('model_lang_index');
     $lang = Uk86Language::uk86_getLangContent();
     $step = $this->step;
     try {
         if (!is_dir(BASE_ROOT_PATH . DS . 'sql_back' . DS . $_SESSION['db_backup']['back_file'])) {
             if (!$this->mkdirs(BASE_ROOT_PATH . DS . 'sql_back' . DS . $_SESSION['db_backup']['back_file'], 0755)) {
                 $error = $lang['db_backup_mkdir_fail'];
                 throw new Exception($error);
             } else {
                 $fp = @fopen(BASE_ROOT_PATH . DS . 'sql_back' . DS . $_SESSION['db_backup']['back_file'] . DS . 'index.html', 'w+');
                 @fclose($fp);
             }
         }
         $file_name = BASE_ROOT_PATH . DS . 'sql_back' . DS . $_SESSION['db_backup']['back_file'] . DS . $_SESSION['db_backup']['back_file'] . '_' . $step . '_' . $_SESSION['db_backup']['md5'] . '.sql';
         $fp = @fopen($file_name, 'w+');
         if (@fwrite($fp, $this->back_content) === false) {
             $error = $lang['db_backup_vi_file_fail'];
             throw new Exception($error);
         }
         @fclose($fp);
     } catch (Exception $e) {
         uk86_showMessage($e->getMessage(), '', 'exception');
     }
     return true;
 }
Esempio n. 20
0
 public function uploadOp()
 {
     if (!uk86_chksubmit()) {
         uk86_redirect('index.php?act=member_information&op=avatar');
     }
     uk86_import('function.thumb');
     Uk86Language::uk86_read('member_home_member,cut');
     $lang = Uk86Language::uk86_getLangContent();
     $member_id = $_SESSION['member_id'];
     //上传图片
     $upload = new Uk86UploadFile();
     $upload->uk86_set('thumb_width', 500);
     $upload->uk86_set('thumb_height', 499);
     $ext = strtolower(pathinfo($_FILES['pic']['name'], PATHINFO_EXTENSION));
     $upload->uk86_set('file_name', "avatar_{$member_id}.{$ext}");
     $upload->uk86_set('thumb_ext', '_new');
     $upload->uk86_set('ifremove', true);
     $upload->uk86_set('default_dir', ATTACH_AVATAR);
     if (!empty($_FILES['pic']['tmp_name'])) {
         $result = $upload->uk86_upfile('pic');
         if (!$result) {
             uk86_showMessage($upload->error, '', 'html', 'error');
         }
     } else {
         uk86_showMessage('上传失败,请尝试更换图片格式或小图片', '', 'html', 'error');
     }
     self::profile_menu('member', 'avatar');
     Tpl::output('menu_sign', 'profile');
     Tpl::output('menu_sign_url', 'index.php?act=member_information&op=member');
     Tpl::output('menu_sign1', 'avatar');
     Tpl::output('newfile', $upload->thumb_image);
     Tpl::output('height', uk86_get_height(BASE_UPLOAD_PATH . '/' . ATTACH_AVATAR . '/' . $upload->thumb_image));
     Tpl::output('width', uk86_get_width(BASE_UPLOAD_PATH . '/' . ATTACH_AVATAR . '/' . $upload->thumb_image));
     Tpl::showpage('member_profile.avatar');
 }
Esempio n. 21
0
 /**
  * 取得后台菜单
  *
  * @param string $permission
  * @return
  */
 protected final function getNav($permission = '', &$top_nav, &$left_nav, &$map_nav)
 {
     $act = $_GET['act'] ? $_GET['act'] : $_POST['act'];
     $op = $_GET['op'] ? $_GET['op'] : $_POST['op'];
     if ($this->admin_info['sp'] != 1 && empty($this->permission)) {
         $gadmin = Model('gadmin')->getby_gid($this->admin_info['gid']);
         $permission = uk86_decrypt($gadmin['limits'], MD5_KEY . md5($gadmin['gname']));
         $this->permission = $permission = explode('|', $permission);
     }
     Uk86Language::uk86_read('common');
     $lang = Uk86Language::uk86_getLangContent();
     $array = (require BASE_PATH . '/include/menu.php');
     $array = $this->parseMenu($array);
     //管理地图
     $map_nav = $array['left'];
     unset($map_nav[0]);
     $model_nav = "<li><a class=\"link actived\" id=\"nav__nav_\" href=\"javascript:;\" onclick=\"openItem('_args_');\"><span>_text_</span></a></li>\n";
     $top_nav = '';
     //顶部菜单
     foreach ($array['top'] as $k => $v) {
         $v['nav'] = $v['args'];
         $top_nav .= str_ireplace(array('_args_', '_text_', '_nav_'), $v, $model_nav);
     }
     $top_nav = str_ireplace("\n<li><a class=\"link actived\"", "\n<li><a class=\"link\"", $top_nav);
     //左侧菜单
     $model_nav = "\n          <ul id=\"sort__nav_\">\n            <li>\n              <dl>\n                <dd>\n                  <ol>\n                    list_body\n                  </ol>\n                </dd>\n              </dl>\n            </li>\n          </ul>\n";
     $left_nav = '';
     foreach ($array['left'] as $k => $v) {
         $left_nav .= str_ireplace(array('_nav_'), array($v['nav']), $model_nav);
         $model_list = "<li nc_type='_pkey_'><a href=\"JavaScript:void(0);\" name=\"item__opact_\" id=\"item__opact_\" onclick=\"openItem('_args_');\">_text_</a></li>";
         $tmp_list = '';
         $current_parent = '';
         //当前父级key
         foreach ($v['list'] as $key => $value) {
             $model_list_parent = '';
             $args = explode(',', $value['args']);
             if ($admin_array['admin_is_super'] != 1) {
                 if (!@in_array($args[1], $permission)) {
                     //continue;
                 }
             }
             if (!empty($value['parent'])) {
                 if (empty($current_parent) || $current_parent != $value['parent']) {
                     $model_list_parent = "<li nc_type='parentli' dataparam='{$value['parent']}'><dt>{$value['parenttext']}</dt><dd style='display:block;'></dd></li>";
                 }
                 $current_parent = $value['parent'];
             }
             $value['op'] = $args[0];
             $value['act'] = $args[1];
             //$tmp_list .= str_ireplace(array('_args_','_text_','_op_'),$value,$model_list);
             $tmp_list .= str_ireplace(array('_args_', '_text_', '_opact_', '_pkey_'), array($value['args'], $value['text'], $value['op'] . $value['act'], $value['parent']), $model_list_parent . $model_list);
         }
         $left_nav = str_replace('list_body', $tmp_list, $left_nav);
     }
 }
Esempio n. 22
0
 /**
  * 导出
  *
  */
 public function export_step1Op()
 {
     $lang = Uk86Language::uk86_getLangContent();
     $model_order = Model('order');
     $condition = array();
     if ($_GET['order_sn']) {
         $condition['order_sn'] = $_GET['order_sn'];
     }
     if ($_GET['store_name']) {
         $condition['store_name'] = $_GET['store_name'];
     }
     if (in_array($_GET['order_state'], array('0', '10', '20', '30', '40'))) {
         $condition['order_state'] = $_GET['order_state'];
     }
     if ($_GET['payment_code']) {
         $condition['payment_code'] = $_GET['payment_code'];
     }
     if ($_GET['buyer_name']) {
         $condition['buyer_name'] = $_GET['buyer_name'];
     }
     $if_start_time = preg_match('/^20\\d{2}-\\d{2}-\\d{2}$/', $_GET['query_start_time']);
     $if_end_time = preg_match('/^20\\d{2}-\\d{2}-\\d{2}$/', $_GET['query_end_time']);
     $start_unixtime = $if_start_time ? strtotime($_GET['query_start_time']) : null;
     $end_unixtime = $if_end_time ? strtotime($_GET['query_end_time']) : null;
     if ($start_unixtime || $end_unixtime) {
         $condition['add_time'] = array('time', array($start_unixtime, $end_unixtime));
     }
     if (!is_numeric($_GET['curpage'])) {
         $count = $model_order->getOrderCount($condition);
         $array = array();
         if ($count > self::EXPORT_SIZE) {
             //显示下载链接
             $page = ceil($count / self::EXPORT_SIZE);
             for ($i = 1; $i <= $page; $i++) {
                 $limit1 = ($i - 1) * self::EXPORT_SIZE + 1;
                 $limit2 = $i * self::EXPORT_SIZE > $count ? $count : $i * self::EXPORT_SIZE;
                 $array[$i] = $limit1 . ' ~ ' . $limit2;
             }
             Tpl::output('list', $array);
             Tpl::output('murl', 'index.php?act=order&op=index');
             Tpl::showpage('export.excel');
         } else {
             //如果数量小,直接下载
             $data = $model_order->getOrderList($condition, '', '*', 'order_id desc', self::EXPORT_SIZE);
             $this->createExcel($data);
         }
     } else {
         //下载
         $limit1 = ($_GET['curpage'] - 1) * self::EXPORT_SIZE;
         $limit2 = self::EXPORT_SIZE;
         $data = $model_order->getOrderList($condition, '', '*', 'order_id desc', "{$limit1},{$limit2}");
         $this->createExcel($data);
     }
 }
Esempio n. 23
0
 /**
  * 删除TAG
  */
 public function tag_delOp()
 {
     $id = intval($_GET['tag_id']);
     $lang = Uk86Language::uk86_getLangContent();
     $model_class_tag = Model('goods_class_tag');
     if ($id > 0) {
         /**
          * 删除TAG
          */
         $model_class_tag->delTagByIds($id);
         $this->log(L('nc_delete') . 'tag[ID:' . $id . ']', 1);
         uk86_showMessage($lang['nc_common_op_succ']);
     } else {
         $this->log(L('nc_delete') . 'tag[ID:' . $id . ']', 0);
         uk86_showMessage($lang['nc_common_op_fail']);
     }
 }
Esempio n. 24
0
 public function forget_password_identify_postOp()
 {
     Uk86Language::uk86_read('home_login_register');
     $lang = Uk86Language::uk86_getLangContent();
     $result = uk86_chksubmit(true, true, 'num');
     if ($result !== false) {
         if ($result === -11) {
             showDialog('非法提交');
         } elseif ($result === -12) {
             showDialog('验证码错误');
         }
     }
     if (empty($_POST['password'])) {
         showDialog($lang['login_password_input_email']);
     }
     if (Uk86process::uk86_islock('forget')) {
         showDialog($lang['nc_common_op_repeat'], 'reload');
     }
     if (!$_SESSION['temp_user_id']) {
         showDialog("参数不正确");
     }
     echo $_SESSION['temp_user_id'];
     $member_model = Model('member');
     //	可能有注入问题
     if (!$member_model->editMember(array('member_id' => $_SESSION['temp_user_id']), array('member_passwd' => md5($_POST['password'])))) {
         showDialog($lang['login_password_email_fail'], 'reload');
     }
     $_SESSION['temp_identifying_time'] = $_SESSION['temp_identifying_time'] - 1800;
     showDialog("修改成功", 'index.php');
 }
Esempio n. 25
0
 /**
  * 调用显示模板
  *
  * @param string $page_name
  * @param string $layout
  * @param int $time
  */
 public static function showpage($page_name = '', $layout = '', $time = 2000)
 {
     if (!defined('TPL_NAME')) {
         define('TPL_NAME', 'default');
     }
     self::getInstance();
     if (!empty(self::$tpl_dir)) {
         $tpl_dir = self::$tpl_dir . DS;
     }
     //默认是带有布局文件
     if (empty($layout)) {
         $layout = 'layout' . DS . self::$layout_file . '.php';
     } else {
         $layout = 'layout' . DS . $layout . '.php';
     }
     $layout_file = BASE_PATH . '/templates/' . TPL_NAME . DS . $layout;
     $tpl_file = BASE_PATH . '/templates/' . TPL_NAME . DS . $tpl_dir . $page_name . '.php';
     if (file_exists($tpl_file)) {
         //对模板变量进行赋值
         $output = self::$output_value;
         //页头
         $output['html_title'] = $output['html_title'] != '' ? $output['html_title'] : $GLOBALS['setting_config']['site_name'];
         $output['seo_keywords'] = $output['seo_keywords'] != '' ? $output['seo_keywords'] : $GLOBALS['setting_config']['site_name'];
         $output['seo_description'] = $output['seo_description'] != '' ? $output['seo_description'] : $GLOBALS['setting_config']['site_name'];
         $output['ref_url'] = uk86_getReferer();
         Uk86Language::uk86_read('common');
         $lang = Uk86Language::uk86_getLangContent();
         @header("Content-type: text/html; charset=" . CHARSET);
         //判断是否使用布局方式输出模板,如果是,那么包含布局文件,并且在布局文件中包含模板文件
         if ($layout != '') {
             if (file_exists($layout_file)) {
                 include_once $layout_file;
             } else {
                 $error = 'Tpl ERROR:' . 'templates' . DS . $layout . ' is not exists';
                 uk86_throw_exception($error);
             }
         } else {
             include_once $tpl_file;
         }
     } else {
         $error = 'Tpl ERROR:' . 'templates' . DS . $tpl_dir . $page_name . '.php' . ' is not exists';
         uk86_throw_exception($error);
     }
 }
Esempio n. 26
0
 /**
  * 物流跟踪
  */
 public function search_deliverOp()
 {
     Uk86Language::uk86_read('member_member_index');
     $lang = Uk86Language::uk86_getLangContent();
     $order_sn = $_GET['order_sn'];
     if (!is_numeric($order_sn)) {
         uk86_showMessage(Uk86Language::uk86_get('wrong_argument'), '', 'html', 'error');
     }
     $model_order = Model('order');
     $condition['order_sn'] = $order_sn;
     $condition['store_id'] = $_SESSION['store_id'];
     $order_info = $model_order->getOrderInfo($condition, array('order_common', 'order_goods'));
     if (empty($order_info) || $order_info['shipping_code'] == '') {
         uk86_showMessage('未找到信息', '', 'html', 'error');
     }
     $order_info['state_info'] = uk86_orderState($order_info);
     Tpl::output('order_info', $order_info);
     //卖家发货信息
     $daddress_info = Model('daddress')->getAddressInfo(array('address_id' => $order_info['extend_order_common']['daddress_id']));
     Tpl::output('daddress_info', $daddress_info);
     //取得配送公司代码
     $express = uk86_rkcache('express', true);
     Tpl::output('e_code', $express[$order_info['extend_order_common']['shipping_express_id']]['e_code']);
     Tpl::output('e_name', $express[$order_info['extend_order_common']['shipping_express_id']]['e_name']);
     Tpl::output('e_url', $express[$order_info['extend_order_common']['shipping_express_id']]['e_url']);
     Tpl::output('shipping_code', $order_info['shipping_code']);
     self::profile_menu('search', 'search');
     Tpl::showpage('store_deliver.detail');
 }
Esempio n. 27
0
 /**
  * 更新模块html信息
  *
  */
 public function updateWebHtml($web_id = 1, $web_array = array())
 {
     $web_html = '';
     $code_list = $this->getCodeList(array('web_id' => $web_id));
     if (!empty($code_list) && is_array($code_list)) {
         Uk86Language::uk86_read('web_config,home_index_index');
         $lang = Uk86Language::uk86_getLangContent();
         $output = array();
         if (empty($web_array)) {
             $web_array = $web_list[0];
         }
         $output['web_id'] = $web_id;
         $output['style_name'] = $web_array['style_name'];
         foreach ($code_list as $key => $val) {
             $var_name = $val['var_name'];
             $code_info = $val['code_info'];
             $code_type = $val['code_type'];
             $val['code_info'] = $this->get_array($code_info, $code_type);
             $output['code_' . $var_name] = $val;
         }
         $web_page = $web_array['web_page'];
         switch ($web_page) {
             case 'index':
                 $style_file = BASE_DATA_PATH . DS . 'resource' . DS . 'web_config' . DS . 'default.php';
                 break;
             case 'index_pic':
                 $style_file = BASE_DATA_PATH . DS . 'resource' . DS . 'web_config' . DS . 'focus.php';
                 break;
             case 'index_sale':
                 $style_file = BASE_DATA_PATH . DS . 'resource' . DS . 'web_config' . DS . 'sale_goods.php';
                 break;
             case 'channel_tp':
                 $style_file = BASE_DATA_PATH . DS . 'resource' . DS . 'web_config' . DS . 'channel_top.php';
                 break;
             case 'channel_fl':
                 $style_file = BASE_DATA_PATH . DS . 'resource' . DS . 'web_config' . DS . 'channel_floor.php';
                 break;
             default:
                 $style_file = BASE_DATA_PATH . DS . 'resource' . DS . 'web_config' . DS . 'default.php';
                 break;
         }
         if (file_exists($style_file)) {
             ob_start();
             include $style_file;
             $web_html = ob_get_contents();
             ob_end_clean();
         }
         $web_array = array();
         $web_array['web_html'] = C('dbdriver') == 'mysql' ? addslashes($web_html) : $web_html;
         $web_array['update_time'] = time();
         $this->updateWeb(array('web_id' => $web_id), $web_array);
     }
     return $web_html;
 }
Esempio n. 28
0
 /**
  * 取得所有权限项
  *
  * @return array
  */
 private function permission()
 {
     Uk86Language::uk86_read('common');
     $lang = Uk86Language::uk86_getLangContent();
     $limit = (require BASE_PATH . '/include/limit.php');
     if (is_array($limit)) {
         foreach ($limit as $k => $v) {
             if (is_array($v['child'])) {
                 $tmp = array();
                 foreach ($v['child'] as $key => $value) {
                     $act = !empty($value['act']) ? $value['act'] : $v['act'];
                     if (strpos($act, '|') == false) {
                         //act参数不带|
                         $limit[$k]['child'][$key]['op'] = rtrim($act . '.' . str_replace('|', '|' . $act . '.', $value['op']), '.');
                     } else {
                         //act参数带|
                         $tmp_str = '';
                         if (empty($value['op'])) {
                             $limit[$k]['child'][$key]['op'] = $act;
                         } elseif (strpos($value['op'], '|') == false) {
                             //op参数不带|
                             foreach (explode('|', $act) as $v1) {
                                 $tmp_str .= "{$v1}.{$value['op']}|";
                             }
                             $limit[$k]['child'][$key]['op'] = rtrim($tmp_str, '|');
                         } elseif (strpos($value['op'], '|') != false && strpos($act, '|') != false) {
                             //op,act都带|,交差权限
                             foreach (explode('|', $act) as $v1) {
                                 foreach (explode('|', $value['op']) as $v2) {
                                     $tmp_str .= "{$v1}.{$v2}|";
                                 }
                             }
                             $limit[$k]['child'][$key]['op'] = rtrim($tmp_str, '|');
                         }
                     }
                 }
             }
         }
         return $limit;
     } else {
         return array();
     }
 }
Esempio n. 29
0
 /**
  * 系统文章编辑
  */
 public function editOp()
 {
     $lang = Uk86Language::uk86_getLangContent();
     /**
      * 更新
      */
     if (uk86_chksubmit()) {
         /**
          * 验证
          */
         $obj_validate = new Uk86Validate();
         $obj_validate->validateparam = array(array("input" => $_POST["doc_title"], "require" => "true", "message" => $lang['document_index_title_null']), array("input" => $_POST["doc_content"], "require" => "true", "message" => $lang['document_index_content_null']));
         $error = $obj_validate->uk86_validate();
         if ($error != '') {
             uk86_showMessage($error);
         } else {
             $param = array();
             $param['doc_id'] = intval($_POST['doc_id']);
             $param['doc_title'] = trim($_POST['doc_title']);
             $param['doc_content'] = trim($_POST['doc_content']);
             $param['doc_time'] = time();
             $model_doc = Model('document');
             $result = $model_doc->update($param);
             if ($result) {
                 /**
                  * 更新图片信息ID
                  */
                 $model_upload = Model('upload');
                 if (is_array($_POST['file_id'])) {
                     foreach ($_POST['file_id'] as $k => $v) {
                         $v = intval($v);
                         $update_array = array();
                         $update_array['upload_id'] = $v;
                         $update_array['item_id'] = intval($_POST['doc_id']);
                         $model_upload->update($update_array);
                         unset($update_array);
                     }
                 }
                 $url = array(array('url' => 'index.php?act=document&op=document', 'msg' => $lang['document_edit_back_to_list']), array('url' => 'index.php?act=document&op=edit&doc_id=' . intval($_POST['doc_id']), 'msg' => $lang['document_edit_again']));
                 $this->log(L('nc_edit,document_index_document') . '[ID:' . $_POST['doc_id'] . ']', 1);
                 uk86_showMessage($lang['nc_common_save_succ'], $url);
             } else {
                 uk86_showMessage($lang['nc_common_save_fail']);
             }
         }
     }
     /**
      * 编辑
      */
     if (empty($_GET['doc_id'])) {
         uk86_showMessage($lang['miss_argument']);
     }
     $model_doc = Model('document');
     $doc = $model_doc->getOneById(intval($_GET['doc_id']));
     /**
      * 模型实例化
      */
     $model_upload = Model('upload');
     $condition['upload_type'] = '4';
     $condition['item_id'] = $doc['doc_id'];
     $file_upload = $model_upload->getUploadList($condition);
     if (is_array($file_upload)) {
         foreach ($file_upload as $k => $v) {
             $file_upload[$k]['upload_path'] = UPLOAD_SITE_URL . '/' . ATTACH_ARTICLE . '/' . $file_upload[$k]['file_name'];
         }
     }
     Tpl::output('PHPSESSID', session_id());
     Tpl::output('file_upload', $file_upload);
     Tpl::output('doc', $doc);
     Tpl::showpage('document.edit');
 }
Esempio n. 30
0
 /**
  * 用户中心右边,小导航
  *
  * @param string	$menu_type	导航类型
  * @param string 	$menu_key	当前导航的menu_key
  * @param array 	$array		附加菜单
  * @return 
  */
 private function profile_menu($menu_type, $menu_key = '', $array = array())
 {
     $lang = Uk86Language::uk86_getLangContent();
     $menu_array = array();
     switch ($menu_type) {
         case 'goods':
             $menu_array = array(1 => array('menu_key' => 'flea_list', 'menu_name' => "闲置列表", 'menu_url' => 'index.php?act=member_flea'));
             break;
         case 'add_goods':
             $menu_array = array(1 => array('menu_key' => 'flea_list', 'menu_name' => "闲置列表", 'menu_url' => 'index.php?act=member_flea'), 2 => array('menu_key' => 'goods_add', 'menu_name' => "发布闲置", 'menu_url' => 'index.php?act=member_flea&op=add_goods'));
             break;
         case 'favorites':
             $menu_array = array(1 => array('menu_key' => 'favorites', 'menu_name' => "编辑闲置", 'menu_url' => 'index.php?act=member_flea&op=favorites'));
     }
     if (!empty($array)) {
         $menu_array[] = $array;
     }
     Tpl::output('member_menu', $menu_array);
     Tpl::output('menu_key', $menu_key);
 }