本文整理匯總了PHP中merge_user_order函數的典型用法代碼示例。如果您正苦於以下問題:PHP merge_user_order函數的具體用法?PHP merge_user_order怎麽用?PHP merge_user_order使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了merge_user_order函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ecs_header
ecs_header("Location: user.php?act=message_list&order_id={$order_id}\n");
exit;
} elseif ($action == 'del_cmt') {
$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
if ($id > 0) {
$sql = "DELETE FROM " . $ecs->table('comment') . " WHERE comment_id = '{$id}' AND user_id = '{$user_id}'";
$db->query($sql);
}
ecs_header("Location: user.php?act=comment_list\n");
exit;
} elseif ($action == 'merge_order') {
include_once ROOT_PATH . 'includes/lib_transaction.php';
include_once ROOT_PATH . 'includes/lib_order.php';
$from_order = isset($_POST['from_order']) ? trim($_POST['from_order']) : '';
$to_order = isset($_POST['to_order']) ? trim($_POST['to_order']) : '';
if (merge_user_order($from_order, $to_order, $user_id)) {
show_message($_LANG['merge_order_success'], $_LANG['order_list_lnk'], 'user.php?act=order_list', 'info');
} else {
$err->show($_LANG['order_list_lnk']);
}
} elseif ($action == 'return_to_cart') {
include_once ROOT_PATH . 'includes/cls_json.php';
include_once ROOT_PATH . 'includes/lib_transaction.php';
$json = new JSON();
$result = array('error' => 0, 'message' => '', 'content' => '');
$order_id = isset($_POST['order_id']) ? intval($_POST['order_id']) : 0;
if ($order_id == 0) {
$result['error'] = 1;
$result['message'] = $_LANG['order_id_empty'];
die($json->encode($result));
}
示例2: action_merge_order
function action_merge_order()
{
$user = $GLOBALS['user'];
$_CFG = $GLOBALS['_CFG'];
$_LANG = $GLOBALS['_LANG'];
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
$user_id = $_SESSION['user_id'];
include_once ROOT_PATH . 'includes/lib_transaction.php';
include_once ROOT_PATH . 'includes/lib_order.php';
$from_order = isset($_POST['from_order']) ? trim($_POST['from_order']) : '';
$to_order = isset($_POST['to_order']) ? trim($_POST['to_order']) : '';
/* 代碼增加_start By www.68ecshop.com */
$sql = "select supplier_id from " . $ecs->table('order_info') . " where order_sn='{$from_order}' ";
$supplier_id_from = $db->getOne($sql);
$sql = "select supplier_id from " . $ecs->table('order_info') . " where order_sn='{$to_order}' ";
$supplier_id_to = $db->getOne($sql);
if ($supplier_id_from != $supplier_id_to) {
show_message('由於供貨商不同,訂單合並失敗', $_LANG['order_list_lnk'], 'user.php?act=order_list', 'info');
}
/* 代碼增加_end By www.68ecshop.com */
if (merge_user_order($from_order, $to_order, $user_id)) {
show_message($_LANG['merge_order_success'], $_LANG['order_list_lnk'], 'user.php?act=order_list', 'info');
} else {
$err->show($_LANG['order_list_lnk']);
}
}