本文整理汇总了PHP中Room::findById方法的典型用法代码示例。如果您正苦于以下问题:PHP Room::findById方法的具体用法?PHP Room::findById怎么用?PHP Room::findById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Room
的用法示例。
在下文中一共展示了Room::findById方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildDepositReceipt
/**
* Generate the HTML of the receipt print
*/
public function buildDepositReceipt()
{
$html = '<div id="outerHTML">';
$html .= '<div id="printArea">';
$html .= '<h2 align="center">Salesforce</h2>';
$html .= '<h3 align="center">Official Receipt: ELDOWAS Deposit</h3>';
$html .= '<div id="receipt-header">';
$html .= '<p align="center">';
$html .= 'Kenyatta Street, New Muya House<br />';
$html .= '2<sup>nd</sup> Flr, Room 105.<br />';
$html .= 'Tel: + 254 721 156 315 / + 254 720 711 115<br />';
$html .= 'www.salesforce.co.ke Email: info@salesforce.co.ke';
$html .= '</p></div>';
$html .= '<hr align="center" />';
$html .= '<div id="receipt-body">';
$html .= '<p>';
$html .= '<strong>Receipt No:</strong> <span style="color:#F00;">';
$html .= $this->_receipt_no;
$html .= '</span></p>';
$html .= '<p><strong>Tenant:</strong> ';
$html .= $this->_tenant_name . '</p>';
$html .= '<p><strong>Room No:</strong> ';
$html .= Room::findById($this->_rid)->getRoomLabel();
$html .= '<p><strong>Payment Amount:</strong> ';
$html .= number_format($this->_amount);
$html .= '</p><p><strong>Company Agent:</strong> ';
$html .= $this->_agent . '</p>';
$html .= '<p><strong>Date:</strong> ';
$html .= $this->_date_paid . " " . strftime("%H:%I:%S");
$html .= '</p></div>';
$html .= '</div></div>';
print $html;
}
示例2: foreach
</form>
<?php
if (!empty($tenants)) {
?>
<?php
foreach ($tenants as $tnt) {
?>
<p><a href="tenant.php?tid=<?php
echo $tnt->id;
?>
"><?php
echo $tnt->getFullName();
?>
</a> <?php
echo "Room No: " . Room::findById($tnt->getRoomId())->getRoomLabel();
?>
</p>
<?php
}
?>
<?php
} elseif (empty($tenants) && !empty($prop_id)) {
?>
<?php
$mesg = "No previous tenants found from the selected property";
echo output_message($mesg);
?>
<?php
}
?>
示例3: buildArrearsReceipt
/**
* Generate the HTML of the receipt print
*/
public function buildArrearsReceipt()
{
global $session;
$html = '<div id="outerHTML">';
$html .= '<div id="printArea">';
$html .= '<h2 align="center">Salesforce</h2>';
$html .= '<h3 align="center">Official Receipt: Arrears Payment</h3>';
$html .= '<div id="receipt-header">';
$html .= '<p align="center">';
$html .= 'Kenyatta Street, New Muya House<br />';
$html .= '2<sup>nd</sup> Flr, Room 105.<br />';
$html .= 'Tel: + 254 721 156 315 / + 254 720 711 115<br />';
$html .= 'www.salesforce.co.ke Email: info@salesforce.co.ke';
$html .= '</p></div>';
$html .= '<hr align="center" />';
$html .= '<div id="receipt-body">';
$html .= '<p><strong>Receipt No:</strong> <span style="color:#F00;">';
$html .= $this->_receipt_no;
$html .= '</span></p>';
$html .= '<p><strong>Tenant:</strong> ';
$tenant = Tenant::findById($this->_tid);
$html .= $tenant->getFullName() . '</p>';
$html .= '<p><strong>Room No:</strong> ';
$html .= Room::findById(Tenant::findById($this->_tid)->getRoomId())->getRoomLabel();
$html .= '</p><p><strong>Payment Amount:</strong> ';
//$html .= number_format($session->sessionVar('amount'));
$html .= number_format($this->_amount);
if ($tenant->hasArrears()) {
$arrears = new Arrears();
$html .= '</p><p><strong>Arrears</strong> ';
$html .= $arrears->calcTotalArrearsFromTenant($this->_tid);
}
$html .= '</p><p><strong>Month:</strong> ';
$html .= $this->_getMonthFromDate($this->_start_date);
$html .= '</p><p><strong>Company Agent:</strong> ';
$html .= $this->_agent . '</p>';
$html .= '<p><strong>Date:</strong> ';
$html .= $this->_date_paid . " ";
$html .= '</p></div>';
$html .= '</div></div>';
print $html;
}
示例4:
} else {
// Get the vacant rooms from the property
$vacant_rooms = $property->getVacantRooms();
}
}
}
///////////////////////////////////////////////////////////////////////////
///////////////////////////// PROCESS SUBMIT //////////////////////////////
///////////////////////////////////////////////////////////////////////////
if (isset($_POST['submit'])) {
//echo var_dump($_POST);
$room_id = $_POST['room'];
if (!isset($room_id)) {
$err = "Choose room to move tenant to";
} else {
$new_room = Room::findById($room_id);
if ($tenant->changeRoom($new_room)) {
$mesg = "Tenant has been moved to new room";
$session->message($mesg);
redirect_to("tenant.php?tid={$tenant->id}");
} else {
$err = "An error occured preventing the tenant from being moved into the selected room";
}
}
}
include_layout_template("admin_header.php");
?>
<div id="container">
<div id="side-bar">
<?php
示例5: edit
public function edit($id)
{
if (!($room = Room::findById($id))) {
Flash::set('error', __('Room not found!'));
redirect(get_url('room'));
}
// check if trying to save
if (get_request_method() == 'POST') {
return $this->_edit($id);
}
$roomgalleries = RoomImage::findByRoomId($id);
$features = FeatureImage::findByRoomId($id);
$this->display('room/edit', array('action' => 'edit', 'csrf_token' => SecureToken::generateToken(BASE_URL . 'room/edit/' . $id), 'room' => $room, 'roomgalleries' => $roomgalleries, 'features' => $features, 'id' => $id, 'pages' => Record::findAllFrom('Page', 'parent_id=1 order by parent_id,position')));
}
示例6:
if (!empty($email)) {
?>
<p><strong>Email:</strong> <?php
echo $tenant->getEmail();
}
?>
</p>
<p><strong>Tenancy Status:</strong> <?php
echo $tenant->hasMovedOut() ? '<span style="color:red">Moved Out</span>' : '<span style="color:green">Active Tenant</span>';
?>
</p>
<br /><br />
<h3>Rent Payment</h3>
<p>Monthly Rent: <?php
echo $room = Room::findById($tenant->getRoomId())->getRent();
?>
</p><br />
<h3>Arrears</h3>
<p>Rent Arrears: <?php
if ($tenant->hasArrears()) {
$arrears = $tenant->getTotalArrears();
echo $arrears;
} else {
echo "Ksh. 0.00";
}
?>
</p><br />
<p><a class="btn-action" id="rent-payment" href="rent_payment.php?tid=<?php
示例7: changeRoom
/**
* Change the room occupied by the tenant
* @todo Check if there are any empty rooms in the
* property, then assign a room to the tenant
* @param object $roomObj
* @return boolean
*/
public function changeRoom($roomObj)
{
$db = Database::getInstance();
$mysqli = $db->getConnection();
$curr_room = Room::findById($this->_rid);
$mysqli->autocommit(false);
// Set room's status to vacant
$curr_room->setRoomStatus(0);
$curr_room->unsetTenantId();
if (!$curr_room->save()) {
$mysqli->rollback();
$mysqli->autocommit(true);
return false;
}
// Set room_id property to ID of new room and
// change stauts of new room
$this->_rid = $roomObj->id;
$roomObj->setRoomStatus(1);
$roomObj->setTenantId($this);
if (!$this->save()) {
$mysqli->rollback();
$mysqli->autocommit(true);
return false;
}
if (!$roomObj->save()) {
$mysqli->rollback();
$mysqli->autocommit(true);
return false;
}
if (!$mysqli->commit()) {
$mysqli->rollback();
$mysqli->autocommit(true);
return false;
}
return true;
}