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


PHP deleteBooking函数代码示例

本文整理汇总了PHP中deleteBooking函数的典型用法代码示例。如果您正苦于以下问题:PHP deleteBooking函数的具体用法?PHP deleteBooking怎么用?PHP deleteBooking使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了deleteBooking函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: date

}
// deleteBooking
// Set up inital date
$_SESSION["todaydate"] = date('Ymd');
// Checks if currentweek button has been pressed
// to call setToCurrentWeek function
if (isset($_POST["currentweek"])) {
    setToCurrentWeek();
} elseif (isset($_POST["nextweek"])) {
    setToNextWeek($_POST["nextweek"]);
} elseif (isset($_POST["prevweek"])) {
    setToPreviousWeek($_POST["prevweek"]);
} elseif (isset($_POST["book"])) {
    createBooking($_POST["book"], $conn);
} elseif (isset($_POST["undo"])) {
    deleteBooking($_POST["undo"], $conn);
} else {
    setToCurrentWeek();
}
// else
// Establish the date of each day, store in individual variables
$mondate = $_SESSION["mondate"];
// calculate whole week
$tuedate = findNextDate($mondate);
$weddate = findNextDate($tuedate);
$thudate = findNextDate($weddate);
$fridate = findNextDate($thudate);
?>
  <!-- Form used to change to previous or next week
  Set values to current mondate, so that next mondate
  Can be set as +1 week (or -1 week for previous)-->
开发者ID:awt95,项目名称:resource-booker,代码行数:31,代码来源:slt_clip.php

示例2: date

            $numBlocks = $numBlocks - 1;
        }
        //change the endtime to appropriate value
        $row['endTime'] = date("H:i:s", $endTime);
        $end = $row['endTime'];
    }
}
//Cancel booking
//This is not the user and the user is not an admin
if ($bookingUserID != $_SESSION["netID"] && $_SESSION["class"] != "Admin") {
    http_response_code(406);
    //Invalid Entry
} else {
    //it is the user's own booking or they are admin
    foreach ($bookingIDList as $bid) {
        deleteBooking($db, $bid);
    }
    $admin = false;
    if ($_SESSION["class"] == "Admin" && $bookingUserID != $_SESSION["netID"]) {
        //cancelled by admin
        $admin = true;
        $to = $bookingUserID . "@queensu.ca";
    } else {
        $to = userEmail();
    }
    cancelRecurring($room, $building, $cancelDates, $start, $end, $reason, $desc, $numP, $db, $to, $admin);
    http_response_code(200);
    //success
}
//Close the connection
$db = NULL;
开发者ID:ErinCGallagher,项目名称:MDRoomBooking,代码行数:31,代码来源:cancelRecurring.php

示例3: cancelBooking

                cancelBooking($room, $building, $startDate, $start, $end, $reason, $desc, $numP, $db, $to, true);
                //determnes which week the booking was booked in
                $week = determineWhichWeek($bookingDate);
                //return hours to the appropriate week and group
                for ($i = 0; $i < count($hrsSourceList); $i++) {
                    if (strtolower($hrsSourceList[$i]) == "weekly") {
                        returnWeeklyHoursToUser($db, $week, $bookingUserID, 0.5);
                    } else {
                        returnSpecialHoursToUser($db, $bookingUserID, $hrsSourceList[$i], 0.5);
                    }
                }
                http_response_code(200);
                //success
            } else {
                //otherwise they are admin or deleting a faculty booking
                deleteBooking($db, $bookingID);
                //check if admin is deleting a different user's booking
                if ($bookingUserID != $_SESSION["netID"]) {
                    $to = $bookingUserID . "@queensu.ca";
                    cancelBooking($room, $building, $startDate, $start, $end, $reason, $desc, $numP, $db, $to, true);
                } else {
                    $to = userEmail();
                    cancelBooking($room, $building, $startDate, $start, $end, $reason, $desc, $numP, $db, $to, false);
                }
            }
            http_response_code(200);
            //sucess
        }
    }
}
//Close the connection
开发者ID:ErinCGallagher,项目名称:MDRoomBooking,代码行数:31,代码来源:cancel.php

示例4: saveBooking

function saveBooking($activityids, $edit_userid = FALSE)
{
    include_once "includes/sessionhandler.php";
    require "includes/config.php";
    $userid = $_SESSION['loginuserid'];
    $activity_data = $_SESSION['activitydetails'];
    if ($edit_userid) {
        $userid = $edit_userid;
    }
    deleteBooking($userid);
    $activitiesfordb = implode("|", $activityids);
    if (mysql_query("INSERT INTO `activities_bookings` (`user_id` ,`bookings`) VALUES ('{$userid}', '{$activitiesfordb}');")) {
        for ($i = 0; $i < count($activityids); $i++) {
            if ($activity_data[$activityids[$i]]) {
                //allocate a place (adjust counter)
                mysql_query("UPDATE `activities` SET `placestaken` = `placestaken` + 1 WHERE `id` = {$activityids[$i]} LIMIT 1 ;");
            }
        }
        if ($edit_userid) {
            $_SESSION['message'] = 2;
        } else {
            //refresh booking id cache in session
            $user_bookings = mysql_query("SELECT * FROM `activities_bookings` WHERE `user_id` = {$userid} LIMIT 1;");
            $user_bookings = mysql_fetch_object($user_bookings);
            $user_bookings->bookings = explode("|", $user_bookings->bookings);
            $_SESSION['userbookings'] = $user_bookings;
            $_SESSION['booked_activitys'] = $activityids;
        }
    } else {
        $_SESSION['message'] = 22;
        unset($_SESSION['booked_activitys']);
        //activities weren't stored so clear cache
    }
}
开发者ID:myjavawork,项目名称:actisoft_activitiesweeksystem,代码行数:34,代码来源:sysfunc.php

示例5: ba_db_query

    $bookingsql = "Select * FROM {$db_prefix}bookings inner join {$db_prefix}events on evEventID = bkEventID inner join {$db_prefix}players on plPlayerID = bkPlayerID where bkID = " . $bookingid;
} else {
    $bookingsql = "Select * FROM {$db_prefix}events cross join {$db_prefix}players where evEventID = " . $eventid . " and plPlayerID = " . $playerid;
}
$result = ba_db_query($link, $bookingsql);
$bookinginfo = ba_db_fetch_assoc($result);
if ($playerid == 0 && ba_db_num_rows($result) == 0) {
    $sMsg = "You cannot view this booking";
    $sURL = fnSystemURL() . 'admin.php?warn=' . urlencode($sMsg);
    header("Location: {$sURL}");
}
$eventinfo = getEventDetails($bookinginfo['evEventID'], 0);
//Delete
if (($_POST['btnDelete'] != '' || $_POST['btnDeleteAndRebook'] != '') && CheckReferrer('admin_booking.php')) {
    if ($_POST['txtConfirm'] == 'CONFIRM') {
        deleteBooking($bookinginfo['bkID']);
        if ($_POST['btnDelete'] != '') {
            $sURL = fnSystemURL() . 'admin_manageevent.php?EventID=' . $bookinginfo['bkEventID'];
        } else {
            $sURL = fnSystemURL() . 'admin_booking.php?PlayerID=' . $bookinginfo['bkPlayerID'] . "&EventID=" . $bookinginfo['bkEventID'];
        }
        header("Location: {$sURL}");
    }
}
//Update
if ($_POST['btnSave'] != '' && CheckReferrer('admin_booking.php')) {
    $bookas = htmlentities(stripslashes($_POST['cboBookAs']));
    $overriddenvalue = htmlentities(stripslashes($_POST['txtOverriddenExpectedValue']));
    $overrideexpected = (int) $_POST['chkOverride'];
    $overriddenpaidvalue = htmlentities(stripslashes($_POST['txtOverriddenAmountPaid']));
    $overridepaid = (int) $_POST['chkOverridePaid'];
开发者ID:jfharden,项目名称:bitsand,代码行数:31,代码来源:admin_booking.php

示例6: printAlert

    <![endif]-->
  </head>

  <body>
    <!-- Main jumbotron for a primary marketing message or call to action -->
        <?php 
include "../common/process_DB.php";
if (!isset($_SESSION["User"])) {
    printAlert("danger", "You haven't sign in yet!", "index.php");
    exit;
}
$result = $_SESSION["User"];
printNavbar($result);
print '</div>';
if (isset($_POST['Delete'])) {
    $suc = deleteBooking($_SESSION["Email"], $_POST['HotelName'], $_POST['HotelAddr'], $_POST['RoomType'], $_POST['RoomQuant'], $_POST['StartDate'], $_POST['EndDate']);
    if ($suc) {
        printAlert("success", "Deleted", "index.php");
    } else {
        printAlert("failure", "Failed", "index.php");
    }
}
$userEmail = $_SESSION["Email"];
$userName = $_SESSION["User"];
?>
        <div class="container theme-showcase" role="main">
          <div class="jumbotron">
            <div class="container"><div class="panel-group" role="tablist">
              <div class="panel panel-default">
                <div class="panel-heading" role="tab" id="collapseListGroupHeading1">
                  <label>
开发者ID:lxqlx,项目名称:Hotel_Booking_System,代码行数:31,代码来源:index.php

示例7: catch

                // change session variable
                $_SESSION["password"] = $password;
            }
        }
    } catch (Exception $e) {
        echo "An error occured:<br>";
        echo $e->getMessage();
    } finally {
        echo "<button id='dismiss'>Dismiss</button>";
        echo "</form>";
        echo "</p>";
    }
}
// Checks if a booking has been deleted through POST
if (isset($_POST['deletebooking'])) {
    deleteBooking($_POST['deletebooking']);
}
// If new user has been entered
if (isset($_POST['newuser'])) {
    createNewUser($_POST['newusername'], $_POST['newuserfullname'], $_POST['newuserpwd']);
}
// If Delete button pressed on one of the users
if (isset($_POST['deleteuser'])) {
    deleteUser($_POST['deleteuser']);
}
// If Make Admin has been pressed
if (isset($_POST['makeadmin'])) {
    makeAdmin($_POST['makeadmin']);
}
// If allow book vehicles has been pressed
if (isset($_POST['bookvehicles'])) {
开发者ID:awt95,项目名称:resource-booker,代码行数:31,代码来源:admin.php

示例8: getPendingPaperwork

     getPendingPaperwork($_REQUEST);
     break;
 case "embedhtmlreport":
     embedReport($_REQUEST);
     break;
 case "loadpane":
     showAdminPane($_REQUEST);
     break;
 case "getactivity":
     getActivityByID($_REQUEST['actid']);
     break;
 case "deleteactivity":
     deleteActivity($_REQUEST['actid']);
     break;
 case "deletebooking":
     deleteBooking($_REQUEST['uid']);
     break;
 case "generateuserlist":
     showUserList($_REQUEST);
     break;
 case "generategrouplist":
     showGroupList($_REQUEST);
     break;
 case "editbooking":
     editBooking($_REQUEST['userid']);
     break;
 case "getpaperwork":
     getPaperworkByID($_REQUEST['papid']);
     break;
 case "deletepaperwork":
     deletePaperwork($_REQUEST['papid']);
开发者ID:myjavawork,项目名称:actisoft_activitiesweeksystem,代码行数:31,代码来源:adminajax.php


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