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


PHP Room::all方法代码示例

本文整理汇总了PHP中Room::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Room::all方法的具体用法?PHP Room::all怎么用?PHP Room::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Room的用法示例。


在下文中一共展示了Room::all方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     $rooms = Room::all();
     $locations = Location::all();
     $menu = 'data';
     return View::make('rooms.index', compact('rooms', 'locations', 'menu'));
 }
开发者ID:emanmks,项目名称:oneschool,代码行数:7,代码来源:RoomsController.php

示例2: getRoom

 public function getRoom()
 {
     $date = date('Y-m-d', strtotime(Input::get('date')));
     $rtype_id = Input::get('rtype_id');
     $reserves = CottageReservation::where('reservation_date', '=', $date)->where('reservation_type', '=', $rtype_id)->get();
     if (!empty($reserves)) {
         $id = array();
         foreach ($reserves as $reserve) {
             if (!in_array($reserve['room_id'], $id)) {
                 $id[count($id)] = $reserve['room_id'];
             }
         }
         $response = array();
         $rooms = Room::all();
         foreach ($rooms as $room) {
             if (!in_array($room['rnid'], $id)) {
                 $response[] = array("id" => $room['rnid'], "name" => $room['roomname']);
             }
         }
         return $response;
     } else {
         $rooms = Room::all();
         foreach ($rooms as $room) {
             $response[] = array("id" => $room['rnid'], "name" => $room['roomname']);
         }
         return $response;
     }
 }
开发者ID:jhunel2389,项目名称:baeyaya-dev,代码行数:28,代码来源:ReservationController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     // get all the rooms
     $rooms = Room::all();
     // load the view and pass the rooms
     return View::make('rooms.index')->with('rooms', $rooms);
 }
开发者ID:ehumps,项目名称:rendezview,代码行数:12,代码来源:RoomController.php

示例4: formSelect

 public static function formSelect()
 {
     $result = array();
     $result[-1] = "No room";
     foreach (Room::all() as $room) {
         $result[$room->id] = "Room " . $room->room_code;
     }
     return $result;
 }
开发者ID:hlmasterchief,项目名称:lacrestaurant,代码行数:9,代码来源:Room.php

示例5: index

 public function index()
 {
     $rooms = Room::all();
     $dir = scandir(public_path() . '/room/');
     $file = array();
     foreach ($dir as $key => $id) {
         if (substr($id, 0, 1) !== ".") {
             $folder = scandir(public_path() . '/room/' . $id . '/');
             $img = array_pop($folder);
             $file += [$id => '/room/' . $id . '/' . $img];
         }
     }
     return view('rooms.index', ['rooms' => $rooms, 'file' => $file]);
 }
开发者ID:RetinaInc,项目名称:Booking-application,代码行数:14,代码来源:RoomsController.php

示例6: run

 public function run()
 {
     $faker = Faker\Factory::create();
     DB::table('groups')->delete();
     DB::table('rooms')->delete();
     DB::table('users')->delete();
     $group = new Group();
     $group->name = "Admin";
     $group->permission = "1,2,3,4,5,6";
     $group->admin = true;
     $group->save();
     $group = new Group();
     $group->name = "Customer";
     $group->permission = "10";
     $group->admin = false;
     $group->save();
     for ($i = 1; $i < 10; $i++) {
         $room = new Room();
         $room->room_code = sprintf("%03dS", $i);
         $room->save();
     }
     $admin_group = Group::where('name', '=', 'Admin')->first();
     $customer_group = Group::where('name', '=', 'Customer')->first();
     $user = new User();
     $user->username = "admin";
     $user->password = Hash::make("passnhulon");
     $user->group_id = $admin_group->id;
     $user->realname = "Sairen Nguyen";
     $user->birthday = "1993-04-05";
     $user->email = "t3ngcu00@students.oamk.fi";
     $user->save();
     for ($i = 1; $i < 10; $i++) {
         $user = new User();
         $user->username = sprintf("%03dS", $i);
         $user->password = Hash::make("passnhulon");
         $user->group_id = $customer_group->id;
         $user->room_id = Room::all()->first()->id + $i - 1;
         $user->realname = $faker->name();
         $user->email = $faker->email;
         $user->save();
     }
 }
开发者ID:hlmasterchief,项目名称:lacrestaurant,代码行数:42,代码来源:UserTableSeeder.php

示例7: isNumber

                      <label class="control-label">No. of Kids</label>
                      <input type="text" class="form-control input-sm" id="kid" name="kid"placeholder="" onkeypress="return isNumber(event)">
                    </div>
                    <div class="form-group">
                      <label class="control-label">No. of Adults</label>
                      <input type="text" class="form-control input-sm" id="adult" name="adult"placeholder=" " onkeypress="return isNumber(event)">
                    </div>
                  </div>
                  <div id="forRoom">
                     <div id="pT"class="form-group" style="position:relative;">
                      <label class="control-label" for="inputDefault">Room</label>
                      <i class="fa fa-2x fa-caret-down" style="position:absolute;right:10px;bottom:2px;color:#000;pointer-events:none;"></i>
                      <select class="form-control input-sm" id="room" name="room" style="padding-top:0px;padding-left:5px;line-height:20pt;" >
                        <option value="" disabled selected style="display:none;">Choose room</option>
                        <?php 
$rooms = Room::all();
?>
                        @foreach($rooms as $room)
                          <option value = "{{$room['rnid']}}">{{$room['roomname']}}</option>
                        @endforeach
                      </select>
                    </div>
                    <div id="pT"class="form-group" style="position:relative;">
                      <label class="control-label" for="inputDefault">Room Package</label>
                      <i class="fa fa-2x fa-caret-down" style="position:absolute;right:10px;bottom:2px;color:#000;pointer-events:none;"></i>
                      <select class="form-control input-sm" id="roomPackage" name="roomPackage" style="padding-top:0px;padding-left:5px;line-height:20pt;" >
                        <option value="" disabled selected style="display:none;">Choose package</option>
                        <?php 
$roomPackages = RoomPackage::all();
?>
                        @foreach($roomPackages as $package)
开发者ID:jhunel2389,项目名称:baeyaya-dev,代码行数:31,代码来源:fm_walkin.blade.php

示例8: Rooms

 public function Rooms($page = '', $perpage = '')
 {
     $h = new Room();
     echo json_encode($h->all());
     // or render View
 }
开发者ID:jnaroogheh,项目名称:darvishi,代码行数:6,代码来源:RoomController.php


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