本文整理匯總了PHP中Guest::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP Guest::save方法的具體用法?PHP Guest::save怎麽用?PHP Guest::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Guest
的用法示例。
在下文中一共展示了Guest::save方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: register
public function register()
{
$input = Input::all();
$rules = array('name' => 'required | min:5', 'email' => 'required | email');
$validator = Validator::make($input, $rules);
if ($validator->fails()) {
return Redirect::to('/')->withErrors($validator);
} else {
// save guest data
$guest = new Guest();
$guest->name = Input::get('name');
$guest->email = Input::get('email');
$guest->save();
$guests = Guest::all();
return Redirect::to('guests');
}
}
示例2: setNewGuest
public static function setNewGuest($cookie)
{
$guest = new Guest(isset($cookie->id_customer) ? Guest::getFromCustomer((int) $cookie->id_customer) : null);
$guest->userAgent();
$guest->save();
$cookie->id_guest = (int) $guest->id;
}
示例3: setNewGuest
public static function setNewGuest($cookie)
{
$guest = new Guest(isset($cookie->id_customer) ? Guest::getFromCustomer((int) $cookie->id_customer) : null);
$guest->userAgent();
if ($guest->id_operating_system or $guest->id_web_browser) {
$guest->save();
$cookie->id_guest = (int) $guest->id;
}
}
示例4: insertBookNormal
//.........這裏部分代碼省略.........
$payment->Credit_Number = Input::get('ccnum');
$payment->Credit_Expiry = $ccexpiry;
} else {
$payment->ID_Payment = "PAY" . date('y') . "00001";
$payment->ID_Booking = $joinBook;
$payment->Credit_Type = Input::get('CardType');
$payment->Credit_Holder = Input::get('ccname');
$payment->Credit_Number = Input::get('ccnum');
$payment->Credit_Expiry = $ccexpiry;
}
//4. insert to extra
if ($checkYearExtra == strval(date("y"))) {
$extra->ID_Extra = $joinExtra;
$extra->ID_Booking = $joinBook;
$extra->Arrival_time = Input::get('darrive');
$extra->Flight_detail = Input::get('fdetail');
$extra->Comment = Input::get('comment');
} else {
$extra->ID_Extra = "EXT" . date('y') . "00001";
$extra->ID_Booking = $joinBook;
$extra->Arrival_Time = Input::get('darrive');
$extra->Flight_Detail = Input::get('fdetail');
$extra->Comment = Input::get('comment');
}
//5. insert to detail Book
$detailBook->ID_Booking = $joinBook;
$detailBook->ID_RoomType = Input::get('roomID');
$detailBook->Quantity = Input::get('quantity');
$detailBook->Price = Input::get('roomPR');
for ($i = 0; $i < $countAdd; $i++) {
$data = array(array('ID_Booking' => $joinBook, 'ID_Additional' => Input::get("id_add_{$i}"), 'Price' => Input::get("price_add_{$i}"), 'Quantity' => Input::get("add_{$i}")));
DetailAdditional::insert($data);
}
$booking->save();
$guest->save();
$payment->save();
$extra->save();
$detailBook->save();
return Redirect::action('showBook', $bookCode);
} else {
//1. insert to book
$booking->ID_Booking = "BOK" . date('y') . "00001";
$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 = "BOK" . date('y') . "00001";
$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 = "BOK" . date('y') . "00001";
$guest->First_Name = Input::get('fname');