当前位置: 首页>>代码示例>>PHP>>正文


PHP add_booking函数代码示例

本文整理汇总了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');
    }
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:22,代码来源:user.php

示例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;
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:31,代码来源:user.php

示例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;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:24,代码来源:booking.php


注:本文中的add_booking函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。