当前位置: 首页>>代码示例>>PHP>>正文


PHP Room::findById方法代码示例

本文整理汇总了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 &nbsp; / &nbsp; + 254 720 711 115<br />';
     $html .= 'www.salesforce.co.ke &nbsp; Email: info@salesforce.co.ke';
     $html .= '</p></div>';
     $html .= '<hr align="center" />';
     $html .= '<div id="receipt-body">';
     $html .= '<p>';
     $html .= '<strong>Receipt No:</strong> &nbsp;<span style="color:#F00;">';
     $html .= $this->_receipt_no;
     $html .= '</span></p>';
     $html .= '<p><strong>Tenant:</strong> &nbsp;';
     $html .= $this->_tenant_name . '</p>';
     $html .= '<p><strong>Room No:</strong> &nbsp;';
     $html .= Room::findById($this->_rid)->getRoomLabel();
     $html .= '<p><strong>Payment Amount:</strong> &nbsp;';
     $html .= number_format($this->_amount);
     $html .= '</p><p><strong>Company Agent:</strong> &nbsp;';
     $html .= $this->_agent . '</p>';
     $html .= '<p><strong>Date:</strong> &nbsp;';
     $html .= $this->_date_paid . " &nbsp;&nbsp;" . strftime("%H:%I:%S");
     $html .= '</p></div>';
     $html .= '</div></div>';
     print $html;
 }
开发者ID:ALCHEMIST09,项目名称:one-square-foot,代码行数:36,代码来源:class.DepositEldowas.php

示例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>&nbsp;&nbsp;<?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 
}
?>
开发者ID:ALCHEMIST09,项目名称:one-square-foot,代码行数:31,代码来源:tenants_old.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 &nbsp; / &nbsp; + 254 720 711 115<br />';
     $html .= 'www.salesforce.co.ke &nbsp; Email: info@salesforce.co.ke';
     $html .= '</p></div>';
     $html .= '<hr align="center" />';
     $html .= '<div id="receipt-body">';
     $html .= '<p><strong>Receipt No:</strong> &nbsp;<span style="color:#F00;">';
     $html .= $this->_receipt_no;
     $html .= '</span></p>';
     $html .= '<p><strong>Tenant:</strong> &nbsp;';
     $tenant = Tenant::findById($this->_tid);
     $html .= $tenant->getFullName() . '</p>';
     $html .= '<p><strong>Room No:</strong> &nbsp;';
     $html .= Room::findById(Tenant::findById($this->_tid)->getRoomId())->getRoomLabel();
     $html .= '</p><p><strong>Payment Amount:</strong> &nbsp;';
     //$html .= number_format($session->sessionVar('amount'));
     $html .= number_format($this->_amount);
     if ($tenant->hasArrears()) {
         $arrears = new Arrears();
         $html .= '</p><p><strong>Arrears</strong>&nbsp;';
         $html .= $arrears->calcTotalArrearsFromTenant($this->_tid);
     }
     $html .= '</p><p><strong>Month:</strong>&nbsp;';
     $html .= $this->_getMonthFromDate($this->_start_date);
     $html .= '</p><p><strong>Company Agent:</strong> &nbsp;';
     $html .= $this->_agent . '</p>';
     $html .= '<p><strong>Date:</strong> &nbsp;';
     $html .= $this->_date_paid . " &nbsp;&nbsp;";
     $html .= '</p></div>';
     $html .= '</div></div>';
     print $html;
 }
开发者ID:ALCHEMIST09,项目名称:one-square-foot,代码行数:45,代码来源:class.ArrearsPaid.php

示例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 
开发者ID:ALCHEMIST09,项目名称:one-square-foot,代码行数:31,代码来源:change_room.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')));
 }
开发者ID:sindotnet,项目名称:dashhotel,代码行数:14,代码来源:RoomController.php

示例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 
开发者ID:ALCHEMIST09,项目名称:one-square-foot,代码行数:31,代码来源:tenant.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;
 }
开发者ID:ALCHEMIST09,项目名称:one-square-foot,代码行数:43,代码来源:class.Tenant.php


注:本文中的Room::findById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。