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


PHP Guest::orderby方法代码示例

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


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

示例1: insertBookNormal

 public function insertBookNormal()
 {
     $validator = Validator::make(Input::all(), $this->rules);
     $getNum = Input::get('ccnum');
     $getType = Input::get('CardType');
     if ($validator->fails()) {
         return Redirect::action('normalBook', [Input::get('roomID')])->withErrors($validator, 'guest')->withInput();
     } else {
         if (!checkCreditCard($getNum, $getType, $errornumber, $errortext)) {
             $errortext = "This Card Has Invalid Number";
             return Redirect::action('normalBook', [Input::get('roomID')])->with('ccError', $errortext)->withInput();
         } else {
             $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
             $temp;
             $bookCode = "";
             for ($i = 1; $i <= 10; $i++) {
                 if ($i % 2 == 1) {
                     $temp = floor(rand(0, 9));
                 } else {
                     $temp = $characters[rand(0, strlen($characters) - 1)];
                 }
                 $bookCode = $bookCode . $temp;
             }
             $inputAll = Input::all();
             $guest = new Guest();
             $booking = new Book();
             $payment = new Payment();
             $extra = new Extra();
             $detailBook = new DetailBooking();
             $detailAdditional = new DetailAdditional();
             $countAdd = Additional::where('Status', '=', 'Active')->count();
             $countBook = Book::orderby('ID_Booking', 'DESC')->first();
             $countGuest = Guest::orderby('ID_Guest', 'DESC')->first();
             $countExtra = Extra::orderby('ID_Extra', 'DESC')->first();
             $countPayment = Payment::orderby('ID_Payment', 'DESC')->first();
             $tampIDBook = $countBook->ID_Booking;
             $tampIDGuest = $countGuest->ID_Guest;
             $tampIDExtra = $countExtra->ID_Extra;
             $tampIDPayment = $countPayment->ID_Payment;
             $checkYearBook = substr(strval($tampIDBook), 3, -5);
             $checkYearGuest = substr(strval($tampIDGuest), 3, -5);
             $checkYearExtra = substr(strval($tampIDExtra), 3, -5);
             $checkYearPayment = substr(strval($tampIDPayment), 3, -5);
             $incrementIDBook = substr($tampIDBook, 3) + 1;
             $incrementIDGuest = substr($tampIDGuest, 3) + 1;
             $incrementIDExtra = substr($tampIDExtra, 3) + 1;
             $incrementIDPayment = substr($tampIDPayment, 3) + 1;
             $joinBook = "BOK" . $incrementIDBook;
             $joinGuest = "GUE" . $incrementIDGuest;
             $joinExtra = "EXT" . $incrementIDExtra;
             $joinPayment = "PAY" . $incrementIDPayment;
             $occupancy = Input::get('adult') . ' Adult | ' . Input::get('child') . ' Child';
             $ccexpiry = Input::get('ccmonth') . '/' . Input::get('ccyear');
             $arrive = date("Y-m-d", strtotime(Input::get('from')));
             //arrive date
             $depart = date("Y-m-d", strtotime(Input::get('to')));
             //depart
             if ($checkYearBook == strval(date("y"))) {
                 //1. insert to book
                 $booking->ID_Booking = $joinBook;
                 $booking->Booking_code = $bookCode;
                 $booking->Arrive = $arrive;
                 $booking->Depart = $depart;
                 $booking->Number_nights = Input::get('total_d');
                 $booking->Occupancy = $occupancy;
                 $booking->Booking_Status = "Booked";
                 //2. insert to guest
                 if ($checkYearGuest == strval(date("y"))) {
                     $guest->ID_Guest = $joinGuest;
                     $guest->ID_Booking = $joinBook;
                     $guest->First_Name = Input::get('fname');
                     $guest->Last_Name = Input::get('lname');
                     $guest->No_Identity = Input::get('identity');
                     $guest->Email = Input::get('email');
                     $guest->Telephone = Input::get('phone');
                     $guest->Address = Input::get('address');
                     $guest->Country = Input::get('country');
                     $guest->City = Input::get('city');
                     $guest->State = Input::get('city');
                     $guest->Post_code = Input::get('state');
                 } else {
                     $guest->ID_Guest = "GUE" . date('y') . "00001";
                     $guest->ID_Booking = $joinBook;
                     $guest->First_Name = Input::get('fname');
                     $guest->Last_Name = Input::get('lname');
                     $guest->No_Identity = Input::get('identity');
                     $guest->Email = Input::get('email');
                     $guest->Telephone = Input::get('phone');
                     $guest->Address = Input::get('address');
                     $guest->Country = Input::get('country');
                     $guest->City = Input::get('city');
                     $guest->State = Input::get('city');
                     $guest->Post_code = Input::get('state');
                 }
                 //3. insert to payment
                 if ($checkYearPayment == strval(date("y"))) {
                     $payment->ID_Payment = $joinPayment;
                     $payment->ID_Booking = $joinBook;
                     $payment->Credit_Type = Input::get('CardType');
                     $payment->Credit_Holder = Input::get('ccname');
//.........这里部分代码省略.........
开发者ID:hilmysyarif,项目名称:hotel-application-laravel,代码行数:101,代码来源:BooksController.php


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