| @@ 17-39 (lines=23) @@ | ||
| 14 | return 'guest'; |
|
| 15 | } |
|
| 16 | ||
| 17 | public function index() |
|
| 18 | { |
|
| 19 | $title = trans('general.guests'); |
|
| 20 | ||
| 21 | $dataset = Guest::select('id', 'first_name', 'last_name', 'address', 'zip_code', 'place', 'PESEL', 'contact') |
|
| 22 | ->paginate($this->getItemsPerPage()); |
|
| 23 | ||
| 24 | $viewData = [ |
|
| 25 | 'columns' => $this->getColumns(), |
|
| 26 | 'dataset' => $dataset, |
|
| 27 | 'routeName' => $this->getRouteName(), |
|
| 28 | 'title' => $title, |
|
| 29 | // TODO |
|
| 30 | 'deleteMessage' => mb_strtolower(trans('general.guest')).' '.mb_strtolower(trans('general.number')), |
|
| 31 | ]; |
|
| 32 | ||
| 33 | if ($dataset->isEmpty() && !Session::has('message')) { |
|
| 34 | Session::flash('message', trans('general.no_guests_in_database')); |
|
| 35 | Session::flash('alert-class', 'alert-danger'); |
|
| 36 | } |
|
| 37 | ||
| 38 | return view('list', $viewData); |
|
| 39 | } |
|
| 40 | ||
| 41 | public function store(GuestRequest $request, $id = null) |
|
| 42 | { |
|
| @@ 18-42 (lines=25) @@ | ||
| 15 | return 'reservation'; |
|
| 16 | } |
|
| 17 | ||
| 18 | public function index() |
|
| 19 | { |
|
| 20 | $title = trans('general.reservations'); |
|
| 21 | ||
| 22 | $dataset = Reservation::select('id', 'room_id', 'guest_id', 'date_start', 'date_end', 'people') |
|
| 23 | ->with('guest:id,first_name,last_name') |
|
| 24 | ->with('room:id,number') |
|
| 25 | ->paginate($this->getItemsPerPage()); |
|
| 26 | ||
| 27 | $viewData = [ |
|
| 28 | 'columns' => $this->getColumns(), |
|
| 29 | 'dataset' => $dataset, |
|
| 30 | 'routeName' => $this->getRouteName(), |
|
| 31 | 'title' => $title, |
|
| 32 | // TODO |
|
| 33 | 'deleteMessage' => mb_strtolower(trans('general.reservation')).' '.mb_strtolower(trans('general.number')), |
|
| 34 | ]; |
|
| 35 | ||
| 36 | if ($dataset->isEmpty() && !Session::has('message')) { |
|
| 37 | Session::flash('message', trans('general.no_reservations_in_database')); |
|
| 38 | Session::flash('alert-class', 'alert-danger'); |
|
| 39 | } |
|
| 40 | ||
| 41 | return view('list', $viewData); |
|
| 42 | } |
|
| 43 | ||
| 44 | // TODO |
|
| 45 | public function store(GuestRequest $request, $id = null) |
|
| @@ 17-38 (lines=22) @@ | ||
| 14 | return 'room'; |
|
| 15 | } |
|
| 16 | ||
| 17 | public function index() |
|
| 18 | { |
|
| 19 | $title = trans('general.rooms'); |
|
| 20 | ||
| 21 | $dataset = Room::select('id', 'number', 'floor', 'capacity', 'price', 'comment') |
|
| 22 | ->paginate($this->getItemsPerPage()); |
|
| 23 | ||
| 24 | $viewData = [ |
|
| 25 | 'columns' => $this->getColumns(), |
|
| 26 | 'dataset' => $dataset, |
|
| 27 | 'routeName' => $this->getRouteName(), |
|
| 28 | 'title' => $title, |
|
| 29 | 'deleteMessage' => mb_strtolower(trans('general.room')).' '.mb_strtolower(trans('general.number')), |
|
| 30 | ]; |
|
| 31 | ||
| 32 | if ($dataset->isEmpty() && !Session::has('message')) { |
|
| 33 | Session::flash('message', trans('general.no_rooms_in_database')); |
|
| 34 | Session::flash('alert-class', 'alert-danger'); |
|
| 35 | } |
|
| 36 | ||
| 37 | return view('list', $viewData); |
|
| 38 | } |
|
| 39 | ||
| 40 | public function store(RoomRequest $request, $id = null) |
|
| 41 | { |
|