Example #1
0
 function action_diff()
 {
     $this->buffer_output();
     include_once "lib/diff.php";
     showDiff($this);
 }
<?php

require_once "../functions/register_room.php";
$control = 0;
$data = array();
if (isset($_POST["datePickerA"]) && isset($_POST['datePickerD'])) {
    $arrival = $_POST["datePickerA"];
    $departure = $_POST["datePickerD"];
    if (showDiff($arrival, $departure) == true) {
        $control = 1;
        if (isset($_POST["roomType"])) {
            if (!isset($_POST['idSelector'])) {
                $room_type = $_POST["roomType"];
                $data = findAvailableRooms($arrival, $departure, $room_type);
                $control = 2;
            } else {
                $id = $_POST['idSelector'];
                $user_id = $_SESSION['id'];
                registerRoomOrder($id, $user_id, $arrival, $departure);
                $control = 3;
            }
        }
    } else {
        $_SESSION["messageRent"] = "error";
        $control = 0;
    }
} else {
    $control = 0;
}