Пример #1
0
                					echo "<div align=\"center\"><h1>".$_L['GST_success']."</h1></div>";
                				}
                */
            }
            break;
        case 'List':
            break;
        case 'Find':
            // check if user is searching using name, payrollno, national id number or other fields
            $guestid = $_POST["search"];
            break;
    }
}
if ($guestid) {
    $thisguest = array();
    $ret = findguestbyid($guestid, $thisguest);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link href="css/new.css" rel="stylesheet" type="text/css">
  <title><?php 
echo $_L['MAIN_Title'];
?>
</title>
  <script type="text/javascript">
	<!--
	var request;
	var dest;
if ($resid) {
    $details = array();
    $total = 0;
    reservation_details_byResID($resid, $details);
    foreach ($details as $resdetail) {
        $rate = array();
        $rate_id = $resdetail['ratesid'];
        get_ratebyratesid($rate_id, $rate);
        $total = $total + $rate['price'];
    }
} else {
    $total = $rate['price'];
}
if ($guestid > 0) {
    $guest = array();
    findguestbyid($guestid, $guest);
    $guestname = $guest['guest'];
}
//get the last index of the address for the profile
get_addresses_by_profileID($guestid, $addr);
for ($i = 0; $i < count($addr); $i++) {
    $addStr = "";
    $postal = "";
    $comma = "";
    //echo $addr[$i]['addressid'];
    if ($addr[$i]['floor']) {
        $addStr .= $addr[$i]['floor'] . "Flr";
        $comma = ", ";
    }
    if ($addr[$i]['unit']) {
        $addStr .= "-" . $addr[$i]['unit'];
Пример #3
0
/**
 * Get the booking detail by the guest id, first check any open reservation that is due today
 * if found, use this reservation, if not found then create a new booking filling in the guest
 * detail, but the booking will not be created like with a reservation.
 * @ingroup BOOKING_MANAGEMENT
 * @param $guestid [in] Guest ID
 * @param $booking [in/out] result array
 *
 * @return number of elements in booking
 * @todo complete this function.
 */
function get_booking_byguest($guestid, &$booking)
{
    global $conn;
    if (!$conn) {
        $conn = connect_Hotel_db(HOST, USER, PASS, DB, PORT);
    }
    if (!$conn) {
        return 0;
    }
    $todaystart = date("d/m/Y") . " 00:00";
    $todayend = date("d/m/Y") . " 23:59";
    $rightnow = date("d/m/Y H:i");
    $booking = array();
    $sql = "select book_id from booking where guestid=" . $guestid;
    $sql .= " and checkindate >= " . date_to_dbformat("DD/MM/YYYY HH:MI", 1, $todaystart);
    $sql .= " and checkoutdate <= " . date_to_dbformat("DD/MM/YYYY HH:MI", 1, $todayend);
    $stmt = $conn->prepare($sql);
    $results = $stmt->execute();
    if ($results && ($row = $stmt->fetch())) {
        return get_booking($row['book_id'], $booking);
    }
    $guest = array();
    if (findguestbyid($guestid, $guest)) {
        $booking['book_id'] = 0;
        $booking['guestid'] = $guestid;
        $booking['reservation_id'] = 0;
        $booking['bill_id'] = 0;
        $booking['no_adults'] = 1;
        $booking['no_child1_5'] = 0;
        $booking['no_child6_12'] = 0;
        $booking['no_babies'] = 0;
        $booking['checkindate'] = $rightnow;
        $booking['checkoutdate'] = '';
        $booking['checkedin_by'] = 0;
        $booking['checkedout_by'] = 0;
        $booking['checkedout_date'] = 0;
        $booking['checkedin_date'] = '';
        $booking['cctype'] = '';
        $booking['CCnum'] = '';
        $booking['expiry'] = '';
        $booking['CVV'] = '';
        $booking['pp_no'] = $guest['pp_no'];
        $booking['idno'] = $guest['idno'];
        $booking['address'] = $guest['address'];
        $booking['town'] = $guest['town'];
        $booking['postal_code'] = $guest['postal_code'];
        $booking['phone'] = $guest['phone'];
        $booking['email'] = $guest['email'];
        $booking['mobilephone'] = $guest['mobilephone'];
        $booking['eBridgeID'] = $guest['eBridgeID'];
        $booking['IM'] = $guest['IM'];
        $booking['nationality'] = $guest['nationality'];
        $booking['countrycode'] = $guest['countrycode'];
        $booking['nation'] = Get_Country($guest['nationality']);
        $booking['country'] = Get_Country($guest['countrycode']);
        $booking['instructions'] = '';
        $booking['guestname'] = trim(trim($guest['firstname']) . " " . trim($guest['middlename']) . " " . trim($guest['lastname']));
    }
    return sizeof($booking);
}