From f8322f1a61ba32ddda776bc9c8ac883972f6dc1f Mon Sep 17 00:00:00 2001 From: Rangga Adithia Date: Mon, 20 Nov 2023 15:57:13 +0800 Subject: [PATCH] finishing view user --- app/Http/Controllers/HistoryController.php | 12 +- app/Livewire/ModalBooking.php | 4 +- app/Livewire/ScheduleCalendar.php | 1 + public/favicon.ico | Bin 0 -> 15406 bytes .../views/components/modal-button.blade.php | 2 +- resources/views/home/history.blade.php | 177 +++++++++--------- .../views/livewire/detail-schedule.blade.php | 10 +- .../views/livewire/lab-schedule.blade.php | 2 +- resources/views/livewire/loading.blade.php | 2 +- .../views/livewire/modal-booking.blade.php | 18 +- resources/views/livewire/navbar.blade.php | 34 ++-- .../livewire/schedule-calendar.blade.php | 12 +- .../views/livewire/success-booking.blade.php | 2 +- 13 files changed, 139 insertions(+), 137 deletions(-) diff --git a/app/Http/Controllers/HistoryController.php b/app/Http/Controllers/HistoryController.php index a4b17b5..2646827 100644 --- a/app/Http/Controllers/HistoryController.php +++ b/app/Http/Controllers/HistoryController.php @@ -12,7 +12,7 @@ public function history() { $now = Carbon::now(); - $upcomingHistories = LabsBooking::with('lab', 'user') + $upcomingHistories = LabsBooking::with('lab') ->where('user_id', auth()->user()->id) ->where(function ($query) use ($now) { $query->where('booking_date', '>=', $now->format('Y-m-d')) @@ -21,16 +21,16 @@ public function history() ->where('start_time', '>', $now->format('H:i:s')); }); }) - ->orderBy('booking_date', 'desc') + ->orderBy('booking_date', 'asc') ->get(); $expiredHistories = LabsBooking::with('lab') ->where('user_id', auth()->user()->id) ->where(function ($query) use ($now) { - $query->where('booking_date', '<', $now) - ->orWhere(function ($query) use ($now) { - $query->whereDate('booking_date', '=', $now->format('Y-m-d')) - ->whereTime('start_time', '<=', $now->format('H:i:s')); + $query->where('booking_date', '<', $now->format('Y-m-d')) + ->orWhere(function ($subquery) use ($now) { + $subquery->whereDate('booking_date', '=', $now->format('Y-m-d')) + ->whereTime('start_time', '<', $now->format('H:i:s')); }); }) ->orderBy('booking_date', 'desc') diff --git a/app/Livewire/ModalBooking.php b/app/Livewire/ModalBooking.php index 2bc4371..257589c 100644 --- a/app/Livewire/ModalBooking.php +++ b/app/Livewire/ModalBooking.php @@ -59,9 +59,9 @@ public function bookingLab() $isLabAvailable = ClassSchedule::isLabAvailable($this->lab_id, $day, $this->start_time, $this->end_time)->count() == 0; if (!$isBookingConflict) { - session()->flash('conflict', 'Pada tanggal dan jam tersebut lab sedang digunakan'); + session()->flash('conflict', 'Pada tanggal & jam tersebut ruangan sedang digunakan'); } else if (!$isLabAvailable) { - session()->flash('conflict', 'Pada hari dan jam tersebut sedang ada perkuliahan di lab'); + session()->flash('conflict', 'Pada hari & jam tersebut sedang ada perkuliahan di ruangan'); } else { $data = [ diff --git a/app/Livewire/ScheduleCalendar.php b/app/Livewire/ScheduleCalendar.php index 5a0ef35..eb9590c 100644 --- a/app/Livewire/ScheduleCalendar.php +++ b/app/Livewire/ScheduleCalendar.php @@ -15,6 +15,7 @@ class ScheduleCalendar extends Component private function generateWeekDates(Carbon $startDate, Carbon $endDate) { + Carbon::setLocale('id'); $weekDates = []; for ($date = $startDate; $date <= $endDate; $date->addDay()) { diff --git a/public/favicon.ico b/public/favicon.ico index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0860b8e6cca148f0154f8b75447bb0c0741ec906 100644 GIT binary patch literal 15406 zcmeHO2~?FwmL`G<2)xIxETW=-C~mkSBDkU8g0io^g?-<*#}0zBiJ+pm?@OX49b+fm zNi<8Rw{%Zu(mk1EI+MzuZMn?=5RRJvY{26SnC8 z&c|barplfzGF9K2#j8$a1bf6kyV9$9*GjL}9a}w;E_kjvpCZcSik_g6Ix>xeWu!~U zp)#W}?^K(c-0Sl5#{OlC?wkz|xpQ#ka@5;d-77O3^ZRhuu%oi5o8)@%Z+g(L)#XNG zKCLtzk0a~XpmCZbN=%JVBAbAw8B@^dy%ZHD<4|U(|Cbq?-bmDKZKmj5lx^vBz1&D2 znUkl(E9eyFCj1n$(%yo5`Y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h7Q>3D33Xig=HFPq$CuUp~aRZE>y%oczu9-MCD=d6=%CENRH& zNVaAB0uN%;3DUVJbi#8PX%f~hFkW3+oV!n!`5x|&sc!8XO^l}Q7z`DdBIL;1yFF54 zJnlE_>s!i`_)md!R&{zWfrw{0A05H{)`YIrKGIpywQ42LI#<+Ew(4xnCBB55wK48! z&wLLlp7n#5e~L!p?pIQih~ci0bhOYlQs3h4N56>1aP0f*7nah;)N|4}Vt8DkF0Ui! z@sv3+N1hXhoWkC14w)I-m1gUHCeOn09CewrCSnhZwHGnBEpF2ppHxVUza8g@_g~G= zk^BHJ*Hz;pqeD@@aP8^qPpl zIZj(`>4^Tlk(nOy6;BDwkvc0}?0v>hykQgjx7Ukg=3QJ5>5eSoki^~=7{0*6-`clV zviF2fKr$R!_ljheM{HvL`X*_7K;8a|T-BG` zAI~^~Z*mBiPx30xy&#Xo8q)kiOJDaXWI*T-`n{z89|&7U#Qj!sFGywgc^=e;eFb \ No newline at end of file diff --git a/resources/views/home/history.blade.php b/resources/views/home/history.blade.php index 93d2ac1..33f1d94 100644 --- a/resources/views/home/history.blade.php +++ b/resources/views/home/history.blade.php @@ -2,98 +2,98 @@ @section('container')
- + + +
+ @else + + + @endauth + + + + -

Mendatang

+
+

Riwayat Peminjaman Ruangan

+ + @if (count($upcomingHistories) == 0 && count($expiredHistories) == 0) +
+

Anda belum memesan Ruangan

+
+ @endif + + + +@if(count($upcomingHistories) > 0) +

Mendatang

+ @foreach ($upcomingHistories as $history) -
+
- {{ $history->reason_to_booking }} + {{ $history->reason_to_booking }} | R. {{ str_replace('Ruang ', '', $history->lab->name) }}
{{ \Carbon\Carbon::parse($history->booking_date)->format('d F Y') }} - - ({{ \Carbon\Carbon::parse($history->booking_date)->diffForHumans()}}) + ({{ \Carbon\Carbon::parse("$history->booking_date $history->start_time")->diffForHumans()}})

{{ $history->start_time }} - {{ $history->end_time }} @@ -109,15 +109,18 @@ class="text-left w-full bg-transparent px-4 py-2 text-sm font-normal text-neutra

@endforeach +@endif +@if ($expiredHistories->count() > 0) -

Selesai

+ +

Selesai

@foreach ($expiredHistories as $history) -
+
- {{ $history->reason_to_booking }} + {{ $history->reason_to_booking }} | R. {{ str_replace('Ruang ', '', $history->lab->name) }}
@@ -128,7 +131,9 @@ class="text-left w-full bg-transparent px-4 py-2 text-sm font-normal text-neutra

-@endforeach +@endforeach +@endif +
@endsection \ No newline at end of file diff --git a/resources/views/livewire/detail-schedule.blade.php b/resources/views/livewire/detail-schedule.blade.php index a6e0042..60654f3 100644 --- a/resources/views/livewire/detail-schedule.blade.php +++ b/resources/views/livewire/detail-schedule.blade.php @@ -1,15 +1,15 @@