コード例 #1
0
include_once dirname(__FILE__) . "/../dailyfunc.php";
include_once dirname(__FILE__) . "/../lang/lang_en.php";
$lang = get_language();
load_language($lang);
$logofile = Get_LogoFile();
access("billing");
$bill = array();
$book = array();
$guest = array();
$inv = $_GET['inv'];
get_bill($inv, $bill);
if ($bill['book_id']) {
    get_booking($bill['book_id'], $book);
} else {
    if ($bill['reservation_id']) {
        get_reservation($bill['reservation_id'], $book);
    }
}
if ($book['guestid']) {
    get_guest($book['guestid'], $guest);
}
// Default page size A4 - 210mm x 297mm
//  Header is set to 60mm
//  Footer is set to 27mm
//  body of invoice is set to 210mm
//  Rough rules of thumb
//  font 12px has 59 lines
//  font 13px has 52 lines
//  font 14px has 45 lines
$px = 12;
$LC = 55;
コード例 #2
0
ファイル: billings.php プロジェクト: bogiesoft/hotelmis-ota
$MISreturnURL = 'http' . $ssl . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?id=" . $bill['bill_id'];
//referer for XO
// If the booking id is present load the booking
if ($bid) {
    get_booking($bid, $book);
    // If the bill id is not set, ie get bill by booking
    // retrieve the bill and set the reservation id
    if (!$id && sizeof($bill) == 0) {
        $id = $book['bill_id'];
        get_bill($id, $bill);
        $rid = $bill['reservation_id'];
    }
}
// if the reservation id is found, load the reservation
if ($rid) {
    get_reservation($rid, $res);
    // if the bill is not loaded, load the invoice id from the reservation
    // load the bill, then attempt to load the booking detail that goes
    // with it.
    if (!$id && sizeof($bill) == 0) {
        $id = $res['bill_id'];
        get_bill($id, $bill);
        $bid = $bill['book_id'];
        get_booking($bid, $book);
    }
}
$guestid = $bill['guestid'];
if (!$guestid && $book['guestid']) {
    $guestid = $book['guestid'];
}
if (!$guestid && $res['guestid']) {
コード例 #3
0
            }
        case 'List':
            break;
    }
}
$reservation['reserved_by'] = $_SESSION["userid"];
$reservation['reserved_name'] = $_SESSION["employee"];
$vch = "NEW";
$reservation['no_adults'] = 1;
$reservation['no_child1_5'] = 0;
$reservation['no_child6_12'] = 0;
$reservation['no_babies'] = 0;
$paydetail = array();
if ($resid) {
    $reservation = array();
    if (get_reservation($resid, $reservation, 0)) {
        $vch = $reservation['voucher_no'];
        $guestid = $reservation['guestid'];
    }
}
// Just pull up the guest detail.
if ($guestid > 0) {
    $guest = array();
    findguestbyid($guestid, $guest);
    if (!$reservation['guestname']) {
        if (strncmp($guest['salutation'], $guest['guest'], strlen($guest['salutation'])) == 0) {
            $reservation['guestname'] = $guest['guest'];
        } else {
            $reservation['guestname'] = $guest['salutation'] . " " . $guest['guest'];
        }
    }
コード例 #4
0
ファイル: functions.php プロジェクト: bogiesoft/hotelmis-ota
/**
 * Get the booking detail by the reservation id
 * This is the combination of user detail, country detail 
 * @ingroup BOOKING_MANAGEMENT
 * @param $res_id [in] Reservation ID
 * @param $resDetail_id [in] Reservation Details ID
 * @param $booking [in/out] result array
 *
 * @return number of elements in booking
 */
function get_booking_byresid($res_id, $resDetail_id, &$booking)
{
    global $conn;
    if (!$conn) {
        $conn = connect_Hotel_db(HOST, USER, PASS, DB, PORT);
    }
    if (!$conn) {
        return 0;
    }
    $booking = array();
    $sql = "SELECT book_id FROM booking WHERE reservation_id=" . strip_specials($res_id) . "and res_det_id=" . $resDetail_id;
    //	print "Res id".$res_id."<br/>";
    $stmt = $conn->prepare($sql);
    $results = $stmt->execute();
    $row = $stmt->fetch();
    if ($row['book_id']) {
        //		print "Found".$res_id."<br/>";
        return get_booking($row['book_id'], $booking);
    }
    $stmt = null;
    $res = array();
    $book_id = 0;
    $today = date("d/m/Y H:i");
    if (get_reservation($res_id, $res, $resDetail_id)) {
        //	print "Not found load new".$res_id."<br/>";
        switch ($res['status']) {
            case RES_QUOTE:
                $book_status = BOOK_REGISTERED;
                break;
            case RES_ACTIVE:
            case RES_CHECKIN:
                $book_status = BOOK_CHECKEDIN;
                break;
            case RES_CHECKOUT:
                $book_status = BOOK_CHECKEDOUT;
                break;
            case RES_CANCEL:
            case RES_EXPIRE:
            case RES_VOID:
            case RES_CLOSE:
                $book_status = BOOK_CLOSE;
                break;
            default:
                $book_status = BOOK_CHECKEDIN;
        }
        $book_id = modify_booking(0, $res_id, $res['bill_id'], $res['guestid'], $res['no_adults'], $res['no_child6_12'], $res['no_child1_5'], $res['no_babies'], $res['checkindate'], $res['checkoutdate'], $res['roomid'], $res['roomtypeid'], $res['ratesid'], $res['instructions'], $_SESSION['userid'], $res['checkedin_date'], '', '', $res['cctype'], $res['CCnum'], $res['expiry'], $res['CVV'], $res['voucher_no'], $book_status, $resDetail_id);
        if ($book_id && $res['roomid']) {
            update_room_status($res['roomid'], BOOKED);
        }
    }
    if (!$book_id) {
        return 0;
    }
    return get_booking($book_id, $booking);
}