Esempio n. 1
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. 2
0
 public function inform_saveOp()
 {
     //检查当前用户是否允许举报
     $this->check_member_allow_inform();
     $goods_id = intval($_POST['inform_goods_id']);
     //获取商品详细信息
     $goods_info = $this->get_goods_info_byid($goods_id);
     //检查是否是本店商品
     if (!empty($_SESSION['store_id'])) {
         if ($goods_info['store_id'] == $_SESSION['store_id']) {
             showDialog(Uk86Language::uk86_get('para_error'));
         }
     }
     //实例化举报模型
     $model_inform = Model('inform');
     //检查是否当前正在举报
     if ($model_inform->isProcessOfInform($goods_id)) {
         showDialog(Uk86Language::uk86_get('inform_handling'));
     }
     //处理用户输入的数据
     $input = array();
     $input['inform_member_id'] = $_SESSION['member_id'];
     $input['inform_member_name'] = $_SESSION['member_name'];
     $input['inform_goods_id'] = $goods_id;
     $input['inform_goods_name'] = $goods_info['goods_name'];
     $input['inform_goods_image'] = $goods_info['goods_image'];
     list($input['inform_subject_id'], $input['inform_subject_content']) = explode(",", trim($_POST['inform_subject']));
     $input['inform_content'] = trim($_POST['inform_content']);
     //上传图片
     $inform_pic = array();
     $inform_pic[1] = 'inform_pic1';
     $inform_pic[2] = 'inform_pic2';
     $inform_pic[3] = 'inform_pic3';
     $pic_name = $this->inform_upload_pic($inform_pic);
     $input['inform_pic1'] = $pic_name[1];
     $input['inform_pic2'] = $pic_name[2];
     $input['inform_pic3'] = $pic_name[3];
     $input['inform_datetime'] = time();
     $input['inform_store_id'] = $goods_info['store_id'];
     $input['inform_store_name'] = $goods_info['store_name'];
     $input['inform_state'] = 1;
     $input['inform_handle_message'] = '';
     $input['inform_handle_member_id'] = 0;
     $input['inform_handle_datetime'] = 1;
     //验证输入的数据
     $obj_validate = new Uk86Validate();
     $obj_validate->validateparam = array(array("input" => $input["inform_content"], "require" => "true", "validator" => "Length", "min" => "1", "max" => "100", "message" => Uk86Language::uk86_get('inform_content_null')), array("input" => $input["inform_subject_content"], "require" => "true", "validator" => "Length", "min" => "1", "max" => "50", "message" => Uk86Language::uk86_get('para_error')));
     $error = $obj_validate->uk86_validate();
     if ($error != '') {
         uk86_showValidateError($error);
     }
     //保存
     if ($model_inform->saveInform($input)) {
         showDialog(Uk86Language::uk86_get('inform_success'), 'index.php?act=member_inform&op=inform_list', 'succ');
     } else {
         showDialog(Uk86Language::uk86_get('inform_fail'), 'index.php?act=member_inform&op=inform_list', 'error');
     }
 }
Esempio n. 3
0
 /**
  * 绑定手机
  */
 public function modify_mobileOp()
 {
     $model_member = Model('member');
     $member_info = $model_member->getMemberInfoByID($_SESSION['member_id'], 'member_mobile_bind');
     if (uk86_chksubmit()) {
         $obj_validate = new Uk86Validate();
         $obj_validate->validateparam = array(array("input" => $_POST["mobile"], "require" => "true", 'validator' => 'mobile', "message" => '请正确填写手机号'), array("input" => $_POST["vcode"], "require" => "true", 'validator' => 'number', "message" => '请正确填写手机验证码'));
         $error = $obj_validate->uk86_validate();
         if ($error != '') {
             uk86_showValidateError($error);
         }
         $condition = array();
         $condition['member_id'] = $_SESSION['member_id'];
         $condition['auth_code'] = intval($_POST['vcode']);
         $member_common_info = $model_member->getMemberCommonInfo($condition, 'send_acode_time');
         if (!$member_common_info) {
             showDialog('手机验证码错误,请重新输入');
         }
         if (TIMESTAMP - $member_common_info['send_acode_time'] > 1800) {
             showDialog('手机验证码已过期,请重新获取验证码');
         }
         $data = array();
         $data['auth_code'] = '';
         $data['send_acode_time'] = 0;
         $update = $model_member->editMemberCommon($data, array('member_id' => $_SESSION['member_id']));
         if (!$update) {
             showDialog('系统发生错误,如有疑问请与管理员联系');
         }
         $update = $model_member->editMember(array('member_id' => $_SESSION['member_id']), array('member_mobile_bind' => 1));
         if (!$update) {
             showDialog('系统发生错误,如有疑问请与管理员联系');
         }
         showDialog('手机号绑定成功', 'index.php?act=member_security&op=index', 'succ');
     }
 }
Esempio n. 4
0
 /**
  * 品牌修改
  */
 public function brand_editOp()
 {
     $lang = Uk86Language::uk86_getLangContent();
     $model_brand = Model('brand');
     if ($_POST['form_submit'] == 'ok' and intval($_POST['brand_id']) != 0) {
         /**
          * 验证
          */
         $obj_validate = new Uk86Validate();
         $obj_validate->validateparam = array(array("input" => $_POST["brand_name"], "require" => "true", "message" => $lang['store_goods_brand_name_null']), array("input" => $_POST["brand_initial"], "require" => "true", "message" => '请填写首字母'));
         $error = $obj_validate->uk86_validate();
         if ($error != '') {
             uk86_showValidateError($error);
         } else {
             /**
              * 上传图片
              */
             if (!empty($_FILES['brand_pic']['name'])) {
                 $upload = new Uk86UploadFile();
                 $upload->uk86_set('default_dir', ATTACH_BRAND);
                 $upload->uk86_set('thumb_width', 150);
                 $upload->uk86_set('thumb_height', 50);
                 $upload->uk86_set('thumb_ext', '_small');
                 $upload->uk86_set('ifremove', true);
                 $result = $upload->uk86_upfile('brand_pic');
                 if ($result) {
                     $_POST['brand_pic'] = $upload->thumb_image;
                 } else {
                     showDialog($upload->error);
                 }
             }
             $where = array();
             $where['brand_id'] = intval($_POST['brand_id']);
             $update_array = array();
             $update_array['brand_initial'] = strtoupper($_POST['brand_initial']);
             $update_array['brand_name'] = trim($_POST['brand_name']);
             $update_array['class_id'] = $_POST['class_id'];
             $update_array['brand_class'] = $_POST['brand_class'];
             //add wangjiang修改审核状态为待审核
             $update_array['brand_apply'] = 0;
             //end wangjiang
             if (!empty($_POST['brand_pic'])) {
                 $update_array['brand_pic'] = $_POST['brand_pic'];
             }
             //查出原图片路径,后面会删除图片
             $brand_info = $model_brand->getBrandInfo($where);
             $result = $model_brand->editBrand($where, $update_array);
             if ($result) {
                 //删除老图片
                 if (!empty($brand_info['brand_pic']) && $_POST['brand_pic']) {
                     @unlink(BASE_UPLOAD_PATH . DS . ATTACH_BRAND . DS . $brand_info['brand_pic']);
                 }
                 showDialog($lang['nc_common_save_succ'], 'index.php?act=store_brand&op=brand_list', 'succ', empty($_GET['inajax']) ? '' : 'CUR_DIALOG.close();');
             } else {
                 showDialog($lang['nc_common_save_fail']);
             }
         }
     } else {
         showDialog($lang['nc_common_save_fail']);
     }
 }
Esempio n. 5
0
 public function appeal_saveOp()
 {
     $complain_id = intval($_POST['input_complain_id']);
     //获取投诉详细信息
     $complain_info = $this->get_complain_info($complain_id);
     //检查当前是不是投诉状态
     if (intval($complain_info['complain_state']) !== self::STATE_APPEAL) {
         showDialog(Uk86Language::uk86_get('para_error'), 'reload');
     }
     $input = array();
     $input['appeal_message'] = trim($_POST['input_appeal_message']);
     //验证输入的信息
     $obj_validate = new Uk86Validate();
     $obj_validate->validateparam = array(array("input" => $input['appeal_message'], "require" => "true", "validator" => "Length", "min" => "1", "max" => "255", "message" => Uk86Language::uk86_get('appeal_message_error')));
     $error = $obj_validate->uk86_validate();
     if ($error != '') {
         uk86_showValidateError($error);
     }
     //上传图片
     $appeal_pic = array();
     $appeal_pic[1] = 'input_appeal_pic1';
     $appeal_pic[2] = 'input_appeal_pic2';
     $appeal_pic[3] = 'input_appeal_pic3';
     $pic_name = array();
     $upload = new Uk86UploadFile();
     $uploaddir = ATTACH_PATH . DS . 'complain' . DS;
     $upload->uk86_set('default_dir', $uploaddir);
     $upload->uk86_set('allow_type', array('jpg', 'jpeg', 'gif', 'png'));
     $count = 1;
     foreach ($appeal_pic as $pic) {
         if (!empty($_FILES[$pic]['name'])) {
             $result = $upload->uk86_upfile($pic);
             if ($result) {
                 $pic_name[$count] = $upload->file_name;
                 $upload->file_name = '';
             } else {
                 $pic_name[$count] = '';
             }
         }
         $count++;
     }
     $input['appeal_pic1'] = $pic_name[1];
     $input['appeal_pic2'] = $pic_name[2];
     $input['appeal_pic3'] = $pic_name[3];
     $input['appeal_datetime'] = time();
     $input['complain_state'] = self::STATE_TALK;
     $where_array = array();
     $where_array['complain_id'] = $complain_id;
     //保存申诉信息
     $model_complain = Model('complain');
     $complain_id = $model_complain->updateComplain($input, $where_array);
     $this->recordSellerLog('投诉申诉处理,投诉编号:' . $complain_id);
     showDialog(Uk86Language::uk86_get('appeal_submit_success'), 'index.php?act=store_complain', 'succ');
 }
Esempio n. 6
0
 /**
  * 会员地址
  *
  * @param
  * @return
  */
 public function addressOp()
 {
     Uk86Language::uk86_read('member_member_index');
     $lang = Uk86Language::uk86_getLangContent();
     $address_class = Model('address');
     /**
      * 判断页面类型
      */
     if (!empty($_GET['type'])) {
         /**
          * 新增/编辑地址页面
          */
         if (intval($_GET['id']) > 0) {
             /**
              * 得到地址信息
              */
             $address_info = $address_class->getOneAddress(intval($_GET['id']));
             if ($address_info['member_id'] != $_SESSION['member_id']) {
                 uk86_showMessage($lang['member_address_wrong_argument'], 'index.php?act=member_address&op=address', 'html', 'error');
             }
             /**
              * 输出地址信息
              */
             Tpl::output('address_info', $address_info);
         }
         /**
          * 增加/修改页面输出
          */
         Tpl::output('type', $_GET['type']);
         Tpl::showpage('member_address.edit', 'null_layout');
         exit;
     }
     /**
      * 判断操作类型
      */
     if (uk86_chksubmit()) {
         /**
          * 验证表单信息
          */
         $obj_validate = new Uk86Validate();
         $obj_validate->validateparam = array(array("input" => $_POST["true_name"], "require" => "true", "message" => $lang['member_address_receiver_null']), array("input" => $_POST["area_id"], "require" => "true", "validator" => "Number", "message" => $lang['member_address_wrong_area']), array("input" => $_POST["city_id"], "require" => "true", "validator" => "Number", "message" => $lang['member_address_wrong_area']), array("input" => $_POST["area_info"], "require" => "true", "message" => $lang['member_address_area_null']), array("input" => $_POST["address"], "require" => "true", "message" => $lang['member_address_address_null']), array("input" => $_POST['tel_phone'] . $_POST['mob_phone'], 'require' => 'true', 'message' => $lang['member_address_phone_and_mobile']));
         $error = $obj_validate->uk86_validate();
         if ($error != '') {
             uk86_showValidateError($error);
         }
         $data = array();
         $data['member_id'] = $_SESSION['member_id'];
         $data['true_name'] = $_POST['true_name'];
         $data['area_id'] = intval($_POST['area_id']);
         $data['city_id'] = intval($_POST['city_id']);
         $data['area_info'] = $_POST['area_info'];
         $data['address'] = $_POST['address'];
         $data['tel_phone'] = $_POST['tel_phone'];
         $data['mob_phone'] = $_POST['mob_phone'];
         $data['is_default'] = $_POST['is_default'] ? 1 : 0;
         if ($_POST['is_default']) {
             $address_class->editAddress(array('is_default' => 0), array('member_id' => $_SESSION['member_id'], 'is_default' => 1));
         }
         if (intval($_POST['id']) > 0) {
             $rs = $address_class->editAddress($data, array('address_id' => $_POST['id']));
             if (!$rs) {
                 showDialog($lang['member_address_modify_fail'], '', 'error');
             }
         } else {
             $count = $address_class->getAddressCount(array('member_id' => $_SESSION['member_id']));
             if ($count >= 20) {
                 showDialog('最多允许添加20个有效地址', '', 'error');
             }
             $rs = $address_class->addAddress($data);
             if (!$rs) {
                 showDialog($lang['member_address_add_fail'], '', 'error');
             }
         }
         showDialog($lang['nc_common_op_succ'], 'reload', 'js');
     }
     $del_id = isset($_GET['id']) ? intval(trim($_GET['id'])) : 0;
     if ($del_id > 0) {
         $rs = $address_class->delAddress(array('address_id' => $del_id, 'member_id' => $_SESSION['member_id']));
         if ($rs) {
             showDialog(Uk86Language::uk86_get('member_address_del_succ'), 'index.php?act=member_address&op=address', 'js');
         } else {
             showDialog(Uk86Language::uk86_get('member_address_del_fail'), '', 'error');
         }
     }
     $address_list = $address_class->getAddressList(array('member_id' => $_SESSION['member_id']));
     self::profile_menu('address', 'address');
     Tpl::output('address_list', $address_list);
     Tpl::showpage('member_address.index');
 }