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


PHP get_consignee函数代码示例

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


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

示例1: exit

 if ($db->getOne($sql) == 0) {
     $tips = '您的购物车中没有商品';
     exit($tips);
 }
 /* 检查商品库存 */
 /* 如果使用库存,且下订单时减库存,则减少库存 */
 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'];
     }
     flow_cart_stock($_cart_goods_stock);
     unset($cart_goods_stock, $_cart_goods_stock);
 }
 $consignee = get_consignee($_SESSION['user_id']);
 $_POST['how_oos'] = isset($_POST['how_oos']) ? intval($_POST['how_oos']) : 0;
 $_POST['card_message'] = isset($_POST['card_message']) ? htmlspecialchars($_POST['card_message']) : '';
 $_POST['inv_type'] = !empty($_POST['inv_type']) ? htmlspecialchars($_POST['inv_type']) : '';
 $_POST['inv_payee'] = isset($_POST['inv_payee']) ? htmlspecialchars($_POST['inv_payee']) : '';
 $_POST['inv_content'] = isset($_POST['inv_content']) ? htmlspecialchars($_POST['inv_content']) : '';
 $_POST['postscript'] = isset($_POST['postscript']) ? htmlspecialchars($_POST['postscript']) : '';
 $order = array('shipping_id' => intval($_POST['shipping']), 'pay_id' => isset($_POST['payment']) ? intval($_POST['payment']) : '0', 'pack_id' => isset($_POST['pack']) ? intval($_POST['pack']) : 0, 'card_id' => isset($_POST['card']) ? intval($_POST['card']) : 0, 'card_message' => trim($_POST['card_message']), 'surplus' => isset($_POST['surplus']) ? floatval($_POST['surplus']) : 0.0, 'integral' => isset($_POST['integral']) ? intval($_POST['integral']) : 0, 'bonus_id' => isset($_POST['bonus']) ? intval($_POST['bonus']) : 0, 'need_inv' => empty($_POST['need_inv']) ? 0 : 1, 'inv_type' => $_POST['inv_type'], 'inv_payee' => trim($_POST['inv_payee']), 'inv_content' => $_POST['inv_content'], '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 (isset($_SESSION['flow_type']) && intval($_SESSION['flow_type']) != CART_GENERAL_GOODS) {
     $order['extension_code'] = $_SESSION['extension_code'];
     $order['extension_id'] = $_SESSION['extension_id'];
 } else {
     $order['extension_code'] = '';
     $order['extension_id'] = 0;
 }
开发者ID:a494008974,项目名称:bzbshop,代码行数:31,代码来源:order.php

示例2: define

 *
 *  QQ Group:   329673575
 *  BBS:        bbs.ecmobile.cn
 *  Fax:        +86-10-6561-5510
 *  Mail:       info@geek-zoo.com
 */
define('INIT_NO_USERS', true);
require EC_PATH . '/includes/init.php';
GZ_Api::authSession();
include_once EC_PATH . '/includes/lib_order.php';
include_once EC_PATH . '/includes/lib_transaction.php';
$user_id = $_SESSION['user_id'];
// $user_id = _POST('user_id', 0);
$sql = "SELECT * FROM " . $GLOBALS['ecs']->table('user_address') . " WHERE user_id = '{$user_id}' ORDER BY address_id DESC LIMIT 5";
$consignee_list = $GLOBALS['db']->getAll($sql);
$consignee = get_consignee($user_id);
// 取得默认地址
$result = array();
foreach ($consignee_list as $key => $value) {
    $result[$key]['id'] = $value['address_id'];
    $result[$key]['consignee'] = $value['consignee'];
    $result[$key]['address'] = $value['address'];
    $country = $value['country'];
    $sql1 = "SELECT * FROM " . $GLOBALS['ecs']->table('region') . " WHERE region_id = '{$country}'";
    $country = $GLOBALS['db']->getAll($sql1);
    $result[$key]['country_name'] = $country[0]['region_name'];
    $province = $value['province'];
    $sql2 = "SELECT * FROM " . $GLOBALS['ecs']->table('region') . " WHERE region_id = '{$province}'";
    $province = $GLOBALS['db']->getAll($sql2);
    $result[$key]['province_name'] = $province[0]['region_name'];
    $city = $value['city'];
开发者ID:dx8719,项目名称:ECMobile_Universal,代码行数:31,代码来源:list.php

示例3: get_consignee_list_ecshop68

function get_consignee_list_ecshop68()
{
    $consignee = get_consignee($_SESSION['user_id']);
    $sql = "SELECT * FROM " . $GLOBALS['ecs']->table('user_address') . " WHERE user_id = '" . $_SESSION['user_id'] . "' order by address_id ";
    $consignee_list_ecshop68 = $GLOBALS['db']->getAll($sql);
    foreach ($consignee_list_ecshop68 as $cons_key => $cons_val) {
        $consignee_list_ecshop68[$cons_key]['address_short_name'] = $cons_val['consignee'] . "<br>";
        $consignee_list_ecshop68[$cons_key]['address_short_name'] .= get_region_info($cons_val['province']) . "-";
        $consignee_list_ecshop68[$cons_key]['address_short_name'] .= get_region_info($cons_val['city']) . "-";
        $consignee_list_ecshop68[$cons_key]['address_short_name'] .= get_region_info($cons_val['district']) . "&nbsp;";
        $consignee_list_ecshop68[$cons_key]['address_short_name'] .= sub_str($cons_val['address'], 16);
        $consignee_list_ecshop68[$cons_key]['address_short_name'] .= $cons_val['zipcode'] ? "," . $cons_val['zipcode'] : "";
        $consignee_list_ecshop68[$cons_key]['address_short_name'] .= "<br>" . ($cons_val['tel'] != '--' ? $cons_val['tel'] : $cons_val['mobile']);
        if ($consignee['address_id'] == $cons_val['address_id']) {
            $consignee_list_ecshop68[$cons_key]['def_addr'] = 1;
            $have_def_addr = 1;
        }
    }
    if (count($consignee_list_ecshop68) && !$have_def_addr) {
        $consignee_list_ecshop68[0]['def_addr'] = 1;
    }
    return $consignee_list_ecshop68;
}
开发者ID:moonlight-wang,项目名称:feilun,代码行数:23,代码来源:flow.php

示例4: get_consignee_list_ecshop68

function get_consignee_list_ecshop68()
{
    $consignee = get_consignee($_SESSION['user_id']);
    $sql = "SELECT * FROM " . $GLOBALS['ecs']->table('user_address') . " WHERE user_id = '" . $_SESSION['user_id'] . "' order by address_id ";
    $consignee_list_ecshop68 = $GLOBALS['db']->getAll($sql);
    foreach ($consignee_list_ecshop68 as $cons_key => $cons_val) {
        $consignee_list_ecshop68[$cons_key]['province'] = get_region_info($cons_val['province']);
        $consignee_list_ecshop68[$cons_key]['city'] = get_region_info($cons_val['city']);
        $consignee_list_ecshop68[$cons_key]['district'] = get_region_info($cons_val['district']);
        $consignee_list_ecshop68[$cons_key]['address'] = $cons_val['address'];
        $consignee_list_ecshop68[$cons_key]['mobile'] = $cons_val['mobile'];
        $consignee_list_ecshop68[$cons_key]['tel'] = $cons_val['tel'];
        if ($consignee['address_id'] == $cons_val['address_id']) {
            $consignee_list_ecshop68[$cons_key]['def_addr'] = 1;
            $have_def_addr = 1;
        }
    }
    if (count($consignee_list_ecshop68) && !$have_def_addr) {
        $consignee_list_ecshop68[0]['def_addr'] = 1;
    }
    return $consignee_list_ecshop68;
}
开发者ID:firsteam,项目名称:falcons,代码行数:22,代码来源:flow.php

示例5: 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

示例6: insert_right_my_info

/**
 * 调用配送地址信息
 *
 * @access  public
 * @return  string
 */
function insert_right_my_info()
{
    require_once ROOT_PATH . 'includes/lib_order.php';
    $need_cache = $GLOBALS['smarty']->caching;
    $need_compile = $GLOBALS['smarty']->force_compile;
    $GLOBALS['smarty']->caching = false;
    $GLOBALS['smarty']->force_compile = true;
    $consignee = get_consignee($_SESSION['user_id']);
    $GLOBALS['smarty']->assign('consignee', $consignee);
    /* 取得国家列表、商店所在国家、商店所在国家的省列表 */
    $GLOBALS['smarty']->assign('country_list', get_regions());
    $GLOBALS['smarty']->assign('shop_country', $_CFG['shop_country']);
    //if($consignee['country'] >0)
    //{
    //$GLOBALS['smarty']->assign('city_list', get_regions(2, 2));
    $GLOBALS['smarty']->assign('district_list', get_regions(2, 501));
    //}
    $val = $GLOBALS['smarty']->fetch('library/right_my_info.lbi');
    $GLOBALS['smarty']->caching = $need_cache;
    $GLOBALS['smarty']->force_compile = $need_compile;
    return $val;
}
开发者ID:songtaiwu,项目名称:m-cmsold,代码行数:28,代码来源:lib_insert.php

示例7: set_session_consignee

function set_session_consignee($smarty)
{
    $consignee = get_consignee($_SESSION['user_id'], 'set_moren');
    $_SESSION['flow_consignee'] = $consignee;
    $smarty->assign('consignee', $consignee);
}
开发者ID:norain2050,项目名称:benhu,代码行数:6,代码来源:flow.php


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