本文整理汇总了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));
}
}