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


PHP Reservation::delete方法代码示例

本文整理汇总了PHP中Reservation::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Reservation::delete方法的具体用法?PHP Reservation::delete怎么用?PHP Reservation::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Reservation的用法示例。


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

示例1: testDelete

 /**
  * Test we can delete the reservation
  */
 public function testDelete()
 {
     $this->resetReservationTable();
     $this->resetDateTimes();
     $reservation = new Reservation();
     $reservation->setAttributes(array('roomid' => 1, 'datefrom' => $this->_dateOverlapFrom, 'numberofnights' => $this->_numberofnights));
     $reservation->save(false);
     $this->assertTrue($reservation->delete());
 }
开发者ID:bogiesoft,项目名称:YiiHotelReservation,代码行数:12,代码来源:ReservationTest.php

示例2: list

if (isset($_POST["update"])) {
    list($begin_year, $begin_month, $begin_day) = explode("-", $_POST['resa']["begin"]);
    Toolbox::manageBeginAndEndPlanDates($_POST['resa']);
    if (Session::haveRight("reservation", UPDATE) || Session::getLoginUserID() === $_POST["users_id"]) {
        $_POST['_target'] = $_SERVER['PHP_SELF'];
        $_POST['_item'] = key($_POST["items"]);
        $_POST['begin'] = $_POST['resa']["begin"];
        $_POST['end'] = $_POST['resa']["end"];
        if ($rr->update($_POST)) {
            Html::redirect($CFG_GLPI["root_doc"] . "/front/reservation.php?reservationitems_id=" . $_POST['_item'] . "&mois_courant={$begin_month}&annee_courante={$begin_year}");
        }
    }
} else {
    if (isset($_POST["purge"])) {
        $reservationitems_id = key($_POST["items"]);
        if ($rr->delete($_POST, 1)) {
            Event::log($_POST["id"], "reservation", 4, "inventory", sprintf(__('%1$s purges the reservation for item %2$s'), $_SESSION["glpiname"], $reservationitems_id));
        }
        list($begin_year, $begin_month, $begin_day) = explode("-", $rr->fields["begin"]);
        Html::redirect($CFG_GLPI["root_doc"] . "/front/reservation.php?reservationitems_id=" . "{$reservationitems_id}&mois_courant={$begin_month}&annee_courante={$begin_year}");
    } else {
        if (isset($_POST["add"])) {
            $all_ok = true;
            $reservationitems_id = 0;
            if (empty($_POST['users_id'])) {
                $_POST['users_id'] = Session::getLoginUserID();
            }
            Toolbox::manageBeginAndEndPlanDates($_POST['resa']);
            $dates_to_add = array();
            list($begin_year, $begin_month, $begin_day) = explode("-", $_POST['resa']["begin"]);
            if (isset($_POST['resa']["end"])) {
开发者ID:stweil,项目名称:glpi,代码行数:31,代码来源:reservation.form.php

示例3: commonHeader

} else {
    commonHeader($LANG['Menu'][17], $_SERVER['PHP_SELF'], "utils", "reservation");
}
if (isset($_POST["update"])) {
    list($begin_year, $begin_month, $begin_day) = explode("-", $_POST["begin"]);
    if (haveRight("reservation_central", "w") || getLoginUserID() === $_POST["users_id"]) {
        $_POST['_target'] = $_SERVER['PHP_SELF'];
        $_POST['_item'] = key($_POST["items"]);
        if ($rr->update($_POST)) {
            glpi_header($CFG_GLPI["root_doc"] . "/front/reservation.php?reservationitems_id=" . $_POST['_item'] . "&mois_courant={$begin_month}&annee_courante={$begin_year}");
        }
    }
} else {
    if (isset($_POST["delete"])) {
        $reservationitems_id = key($_POST["items"]);
        if ($rr->delete($_POST)) {
            Event::log($_POST["id"], "reservation", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][22]);
        }
        list($begin_year, $begin_month, $begin_day) = explode("-", $_POST["begin"]);
        glpi_header($CFG_GLPI["root_doc"] . "/front/reservation.php?reservationitems_id=" . "{$reservationitems_id}&mois_courant={$begin_month}&annee_courante={$begin_year}");
    } else {
        if (isset($_POST["add"])) {
            $all_ok = true;
            $reservationitems_id = 0;
            if (empty($_POST['users_id'])) {
                $_POST['users_id'] = getLoginUserID();
            }
            foreach ($_POST['items'] as $reservationitems_id) {
                $_POST['reservationitems_id'] = $reservationitems_id;
                $times = $_POST["periodicity_times"];
                $begin = $_POST["begin"];
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:31,代码来源:reservation.form.php


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