本文整理汇总了PHP中Room::findVacantRoomsByPropertyId方法的典型用法代码示例。如果您正苦于以下问题:PHP Room::findVacantRoomsByPropertyId方法的具体用法?PHP Room::findVacantRoomsByPropertyId怎么用?PHP Room::findVacantRoomsByPropertyId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Room
的用法示例。
在下文中一共展示了Room::findVacantRoomsByPropertyId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getVacantRooms
/**
* Find rooms in this property that are vavant
* @todo Use the room class to lookup rooms that have not been occupied
* @return array An array of room objects
*/
public function getVacantRooms()
{
$vacant_rooms = Room::findVacantRoomsByPropertyId($this->id);
return $vacant_rooms;
}
示例2: redirect_to
<?php
require_once "../lib/init.php";
if (!$session->isLoggedIn()) {
redirect_to("../index.php");
}
$permissions = array('admin');
try {
$ac->checkPermissions($permissions);
} catch (Exception $e) {
$mesg = $e->getMessage();
$session->message($mesg);
redirect_to($_SERVER['HTTP_REFERER']);
}
$prop_id = $session->sessionVar("prop_id");
$rooms = Room::findVacantRoomsByPropertyId($prop_id);
if (isset($_POST['submit'])) {
$selected_room = $_POST['room_name'];
if (empty($selected_room)) {
$err = "Please choose a room to assign a tenant";
} else {
$session->sessionVar("room_id", $selected_room);
$session->message("Room selection saved");
redirect_to("add_tenant.php");
}
} else {
$err = "";
}
include_layout_template("admin_header.php");
?>