本文整理汇总了PHP中Room::byId方法的典型用法代码示例。如果您正苦于以下问题:PHP Room::byId方法的具体用法?PHP Room::byId怎么用?PHP Room::byId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Room
的用法示例。
在下文中一共展示了Room::byId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTotal
public function getTotal()
{
$room_price = Room::byId($this->id_room)->price;
$service_price = $this->id_service > 0 ? Service::byId($this->id_service)->price : 0;
if ($service_price) {
$service_price *= $this->adults + $this->childs;
}
return $this->getDays() * $room_price + $service_price;
}
示例2: getTotal
public function getTotal()
{
$price = Room::byId($this->id_room)->price;
return $this->getDays() * $price;
}
示例3: define
<?php
require_once 'config.php';
define('ID_LANG', 1);
if (isset($_GET['id'])) {
$booking = Booking::byId($_GET['id']);
$user = User::byId($booking->id_user);
$room = Room::byId($booking->id_room);
// HEADER
// create a PDF object
$pdf = new pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document (meta) information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Hotel Plaza Nueva');
$pdf->SetTitle('Hotel Plaza Nueva');
$pdf->SetSubject('Hotel Plaza Nueva');
$pdf->SetKeywords('hotel, plaza, nueva, granada');
// add a page
$pdf->AddPage();
// create address box
$pdf->CreateTextBox($user->name, 0, 55, 80, 10, 10, 'B');
$pdf->CreateTextBox($user->email, 0, 60, 80, 10, 10);
$pdf->CreateTextBox($user->phone, 0, 65, 80, 10, 10);
//$pdf->CreateTextBox('Zip, city name', 0, 70, 80, 10, 10);
// invoice title / number
$pdf->CreateTextBox('Factura #' . $booking->id, 0, 90, 120, 20, 16);
// date, order ref
$date = date_create($booking->date_booking);
$pdf->CreateTextBox('Fecha: ' . date_format($date, "d/m/Y H:i:s"), 0, 100, 0, 10, 10, '', 'R');
$pdf->CreateTextBox('Order ref.: #' . $booking->id, 0, 105, 0, 10, 10, '', 'R');
// ROWS