コード例 #1
0
ファイル: activity.php プロジェクト: lehman3087/wanhaoshop
 /**
  * 审核活动
  */
 public function activity_verifyOp()
 {
     if (chksubmit()) {
         $commonids = $_POST['commonids'];
         $commonid_array = explode(',', $commonids);
         foreach ($commonid_array as $value) {
             if (!is_numeric($value)) {
                 showDialog(L('nc_common_op_fail'), 'reload');
             }
         }
         $update2 = array();
         $update2['activity_verify'] = intval($_POST['verify_state']);
         $update2['activity_state'] = intval($_POST['verify_state']);
         $update1 = array();
         $update1['activity_verifyremark'] = trim($_POST['verify_reason']);
         $update1 = array_merge($update1, $update2);
         $where = array();
         $where['activity_id_in'] = $commonids;
         $model_activity = Model('activity');
         if (intval($_POST['verify_state']) == 0) {
             $model_activity->editActivityVerifyFail($where, $update1);
         } else {
             $model_activity->updateBycondition($update1, $where);
         }
         showDialog(L('nc_common_op_succ'), 'reload', 'succ');
     }
     Tpl::output('commonids', $_GET['id']);
     Tpl::showpage('activity.verify_remark', 'null_layout');
 }
コード例 #2
0
ファイル: share.php プロジェクト: wangjiang988/ukshop
 /**
  * 分享保存
  **/
 public function share_saveOp()
 {
     $data = array();
     $data['result'] = 'true';
     $share_id = intval($_POST['share_id']);
     $share_type = self::get_channel_type($_GET['type']);
     if ($share_id <= 0 || empty($share_type) || mb_strlen($_POST['commend_message']) > 140) {
         showDialog(Uk86Language::uk86_get('wrong_argument'), 'reload', 'fail', '');
     }
     if (!empty($_SESSION['member_id'])) {
         $model = Model("micro_{$_GET['type']}");
         //分享内容
         if (isset($_POST['share_app_items'])) {
             $condition = array();
             $condition[$share_type['type_key']] = $_POST['share_id'];
             if ($_GET['type'] == 'store') {
                 $info = $model->getOneWithStoreInfo($condition);
             } else {
                 $info = $model->getOne($condition);
             }
             $info['commend_message'] = $_POST['commend_message'];
             if (empty($info['commend_message'])) {
                 $info['commend_message'] = Uk86Language::uk86_get('microshop_share_default_message');
             }
             $info['type'] = $_GET['type'];
             $info['url'] = MICROSHOP_SITE_URL . DS . "index.php?act={$_GET['type']}&op=detail&{$_GET['type']}_id=" . $_POST['share_id'];
             self::share_app_publish('share', $info);
         }
         showDialog(Uk86Language::uk86_get('nc_common_save_succ'), '', 'succ', '');
     } else {
         showDialog(Uk86Language::uk86_get('no_login'), 'reload', 'fail', '');
     }
 }
コード例 #3
0
ファイル: share.php プロジェクト: ff00x0/shopnc-api
 /**
  * 分享保存
  **/
 public function share_saveOp()
 {
     $data = array();
     $data['result'] = 'true';
     $share_id = intval($_POST['share_id']);
     $share_type = $_GET['type'];
     if ($share_id <= 0 || empty($share_type) || mb_strlen($_POST['commend_message']) > 140) {
         showDialog(Language::get('wrong_argument'), 'reload', 'fail', '');
     }
     if (!empty($_SESSION['member_id'])) {
         $model = Model('cms_' . $share_type);
         $model->modify(array($share_type . '_share_count' => array('exp', $share_type . '_share_count+1')), array($share_type . '_id' => $share_id));
         //分享内容
         if (isset($_POST['share_app_items'])) {
             $info['commend_message'] = $_POST['commend_message'];
             $info['share_title'] = $_POST['share_title'];
             $info['share_image'] = $_POST['share_image'];
             if (empty($info['commend_message'])) {
                 $info['commend_message'] = Language::get('share_text');
             }
             $info['url'] = CMS_SITE_URL . DS . "index.php?act={$_GET['type']}&op={$_GET['type']}_detail&{$_GET['type']}_id=" . $_POST['share_id'];
             self::share_app_publish($info);
         }
         showDialog(Language::get('nc_common_save_succ'), '', 'succ', '');
     } else {
         showDialog(Language::get('no_login'), 'reload', 'fail', '');
     }
 }
コード例 #4
0
ファイル: joinin.php プロジェクト: flying3615/chuniang
 /**
  * 保存申请
  */
 public function save_deliveryOp()
 {
     if (!chksubmit()) {
         showDialog(L('wrong_argument'));
     }
     $insert = array();
     $insert['dlyp_name'] = $_POST['dname'];
     $insert['dlyp_passwd'] = md5($_POST['dpasswd']);
     $insert['dlyp_truename'] = $_POST['dtruename'];
     $insert['dlyp_mobile'] = $_POST['dmobile'];
     $insert['dlyp_telephony'] = $_POST['dtelephony'];
     $insert['dlyp_address_name'] = $_POST['daddressname'];
     $insert['dlyp_area_2'] = $_POST['area_id_2'];
     $insert['dlyp_area_3'] = $_POST['area_id'];
     $insert['dlyp_area_info'] = $_POST['area_info'];
     $insert['dlyp_address'] = $_POST['daddress'];
     $insert['dlyp_idcard'] = $_POST['didcard'];
     $insert['dlyp_addtime'] = TIMESTAMP;
     $insert['dlyp_state'] = 10;
     $upload = new UploadFile();
     $upload->set('default_dir', ATTACH_DELIVERY);
     $result = $upload->upfile('didcardimg');
     if (!$result) {
         showDialog($upload->error);
     }
     $insert['dlyp_idcard_image'] = $upload->file_name;
     $result = Model('delivery_point')->addDeliveryPoint($insert);
     if ($result) {
         showDialog('操作成功,等待管理员审核', 'index.php?act=login', 'succ');
     } else {
         showDialog(L('nc_common_op_fail'));
     }
 }
コード例 #5
0
ファイル: seller_store.php プロジェクト: noikiy/meizhan
 /**
  * 编辑店铺
  */
 public function store_editOp()
 {
     $upload = new UploadFile();
     /**
      * 上传店铺图片
      */
     if (!empty($_FILES['store_banner']['name'])) {
         $upload->set('default_dir', ATTACH_STORE);
         $upload->set('thumb_ext', '');
         $upload->set('file_name', '');
         $upload->set('ifremove', false);
         $result = $upload->upfile('store_banner');
         if ($result) {
             $_POST['store_banner'] = $upload->file_name;
         } else {
             showDialog($upload->error);
         }
     }
     //删除旧店铺图片
     if (!empty($_POST['store_banner']) && !empty($store_info['store_banner'])) {
         @unlink(BASE_UPLOAD_PATH . DS . ATTACH_STORE . DS . $this->store_info['store_banner']);
     }
     /**
      * 更新入库
      */
     $param = array('store_banner' => empty($_POST['store_banner']) ? $this->store_info['store_banner'] : $_POST['store_banner'], 'store_qq' => $_POST['store_qq'], 'store_ww' => $_POST['store_ww'], 'store_phone' => $_POST['store_phone'], 'store_zy' => $_POST['store_zy'], 'store_keywords' => $_POST['seo_keywords'], 'store_description' => $_POST['seo_description']);
     $result = Model('store')->editStore($param, array('store_id' => $this->store_info['store_id']));
     if (!$result) {
         output_error('编辑失败');
     }
     output_data('1');
 }
コード例 #6
0
ファイル: connect_wx.php プロジェクト: dotku/shopnc_cnnewyork
 /**
  * 回调获取信息
  */
 public function get_infoOp()
 {
     $code = $_GET['code'];
     if (!empty($code)) {
         $user_info = $this->get_user_info($code);
         if (!empty($user_info['unionid'])) {
             $unionid = $user_info['unionid'];
             $model_member = Model('member');
             $member = $model_member->getMemberInfo(array('weixin_unionid' => $unionid));
             if (!empty($member)) {
                 //会员信息存在时自动登录
                 $model_member->createSession($member);
                 showDialog('登录成功', 'index.php?act=member&op=home', 'succ');
             }
             if (!empty($_SESSION['member_id'])) {
                 //已登录时绑定微信
                 $member_id = $_SESSION['member_id'];
                 $member = array();
                 $member['weixin_unionid'] = $unionid;
                 $member['weixin_info'] = $user_info['weixin_info'];
                 $model_member->editMember(array('member_id' => $member_id), $member);
                 showDialog('微信绑定成功', 'index.php?act=member&op=home', 'succ');
             } else {
                 //自动注册会员并登录
                 $this->register($user_info);
                 exit;
             }
         }
     }
     showDialog('微信登录失败', urlLogin('login', 'index'), 'succ');
 }
コード例 #7
0
ファイル: login.php プロジェクト: wangjiang988/ukshop
 /**
  * 登出
  */
 public function logoutOp()
 {
     unset($_SESSION['delivery_login']);
     unset($_SESSION['dlyp_id']);
     unset($_SESSION['dlyp_name']);
     showDialog('退出成功', 'reload', 'succ');
 }
コード例 #8
0
ファイル: login.php プロジェクト: Maplecms/shopnc-api
 public function loginoutOp()
 {
     session_unset();
     session_destroy();
     setNcCookie('goodsnum', '', -3600);
     showDialog(L('login_logout_success'), '', 'succ', '', 2);
 }
コード例 #9
0
 /**
  * 添加商品
  */
 public function add_step_twoOp()
 {
     // 实例化商品分类模型
     $model_goodsclass = Model('goods_class');
     // 是否能使用编辑器
     if (checkPlatformStore()) {
         // 平台店铺可以使用编辑器
         $editor_multimedia = true;
     } else {
         // 三方店铺需要
         $editor_multimedia = false;
         if ($this->store_grade['sg_function'] == 'editor_multimedia') {
             $editor_multimedia = true;
         }
     }
     Tpl::output('editor_multimedia', $editor_multimedia);
     $gc_id = intval($_GET['class_id']);
     // 验证商品分类是否存在且商品分类是否为最后一级
     $data = H('goods_class') ? H('goods_class') : H('goods_class', true);
     if (!isset($data[$gc_id]) || isset($data[$gc_id]['child']) || isset($data[$gc_id]['childchild'])) {
         showDialog(L('store_goods_index_again_choose_category1'));
     }
     // 三方店铺验证是否绑定了该分类
     if (!checkPlatformStore()) {
         $where['class_1|class_2|class_3'] = $gc_id;
         $where['store_id'] = $_SESSION['store_id'];
         $rs = Model('store_bind_class')->getStoreBindClassInfo($where);
         if (empty($rs)) {
             showMessage(L('store_goods_index_again_choose_category2'));
         }
     }
     // 更新常用分类信息
     $goods_class = $model_goodsclass->getGoodsClassLineForTag($gc_id);
     Tpl::output('goods_class', $goods_class);
     Model('goods_class_staple')->autoIncrementStaple($goods_class, $_SESSION['member_id']);
     // 获取类型相关数据
     if ($goods_class['type_id'] > 0) {
         $typeinfo = Model('type')->getAttr($goods_class['type_id'], $_SESSION['store_id'], $gc_id);
         list($spec_json, $spec_list, $attr_list, $brand_list) = $typeinfo;
         Tpl::output('sign_i', count($spec_list));
         Tpl::output('spec_list', $spec_list);
         Tpl::output('attr_list', $attr_list);
         Tpl::output('brand_list', $brand_list);
     }
     // 实例化店铺商品分类模型
     $store_goods_class = Model('my_goods_class')->getClassTree(array('store_id' => $_SESSION['store_id'], 'stc_state' => '1'));
     Tpl::output('store_goods_class', $store_goods_class);
     // 小时分钟显示
     $hour_array = array('00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23');
     Tpl::output('hour_array', $hour_array);
     $minute_array = array('05', '10', '15', '20', '25', '30', '35', '40', '45', '50', '55');
     Tpl::output('minute_array', $minute_array);
     // 关联版式
     $plate_list = Model('store_plate')->getPlateList(array('store_id' => $_SESSION['store_id']), 'plate_id,plate_name,plate_position');
     $plate_list = array_under_reset($plate_list, 'plate_position', 2);
     Tpl::output('plate_list', $plate_list);
     Tpl::output('item_id', '');
     Tpl::output('menu_sign', 'add_goods_stpe2');
     Tpl::showpage('store_goods_add.step2');
 }
コード例 #10
0
ファイル: store_spec.php プロジェクト: noikiy/cunkou
 /**
  * 保存规格值
  */
 public function save_specOp()
 {
     $sp_id = intval($_POST['sp_id']);
     $gc_id = intval($_POST['gc_id']);
     if ($sp_id <= 0 || $gc_id <= 0 || !chksubmit()) {
         showDialog(L('wrong_argument'));
     }
     $model_spec = Model('spec');
     // 更新原规格值
     if (is_array($_POST['sv']['old'])) {
         foreach ($_POST['sv']['old'] as $key => $value) {
             if (empty($value['name'])) {
                 continue;
             }
             $where = array('sp_value_id' => $key);
             $update = array('sp_value_name' => $value['name'], 'sp_id' => $sp_id, 'gc_id' => $gc_id, 'store_id' => $_SESSION['store_id'], 'sp_value_color' => $value['color'], 'sp_value_sort' => intval($value['sort']));
             $model_spec->editSpecValue($update, $where);
         }
     }
     // 添加新规格值
     if (is_array($_POST['sv']['new'])) {
         $insert_array = array();
         foreach ($_POST['sv']['new'] as $value) {
             if (empty($value['name'])) {
                 continue;
             }
             $tmp_insert = array('sp_value_name' => $value['name'], 'sp_id' => $sp_id, 'gc_id' => $gc_id, 'store_id' => $_SESSION['store_id'], 'sp_value_color' => $value['color'], 'sp_value_sort' => intval($value['sort']));
             $insert_array[] = $tmp_insert;
         }
         $model_spec->addSpecValueALL($insert_array);
     }
     showDialog(L('nc_common_op_succ'), 'reload', 'succ');
 }
コード例 #11
0
ファイル: pointgrade.php プロジェクト: noikiy/ejia
	public function __construct() {
		parent::__construct();
		//验证是否登录
		if ($_SESSION['is_login'] != '1'){
		    showDialog(L('no_login'),'index.php?act=login', 'error');
		}
	}
コード例 #12
0
 /**
  * 添加商品
  */
 public function add_step_twoOp()
 {
     // 实例化模型
     $model_goodsclass = Model('goods_class');
     // 现暂时改为从匿名“自营店铺专属等级”中判断
     $editor_multimedia = false;
     if ($this->store_grade['sg_function'] == 'editor_multimedia') {
         $editor_multimedia = true;
     }
     Tpl::output('editor_multimedia', $editor_multimedia);
     $gc_id = intval($_GET['class_id']);
     // 验证商品分类是否存在且商品分类是否为最后一级
     $data = Model('goods_class')->getGoodsClassForCacheModel();
     if (!isset($data[$gc_id]) || isset($data[$gc_id]['child']) || isset($data[$gc_id]['childchild'])) {
         showDialog(L('store_goods_index_again_choose_category1'));
     }
     // 如果不是自营店铺或者自营店铺未绑定全部商品类目,读取绑定分类
     /*if (!checkPlatformStoreBindingAllGoodsClass()) {
           $where['class_1|class_2|class_3'] = $gc_id;
           $where['store_id'] = $_SESSION['store_id'];
           $rs = Model('store_bind_class')->getStoreBindClassInfo($where);
           if (empty($rs)) {
               showMessage(L('store_goods_index_again_choose_category2'));
           }
       }*/
     // 更新常用分类信息
     $goods_class = $model_goodsclass->getGoodsClassLineForTag($gc_id);
     Tpl::output('goods_class', $goods_class);
     Model('goods_class_staple')->autoIncrementStaple($goods_class, $_SESSION['member_id']);
     // 获取类型相关数据
     $typeinfo = Model('type')->getAttr($goods_class['type_id'], $_SESSION['store_id'], $gc_id);
     list($spec_json, $spec_list, $attr_list, $brand_list) = $typeinfo;
     Tpl::output('sign_i', count($spec_list));
     Tpl::output('spec_list', $spec_list);
     Tpl::output('attr_list', $attr_list);
     Tpl::output('brand_list', $brand_list);
     // 实例化店铺商品分类模型
     $store_goods_class = Model('store_goods_class')->getClassTree(array('store_id' => $_SESSION['store_id'], 'stc_state' => '1'));
     Tpl::output('store_goods_class', $store_goods_class);
     // 小时分钟显示
     $hour_array = array('00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23');
     Tpl::output('hour_array', $hour_array);
     $minute_array = array('05', '10', '15', '20', '25', '30', '35', '40', '45', '50', '55');
     Tpl::output('minute_array', $minute_array);
     // 关联版式
     $plate_list = Model('store_plate')->getStorePlateList(array('store_id' => $_SESSION['store_id']), 'plate_id,plate_name,plate_position');
     $plate_list = array_under_reset($plate_list, 'plate_position', 2);
     Tpl::output('plate_list', $plate_list);
     //销售区域by joe
     $salearea = Model('setting');
     $salearea_list = $salearea->getsaleareaList();
     $store = Model('store');
     $storeinfo = $store->getStoreInfoByID($_SESSION['store_id']);
     Tpl::output('storeinfo', $storeinfo);
     Tpl::output('salearea_list', $salearea_list);
     // 获得用户信息
     Tpl::showpage('store_goods_add.step2');
 }
コード例 #13
0
 /**
  * 添加兑换码退款
  *
  */
 public function add_refundOp()
 {
     $model_vr_refund = Model('vr_refund');
     $order_id = intval($_GET['order_id']);
     if ($order_id < 1) {
         //参数验证
         showDialog(Language::get('wrong_argument'), 'index.php?act=member_vr_refund&op=index', 'error');
     }
     $condition = array();
     $condition['buyer_id'] = $_SESSION['member_id'];
     $condition['order_id'] = $order_id;
     $order = $model_vr_refund->getRightOrderList($condition);
     $order_id = $order['order_id'];
     if (!$order['if_refund']) {
         //检查状态,防止页面刷新不及时造成数据错误
         showDialog(Language::get('wrong_argument'), 'index.php?act=member_vr_order&op=index', 'error');
     }
     if (chksubmit() && $order['if_refund']) {
         $code_list = $order['code_list'];
         $refund_array = array();
         $goods_num = 0;
         //兑换码数量
         $refund_amount = 0;
         //退款金额
         $code_sn = '';
         $rec_id_array = $_POST['rec_id'];
         if (!empty($rec_id_array) && is_array($rec_id_array)) {
             //选择退款的兑换码
             foreach ($rec_id_array as $key => $value) {
                 $code = $code_list[$value];
                 if (!empty($code)) {
                     $goods_num += 1;
                     $refund_amount += $code['pay_price'];
                     //实际支付金额
                     $code_sn .= $code['vr_code'] . ',';
                     //兑换码编号
                 }
             }
         }
         if ($goods_num < 1) {
             showDialog(Language::get('wrong_argument'), 'reload', 'error');
         }
         $refund_array['code_sn'] = rtrim($code_sn, ',');
         $refund_array['admin_state'] = '1';
         //状态:1为待审核,2为同意,3为不同意
         $refund_array['refund_amount'] = ncPriceFormat($refund_amount);
         $refund_array['goods_num'] = $goods_num;
         $refund_array['buyer_message'] = $_POST['buyer_message'];
         $refund_array['add_time'] = time();
         $state = $model_vr_refund->addRefund($refund_array, $order);
         if ($state) {
             showDialog(Language::get('nc_common_save_succ'), 'index.php?act=member_vr_refund&op=index', 'succ');
         } else {
             showDialog(Language::get('nc_common_save_fail'), 'reload', 'error');
         }
     }
     Tpl::showpage('member_vr_refund_add');
 }
コード例 #14
0
ファイル: pointgrade.php プロジェクト: wangjiang988/ukshop
 public function __construct()
 {
     parent::__construct();
     Uk86Language::uk86_read('home_pointprod');
     //验证是否登录
     if ($_SESSION['is_login'] != '1') {
         showDialog(L('no_login'), 'index.php?act=login', 'error');
     }
 }
コード例 #15
0
 public function delete_goods_floorOp()
 {
     $condition['id'] = $_GET['id'];
     $condition['store_id'] = $_SESSION['store_id'];
     $model = Model();
     if ($model->table('store_floor')->where($condition)->delete()) {
         showDialog('删除成功', 'reload', 'succ');
     } else {
         showDialog('删除失败', '', 'error');
     }
 }
コード例 #16
0
ファイル: store_free_freight.php プロジェクト: noikiy/ejia
    public function indexOp(){
        $model_store = Model('store');
        if (chksubmit()) {
            $store_free_price = floatval(abs($_POST['store_free_price']));
            $model_store->editStore(array('store_free_price'=>$store_free_price),array('store_id'=>$_SESSION['store_id']));
            showDialog(L('nc_common_save_succ'),'reload','succ');
        }
        Tpl::output('store_free_price',$this->store_info['store_free_price']);
        self::profile_menu('free_freight','free_freight');
        Tpl::showpage('store_free_freight.index');
	}
コード例 #17
0
ファイル: theme_inform.php プロジェクト: noikiy/nc-1
 /**
  * Share the binding
  */
 public function indexOp()
 {
     // memberInfo
     $this->memberInfo();
     if (empty($this->cm_info)) {
         showDialog(L('circle_inform_error'));
     }
     $t_id = intval($_GET['t_id']);
     if ($t_id <= 0) {
         echo '<script>DialogManager.close("inform");</script>';
     }
     $model = Model();
     $r_id = intval($_GET['r_id']);
     $where = array();
     $where['circle_id'] = $this->c_id;
     $where['theme_id'] = $t_id;
     $where['reply_id'] = $r_id;
     $inform_info = $model->table('circle_inform')->where($where)->find();
     if (!empty($inform_info)) {
         echo '<script>showError("' . L('circle_inform_have_been_reported') . '");DialogManager.close("inform");</script>';
         exit;
     }
     if (chksubmit()) {
         $circle_info = $model->table('circle')->field('circle_name')->find($this->c_id);
         if (!empty($circle_info)) {
             echo '<script>DialogManager.close("inform");</script>';
         }
         $theme_info = $model->table('circle_theme')->field('theme_name')->find($t_id);
         if (!empty($theme_info)) {
             echo '<script>DialogManager.close("inform");</script>';
         }
         $insert = array();
         $insert['circle_id'] = $this->c_id;
         $insert['circle_name'] = $circle_info['circle_name'];
         $insert['theme_id'] = $t_id;
         $insert['theme_name'] = $theme_info['theme_name'];
         $insert['reply_id'] = $r_id;
         $insert['member_id'] = $_SESSION['member_id'];
         $insert['member_name'] = $_SESSION['member_name'];
         $insert['inform_content'] = $_POST['content'];
         $insert['inform_time'] = time();
         $insert['inform_type'] = 0;
         $insert['inform_state'] = 0;
         $model->table('circle_inform')->insert($insert);
         // Update the inform number
         $update = array('circle_id' => $this->c_id, 'new_informcount' => array('exp', 'new_informcount+1'));
         $model->table('circle')->update($update);
         showDialog(L('nc_common_op_succ'), '', 'succ', '$(\'a[nctype="inform_cancel"]\').click();');
     }
     Tpl::output('t_id', $t_id);
     Tpl::showpage('theme.inform', 'null_layout');
 }
コード例 #18
0
ファイル: designer.php プロジェクト: lehman3087/wanhaoshop
 public function designer_delOp()
 {
     $sn_id = intval($_POST['sn_id']);
     if ($sn_id > 0) {
         $condition = array('id' => $sn_id, 'sn_store_id' => $_SESSION['store_id']);
         $model_designer = Model('designer');
         $model_designer->delDesigner($condition);
         $this->recordSellerLog('删除店铺导航,导航编号' . $sn_id);
         showDialog(L('nc_common_op_succ'), urlShop('designer', 'designer_list'), 'succ');
     } else {
         showDialog(L('nc_common_op_fail'), urlShop('designer', 'designer_list'), 'error');
     }
 }
コード例 #19
0
ファイル: store_navigation.php プロジェクト: uwitec/xbshop
 public function navigation_delOp()
 {
     $sn_id = intval($_POST['sn_id']);
     if ($sn_id > 0) {
         $condition = array('sn_id' => $sn_id, 'sn_store_id' => $_SESSION['store_id']);
         $model_store_navigation = Model('store_navigation');
         $model_store_navigation->delStoreNavigation($condition);
         $this->recordSellerLog('删除店铺导航,导航编号' . $sn_id);
         showDialog(L('nc_common_op_succ'), urlShop('store_navigation', 'navigation_list'), 'succ');
     } else {
         showDialog(L('nc_common_op_fail'), urlShop('store_navigation', 'navigation_list'), 'error');
     }
 }
コード例 #20
0
 /**
  * 卖家商品分类
  *
  * @param 
  * @return 
  */
 public function indexOp()
 {
     $model_store = Model('store');
     if (chksubmit()) {
         $store_storage_alarm = intval(abs($_POST['store_storage_alarm']));
         $model_store->editStore(array('store_storage_alarm' => $store_storage_alarm), array('store_id' => $_SESSION['store_id']));
         showDialog(L('nc_common_save_succ'), 'reload', 'succ');
     }
     Tpl::output('store_storage_alarm', $this->store_info['store_storage_alarm']);
     $this->profile_menu('store_storage_alarm', 'store_storage_alarm');
     Tpl::output('menu_sign', 'store_storage_alarm');
     Tpl::showpage('store_storage_alarm.index');
 }
コード例 #21
0
ファイル: member_information.php プロジェクト: ff00x0/shopnc
 /**
  * 我的资料【更多个人资料】
  *
  * @param
  * @return
  */
 public function moreOp()
 {
     /**
      * 读取语言包
      */
     Language::read('member_home_member');
     // 实例化模型
     $model = Model();
     if (chksubmit()) {
         $model->table('sns_mtagmember')->where(array('member_id' => $_SESSION['member_id']))->delete();
         if (!empty($_POST['mid'])) {
             $insert_array = array();
             foreach ($_POST['mid'] as $val) {
                 $insert_array[] = array('mtag_id' => $val, 'member_id' => $_SESSION['member_id']);
             }
             $model->table('sns_mtagmember')->insertAll($insert_array, '', true);
         }
         showDialog(Language::get('nc_common_op_succ'), '', 'succ');
     }
     // 用户标签列表
     $mtag_array = $model->table('sns_membertag')->order('mtag_sort asc')->limit(1000)->select();
     // 用户已添加标签列表。
     $mtm_array = $model->table('sns_mtagmember')->where(array('member_id' => $_SESSION['member_id']))->select();
     $mtag_list = array();
     $mtm_list = array();
     if (!empty($mtm_array) && is_array($mtm_array)) {
         // 整理
         $elect_array = array();
         foreach ($mtm_array as $val) {
             $elect_array[] = $val['mtag_id'];
         }
         foreach ((array) $mtag_array as $val) {
             if (in_array($val['mtag_id'], $elect_array)) {
                 $mtm_list[] = $val;
             } else {
                 $mtag_list[] = $val;
             }
         }
     } else {
         $mtag_list = $mtag_array;
     }
     Tpl::output('mtag_list', $mtag_list);
     Tpl::output('mtm_list', $mtm_list);
     self::profile_menu('member', 'more');
     Tpl::output('menu_sign', 'profile');
     Tpl::output('menu_sign_url', 'index.php?act=member_information&op=member');
     Tpl::output('menu_sign1', 'baseinfo');
     Tpl::showpage('member_profile.more');
 }
コード例 #22
0
ファイル: buy.php プロジェクト: noikiy/travel
    /**
     * 购物车、直接购买第一步:选择收获地址和配置方式
     */
    public function buy_step1Op() {
        $member_model=Model('member');
        $member_info = $member_model->infoMember(array('member_id'=>"{$_SESSION['member_id']}",'member_state'=>'1'));
        if (!checkLive()){
            showDialog('请先充值,等待激活成为正式会员',urlShop('charge','add'),'error');
            exit;
        }
        
        $model_buy = Model('buy');

        $result = $model_buy->buyStep1($_POST['cart_id'], $_POST['ifcart'], $_POST['invalid_cart'], $_SESSION['member_id'], $_SESSION['store_id']);
        if(!empty($result['error'])) {
            showMessage($result['error'], '', 'html', 'error');
        }

        Tpl::output('ifcart', $result['ifcart']);
        //商品金额计算(分别对每个商品/优惠套装小计、每个店铺小计)
        Tpl::output('store_cart_list', $result['store_cart_list']);
        Tpl::output('store_goods_total', $result['store_goods_total']);
        //取得店铺优惠 - 满即送(赠品列表,店铺满送规则列表)
        Tpl::output('store_premiums_list', $result['store_premiums_list']);
        Tpl::output('store_mansong_rule_list', $result['store_mansong_rule_list']);
        //返回店铺可用的代金券
        Tpl::output('store_voucher_list', $result['store_voucher_list']);
        //返回需要计算运费的店铺ID数组 和 不需要计算运费(满免运费活动的)店铺ID及描述
        Tpl::output('need_calc_sid_list', $result['need_calc_sid_list']);
        Tpl::output('cancel_calc_sid_list', $result['cancel_calc_sid_list']);
        //将商品ID、数量、运费模板、运费序列化,加密,输出到模板,选择地区AJAX计算运费时作为参数使用
        Tpl::output('freight_hash', $result['freight_list']);
        //输出用户默认收货地址
        Tpl::output('address_info', $result['address_info']);
        //输出有货到付款时,在线支付和货到付款及每种支付下商品数量和详细列表
        Tpl::output('pay_goods_list', $result['pay_goods_list']);
        Tpl::output('ifshow_offpay', $result['ifshow_offpay']);
        Tpl::output('deny_edit_payment', $result['deny_edit_payment']);
        //不提供增值税发票时抛出true(模板使用)
        Tpl::output('vat_deny', $result['vat_deny']);
        //增值税发票哈希值(php验证使用)
        Tpl::output('vat_hash', $result['vat_hash']);
        //输出默认使用的发票信息
        Tpl::output('inv_info', $result['inv_info']);
        //显示使用预存款支付及会员预存款
        Tpl::output('available_pd_amount', $result['available_predeposit']);

        //标识 购买流程执行第几步
        Tpl::output('buy_step','step2');
        Tpl::showpage('buy_step1');
    }
コード例 #23
0
ファイル: wifi_gw.php プロジェクト: xingch/myshop
 /**
  * 添加 
  */
 public function addOp()
 {
     if (chksubmit()) {
         $gw_name = trim($_POST['gw_name']);
         $gw_account = trim($_POST['gw_account']);
         $model_gw = Model('wifi_gw');
         $data = array('gw_name' => $gw_name, 'gw_account' => strtoupper($gw_account), 'member_id' => $_SESSION['member_id']);
         $rs = $model_gw->add($data);
         if ($rs) {
             showDialog('添加路由成功!', 'index.php?act=wifi_gw&op=index', 'succ');
         } else {
             showDialog('添加失败!');
         }
     }
     Tpl::showpage('wifi.gw.add_form');
 }
コード例 #24
0
ファイル: store_printsetup.php プロジェクト: noikiy/ejia
	/**
	 * 店铺打印设置
	 */
	public function indexOp(){
		$model = Model();
		$store_info = $model->table('store')->where(array('store_id'=>$_SESSION['store_id']))->find();
		if(empty($store_info)){
			showDialog(Language::get('store_storeinfo_error'),'index.php?act=store_printsetup','error');
		}
		if(chksubmit()){
			$obj_validate = new Validate();
			$obj_validate->validateparam = array(
				array("input"=>$_POST['store_printdesc'], "require"=>"true","validator"=>"Length","min"=>1,"max"=>200,"message"=>Language::get('store_printsetup_desc_error'))
			);
			$error = $obj_validate->validate();
			if ($error != ''){
				showDialog($error);
			}
			$update_arr = array();
			//上传认证文件
			if($_FILES['store_stamp']['name'] != '') {
				$upload = new UploadFile();
				$upload->set('default_dir',ATTACH_STORE);
				if($_FILES['store_stamp']['name'] != '') {
					$result = $upload->upfile('store_stamp');
					if ($result){
						$update_arr['store_stamp'] = $upload->file_name;
						//删除旧认证图片
						if (!empty($store_info['store_stamp'])){
							@unlink(BASE_UPLOAD_PATH.DS.ATTACH_STORE.DS.$store_info['store_stamp']);
						}
					}
				}
			}
			$update_arr['store_printdesc'] = $_POST['store_printdesc'];
			$rs = $model->table('store')->where(array('store_id'=>$_SESSION['store_id']))->update($update_arr);
			if ($rs){
				showDialog(Language::get('nc_common_save_succ'),'index.php?act=store_printsetup','succ');
			}else {
				showDialog(Language::get('nc_common_save_fail'),'index.php?act=store_printsetup','error');
			}
		}else{
			Tpl::output('store_info',$store_info);
			self::profile_menu('store_printsetup');
			Tpl::showpage('store_printsetup');
		}
	}
コード例 #25
0
 public function group_delOp()
 {
     $group_id = intval($_POST['group_id']);
     if ($group_id > 0) {
         $condition = array();
         $condition['group_id'] = $group_id;
         $condition['store_id'] = $_SESSION['store_id'];
         $model_seller_group = Model('seller_group');
         $result = $model_seller_group->delSellerGroup($condition);
         if ($result) {
             $this->recordSellerLog('删除组成功,组编号' . $group_id);
             showDialog(Language::get('nc_common_op_succ'), 'reload', 'succ');
         } else {
             $this->recordSellerLog('删除组失败,组编号' . $group_id);
             showDialog(Language::get('nc_common_save_fail'), 'reload', 'error');
         }
     } else {
         showDialog(Language::get('wrong_argument'), 'reload', 'error');
     }
 }
コード例 #26
0
 /**
  * 保存
  */
 public function saveOp()
 {
     if (chksubmit()) {
         $update = array();
         $i = 0;
         if (is_array($_POST['pre']) && !empty($_POST['pre'])) {
             foreach ($_POST['pre'] as $val) {
                 if (empty($val['name']) || empty($val['type']) || empty($val['num'])) {
                     continue;
                 }
                 $update['store_presales'][$i]['name'] = $val['name'];
                 $update['store_presales'][$i]['type'] = intval($val['type']);
                 $update['store_presales'][$i]['num'] = $val['num'];
                 $i++;
             }
             $update['store_presales'] = serialize($update['store_presales']);
         } else {
             $update['store_presales'] = serialize(null);
         }
         $i = 0;
         if (is_array($_POST['after']) && !empty($_POST['after'])) {
             foreach ($_POST['after'] as $val) {
                 if (empty($val['name']) || empty($val['type']) || empty($val['num'])) {
                     continue;
                 }
                 $update['store_aftersales'][$i]['name'] = $val['name'];
                 $update['store_aftersales'][$i]['type'] = intval($val['type']);
                 $update['store_aftersales'][$i]['num'] = $val['num'];
                 $i++;
             }
             $update['store_aftersales'] = serialize($update['store_aftersales']);
         } else {
             $update['store_aftersales'] = serialize(null);
         }
         $update['store_workingtime'] = $_POST['working_time'];
         $where = array();
         $where['store_id'] = $_SESSION['store_id'];
         Model('store')->editStore($update, $where);
         showDialog(Language::get('nc_common_save_succ'), 'index.php?act=store_callcenter', 'succ');
     }
 }
コード例 #27
0
 /**
  * 店铺装修设置保存
  */
 public function decoration_setting_saveOp()
 {
     $model_store_decoration = Model('store_decoration');
     $model_store = Model('store');
     $store_decoration_info = $model_store_decoration->getStoreDecorationInfo(array('store_id' => $_SESSION['store_id']));
     if (empty($store_decoration_info)) {
         showDialog('参数错误');
     }
     $update = array();
     if (empty($_POST['store_decoration_switch'])) {
         $update['store_decoration_switch'] = 0;
     } else {
         $update['store_decoration_switch'] = $store_decoration_info['decoration_id'];
     }
     $update['store_decoration_only'] = intval($_POST['store_decoration_only']);
     $result = $model_store->editStore($update, array('store_id' => $_SESSION['store_id']));
     if ($result) {
         showDialog(L('nc_common_save_succ'), '', 'succ');
     } else {
         showDialog(L('nc_common_save_fail'));
     }
 }
コード例 #28
0
ファイル: member_sharemanage.php プロジェクト: noikiy/ejia
	/**
	 * 解除绑定
	 */
	public function unbindOp(){
		$type = $_GET['type'];
		if (empty($type)){
			showDialog(Language::get('wrong_argument'),'index.php?act=member_sharemanage','error');
		}
		$model = Model('sns_binding');
		$app_arr = $model->getApps();
		$appkey_arr = array_keys($app_arr);
		if (empty($appkey_arr) || !in_array($type,$appkey_arr)){
			showDialog(Language::get('wrong_argument'),'index.php?act=member_sharemanage','error');
		}
		//删除绑定信息
		$where_arr = array();
		$where_arr['snsbind_memberid'] = $_SESSION['member_id'];
		$where_arr['snsbind_appsign'] = $type;
		$result = $model->table('sns_binding')->where($where_arr)->delete();
		if ($result){
			$js = "location.reload();";
			showDialog(Language::get('sharebind_unbind_succ'),'','succ',$js);
		}else {
			showDialog(Language::get('sharebind_unbind_fail'),'','succ');
		}
	}
コード例 #29
0
ファイル: pointcart.php プロジェクト: noikiy/travel
	public function __construct() {
		parent::__construct();
		/**
		 * 读取语言包
		 */
		Language::read('home_pointcart');
		/**
		 * 判断系统是否开启积分和积分兑换功能
		 */
		if ($GLOBALS['setting_config']['points_isuse'] != 1 || $GLOBALS['setting_config']['pointprod_isuse'] != 1){
			showMessage(Language::get('pointcart_unavailable'),'index.php','html','error');
		}
		//验证是否登录
		if ($_SESSION['is_login'] != '1'){
			showMessage(Language::get('pointcart_unlogin_error'),'index.php?act=login','html','error');
		}
		
		if (!checkLive()){
			showDialog('请先充值,等待激活成为正式会员',urlShop('charge','add'),'error');
			exit;
		}

	}
コード例 #30
0
ファイル: member_grade.php プロジェクト: ff00x0/shopnc-api
 /**
  * 会员管理
  */
 public function indexOp()
 {
     $model_setting = Model('setting');
     $list_setting = $model_setting->getListSetting();
     $list_setting['member_grade'] = $list_setting['member_grade'] ? unserialize($list_setting['member_grade']) : array();
     if (chksubmit()) {
         $update_arr = array();
         if ($_POST['mg']) {
             $mg_arr = array();
             $i = 0;
             foreach ($_POST['mg'] as $k => $v) {
                 $mg_arr[$i]['level'] = $i;
                 $mg_arr[$i]['level_name'] = 'V' . $i;
                 //所需经验值
                 $mg_arr[$i]['exppoints'] = intval($v['exppoints']);
                 $i++;
             }
             $update_arr['member_grade'] = serialize($mg_arr);
         } else {
             $update_arr['member_grade'] = '';
         }
         $result = true;
         if ($update_arr) {
             $result = $model_setting->updateSetting($update_arr);
         }
         if ($result) {
             $this->log(L('nc_edit,nc_member_grade'), 1);
             showDialog(L('nc_common_save_succ'), 'reload', 'succ');
         } else {
             $this->log(L('nc_edit,nc_member_grade'), 0);
             showDialog(L('nc_common_save_fail'));
         }
     } else {
         Tpl::output('list_setting', $list_setting);
         Tpl::showpage('member.grade');
     }
 }