本文整理汇总了PHP中showValidateError函数的典型用法代码示例。如果您正苦于以下问题:PHP showValidateError函数的具体用法?PHP showValidateError怎么用?PHP showValidateError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showValidateError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: daddress_addOp
/**
* 新增/编辑发货地址
*/
public function daddress_addOp() {
Language::read('member_member_index');
$lang = Language::getLangContent();
$model_daddress = Model('daddress');
if (chksubmit()) {
//保存 新增/编辑 表单
$obj_validate = new Validate();
$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->validate();
if ($error != ''){
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)){
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');
}
示例2: emailOp
/**
* 我的资料【email修改】
*
* @param
* @return
*/
public function emailOp()
{
/**
* 读取语言包
*/
Language::read('member_home_member');
$lang = Language::getLangContent();
/**
* 实例化模型
*/
$model_member = Model('member');
if (chksubmit()) {
/**
* 填写密码信息验证
*/
$obj_validate = new Validate();
$obj_validate->validateparam = array(array("input" => $_POST["orig_password"], "require" => "true", "message" => $lang['home_member_password_null']), array("input" => $_POST["email"], "require" => "true", "validator" => "email", "message" => $lang['home_member_input_email_again_format']));
$error = $obj_validate->validate();
if ($error != '') {
showValidateError($error);
}
/**
* 邮箱是否存在检查
*/
$email_array = $model_member->getby_member_email(trim($_POST['email']));
if (!empty($email_array) && is_array($email_array)) {
showDialog($lang['home_member_input_email_again_exists']);
}
/**
* 密码是否正确检查
*/
$member_info = $model_member->where(array('member_name' => trim($_SESSION['member_name']), 'member_passwd' => md5(trim($_POST['orig_password']))))->find();
if (empty($member_info)) {
showDialog($lang['home_member_input_password_again_wrong']);
}
/**
* 修改电子邮件地址
*/
$update = $model_member->update(array('member_email' => trim($_POST['email']), 'member_id' => $_SESSION['member_id']));
if ($update) {
$_SESSION['member_email'] = trim($_POST['email']);
$message = $lang['nc_common_save_succ'];
} else {
$message = $lang['nc_common_save_fail'];
}
showDialog($message, 'reload', $update ? 'succ' : 'error');
}
self::profile_menu('member', 'email');
Tpl::output('menu_sign', 'profile');
Tpl::output('menu_sign_url', 'index.php?act=member&op=home');
Tpl::output('menu_sign1', 'email');
Tpl::setLayout('member_pub_layout');
Tpl::showpage('member_email');
}
示例3: inform_saveOp
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(Language::get('para_error'));
}
}
//实例化举报模型
$model_inform = Model('inform');
//检查是否当前正在举报
if ($model_inform->isProcessOfInform($goods_id)) {
showDialog(Language::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 Validate();
$obj_validate->validateparam = array(array("input" => $input["inform_content"], "require" => "true", "validator" => "Length", "min" => "1", "max" => "100", "message" => Language::get('inform_content_null')), array("input" => $input["inform_subject_content"], "require" => "true", "validator" => "Length", "min" => "1", "max" => "50", "message" => Language::get('para_error')));
$error = $obj_validate->validate();
if ($error != '') {
showValidateError($error);
}
//保存
if ($model_inform->saveInform($input)) {
showDialog(Language::get('inform_success'), 'index.php?act=member_inform&op=inform_list', 'succ');
} else {
showDialog(Language::get('inform_fail'), 'index.php?act=member_inform&op=inform_list', 'error');
}
}
示例4: appeal_saveOp
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(Language::get('para_error'), 'reload');
}
$input = array();
$input['appeal_message'] = trim($_POST['input_appeal_message']);
//验证输入的信息
$obj_validate = new Validate();
$obj_validate->validateparam = array(array("input" => $input['appeal_message'], "require" => "true", "validator" => "Length", "min" => "1", "max" => "255", "message" => Language::get('appeal_message_error')));
$error = $obj_validate->validate();
if ($error != '') {
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 UploadFile();
$uploaddir = ATTACH_PATH . DS . 'complain' . DS;
$upload->set('default_dir', $uploaddir);
$upload->set('allow_type', array('jpg', 'jpeg', 'gif', 'png'));
$count = 1;
foreach ($appeal_pic as $pic) {
if (!empty($_FILES[$pic]['name'])) {
$result = $upload->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(Language::get('appeal_submit_success'), 'index.php?act=store_complain', 'succ');
}
示例5: addressOp
/**
* 会员地址
*
* @param
* @return
*/
public function addressOp()
{
/**
* 读取语言包
*/
Language::read('member_member_index');
$lang = Language::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']) {
showMessage($lang['member_address_wrong_argument'], 'index.php?act=member&op=address', 'html', 'error');
}
/**
* 输出地址信息
*/
Tpl::output('address_info', $address_info);
}
/**
* 增加/修改页面输出
*/
Tpl::output('type', $_GET['type']);
Tpl::showpage('address_form', 'null_layout');
exit;
}
/**
* 判断操作类型
*/
if (chksubmit()) {
/**
* 验证表单信息
*/
$obj_validate = new Validate();
$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->validate();
if ($error != '') {
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'];
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 {
$rs = $address_class->addAddress($data);
if (!$rs) {
showDialog($lang['member_address_add_fail'], '', 'error');
}
}
showDialog($lang['nc_common_op_succ'], 'reload', 'succ', 'CUR_DIALOG.close()');
}
$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(Language::get('member_address_del_succ'), 'index.php?act=member&op=address', 'succ');
} else {
showDialog(Language::get('member_address_del_fail'), '', 'error');
}
}
$address_list = $address_class->getAddressList(array('member_id' => $_SESSION['member_id']));
/**
* 页面输出
*/
self::profile_menu('address', 'address');
Tpl::output('menu_sign', 'address');
Tpl::output('address_list', $address_list);
Tpl::output('menu_sign_url', 'index.php?act=member&op=address');
Tpl::output('menu_sign1', 'address_list');
Tpl::setLayout('member_pub_layout');
Tpl::showpage('address_index');
}
示例6: store_couponOp
/**
* 优惠券管理
*
* @param
* @return
*/
public function store_couponOp()
{
$model_coupon = Model('coupon');
/**
* 判断操作页面
*/
if (!empty($_GET['type'])) {
/*
* 取得优惠券分类
*/
$model_coupon_class = Model('coupon_class');
$condition = array();
$condition['class_show'] = '1';
$condition['order'] = 'class_sort desc,class_id desc';
$class_list = $model_coupon_class->getCouponClass($condition);
if (empty($class_list)) {
Tpl::output('msg', Language::get('store_coupon_null_class'));
Tpl::showpage('../msg', 'null_layout');
exit;
}
/**
* 新增/编辑页面
*/
if (trim($_GET['type'] == 'edit')) {
$param = array();
$coupon_array = array();
$coupon_id = intval($_GET['coupon_id']);
//检查优惠券是否属于该店铺
if (!$model_coupon->checkCouponBelongStore($coupon_id, $_SESSION['store_id'])) {
showMessage(Language::get('store_coupon_error'), '', '', 'error');
}
$param['coupon_id'] = $coupon_id;
$coupon_array = $model_coupon->getCoupon($param);
$coupon_array = $coupon_array[0];
$old_pic = $coupon_array['coupon_pic'];
if ($coupon_array['coupon_lock'] == '2') {
Tpl::output('turnoff', yes);
}
$coupon_array['coupon_pic'] = $coupon_array['coupon_pic'] != '' ? $coupon_array['coupon_pic'] : SiteUrl . DS . ATTACH_COUPON . DS . 'default.gif';
$coupon_array['coupon_desc'] = htmlspecialchars_decode($coupon_array['coupon_desc']);
$coupon_array['coupon_start_date'] = date('Y-m-d', $coupon_array['coupon_start_date']);
$coupon_array['coupon_end_date'] = date('Y-m-d', $coupon_array['coupon_end_date']);
Tpl::output('coupon', $coupon_array);
Tpl::output('old_pic', $old_pic);
}
Tpl::output('coupon_class', $class_list);
Tpl::output('type', $_GET['type']);
Tpl::showpage('member_coupon.form', 'null_layout');
die;
}
/**
* 验证提交
*/
if (chksubmit()) {
if ($_POST['type'] != '') {
$validate = new Validate();
$validate->validateparam = array(array('input' => trim($_POST['coupon_name']), 'require' => true, 'message' => Language::get('store_coupon_name_null')), array('input' => trim($_POST['coupon_value']), 'require' => true, 'validator' => 'Currency', 'message' => Language::get('store_coupon_price_error')), array('input' => $_POST['start_time'], 'require' => true, 'message' => Language::get('store_coupon_start_time_null')), array('input' => $_POST['end_time'], 'require' => true, 'message' => Language::get('store_coupon_end_time_null')));
$error = $validate->validate();
if ($error) {
showValidateError($error);
}
switch ($_POST['type']) {
case 'edit':
$flag = false;
$filename = '';
$update = array();
$update['coupon_title'] = trim($_POST['coupon_name']);
$update['coupon_price'] = trim($_POST['coupon_value']);
$update['coupon_desc'] = htmlspecialchars(trim($_POST['coupon_desc']));
$update['coupon_pic'] = trim($_POST['coupon_pic']);
$date = explode('-', $_POST['start_time']);
$update['coupon_start_date'] = mktime(0, 0, 0, $date[1], $date[2], $date[0]);
unset($date);
$date = explode('-', $_POST['end_time']);
$update['coupon_end_date'] = mktime(0, 0, 0, $date[1], $date[2], $date[0]);
unset($date);
$update['coupon_allowstate'] = '0';
//编辑信息后需要后台审核
$update['coupon_class_id'] = $_POST['coupon_class'];
$where['coupon_id'] = trim($_POST['coupon_id']);
$where['store_id'] = $_SESSION['store_id'];
if ($model_coupon->update_coupon($update, $where)) {
showDialog(Language::get('store_coupon_update_success'), 'index.php?act=store&op=store_coupon', 'succ', 'CUR_DIALOG.close();');
} else {
showDialog(Language::get('store_coupon_update_fail'));
}
break;
case 'add':
$update = array();
$update['coupon_title'] = trim($_POST['coupon_name']);
$update['coupon_price'] = trim($_POST['coupon_value']);
$update['coupon_desc'] = htmlspecialchars(trim($_POST['coupon_desc']));
$update['coupon_pic'] = trim($_POST['coupon_pic']);
$date = explode('-', $_POST['start_time']);
//.........这里部分代码省略.........
示例7: brand_editOp
/**
* 品牌修改
*/
public function brand_editOp()
{
$lang = Language::getLangContent();
$model_brand = Model('brand');
if ($_POST['form_submit'] == 'ok' and intval($_POST['brand_id']) != 0) {
/**
* 验证
*/
$obj_validate = new Validate();
$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->validate();
if ($error != '') {
showValidateError($error);
} else {
/**
* 上传图片
*/
if (!empty($_FILES['brand_pic']['name'])) {
$upload = new UploadFile();
$upload->set('default_dir', ATTACH_BRAND);
$upload->set('thumb_width', '150,450');
$upload->set('thumb_height', '50,50000');
$upload->set('thumb_ext', '_small,_big');
$upload->set('ifremove', FALSE);
$result = $upload->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'];
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']);
}
}
示例8: brand_editOp
/**
* 品牌修改
*/
public function brand_editOp()
{
$lang = Language::getLangContent();
$model_brand = Model('brand');
if ($_POST['form_submit'] == 'ok' and intval($_POST['brand_id']) != 0) {
/**
* 验证
*/
$obj_validate = new Validate();
$obj_validate->validateparam = array(array("input" => $_POST["brand_name"], "require" => "true", "message" => $lang['store_goods_brand_name_null']));
$error = $obj_validate->validate();
if ($error != '') {
showValidateError($error);
} else {
/**
* 上传图片
*/
if (!empty($_FILES['brand_pic']['name'])) {
$upload = new UploadFile();
$upload->set('default_dir', ATTACH_BRAND);
$upload->set('thumb_width', 150);
$upload->set('thumb_height', 50);
$upload->set('thumb_ext', '_small');
$upload->set('ifremove', true);
$result = $upload->upfile('brand_pic');
if ($result) {
$_POST['brand_pic'] = $upload->thumb_image;
} else {
showDialog($upload->error);
}
}
$update_array = array();
$update_array['brand_id'] = $_POST['brand_id'];
$update_array['brand_name'] = $_POST['brand_name'];
$update_array['brand_class'] = $_POST['brand_class'];
if (!empty($_POST['brand_pic'])) {
$update_array['brand_pic'] = $_POST['brand_pic'];
}
$result = $model_brand->update($update_array);
if ($result) {
/**
* 删除老图片
*/
if (!empty($_POST['brand_pic'])) {
@unlink(BasePath . DS . ATTACH_BRAND . DS . $_POST['old_brand_pic']);
}
showDialog($lang['nc_common_save_succ'], 'index.php?act=store_goods&op=brand_list', 'succ', empty($_GET['inajax']) ? '' : 'CUR_DIALOG.close();');
} else {
showDialog($lang['nc_common_save_fail']);
}
}
} else {
showDialog($lang['nc_common_save_fail']);
}
}
示例9: complain_saveOp
public function complain_saveOp()
{
//获取输入的投诉信息
$input = array();
$input['order_id'] = intval($_POST['input_order_id']);
//检查是不是正在进行投诉
if ($this->check_complain_exist($input['order_id'])) {
showDialog(Language::get('complain_repeat'), '', 'error');
}
list($input['complain_subject_id'], $input['complain_subject_content']) = explode(',', trim($_POST['input_complain_subject']));
$input['complain_content'] = trim($_POST['input_complain_content']);
//验证输入的信息
$obj_validate = new Validate();
$obj_validate->validateparam = array(array("input" => $input['complain_content'], "require" => "true", "validator" => "Length", "min" => "1", "max" => "255", "message" => Language::get('complain_content_error')));
$error = $obj_validate->validate();
if ($error != '') {
showValidateError($error);
}
//获取有问题的商品
$checked_goods = $_POST['input_goods_check'];
$goods_problem = $_POST['input_goods_problem'];
if (empty($checked_goods)) {
showDialog(Language::get('para_error'), '', 'error');
}
$order_info = $this->get_order_info($input['order_id']);
$input['accuser_id'] = $order_info['buyer_id'];
$input['accuser_name'] = $order_info['buyer_name'];
$input['accused_id'] = $order_info['store_id'];
$input['accused_name'] = $order_info['store_name'];
//上传图片
$complain_pic = array();
$complain_pic[1] = 'input_complain_pic1';
$complain_pic[2] = 'input_complain_pic2';
$complain_pic[3] = 'input_complain_pic3';
$pic_name = $this->upload_pic($complain_pic);
$input['complain_pic1'] = $pic_name[1];
$input['complain_pic2'] = $pic_name[2];
$input['complain_pic3'] = $pic_name[3];
$input['complain_datetime'] = time();
$input['complain_state'] = self::STATE_NEW;
$input['complain_active'] = self::STATE_UNACTIVE;
//保存投诉信息
$model_complain = Model('complain');
$complain_id = $model_complain->saveComplain($input);
//保存被投诉的商品详细信息
$model_complain_goods = Model('complain_goods');
$order_goods_list = $order_info['extend_order_goods'];
foreach ($order_goods_list as $goods) {
$order_goods_id = $goods['rec_id'];
if (array_key_exists($order_goods_id, $checked_goods)) {
//验证提交的商品属于订单
$input_checked_goods['complain_id'] = $complain_id;
$input_checked_goods['order_goods_id'] = $order_goods_id;
$input_checked_goods['order_goods_type'] = $goods['goods_type'];
$input_checked_goods['goods_id'] = $goods['goods_id'];
$input_checked_goods['goods_name'] = $goods['goods_name'];
$input_checked_goods['goods_price'] = $goods['goods_price'];
$input_checked_goods['goods_num'] = $goods['goods_num'];
$input_checked_goods['goods_image'] = $goods['goods_image'];
$input_checked_goods['complain_message'] = $goods_problem[$order_goods_id];
$model_complain_goods->saveComplainGoods($input_checked_goods);
}
}
showDialog(Language::get('complain_submit_success'), 'index.php?act=member_complain', 'succ');
}
示例10: pop_addressOp
public function pop_addressOp()
{
if (chksubmit()) {
$obj_validate = new Validate();
$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['tel_phone'] . $_POST['mob_phone'], 'require' => 'true', 'message' => $lang['store_daddress_phone_and_mobile']));
$error = $obj_validate->validate();
if ($error != '') {
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'], 'zip_code' => $_POST['zip_code'], 'tel_phone' => $_POST['tel_phone'], 'mob_phone' => $_POST['mob_phone'], 'company' => $_POST['company'], 'content' => $_POST['content']);
$model = Model('daddress');
$insert = $model->insert($data);
if (!$insert) {
showDialog(Language::get('nc_common_op_fail'), '', 'error');
}
$extend_js = array($_POST['area_info'] . $_POST['address'], $_POST['zip_code'], $_POST['seller_name'], $_POST['tel_phone'], $_POST['mob_phone']);
$extend_js = implode(' ', $extend_js);
$extend_js .= "<a href=\"javascript:void(0);\" onclick=\"ajax_form(\\'modfiy_daddress\\', \\'" . Language::get('store_deliver_select_daddress') . "\\', \\'index.php?act=deliver&op=pop_address&type=select\\', 550,0);\" class=\"fr\">" . Language::get('store_deliver_select_ather_daddress') . "</a>";
$extend_js = "\$('#daddress').html('" . $extend_js . "');";
showDialog(Language::get('nc_common_op_succ'), '', 'succ', 'CUR_DIALOG.close();$("#dadress_id").val(' . $insert . ');' . $extend_js);
}
if ($_GET['type'] == 'select') {
$model = Model('daddress');
$daddress_list = $model->where(array('store_id' => $_SESSION['store_id']))->limit(10)->select();
Tpl::output('daddress_list', $daddress_list);
Tpl::showpage('store_deliver_daddress_select', 'null_layout');
} else {
Tpl::showpage('store_deliver_daddress_add', 'null_layout');
}
}
示例11: usersaveOp
/**
* 会员添加操作
*
* @param
* @return
*/
public function usersaveOp()
{
//重复注册验证
if (check_repeat('reg', 40)) {
showDialog(Language::get('nc_common_op_repeat'), 'index.php');
}
/**
* 读取语言包
*/
Language::read("home_login_register");
$lang = Language::getLangContent();
/**
* 实例化模型
*/
$model_member = Model('member');
/**
* 检查登录状态
*/
$model_member->checkloginMember();
/**
* 注册验证
*/
$obj_validate = new Validate();
$obj_validate->validateparam = array(array("input" => $_POST["user_name"], "require" => "true", "message" => $lang['login_usersave_username_isnull']), array("input" => $_POST["password"], "require" => "true", "message" => $lang['login_usersave_password_isnull']), array("input" => $_POST["password_confirm"], "require" => "true", "validator" => "Compare", "operator" => "==", "to" => $_POST["password"], "message" => $lang['login_usersave_password_not_the_same']), array("input" => $_POST["email"], "require" => "true", "validator" => "email", "message" => $lang['login_usersave_wrong_format_email']), array("input" => strtoupper($_POST["captcha"]), "require" => C('captcha_status_register') == '1' ? "true" : "false", "message" => $lang['login_usersave_code_isnull']), array("input" => $_POST["agree"], "require" => "true", "message" => $lang['login_usersave_you_must_agree']));
$error = $obj_validate->validate();
if ($error != '') {
showValidateError($error);
}
if (C('captcha_status_login')) {
if (!checkSeccode($_POST['nchash'], $_POST['captcha'])) {
showDialog($lang['login_usersave_wrong_code']);
}
}
$check_member_name = $model_member->infoMember(array('member_name' => trim($_POST['user_name'])));
if (is_array($check_member_name) and count($check_member_name) > 0) {
showDialog($lang['login_usersave_your_username_exists']);
}
$check_member_email = $model_member->infoMember(array('member_email' => trim($_POST['email'])));
if (is_array($check_member_email) and count($check_member_email) > 0) {
showDialog($lang['login_usersave_your_email_exists']);
}
$user_array = array();
if (C('ucenter_status')) {
/**
* Ucenter处理
*/
$model_ucenter = Model('ucenter');
$uid = $model_ucenter->addUser(trim($_POST['user_name']), trim($_POST['password']), trim($_POST['email']));
if ($uid < 1) {
showMessage($lang['login_usersave_regist_fail'], '', 'html', 'error');
}
$user_array['member_id'] = $uid;
}
/**
* 注册会员发送短信<?php echo $_POST["name"]; ?>----------------------------------------------------------------------------
*/
$phone_zc = $_POST['mobile'];
//注册填写的手机号
$user = $GLOBALS['setting_config']['dxuser'];
//短信接口账号
$passwd = $GLOBALS['setting_config']['dxmima'];
//短信接口密码
$message_mj = $GLOBALS['setting_config']['hyzctz'];
//会员注册时的短信内容
$gateway_1 = $GLOBALS['setting_config']['hyzctzjk'];
//HTTP_POST接口代码
$gateway_1 = iconv("UTF-8", "GB2312//IGNORE", $gateway_1);
$rccc_1 = @file_get_contents($gateway_1);
//短信发送结束------------------------------------------------------------------------------------------------------------
/**
* 会员添加<?php echo $_POST["name"]; ?>
*/
$user_array['member_name'] = $_POST['user_name'];
$user_array['member_passwd'] = $_POST['password'];
$user_array['member_email'] = $_POST['email'];
$user_array['member_mobile'] = $_POST['mobile'];
$result = $model_member->addMember($user_array);
if ($result) {
//注册时间标记,访问灌入垃圾用户
setNcCookie('rp_reg', time());
$_SESSION['is_login'] = '1';
$_SESSION['member_id'] = $result;
$_SESSION['member_name'] = trim($user_array['member_name']);
$_SESSION['member_email'] = trim($user_array['member_email']);
$_SESSION['member_mobile'] = trim($user_array['member_mobile']);
$this->mergecart();
// cookie中的cart存入数据库
//添加会员积分
if ($GLOBALS['setting_config']['points_isuse'] == 1) {
$points_model = Model('points');
$points_model->savePointsLog('regist', array('pl_memberid' => $_SESSION['member_id'], 'pl_membername' => $_SESSION['member_name']), false);
}
$_POST['ref_url'] = strstr($_POST['ref_url'], 'logout') === false && !empty($_POST['ref_url']) ? $_POST['ref_url'] : 'index.php?act=home&op=member';
showDialog(str_replace('site_name', C('site_name'), $lang['login_usersave_regist_success_ajax']), $_POST['ref_url'], 'succ', '', 3);
//.........这里部分代码省略.........
示例12: indexOp
/**
* 登录操作
*
*/
public function indexOp()
{
Language::read("home_login_index");
$lang = Language::getLangContent();
$model_member = Model('member');
//检查登录状态
$model_member->checkloginMember();
$result = chksubmit(true, C('captcha_status_login'), 'num');
if ($result !== false) {
if ($result === -11) {
showDialog($lang['login_index_login_illegal']);
} elseif ($result === -12) {
showDialog($lang['login_index_wrong_checkcode']);
}
if (processClass::islock('login')) {
showDialog($lang['nc_common_op_repeat'], SHOP_SITE_URL);
}
$obj_validate = new Validate();
$obj_validate->validateparam = array(array("input" => $_POST["user_name"], "require" => "true", "message" => $lang['login_index_username_isnull']), array("input" => $_POST["password"], "require" => "true", "message" => $lang['login_index_password_isnull']));
$error = $obj_validate->validate();
if ($error != '') {
showValidateError($error);
exit;
}
$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 {
processClass::addprocess('login');
showDialog($lang['login_index_login_fail']);
}
$model_member->createSession($member_info);
processClass::clear('login');
// cookie中的cart存入数据库
$this->mergecart($member_info);
//添加会员积分
if (C('points_isuse')) {
//一天内只有第一次登录赠送积分
if (trim(@date('Y-m-d', $member_info['member_login_time'])) != trim(date('Y-m-d'))) {
$points_model = Model('points');
$points_model->savePointsLog('login', array('pl_memberid' => $member_info['member_id'], 'pl_membername' => $member_info['member_name']), true);
}
}
showDialog($lang['login_index_login_success'], $_POST['ref_url'], 'succ', $extrajs);
} else {
//登录表单页面
$_pic = @unserialize(C('login_pic'));
if ($_pic[0] != '') {
Tpl::output('lpic', UPLOAD_SITE_URL . '/' . ATTACH_LOGIN . '/' . $_pic[array_rand($_pic)]);
} else {
Tpl::output('lpic', UPLOAD_SITE_URL . '/' . ATTACH_LOGIN . '/' . rand(1, 4) . '.jpg');
}
if (empty($_GET['ref_url'])) {
$ref_url = getReferer();
if (!preg_match('/act=login&op=logout/', $ref_url)) {
$_GET['ref_url'] = $ref_url;
}
}
Tpl::output('html_title', C('site_name') . ' - ' . $lang['login_index_login']);
if ($_GET['inajax'] == 1) {
Tpl::showpage('login_inajax', 'null_layout');
} else {
Tpl::showpage('login');
}
}
}
示例13: indexOp
/**
* 登录操作
*
*/
public function indexOp()
{
Language::read("home_login_index");
$lang = Language::getLangContent();
$model_member = Model('member');
//检查登录状态
$model_member->checkloginMember();
if ($_GET['inajax'] == 1 && C('captcha_status_login') == '1') {
$script = "document.getElementById('codeimage').src='" . APP_SITE_URL . "/index.php?act=seccode&op=makecode&nchash=" . getNchash() . "&t=' + Math.random();";
}
$result = chksubmit(true, C('captcha_status_login'), 'num');
if ($result !== false) {
if ($result === -11) {
showDialog($lang['login_index_login_illegal']);
} elseif ($result === -12) {
showDialog($lang['login_index_wrong_checkcode']);
}
if (processClass::islock('login')) {
showDialog($lang['nc_common_op_repeat'], SHOP_SITE_URL);
}
$obj_validate = new Validate();
$obj_validate->validateparam = array(array("input" => $_POST["user_name"], "require" => "true", "message" => $lang['login_index_username_isnull']), array("input" => $_POST["password"], "require" => "true", "message" => $lang['login_index_password_isnull']));
$error = $obj_validate->validate();
if ($error != '') {
showValidateError($error);
exit;
}
if (C('ucenter_status')) {
$model_ucenter = Model('ucenter');
$member_id = $model_ucenter->userLogin(trim($_POST['user_name']), trim($_POST['password']));
if (intval($member_id) == 0) {
showDialog($lang['login_index_login_again']);
}
}
$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 {
processClass::addprocess('login');
showDialog($lang['login_index_login_fail']);
}
$model_member->createSession($member_info);
processClass::clear('login');
// echo "member_identity:".$member_info['member_identity'];
// echo "inajax:".$_GET['inajax'];
// echo "ref_url:".$_POST['ref_url'];
if ($member_info['member_identity'] != null && $member_info['member_verifycode'] != null) {
//从积分系统获取预备金信息
$this->getPredeposit($member_info);
}
// cookie中的cart存入数据库
$this->mergecart($member_info);
//添加会员积分
if (C('points_isuse')) {
//一天内只有第一次登录赠送积分
if (trim(@date('Y-m-d', $member_info['member_login_time'])) != trim(date('Y-m-d'))) {
$points_model = Model('points');
$points_model->savePointsLog('login', array('pl_memberid' => $member_info['member_id'], 'pl_membername' => $member_info['member_name']), true);
}
}
if (C('ucenter_status')) {
$extrajs = $model_ucenter->outputLogin($member_info['member_id'], trim($_POST['password']));
} elseif (empty($_GET['inajax'])) {
if (empty($_POST['ref_url'])) {
@header('location: index.php');
exit;
} else {
@header('location: ' . $_POST['ref_url']);
exit;
}
}
showDialog($lang['login_index_login_success'], $_POST['ref_url'], 'succ', $extrajs);
} else {
//登录表单页面
$_pic = @unserialize(C('login_pic'));
if ($_pic[0] != '') {
Tpl::output('lpic', UPLOAD_SITE_URL . '/' . ATTACH_LOGIN . '/' . $_pic[array_rand($_pic)]);
} else {
Tpl::output('lpic', UPLOAD_SITE_URL . '/' . ATTACH_LOGIN . '/' . rand(1, 4) . '.jpg');
}
if (empty($_GET['ref_url'])) {
$ref_url = getReferer();
if (!preg_match('/act=login&op=logout/', $ref_url)) {
$_GET['ref_url'] = $ref_url;
}
}
Tpl::output('html_title', C('site_name') . ' - ' . $lang['login_index_login']);
if ($_GET['inajax'] == 1) {
Tpl::showpage('login_inajax', 'null_layout');
} else {
Tpl::showpage('login');
//.........这里部分代码省略.........
示例14: appeal_saveOp
public function appeal_saveOp()
{
$complain_id = intval($_POST['input_complain_id']);
//获取投诉详细信息
$complain_info = $this->get_complain_info($complain_id);
//检查当前用户是不是被投诉人
if ($complain_info['member_status'] !== 'accused') {
showDialog(Language::get('para_error'), 'reload');
}
//检查当前是不是投诉状态
if (intval($complain_info['complain_state']) !== self::STATE_APPEAL) {
showDialog(Language::get('para_error'), 'reload');
}
$input = array();
$input['appeal_message'] = trim($_POST['input_appeal_message']);
//验证输入的信息
$obj_validate = new Validate();
$obj_validate->validateparam = array(array("input" => $input['appeal_message'], "require" => "true", "validator" => "Length", "min" => "1", "max" => "255", "message" => Language::get('appeal_message_error')));
$error = $obj_validate->validate();
if ($error != '') {
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 = $this->upload_pic($appeal_pic);
$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->send_message('appeal', $complain_info);
showDialog(Language::get('appeal_submit_success'), 'index.php?act=store_complain', 'succ');
}
示例15: modify_mobileOp
/**
* 绑定手机
*/
public function modify_mobileOp()
{
$model_member = Model('member');
$member_info = $model_member->getMemberInfoByID($_SESSION['member_id'], 'member_mobile_bind');
if (chksubmit()) {
$obj_validate = new Validate();
$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->validate();
if ($error != '') {
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');
}
}