コード例 #1
0
ファイル: ReservationsController.php プロジェクト: oredla/p4
 /**
  * Responds to requests to POST /reservation/create
  */
 public function postCreate(Request $request)
 {
     $this->validate($request, ['id' => 'required|integer', 'inputRoomID' => 'required|integer', 'inputDateOfEvent' => 'required|date', 'inputStartTime' => 'required', 'inputEndTime' => 'required', 'inputNumOfAttendees' => 'required|integer', 'inputDescriptions' => 'required']);
     $reservation = new \App\Reservation();
     $reservation->user_id = $request->id;
     $reservation->room_id = $request->inputRoomID;
     $reservation->user_group = $request->inputUserGroup;
     $reservation->description_of_event = $request->inputDescriptions;
     $reservation->date_of_event = $request->inputDateOfEvent;
     $reservation->start_time = $request->inputStartTime;
     $reservation->end_time = $request->inputEndTime;
     $reservation->expected_num_of_attendees = $request->inputNumOfAttendees;
     $reservation->status = 'pending';
     $reservation->approved_by = 0;
     // $reservation->approved_by =;
     $reservation->save();
     \Session::flash('flash_message', 'New reservation has been recorded.');
     return redirect('/reservations');
 }
コード例 #2
0
ファイル: routes.php プロジェクト: patrickdamery/Eirene
Route::post('/contract/contractQuota', array('before' => 'auth', 'as' => 'contractQuota', 'uses' => 'ContractsController@contractQuota'));
Route::post('/contract/contractPayment', array('before' => 'auth', 'as' => 'contractPayment', 'uses' => 'ContractsController@contractPayment'));
Route::post('/contract/contractPayments', array('before' => 'auth', 'as' => 'contractPayments', 'uses' => 'ContractsController@contractPayments'));
Route::post('/contract/contractInfo', array('before' => 'auth', 'as' => 'contractInfo', 'uses' => 'ContractsController@contractInfo'));
Route::post('/contract/deleteAuthenticated', array('before' => 'auth', 'as' => 'deleteContractAuthenticated', 'uses' => 'ContractsController@deleteAuthenticated'));
Route::post('/contract/updateContractAuth', array('before' => 'auth', 'as' => 'updateContractAuth', 'uses' => 'ContractsController@updateContractAuth'));
/**********************/
/**Reservation Routes**/
/**********************/
Route::post('/reservation/reservationSearch', array('before' => 'auth', 'as' => 'reservationSearch', 'uses' => 'ReservationsController@reservationSearch'));
Route::post('/reservation/getReservationData', array('before' => 'auth', 'as' => 'getReservationData', 'uses' => 'ReservationsController@getReservationData'));
Route::get('/reservation/getReservationItems/{reservationId}', function ($reservationId) {
    return View('mortuary.tables.reservationItemsTable')->with('id', $reservationId);
});
Route::get('/reservation/getReservationDebt/{reservationId}', function ($reservationId) {
    $reservation = App\Reservation::find($reservationId);
    $debt = $reservation->Value + $reservation->Tax - $reservation->Discount - $reservation->Deposit;
    return $debt;
});
Route::post('/reservation/useReservation', array('before' => 'auth', 'as' => 'useReservation', 'uses' => 'ReservationsController@useReservation'));
Route::post('/reservation/convertCredit', array('before' => 'auth', 'as' => 'convertCredit', 'uses' => 'ReservationsController@convertCredit'));
Route::post('/reservation/deleteReservationAuth', array('before' => 'auth', 'as' => 'deleteReservationAuth', 'uses' => 'ReservationsController@deleteReservationAuth'));
/**********************/
/**  Reminder Routes **/
/**********************/
Route::post('/reminder/addReminder', array('before' => 'auth', 'as' => 'addReminder', 'uses' => 'GeneralController@addReminder'));
Route::post('/reminder/getReminders', array('before' => 'auth', 'as' => 'getReminders', 'uses' => 'GeneralController@getReminders'));
Route::post('/reminder/deleteReminder', array('before' => 'auth', 'as' => 'deleteReminder', 'uses' => 'GeneralController@deleteReminder'));
/**********************/
/**  Calendar Routes **/
/**********************/