本文整理匯總了PHP中return_to_cart函數的典型用法代碼示例。如果您正苦於以下問題:PHP return_to_cart函數的具體用法?PHP return_to_cart怎麽用?PHP return_to_cart使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了return_to_cart函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: die
die($json->encode($result));
}
/* 檢查訂單是否屬於該用戶 */
$order_user = $db->getOne("SELECT user_id FROM " . $ecs->table('order_info') . " WHERE order_id = '{$order_id}'");
if (empty($order_user)) {
$result['error'] = 1;
$result['message'] = $_LANG['order_exist'];
die($json->encode($result));
} else {
if ($order_user != $user_id) {
$result['error'] = 1;
$result['message'] = $_LANG['no_priv'];
die($json->encode($result));
}
}
$message = return_to_cart($order_id);
if ($message === true) {
$result['error'] = 0;
$result['message'] = $_LANG['return_to_cart_success'];
die($json->encode($result));
} else {
$result['error'] = 1;
$result['message'] = $_LANG['order_exist'];
die($json->encode($result));
}
} elseif ($action == 'act_edit_surplus') {
/* 檢查是否登錄 */
if ($_SESSION['user_id'] <= 0) {
ecs_header("Location: ./\n");
exit;
}
示例2: action_return_to_cart
function action_return_to_cart()
{
$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/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));
}
if ($user_id == 0) {
/* 用戶沒有登錄 */
$result['error'] = 1;
$result['message'] = $_LANG['login_please'];
die($json->encode($result));
}
/* 檢查訂單是否屬於該用戶 */
$order_user = $db->getOne("SELECT user_id FROM " . $ecs->table('order_info') . " WHERE order_id = '{$order_id}'");
if (empty($order_user)) {
$result['error'] = 1;
$result['message'] = $_LANG['order_exist'];
die($json->encode($result));
} else {
if ($order_user != $user_id) {
$result['error'] = 1;
$result['message'] = $_LANG['no_priv'];
die($json->encode($result));
}
}
$message = return_to_cart($order_id);
if ($message === true) {
$result['error'] = 0;
$result['message'] = $_LANG['return_to_cart_success'];
die($json->encode($result));
} else {
$result['error'] = 1;
$result['message'] = $_LANG['order_exist'];
die($json->encode($result));
}
}