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


PHP Reservation类代码示例

本文整理汇总了PHP中Reservation的典型用法代码示例。如果您正苦于以下问题:PHP Reservation类的具体用法?PHP Reservation怎么用?PHP Reservation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testGetAuthor

 function testGetAuthor()
 {
     $doc = $date = $duration = 0;
     $author = 'John Cena';
     $res = new Reservation($doc, $author, $date, $duration);
     $this->assertIdentical($res->getAuthor(), $author);
 }
开发者ID:aliuc,项目名称:co-transcript,代码行数:7,代码来源:reservation.php

示例2: addReservation

 public function addReservation(Reservation $reservation)
 {
     if (!$this->roomIsFree($reservation->getStartDate(), $reservation->getEndDate())) {
         throw new EReservationException();
     }
     $this->reservations[] = $reservation;
 }
开发者ID:reminchev,项目名称:SoftUni-Projects,代码行数:7,代码来源:Room.class.php

示例3: IsInConflict

 /**
  * @param Reservation $instance
  * @param ReservationSeries $series
  * @param IReservedItemView $existingItem
  * @param BookableResource[] $keyedResources
  * @return bool
  */
 protected function IsInConflict(Reservation $instance, ReservationSeries $series, IReservedItemView $existingItem, $keyedResources)
 {
     if ($existingItem->GetId() == $instance->ReservationId() || $series->IsMarkedForDelete($existingItem->GetId()) || $series->IsMarkedForUpdate($existingItem->GetId())) {
         return false;
     }
     return parent::IsInConflict($instance, $series, $existingItem, $keyedResources);
 }
开发者ID:hugutux,项目名称:booked,代码行数:14,代码来源:ExistingResourceAvailabilityRule.php

示例4: generate_vars

function generate_vars($section, &$vars)
{
    $vars['ok'] = false;
    $vars['full'] = false;
    if (!isset($_GET['match_id']) || !isset($_GET['nombre_billet'])) {
        return;
    }
    $nombre_billet = $_GET['nombre_billet'];
    $match = Match::get($_GET['match_id']);
    if ($match == null || $nombre_billet <= 0) {
        return;
    }
    if ($match->places < $nombre_billet) {
        $vars['full'] = true;
        return;
    }
    $match->places = $match->places - $nombre_billet;
    $match->save();
    $reservation = new Reservation();
    $reservation->utilisateur = $vars['userid'];
    $reservation->match_id = $match->id;
    $reservation->qte = $nombre_billet;
    $reservation->expiration = 'now()';
    $reservation->save();
    $vars['ok'] = true;
}
开发者ID:pheze,项目名称:ydtp2,代码行数:26,代码来源:reservation_billet.php

示例5: uploadBankReceipt

 public function uploadBankReceipt()
 {
     if (Input::hasFile('uploadReceipt')) {
         $data = array();
         if (is_array(Input::get('room_id'))) {
             foreach (Input::get('room_id') as $key => $val) {
                 $data[$key] = array('am_id' => Input::get('am_id.' . $key), 'rooms' => $val);
             }
         }
         $data2 = array();
         if (is_array(Input::get('add_Am'))) {
             foreach (Input::get('add_Am') as $key => $val) {
                 $data2[$key] = array('am_id' => Input::get('am_id.' . $key), 'rooms' => $val);
             }
         }
         $name = Input::get('packname');
         $price = Input::get('amount');
         $input_dFrom = Input::get('package_datefrom');
         $input_dTo = Input::get('package_dateto');
         $input_nPax = Input::get('num_pax');
         $input_fName = Input::get('fullN');
         $postData = new Reservation();
         $postData->dataInsertPost($name, $price, $input_dFrom, $input_dTo, $input_nPax, $input_fName, json_encode($data), 'Bank', json_encode($data2));
         $lastInsert = DB::getPdo()->lastInsertId();
         $files = Input::file('uploadReceipt');
         $i = 1;
         foreach ($files as $file) {
             try {
                 $path = public_path() . '\\uploads\\bank_deposit\\';
                 $extension = $file->getClientOriginalExtension();
                 $filename = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);
                 $dateNow = date('Ymd_His');
                 $new_filename = Auth::user()->id . '_' . $filename . '_' . $i . '.' . $extension;
                 $upload_success = $file->move($path, $new_filename);
             } catch (Exception $ex) {
                 $path = public_path() . '/uploads/bank_deposit/';
                 $extension = $file->getClientOriginalExtension();
                 $filename = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);
                 $dateNow = date('Ymd_His');
                 $new_filename = Auth::user()->id . '_' . $filename . '_' . $i . '.' . $extension;
                 $upload_success = $file->move($path, $new_filename);
             }
             $insertVal = array('image_fieldvalue' => $lastInsert, 'image_name' => $new_filename);
             $this->GlobalModel->insertModel('tbl_images', $insertVal);
             $i++;
         }
         $data = array('refNumber' => str_pad($lastInsert, 10, "0", STR_PAD_LEFT), 'package' => $name, 'amount' => '₱' . number_format($price, 2), 'paymentMethod' => 'Bank Deposit', 'status' => 1);
         try {
             Mail::send('emails.user.transactionReservation', $data, function ($message) use($data) {
                 $message->from('no-reply@reservation.com', 'El Sitio Filipino');
                 $message->to(Auth::user()->user_email, Auth::user()->user_fname . ' ' . Auth::user()->user_lname)->subject('El Sitio Filipino Transaction Details');
             });
         } catch (Exception $ex) {
             dd($ex->getMessage());
         }
         return Response::json($data);
     }
 }
开发者ID:axisssss,项目名称:ORS,代码行数:58,代码来源:OrdersController.php

示例6: checkForValidReservation

 public function checkForValidReservation(Reservation $reservation)
 {
     foreach ($this->reservations as $existingReservation) {
         if ($reservation->getStartDate() >= $existingReservation->getStartDate() && $reservation->getStartDate() <= $existingReservation->getEndDate()) {
             throw new EReservationException($this->roomNumber, $reservation);
         } elseif ($reservation->getEndDate() >= $existingReservation->getStartDate() && $reservation->getEndDate() <= $existingReservation->getEndDate()) {
             throw new EReservationException($this->roomNumber, $reservation);
         }
     }
 }
开发者ID:simeonemanuilov,项目名称:OOP,代码行数:10,代码来源:Room.class.php

示例7: bindObject

 public function bindObject(Reservation $reservation)
 {
     $taintedValues = $reservation->toArray(BasePeer::TYPE_FIELDNAME);
     $taintedFiles = array();
     foreach ($taintedValues as $key => $value) {
         if (!isset($this->widgetSchema[$key])) {
             unset($taintedValues[$key]);
         }
     }
     $taintedValues[self::$CSRFFieldName] = $this->getCSRFToken(self::$CSRFSecret);
     $this->bind($taintedValues, $taintedFiles);
 }
开发者ID:jfesquet,项目名称:tempos,代码行数:12,代码来源:ReservationForm.class.php

示例8: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Reservation::create([]);
     }
 }
开发者ID:jonagoldman,项目名称:channelmanager,代码行数:7,代码来源:ReservationsTableSeeder.php

示例9: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     //
     try {
         $reservation = new Reservation();
         $reservation->name = Input::get('name');
         $reservation->sex = Input::get('sex');
         $reservation->phone = Input::get('phone');
         $reservation->email = Input::get('email');
         $reservation->note = Input::get('note');
         $reservation->save();
         return View::make('aesthetics.reservations.ok');
     } catch (Exception $e) {
         return Redirect::back()->withInput()->withErrors('新增失敗');
     }
 }
开发者ID:kettanyam,项目名称:20141001done,代码行数:21,代码来源:ReservationsController.php

示例10: testCreate

 public function testCreate()
 {
     $connection = Yii::app()->db;
     $sql = "delete from reservation";
     $command = $connection->createCommand($sql);
     $command->execute();
     $dateOverlapFromObj = new DateTime();
     $dateOverlapFrom = $dateOverlapFromObj->format('Y-m-d');
     $reservation = new Reservation();
     $reservation->setAttributes(array('roomid' => 1, 'datefrom' => $dateOverlapFrom, 'numberofnights' => 10, 'confirmreservation' => true));
     $id = $reservation->save();
     $reservationdetails = new Reservationdetails();
     $reservationdetails->setAttributes(array('reservationid' => $reservation->getAttribute('id'), 'title' => "Mr", 'firstname' => "John", 'lastname' => "Smith", 'contactnumber' => "0123456789", 'emailaddress' => "john.smith@blankemailaddress.blanky.co.uk", 'city' => "City", 'county' => "County", 'country' => "UK", 'postcode' => "ab12 4cd", 'postaddress' => 'Test postal address', 'otherinfo' => "Test"));
     $this->assertTrue($reservationdetails->save());
     return $reservationdetails;
 }
开发者ID:bogiesoft,项目名称:YiiHotelReservation,代码行数:16,代码来源:ReservationDetailsTest.php

示例11: deleteAction

 public function deleteAction()
 {
     $this->view->disable();
     $this->response->setContentType('text/plain', 'UTF-8');
     $Reservationid = $this->request->get('reservationid', 'string');
     $reservation = Reservation::findFirst(array('coditions' => 'id=?1', 'bind' => array(1 => $reservationid)));
     if ($reservation != null) {
         $available = $reservation->Available;
         if ($available->date == date('Y-m-d', strtotime('now'))) {
             $this->response->setContent('对不起,该预约单已经超过可取消日期');
             $this->response->send();
             return;
         } else {
             if ($reservation->delete() == false) {
                 $this->response->setContent('对不起,现在无法取消预约单');
                 $this->response->send();
                 return;
             } else {
                 $this->response->setContent('预约单取消成功');
                 $this->response->send();
                 return;
             }
         }
     }
 }
开发者ID:sify21,项目名称:guahao,代码行数:25,代码来源:HomeController.php

示例12: checkAdditionalResources

 /**
  * Checks to see if any of the additional resources conflict
  * @param Reservation $res the reservation object to validate
  * @return An array of available_number and names of any conflicting resources
  */
 function checkAdditionalResources($res, $resources_to_add)
 {
     $return = array();
     $t = new Timer('get_additional_resource_count()');
     $t->start();
     //		$query = 'SELECT ar.resourceid, ar.name, ar.number_available '
     //				. ' FROM ' . $this->get_table(TBL_ADDITIONAL_RESOURCES) . ' ar'
     //				. ' WHERE resourceid IN (' . . ') AND ar.number_available = 0';
     $values = array($res->get_start_date(), $res->get_start_date(), $res->get_start(), $res->get_end_date(), $res->get_end_date(), $res->get_end(), $res->get_start_date(), $res->get_start_date(), $res->get_start(), $res->get_end_date(), $res->get_end_date(), $res->get_end(), $res->get_start_date(), $res->get_start_date(), $res->get_start(), $res->get_start_date(), $res->get_start_date(), $res->get_start(), $res->get_end_date(), $res->get_end_date(), $res->get_end(), $res->get_end_date(), $res->get_end_date(), $res->get_end());
     $resourceids = $this->make_del_list($resources_to_add);
     $id = $res->get_id();
     $and = '';
     if (!empty($id)) {
         $and = ' AND rr.resid <> ?';
         // Modifying this reservation
         array_unshift($values, $id);
     }
     $query = 'SELECT ar.resourceid, ar.name, ar.number_available, COUNT(*) AS total' . ' FROM ' . $this->get_table(TBL_RESERVATION_RESOURCES) . ' rr' . ' INNER JOIN ' . $this->get_table(TBL_ADDITIONAL_RESOURCES) . ' ar ON rr.resourceid = ar.resourceid' . ' INNER JOIN ' . $this->get_table(TBL_RESERVATIONS) . ' r ON r.resid = rr.resid' . ' WHERE rr.resourceid IN (' . $resourceids . ')' . ' AND ar.number_available <> -1 AND ar.number_available IS NOT NULL' . $and . ' AND (' . ' ( (start_date > ? OR (start_date = ? AND starttime > ?)) AND ( end_date < ? OR (end_date = ? AND endtime < ?)) )' . ' OR ( (start_date < ? OR (start_date = ? AND starttime < ?)) AND (end_date > ? OR (end_date = ? AND endtime > ?)) )' . ' OR ( (start_date < ? OR (start_date = ? AND starttime <= ?)) AND (end_date > ? OR (end_date = ? AND endtime > ?)) ) ' . ' OR ( (start_date < ? OR (start_date = ? AND starttime < ?)) AND (end_date > ? OR (end_date = ? AND endtime >= ?)) )' . ' )' . ' GROUP BY ar.resourceid, ar.name, ar.number_available' . ' HAVING COUNT(*) >= ar.number_available' . ' UNION ' . ' SELECT ar.resourceid, ar.name, ar.number_available, 0 AS total' . ' FROM ' . $this->get_table(TBL_ADDITIONAL_RESOURCES) . ' ar' . ' WHERE resourceid IN (' . $resourceids . ') AND ar.number_available = 0';
     $result = $this->db->query($query, $values);
     // Check if error
     $this->check_for_error($result);
     while ($rs = $result->fetchRow()) {
         $return[] = array('name' => $rs['name'], 'number_available' => $rs['number_available']);
     }
     $t->stop();
     $t->print_comment();
     return $return;
 }
开发者ID:razagilani,项目名称:srrs,代码行数:33,代码来源:ResDB.class.php

示例13: generate_vars

function generate_vars($section, &$vars)
{
    if (!$vars['is_logged']) {
        return;
    }
    if (isset($_GET['reservation_id'])) {
        $reservation = Reservation::get($_GET['reservation_id']);
        if ($reservation != null) {
            $match = $reservation->get_match();
            $match->places += $reservation->qte;
            $match->save();
            $reservation->delete();
        }
    } else {
        if (isset($_GET['tout_effacer'])) {
            $reservations = Reservation::filter_by_user($vars['userid']);
            foreach ($reservations as $reservation) {
                $match = $reservation->get_match();
                $match->places += $reservation->qte;
                $match->save();
                $reservation->delete();
            }
        }
    }
    $reservations = Reservation::filter_by_user($vars['userid']);
    $vars['reservations'] = $reservations;
    $cout_total = 0;
    foreach ($reservations as $reservation) {
        $cout_total += $reservation->get_match()->prix;
    }
    $vars['cout_total'] = $cout_total;
}
开发者ID:pheze,项目名称:ydtp2,代码行数:32,代码来源:panier.php

示例14: freePlaces

 public function freePlaces()
 {
     $reservation = count(Reservation::filter_by_match($this->id));
     $achat = count(Achat::filter_by_match($this->id));
     $arena = $this->getArena();
     return $arena->largeur * $arena->profondeur - $reservation - $achat;
 }
开发者ID:pheze,项目名称:ydtp3,代码行数:7,代码来源:match.inc.php

示例15: getColoredModStatusString

 public function getColoredModStatusString()
 {
     $statusString = Reservation::modStatusToString($this->modStatus);
     if ($this->modStatus == RES_STATUS_CONFIRMED) {
         $status = "<font color=\"#005500\">" . $statusString . "</font>";
     } else {
         if ($this->modStatus == RES_STATUS_CHECKED_OUT) {
             $status = "<font color=\"#005500\">" . $statusString . "</font>";
         } else {
             if ($this->modStatus == RES_STATUS_CHECKED_IN) {
                 $status = "<font color=\"#005500\">" . $statusString . "</font>";
             } else {
                 if ($this->modStatus == RES_STATUS_PENDING) {
                     $status = $statusString;
                 } else {
                     if ($this->modStatus == RES_STATUS_DENIED) {
                         $status = "<font color=\"#FF0000\">" . $statusString . "</font>";
                     } else {
                         $status = "<font color=\"#FF0000\">" . $statusString . "</font>";
                     }
                 }
             }
         }
     }
     return $status;
 }
开发者ID:ramielrowe,项目名称:Reservation-System-V2,代码行数:26,代码来源:Reservation.php


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