本文整理汇总了PHP中orders::add方法的典型用法代码示例。如果您正苦于以下问题:PHP orders::add方法的具体用法?PHP orders::add怎么用?PHP orders::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类orders
的用法示例。
在下文中一共展示了orders::add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: refresh
abr('item', $item);
#BUY ITEM
//购买作品
if (isset($_SESSION['tmp']['order_id']) && $_SESSION['tmp']['order_id']) {
$_SESSION['tmp']['order_id'] = 0;
}
if (isset($_POST['licence'])) {
if (!check_login_bool()) {
$_SESSION['temp']['golink'] = '/' . $languageURL . 'items/' . $itemID;
refresh('/' . $languageURL . 'sign_in/');
}
$ordersClass = new orders();
if ($_POST['licence'] == 'regular') {
//余额购买作品
if (isset($_POST['pay_method']) && $_POST['pay_method'] == 'paymethod') {
$orderID = $ordersClass->add($item['price']);
if (isset($_SESSION['tmp']['deposit_id'])) {
unset($_SESSION['tmp']['deposit_id']);
}
$_SESSION['tmp']['order_id'] = $orderID;
refresh('/' . $languageURL . 'items/payment/');
} else {
//判断余额
if ($_SESSION['user']['total'] < $item['prepaid_price']) {
addErrorMessage($langArray['error_not_enought_money'], '', 'error');
} else {
$total_money = floatval($item['prepaid_price']) + floatval($item['your_profit']);
$ordersClass->buy($total_money);
refresh('/' . $languageURL . 'download/', $langArray['complete_buy_theme'], 'complete');
}
}
示例2: orders
$smarty->assign('to', $_POST['to']);
$smarty->assign('weight', $_POST['weight']);
$smarty->assign('proceed', $proceed);
}
} else {
echo "COMPLETE INFORMATION NECCESSARY";
}
}
if (isset($_POST['payNow'])) {
$order = new orders();
$order->add($_SESSION['userid'], $_POST['from'], $_POST['to'], $_POST['weight'], 0);
echo "thankyou";
}
if (isset($_POST['POD'])) {
echo "thankyou";
$order = new orders();
$order->add($_SESSION['userid'], $_POST['from'], $_POST['to'], $_POST['weight'], 1);
}
$route = new routes();
$allRoutes = $route->getAll();
$smarty->assign('allRoutes', $allRoutes);
$smarty->display('neworder.tpl');
//include neworder template
$smarty->display('footer.tpl');
//include footer file
} else {
header('Location:' . URL . 'notauthorised.php');
}
} else {
header('Location:' . URL . 'noaccess.php');
}