本文整理汇总了PHP中add_booking函数的典型用法代码示例。如果您正苦于以下问题:PHP add_booking函数的具体用法?PHP add_booking怎么用?PHP add_booking使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_booking函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_act_add_booking
function action_act_add_booking()
{
$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_clips.php';
$booking = array('goods_id' => isset($_POST['id']) ? intval($_POST['id']) : 0, 'goods_amount' => isset($_POST['number']) ? intval($_POST['number']) : 0, 'desc' => isset($_POST['desc']) ? trim($_POST['desc']) : '', 'linkman' => isset($_POST['linkman']) ? trim($_POST['linkman']) : '', 'email' => isset($_POST['email']) ? trim($_POST['email']) : '', 'tel' => isset($_POST['tel']) ? trim($_POST['tel']) : '', 'booking_id' => isset($_POST['rec_id']) ? intval($_POST['rec_id']) : 0);
// 查看此商品是否已经登记过
$rec_id = get_booking_rec($user_id, $booking['goods_id']);
if ($rec_id > 0) {
show_message($_LANG['booking_rec_exist'], $_LANG['back_page_up'], '', 'error');
}
if (add_booking($booking)) {
show_message($_LANG['booking_success'], $_LANG['back_booking_list'], 'user.php?act=booking_list', 'info');
} else {
$err->show($_LANG['booking_list_lnk'], 'user.php?act=booking_list');
}
}
示例2: isset
include_once ROOT_PATH . 'includes/lib_clips.php';
$goods_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
if ($goods_id == 0) {
show_message($_LANG['no_goods_id'], $_LANG['back_page_up'], '', 'error');
}
$smarty->assign('info', get_goodsinfo($goods_id));
$smarty->display('user_clips.dwt');
} elseif ($action == 'act_add_booking') {
include_once ROOT_PATH . 'includes/lib_clips.php';
$booking = array('goods_id' => isset($_POST['id']) ? intval($_POST['id']) : 0, 'goods_amount' => isset($_POST['number']) ? intval($_POST['number']) : 0, 'desc' => isset($_POST['desc']) ? trim($_POST['desc']) : '', 'linkman' => isset($_POST['linkman']) ? trim($_POST['linkman']) : '', 'email' => isset($_POST['email']) ? trim($_POST['email']) : '', 'tel' => isset($_POST['tel']) ? trim($_POST['tel']) : '', 'booking_id' => isset($_POST['rec_id']) ? intval($_POST['rec_id']) : 0);
// 查看此商品是否已经登记过
$rec_id = get_booking_rec($user_id, $booking['goods_id']);
if ($rec_id > 0) {
show_message($_LANG['booking_rec_exist'], $_LANG['back_page_up'], '', 'error');
}
if (add_booking($booking)) {
show_message($_LANG['booking_success'], $_LANG['back_booking_list'], 'user.php?act=booking_list', 'info');
} else {
$err->show($_LANG['booking_list_lnk'], 'user.php?act=booking_list');
}
} elseif ($action == 'act_del_booking') {
include_once ROOT_PATH . 'includes/lib_clips.php';
$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
if ($id == 0 || $user_id == 0) {
ecs_header("Location: user.php?act=booking_list\n");
exit;
}
$result = delete_booking($id, $user_id);
if ($result) {
ecs_header("Location: user.php?act=booking_list\n");
exit;
示例3: save_booking_form_to_db
/**
* Take details posted about a booking, and save to the database.
*
* @param array Booking details structure.
* @param array Existing bookings to ignore (presumably the booking we're trying to make - if this is an edit).
* @param ?MEMBER The member ID we are saving as (NULL: current user).
* @return ?array Booking details structure (NULL: error -- reshow form).
*/
function save_booking_form_to_db($request, $ignore_bookings, $member_id = NULL)
{
if (is_null($member_id)) {
$member_id = get_member();
}
if (is_guest($member_id)) {
fatal_exit(do_lang_tempcode('INTERNAL_ERROR'));
}
$test = check_booking_dates_available($request, $ignore_bookings);
if (!is_null($test)) {
attach_message($test, 'warn');
return NULL;
}
$request = add_booking($request, $member_id);
return $request;
}