当前位置: 首页>>代码示例>>PHP>>正文


PHP check_consignee_info函数代码示例

本文整理汇总了PHP中check_consignee_info函数的典型用法代码示例。如果您正苦于以下问题:PHP check_consignee_info函数的具体用法?PHP check_consignee_info怎么用?PHP check_consignee_info使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了check_consignee_info函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show_message

 if ($db->getOne($sql) == 0) {
     show_message($_LANG['no_goods_in_cart'], '', '', 'warning');
 }
 /*
  * 检查用户是否已经登录
  * 如果用户已经登录了则检查是否有默认的收货地址
  * 如果没有登录则跳转到登录和注册页面
  */
 if (empty($_SESSION['direct_shopping']) && $_SESSION['user_id'] == 0) {
     /* 用户没有登录且没有选定匿名购物,转向到登录页面 */
     hhs_header("Location: flows.php?step=login\n");
     exit;
 }
 $consignee = get_consignee($_SESSION['user_id']);
 /* 检查收货人信息是否完整 */
 if (!check_consignee_info($consignee, $flow_type)) {
     /* 如果不完整则转向到收货人信息填写界面 */
     //hhs_header("Location: flows.php?step=consignee\n");
     //exit;
 }
 $smarty->assign("address_num", count(get_consignee_list($_SESSION['user_id'])));
 /* 取得国家列表、商店所在国家、商店所在国家的省列表 */
 $smarty->assign('country_list', get_regions());
 $smarty->assign('shop_country', $_CFG['shop_country']);
 $smarty->assign('shop_province_list', get_regions(1, $_CFG['shop_country']));
 $mobile_phone = $GLOBALS['db']->getOne("select mobile_phone from " . $GLOBALS['hhs']->table('users') . " where user_id=" . $_SESSION['user_id']);
 $smarty->assign('mobile_phone', $mobile_phone);
 //echo "<pre>";
 //print_r($consignee);exit;
 /* 获得用户所有的收货人信息 */
 if ($_SESSION['user_id'] > 0) {
开发者ID:shiruolin,项目名称:hzzshop,代码行数:31,代码来源:flows.php

示例2: array

 //-- 改变发票的设置
 /*------------------------------------------------------ */
 include_once 'includes/cls_json.php';
 $result = array('error' => '', 'content' => '');
 $json = new JSON();
 $_GET['inv_type'] = !empty($_GET['inv_type']) ? json_str_iconv(urldecode($_GET['inv_type'])) : '';
 $_GET['invPayee'] = !empty($_GET['invPayee']) ? json_str_iconv(urldecode($_GET['invPayee'])) : '';
 $_GET['inv_content'] = !empty($_GET['inv_content']) ? json_str_iconv(urldecode($_GET['inv_content'])) : '';
 /* 取得购物类型 */
 $flow_type = isset($_SESSION['flow_type']) ? intval($_SESSION['flow_type']) : CART_GENERAL_GOODS;
 /* 获得收货人信息 */
 $consignee = get_consignee($_SESSION['user_id']);
 /* 对商品信息赋值 */
 $cart_goods = cart_goods($flow_type);
 // 取得商品列表,计算合计
 if (empty($cart_goods) || !check_consignee_info($consignee, $flow_type)) {
     $result['error'] = '您的购物车中没有商品!';
     die($json->encode($result));
 } else {
     /* 取得购物流程设置 */
     $smarty->assign('config', $_CFG);
     /* 取得订单信息 */
     $order = flow_order_info();
     if (isset($_GET['need_inv']) && intval($_GET['need_inv']) == 1) {
         $order['need_inv'] = 1;
         $order['inv_type'] = trim(stripslashes($_GET['inv_type']));
         $order['inv_payee'] = trim(stripslashes($_GET['inv_payee']));
         $order['inv_content'] = trim(stripslashes($_GET['inv_content']));
     } else {
         $order['need_inv'] = 0;
         $order['inv_type'] = '';
开发者ID:nanhuacrab,项目名称:ecshop,代码行数:31,代码来源:order.php

示例3: done

	public function done () {
		global $ecs,$db,$_CFG;
		include_once(RPC_ROOT.'includes/lib_clips_ec.php');
	    include_once(RPC_ROOT.'includes/lib_payment.php');
	
	    /* 取得购物类型 */
	    $flow_type = isset($_SESSION['flow_type']) ? intval($_SESSION['flow_type']) : CART_GENERAL_GOODS;
	
	    /* 检查购物车中是否有商品 */
	    $sql = "SELECT COUNT(*) FROM " . $ecs->table('cart') ." WHERE session_id = '" . SESS_ID . "' " .
	           "AND parent_id = 0 AND is_gift = 0 AND rec_type = '$flow_type'";
	    
		if ($db->getOne($sql) == 0)
	    {
			$msg = rpcLang('flow.php', 'no_goods_in_cart');
			jsonExit("{\"status\":\"$msg\"}");
	    }
	
	    /* 检查商品库存,如果使用库存,且下订单时减库存,则减少库存 */
	    if ($_CFG['use_storage'] == '1' && $_CFG['stock_dec_time'] == SDT_PLACE)
	    {
	        $cart_goods_stock = get_cart_goods();       
	        $_cart_goods_stock = array();        
	        foreach ($cart_goods_stock['goods_list'] as $value)
	        {
	            $_cart_goods_stock[$value['rec_id']] = $value['goods_number'];
	        }       
	        zy_flow_cart_stock($_cart_goods_stock);        
	        unset($cart_goods_stock, $_cart_goods_stock);
	    }
	
	    /*
	     * 检查用户是否已经登录
	     * 如果用户已经登录了则检查是否有默认的收货地址
	     * 如果没有登录则跳转到登录和注册页面
	     */
	    if (empty($_SESSION['direct_shopping']) && $_SESSION['user_id'] == 0)
	    {
	        /* 用户没有登录且没有选定匿名购物,转向到登录页面 */
	        $msg = rpcLang('user.php', 'nologin');
			jsonExit("{\"status\":\"$msg\"}");
	    }
	
	    $consignee = get_consignee($_SESSION['user_id']);
	
	    /* 检查收货人信息是否完整 */
	    if (!check_consignee_info($consignee, $flow_type))
	    {
	        $msg = rpcLang('flow.php', 'user_address_not_full');
			jsonExit("{\"status\":\"$msg\"}");
	    }
	
	
	    $_GET['how_oos']	  = isset($_GET['how_oos']) ? intval($_GET['how_oos']) : 0;
	    $_GET['card_message'] = isset($_GET['card_message']) ? htmlspecialchars($_GET['card_message']) : '';
	    $_GET['inv_type']     = !empty($_GET['inv_type']) ? htmlspecialchars($_GET['inv_type']) : '';
	    $_GET['inv_payee']    = isset($_GET['inv_payee']) ? htmlspecialchars($_GET['inv_payee']) : '';
	    $_GET['inv_content']  = isset($_GET['inv_content']) ? htmlspecialchars($_GET['inv_content']) : '';
	    $_GET['postscript']   = isset($_GET['postscript']) ? htmlspecialchars($_GET['postscript']) : '';
	
	    $referer = empty($_GET['referer']) ? 'Android':trim($_GET['referer']);
	    $order = array(
	        //'shipping_id'     => intval($_POST['shipping']),
	    	'shipping_id'     => intval($_GET['shipping']),//快递id
	        'pay_id'          => intval($_GET['payment']),//支付方式id
	        'pack_id'         => isset($_GET['pack']) ? intval($_GET['pack']) : 0,//包装
	        'card_id'         => isset($_GET['card']) ? intval($_GET['card']) : 0,//贺卡
	        'card_message'    => trim($_GET['card_message']),
	        'surplus'         => isset($_POST['surplus']) ? floatval($_POST['surplus']) : 0.00,
	        'integral'        => isset($_POST['integral']) ? intval($_POST['integral']) : 0,
	        'bonus_id'        => isset($_GET['bonus']) ? intval($_GET['bonus']) : 0,
	        'need_inv'        => empty($_POST['need_inv']) ? 0 : 1,
	        'postscript'      => trim($_POST['postscript']),
	        'how_oos'         => isset($_LANG['oos'][$_POST['how_oos']]) ? addslashes($_LANG['oos'][$_POST['how_oos']]) : '',
	        'need_insure'     => isset($_POST['need_insure']) ? intval($_POST['need_insure']) : 0,
	        'user_id'         => $_SESSION['user_id'],
	        'add_time'        => gmtime(),
	        'order_status'    => OS_UNCONFIRMED,
	        'shipping_status' => SS_UNSHIPPED,
	        'pay_status'      => PS_UNPAYED,
	        'agency_id'       => get_agency_by_regions(array($consignee['country'], $consignee['province'], $consignee['city'], $consignee['district']))
	        );
		if(EC_CHARSET == 'utf-8'){
			$order['inv_type'] = gbktoutf8($_GET['inv_type']);
			$order['inv_payee'] = gbktoutf8(trim($_GET['inv_payee']));
			$order['inv_content'] = gbktoutf8($_GET['inv_content']);
		}else{
			$order['inv_type'] = utf8togbk($_GET['inv_type']);
			$order['inv_payee'] = utf8togbk(trim($_GET['inv_payee']));
			$order['inv_content'] = utf8togbk($_GET['inv_content']);
		}
	
	    /* 扩展信息 */
	    if (isset($_SESSION['flow_type']) && intval($_SESSION['flow_type']) != CART_GENERAL_GOODS)
	    {
	        $order['extension_code'] = $_SESSION['extension_code'];
	        $order['extension_id'] = $_SESSION['extension_id'];
	    }
	    else
	    {
//.........这里部分代码省略.........
开发者ID:noikiy,项目名称:mdwp,代码行数:101,代码来源:flow.action.php


注:本文中的check_consignee_info函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。