private function composeNotif()
 {
     \View::composer(['operator.partials.header'], function ($view) {
         $notifs = Reservation::with(['user', 'paket'])->where('confirm_operator', false)->get();
         if (\Auth::user()->role->id == 1) {
             # code...
             $view->with(['notifs' => Reservation::with(['user', 'paket'])->where('confirm_operator', false)->valid()->get()]);
         } else {
             $view->with(['notifs' => Reservation::with(['user', 'paket'])->valid()->get()]);
         }
     });
 }
Beispiel #2
0
 /**
  * Responds to requests to GET /reservations/edit/{reservation_id?}
  */
 public function getEdit($reservation_id)
 {
     $rooms_for_dropdown = \App\Room::roomsForDropdown();
     $admins_for_dropdown = \App\User::adminsForDropdown();
     $reservation = \App\Reservation::with('room')->with('user')->find($reservation_id);
     if ($reservation->date_of_event < date(\Carbon\Carbon::now())) {
         \Session::flash('flash_message', 'Please note you are editing a past event.');
     } elseif ($reservation->date_of_event = date(\Carbon\Carbon::now())) {
         \Session::flash('flash_message', 'Your event is happening today.');
     }
     return view('reservations.detail')->with('reservation', $reservation)->with('edit', true)->with('rooms_for_dropdown', $rooms_for_dropdown)->with('admins_for_dropdown', $admins_for_dropdown);
 }
Beispiel #3
0
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::group(['namespace' => 'Operator', 'prefix' => 'operator', 'middleware' => ['auth', 'operator']], function () {
    get('dashboard', ['as' => 'operator.dashboard', 'uses' => 'DashboardController@index']);
    resource('notif', 'NotifController');
    resource('paket', 'PaketController');
    resource('member', 'MemberController');
    resource('galery', 'GaleryController');
});
Route::group(['prefix' => 'member', 'middleware' => ['auth']], function () {
    Route::resource('reservation', 'ReservationController');
    Route::get('/dashboard', ['as' => 'member.dashboard', 'uses' => 'ReservationController@dashboard']);
    Route::get('/wait/{id}', ['as' => 'wait', 'uses' => 'ReservationController@wait']);
});
Route::get('/', ['as' => 'welcome', 'uses' => 'WelcomeController@index']);
Route::get('/paket_detail/{id}', ['as' => 'paket.detail', 'uses' => 'WelcomeController@show']);
Route::post('/paket_detail/{id}', ['as' => 'paket.detail', 'uses' => 'WelcomeController@show']);
Route::get('/print/tiket/{id}', ['middleware' => 'auth'], function ($id) {
    $reservation = Reservation::with('user', 'paket')->find($id);
    return view('partials.print', compact('reservation'));
});
Route::controller('auth', 'Auth\\AuthController', ['getLogin' => 'auth.login', 'postLogin' => 'post.login', 'getLogout' => 'auth.logout', 'getRegister' => 'auth.register', 'postRegister' => 'post.register']);
Route::controller('password', 'Auth\\PasswordController');
Beispiel #4
0
 public static function fetchReservedRooms()
 {
     $json = array();
     $reservations = Reservation::with(['room', 'reservation_room' => function ($query) {
         $query->where('date_reserved', '>=', date('Y-m-d'));
     }])->get();
     foreach ($reservations as $reservation) {
         foreach ($reservation->reservation_room as $reservation_rooms) {
             $json[] = array('title' => $reservation->reference_number . ' - ' . $reservation_rooms->room->category->name . ' - ' . $reservation_rooms->room->name, 'start' => $reservation_rooms->date_reserved, 'url' => route('show_reserved_room', $reservation_rooms->id));
         }
     }
     return json_encode($json);
 }
 private function getRoomsForReservation($reservationID)
 {
     $reservationWithRooms = Reservation::with('rooms')->get()->find($reservationID);
     $roomsList = array();
     foreach ($reservationWithRooms['rooms'] as $room) {
         $roomsList[] = $room['number'];
     }
     return $roomsList;
 }
Beispiel #6
0
 /**
  * Responds to requests to GET /rooms/reservations/{room_id}
  */
 public function getRoomsUpcomingReservations($room_id)
 {
     $reservations = \App\Reservation::with('room')->with('user')->where('room_id', $room_id)->where('date_of_event', '>=', date(\Carbon\Carbon::now()))->orderBy('date_of_event', 'ASC')->orderBy('start_time', 'ASC')->get();
     return view('rooms.reservationsList')->with('reservations', $reservations)->with('room_id', $room_id);
 }
 public function index()
 {
     $data = [];
     $data['article'] = ArticleCategory::with('articles')->get();
     $data['content'] = Reservation::with('patient', 'schedule.doctor')->where('verified', 1);
     if (Input::get('data_content') == '2') {
         $data['content'] = $data['content']->where('status', "");
     } else {
         if (Input::get('data_content') == '3') {
             $data['content'] = $data['content']->where('status', '1');
         } else {
             if (Input::get('data_content') == '4') {
                 $data['content'] = $data['content']->where('status', '2');
             } else {
                 if (Input::get('data_content') == '5') {
                     $data['content'] = $data['content']->where('status', '3');
                 } else {
                     if (Input::get('data_content') == '6') {
                         $data['content'] = $data['content']->where('status', '4');
                     }
                 }
             }
         }
     }
     $data['content'] = $data['content']->orderBy('created_at', 'desc')->get();
     return view('frontend.pages.clinic.reservation', compact('data'));
 }