本文整理汇总了PHP中Room类的典型用法代码示例。如果您正苦于以下问题:PHP Room类的具体用法?PHP Room怎么用?PHP Room使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Room类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: actionLogout
/**
* Destroy user session
*/
public function actionLogout()
{
try {
// we might not be signed in actually
$this->user = new User();
} catch (UserNotAuthenticatedException $e) {
$this->flashSuccess = 'You are already logged out';
}
// as we are logging out, leave us from all rooms
if ($this->user != NULL) {
$inRooms = $this->user->inRooms();
if (!empty($inRooms)) {
$time = mktime();
foreach ($inRooms as $room) {
// message about it
$message = new MessageSpeak($room, $time);
$message->leave($room, $time, $this->user->getShortName());
}
// remove us from participants
$room = new Room();
$room->removeParticipant($this->user->getId());
}
$this->flashSuccess = 'You have been logged out';
$this->user->signOut();
}
$this->bag->token = Fari_FormToken::create();
$this->renderAction('login');
}
开发者ID:radekstepan,项目名称:Clubhouse,代码行数:31,代码来源:AuthPresenter.php
示例2: Room
/**
* Internal function to return a Room object from a row.
* @param $row array
* @return Room
*/
function &_returnRoomFromRow(&$row)
{
$room = new Room();
$room->setId($row['room_id']);
$room->setBuildingId($row['building_id']);
$this->getDataObjectSettings('room_settings', 'room_id', $row['room_id'], $room);
return $room;
}
开发者ID:jalperin,项目名称:ocs,代码行数:13,代码来源:RoomDAO.inc.php
示例3: joinRoom
public function joinRoom(Room $room)
{
if ($room->isFull()) {
return;
}
$this->room = $room;
$room->addPlayer($this);
}
开发者ID:Koridev,项目名称:PixelDraw-Server,代码行数:8,代码来源:Player.php
示例4: select_group
public function select_group()
{
$group_id = $this->input->post('group_id');
$this->_transaction_isolation();
$this->db->trans_begin();
$group = new Group();
$group->get_by_id($group_id);
if ($group->exists()) {
$course = $group->course->get();
if (is_null($course->groups_change_deadline) || date('U', strtotime($course->groups_change_deadline)) >= time()) {
$student = new Student();
$student->get_by_id($this->usermanager->get_student_id());
if ($student->is_related_to('active_course', $course->id)) {
$participant = new Participant();
$participant->where_related($student);
$participant->where_related($course);
$participant->where('allowed', 1);
$participant->get();
if ($participant->exists()) {
if (!$participant->is_related_to($group)) {
$participant->save($group);
$participant->where_related($course);
$participant->where_related($group);
$participant->where('allowed', 1);
$participants_count = $participant->count();
$room = new Room();
$room->where_related($group)->order_by('capacity', 'asc')->limit(1)->get();
if ($participants_count > intval($room->capacity)) {
$this->db->trans_rollback();
$this->messages->add_message('lang:groups_message_group_is_full', Messages::MESSAGE_TYPE_ERROR);
} else {
$this->db->trans_commit();
$this->messages->add_message(sprintf($this->lang->line('groups_message_group_changed'), $this->lang->text($group->name)), Messages::MESSAGE_TYPE_SUCCESS);
$this->_action_success();
$this->output->set_internal_value('course_id', $participant->course_id);
}
} else {
$this->db->trans_rollback();
$this->messages->add_message('lang:groups_message_you_are_in_group', Messages::MESSAGE_TYPE_ERROR);
}
} else {
$this->db->trans_rollback();
$this->messages->add_message('lang:groups_message_cant_found_participant_record', Messages::MESSAGE_TYPE_ERROR);
}
} else {
$this->db->trans_rollback();
$this->messages->add_message('lang:groups_message_cant_change_group_of_inactive_course', Messages::MESSAGE_TYPE_ERROR);
}
} else {
$this->db->trans_rollback();
$this->messages->add_message('lang:groups_message_groups_switching_disabled', Messages::MESSAGE_TYPE_ERROR);
}
} else {
$this->db->trans_rollback();
$this->messages->add_message('lang:groups_message_group_not_found', Messages::MESSAGE_TYPE_ERROR);
}
redirect(create_internal_url('groups'));
}
开发者ID:andrejjursa,项目名称:list-lms,代码行数:58,代码来源:groups.php
示例5: bookRoom
static function bookRoom(Room $room, Reservation $reservation)
{
$room->addReservation($reservation);
$roomNumber = $room->getRoomInfo()->getRoomNumber();
$guest = $reservation->getGuest()->getFullName();
$start = $reservation->getStartDate();
$end = $reservation->getEndDate();
echo "Room <strong>{$roomNumber}</strong> successfully booked for <strong>{$guest}</strong> from <time>{$start}</time> to <time>{$end}</time>!";
}
开发者ID:reminchev,项目名称:SoftUni-Projects,代码行数:9,代码来源:BookingManager.class.php
示例6: bookRoom
public static function bookRoom(Room $room, Reservation $reservation)
{
try {
$room->addReservation($reservation);
echo "\nRoom " . $room->getRoomNumber() . " successfully booked for " . $reservation->getGuest()->getFullName() . " from " . $reservation->getStartDate()->format("d-m-y") . " to " . $reservation->getEndDate()->format("d-m-y");
} catch (EReservationException $ex) {
echo PHP_EOL . $ex->getMessage();
}
}
开发者ID:TzvetanIG,项目名称:OOP,代码行数:9,代码来源:BookManager.class.php
示例7: bookRoom
public static function bookRoom(Room $room, Reservation $reservation)
{
try {
$room->addReservation($reservation);
$output = "Room <strong>{$room->getRoomNumber()}</strong> successfully booked for " . "<strong>{$reservation->getGuest()}</strong> from " . "<time>{$reservation->getStartDate()->format("d.m.Y")}</time> to " . "<time>{$reservation->getEndDate()->format("d.m.Y")}</time>!";
echo $output;
} catch (EReservationException $e) {
echo $e->getMessage();
}
}
开发者ID:AmaranthInHell,项目名称:SoftUni,代码行数:10,代码来源:BookingManager.class.php
示例8: isEmpty
function isEmpty(Room $room)
{
$quest = new Guest("G", "R", 89466466);
$reservation = new Reservation("15-10-2014", "18-10-2014", $quest);
try {
$room->checkForValidReservation($reservation);
return true;
} catch (EReservationException $ex) {
return false;
}
}
开发者ID:SGStoyanov,项目名称:SoftUni,代码行数:11,代码来源:HotelReservationTester.php
示例9: doDelete
function doDelete()
{
@($id = $_POST['selector']);
$key = count($id);
//multi delete using checkbox as a selector
for ($i = 0; $i < $key; $i++) {
$room = new Room();
$room->delete($id[$i]);
}
message("Room(s) already Deleted!", "info");
redirect('index.php');
}
开发者ID:allybitebo,项目名称:CCECourseCatalogue,代码行数:12,代码来源:controller.php
示例10: bookRoom
static function bookRoom(Room $room, Reservation $reservation)
{
try {
$room->addReservation($reservation);
$startDate = $reservation->getStartDate();
$endDate = $reservation->getEndDate();
$guestName = $reservation->getGuest()->getFistName() . " " . $reservation->getGuest()->getLastName();
echo "\nRoom <strong>" . $room->getRoomId() . "</strong> successfully booked for <strong>" . $guestName . "</strong> from <time>" . date_format($startDate, "d-m-y") . "</time> to <time>" . date_format($endDate, "d-m-y") . "</time>!</br>";
} catch (EReservationException $ex) {
echo $ex->getMessage();
}
}
开发者ID:nok32,项目名称:SoftUni,代码行数:12,代码来源:BookingManager.class.php
示例11: executeAdd
public function executeAdd(sfWebRequest $request)
{
if ($request->isMethod('Post')) {
$room = new Room();
$room->setTitle($this->getRequestParameter('title'));
$room->setPrice($this->getRequestParameter('price'));
$room->setStatus(Constant::BED_AVAILABLE);
$room->save();
$this->getUser()->setFlash('SUCCESS_MESSAGE', Constant::RECORD_ADDED_SUCCESSFULLY);
$this->redirect('Room/list');
}
//end if
}
开发者ID:lejacome,项目名称:hospital-mgt,代码行数:13,代码来源:actions.class.php
示例12: bookRoom
public static function bookRoom(Room $room, Reservation $reservation)
{
try {
$room->addReservation($reservation);
$successMessage = "Room <strong>" . $room->getRoomNumber() . "</strong> successfully booked ";
$successMessage .= "for <strong>" . $reservation->getGuest();
$successMessage .= "</strong> from <time>" . $reservation->getStarDate()->format("d.m.Y") . "</time> ";
$successMessage .= "to <time>" . $reservation->getEndDate()->format("d.m.Y") . "</time>!";
$successMessage .= "</br>";
echo $successMessage;
} catch (EReservationException $ex) {
echo "<strong>Operation failed.</strong> " . $ex->getMessage() . "</br>";
return;
}
}
开发者ID:AmaranthInHell,项目名称:SoftUni-1,代码行数:15,代码来源:BookingManager.class.php
示例13: deleteRoom
public function deleteRoom($buildingid, $id)
{
//
$room = Room::find($id);
$room->delete();
return Redirect::to('/building/' . $buildingid);
}
开发者ID:axelardu,项目名称:festic-partner,代码行数:7,代码来源:DesignerController.php
示例14: run
public function run()
{
$faker = Faker::create();
foreach (range(1, 10) as $index) {
Room::create([]);
}
}
开发者ID:jonagoldman,项目名称:channelmanager,代码行数:7,代码来源:RoomsTableSeeder.php
示例15: getDelete
public function getDelete($id)
{
$room = Room::find($id);
$room->delete();
Session::flash('message', 'The records are deleted successfully');
return Redirect::to('rooms');
}
开发者ID:andrinda,项目名称:myhotel,代码行数:7,代码来源:RoomsController.php
示例16: run
public function run()
{
Bundle::start('messages');
$twoweeks = date('Y-m-d', strtotime('+2 weeks'));
$week = date('Y-m-d', strtotime('+1 weeks'));
$tomorrow = date('Y-m-d', strtotime('+1 day'));
$rooms = Room::where_del_date($tomorrow)->or_where('del_date', '=', $week)->or_where('del_date', '=', $twoweeks)->get();
foreach ($rooms as $room) {
switch ($room->del_date) {
case $twoweeks:
$expire_date = "over twee weken";
break;
case $week:
$expire_date = "over een week";
break;
case $tomorrow:
$expire_date = "morgen";
break;
}
Message::send(function ($message) use($room, $expire_date) {
$message->to($room->email);
$message->from('[email protected]', 'Kamergenood');
$message->subject('Verleng de kameradvertentie: "' . $room->title . '"');
$message->body('view: emails.extend');
$message->body->id = $room->id;
$message->body->title = $room->title;
$message->body->url = $room->url;
$message->body->delkey = $room->delkey;
$message->body->expire_date = $expire_date;
$message->html(true);
});
}
}
开发者ID:sanneterpstra,项目名称:Kamergenood,代码行数:33,代码来源:extend.php
示例17: 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: [email protected]';
$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;
}
开发者ID:ALCHEMIST09,项目名称:one-square-foot,代码行数:36,代码来源:class.DepositEldowas.php
示例18: isUnique
/**
* make shure the username is valid for this room
*
* @param $newName string
* @param $roomName string
* @return bool
*/
public function isUnique($newName, $roomName)
{
$room = Room::where('name', '=', $roomName)->first();
$count = User::where('room_id', '=', $room->id)->where('connected', '=', 1)->where('name', '=', $newName)->count();
$this->validationErrors->add('name', 'This name has already been taken :(');
return $count === 0 ? true : false;
}
开发者ID:brucewu16899,项目名称:whatup,代码行数:14,代码来源:User.php
示例19: editAction
public function editAction()
{
$personId = (int) $this->_getParam('personId');
if (isset($this->_session->messages)) {
$this->view->messages = $this->_session->messages;
}
$this->_form = new WebVista_Form(array('name' => 'provider-detail'));
$this->_form->setAction(Zend_Registry::get('baseUrl') . "admin-providers.raw/edit-process");
$this->_provider = new Provider();
$this->_provider->person_id = $personId;
if (!$this->_provider->populate()) {
if ($personId > 0) {
//handle case where person exists but no provider record
$this->view->noProvider = true;
}
//do nothing if personId is 0, no person selected yet
}
$this->_form->loadORM($this->_provider, 'provider');
//var_dump($this->_form);
$this->view->form = $this->_form;
$this->view->person = $this->_provider;
$stations = Enumeration::getEnumArray(Routing::ENUM_PARENT_NAME);
$stations = array_merge(array('' => ''), $stations);
$this->view->stations = $stations;
$specialties = array('' => '');
$listSpecialties = Provider::getListSpecialties();
// temporarily use AM = American Medical Association
foreach ($listSpecialties['AM'] as $specialty) {
$specialties[$specialty['code']] = $specialty['description'];
}
$this->view->specialties = $specialties;
$this->view->colors = Room::getColorList();
$this->render('edit');
}
开发者ID:dragonlet,项目名称:clearhealth,代码行数:34,代码来源:AdminProvidersController.php
示例20: open
public function open($db)
{
$this->id = Room::getUniqueId('r');
$this->start_time = Room::getCurrentTime();
$this->channel_token = Room::getUniqueId('h');
$this->add($db);
}
开发者ID:rakesh-mohanta,项目名称:Sunrise,代码行数:7,代码来源:room.php
注:本文中的Room类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论