Skip to content

Commit 9718f4a

Browse files
committed
show all button for appointments
1 parent d07d090 commit 9718f4a

File tree

3 files changed

+114
-105
lines changed

3 files changed

+114
-105
lines changed

resources/views/backend/user/appointments.blade.php

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<x-backend.ui.breadcrumbs :list="['User', request('type') == 'consultation' ? 'Consultations' : 'Appointments']" />
1919

2020
<x-backend.ui.section-card name="User {{ request('type') == 'consultation' ? 'Consultations' : 'Appointments' }}">
21+
@if (request('map_id'))
22+
<x-backend.ui.button type="custom" href="{{route('user-appointments.index')}}" class="btn-dark btn-sm mb-2">Show All</x-backend.ui.button>
23+
@endif
2124
<x-backend.table.basic :items="$appointments">
2225
<thead>
2326
<tr>

resources/views/backend/user/appointmentsApproved.blade.php

+106-103
Original file line numberDiff line numberDiff line change
@@ -15,140 +15,143 @@
1515
}
1616
</style>
1717
@endpush
18-
<x-backend.ui.breadcrumbs :list="['User', (request('type')=='consultation' ? 'Consultations' : 'Appointments')]" />
18+
<x-backend.ui.breadcrumbs :list="['User', request('type') == 'consultation' ? 'Consultations' : 'Appointments']" />
1919

20-
<x-backend.ui.section-card name="User {{request('type')=='consultation' ? 'Consultations' : 'Appointments'}}">
21-
<x-backend.table.basic :items="$appointments">
22-
<thead>
23-
<tr>
24-
<th>#</th>
25-
<th>User Info</th>
26-
@if (request('type') == 'consultation')
20+
<x-backend.ui.section-card name="User {{ request('type') == 'consultation' ? 'Consultations' : 'Appointments' }}">
21+
@if (request('map_id'))
22+
<x-backend.ui.button type="custom" href="{{ route('user-appointments.approved') }}" class="btn-dark btn-sm mb-2">Show All</x-backend.ui.button>
23+
@endif
24+
<x-backend.table.basic :items="$appointments">
25+
<thead>
26+
<tr>
27+
<th>#</th>
28+
<th>User Info</th>
29+
@if (request('type') == 'consultation')
2730
<th>Appointment With</th>
2831
@endif
29-
<th>Date & Time</th>
30-
<th>Status</th>
31-
<th>Location</th>
32-
<th>Created at</th>
32+
<th>Date & Time</th>
33+
<th>Status</th>
34+
<th>Location</th>
35+
<th>Created at</th>
3336

34-
@can('delete appointment')
35-
<th>Action</th>
36-
@endcan
37-
</tr>
38-
</thead>
37+
@can('delete appointment')
38+
<th>Action</th>
39+
@endcan
40+
</tr>
41+
</thead>
3942

40-
<tbody>
41-
@forelse ($appointments as $appointment)
42-
<tr>
43-
<td>1</td>
44-
<td>
43+
<tbody>
44+
@forelse ($appointments as $appointment)
45+
<tr>
46+
<td>1</td>
47+
<td>
48+
<p class="mb-1">
49+
<strong>Name:</strong> <span>{{ $appointment->name }}</span>
50+
</p>
51+
<p class="mb-1">
52+
<strong>Email:</strong> <span>{{ $appointment->email }}</span>
53+
</p>
54+
<p class="mb-1">
55+
<strong>Phone:</strong> <span>{{ $appointment->phone }}</span>
56+
</p>
57+
<div class="d-flex gap-3">
58+
<p class="mb-1">
59+
<strong>District:</strong> <span>{{ $appointment->district }}</span>
60+
</p>
4561
<p class="mb-1">
46-
<strong>Name:</strong> <span>{{ $appointment->name }}</span>
62+
<strong>Thana:</strong> <span>{{ $appointment->thana }}</span>
4763
</p>
64+
</div>
65+
</td>
66+
@if (request('type') == 'consultation')
67+
<td>
4868
<p class="mb-1">
49-
<strong>Email:</strong> <span>{{ $appointment->email }}</span>
69+
<strong>Expert Name:</strong> <span>{{ $appointment->expertProfile?->name }}</span>
5070
</p>
5171
<p class="mb-1">
52-
<strong>Phone:</strong> <span>{{ $appointment->phone }}</span>
72+
<strong>Post:</strong> <span
73+
class="badge bg-success p-2">{{ $appointment->expertProfile?->post }}</span>
5374
</p>
54-
<div class="d-flex gap-3">
55-
<p class="mb-1">
56-
<strong>District:</strong> <span>{{ $appointment->district }}</span>
57-
</p>
58-
<p class="mb-1">
59-
<strong>Thana:</strong> <span>{{ $appointment->thana }}</span>
60-
</p>
61-
</div>
6275
</td>
63-
@if(request('type') == 'consultation')
64-
<td>
65-
<p class="mb-1">
66-
<strong>Expert Name:</strong> <span>{{ $appointment->expertProfile?->name }}</span>
67-
</p>
68-
<p class="mb-1">
69-
<strong>Post:</strong> <span
70-
class="badge bg-success p-2">{{ $appointment->expertProfile?->post }}</span>
71-
</p>
72-
</td>
73-
@endif
74-
<td>
75-
<strong class="d-block">Date:
76-
{{ Carbon\Carbon::parse($appointment->date)->format('d M, Y') }}</strong>
77-
<strong class="d-block">Time: {{ $appointment->time }}</strong>
76+
@endif
77+
<td>
78+
<strong class="d-block">Date:
79+
{{ Carbon\Carbon::parse($appointment->date)->format('d M, Y') }}</strong>
80+
<strong class="d-block">Time: {{ $appointment->time }}</strong>
7881

79-
</td>
80-
<td>
81-
@if ($appointment->is_completed)
82-
<span class="badge bg-soft-success text-success p-1 fs-6">Completed</span>
83-
@elseif($appointment->approved_at)
84-
<span class="badge bg-soft-success text-success p-1 fs-5">Approved At:
85-
{{ $appointment->approved_at?->format('d F, Y') }}</span>
86-
@else
82+
</td>
83+
<td>
84+
@if ($appointment->is_completed)
85+
<span class="badge bg-soft-success text-success p-1 fs-6">Completed</span>
86+
@elseif($appointment->approved_at)
87+
<span class="badge bg-soft-success text-success p-1 fs-5">Approved At:
88+
{{ $appointment->approved_at?->format('d F, Y') }}</span>
89+
@else
8790
<span>No approved date</span>
88-
@endif
89-
</td>
90-
@if($appointment->map)
91-
<td>
91+
@endif
92+
</td>
93+
@if ($appointment->map)
94+
<td>
9295
@if ($appointment->map)
9396
<strong>Location: {{ $appointment->map->location }}</strong>
9497
<strong class="d-block">Address:</strong>
9598
<p class="text-muted">
9699
{{ $appointment->map->address }}
97100
</p>
98-
@else
101+
@else
99102
No branch selected
100103
@endif
101104

102-
</td>
103-
@else
104-
<td>
105-
<span class="badge bg-info p-1 fs-6">
106-
Virtual
107-
</span>
108-
</td>
109-
@endif
105+
</td>
106+
@else
110107
<td>
111-
<span class="fw-bold">
112-
{{ $appointment->created_at->format('d F, Y') }}
108+
<span class="badge bg-info p-1 fs-6">
109+
Virtual
113110
</span>
114111
</td>
115-
@can('delete appointment')
116-
<td>
117-
<form action="{{ route('user-appointments.complete', $appointment->id) }}" method="post"
118-
class="d-inline-block">
119-
@csrf
120-
@method('PATCH')
121-
<button type="submit" class="btn btn-success waves-effect waves-light btn-sm">
122-
<span class="mdi mdi-check-all fs-5"></span>
123-
<span class="fs-6">Mark as completed</span>
124-
</button>
125-
</form>
126-
<form action="{{ route('user-appointments.destroy', $appointment->id) }}" method="post"
127-
class="d-inline-block">
128-
@csrf
129-
@method('DELETE')
130-
<button type="submit" class="btn btn-danger btn-sm">
131-
Delete
132-
</button>
133-
</form>
112+
@endif
113+
<td>
114+
<span class="fw-bold">
115+
{{ $appointment->created_at->format('d F, Y') }}
116+
</span>
117+
</td>
118+
@can('delete appointment')
119+
<td>
120+
<form action="{{ route('user-appointments.complete', $appointment->id) }}" method="post"
121+
class="d-inline-block">
122+
@csrf
123+
@method('PATCH')
124+
<button type="submit" class="btn btn-success waves-effect waves-light btn-sm">
125+
<span class="mdi mdi-check-all fs-5"></span>
126+
<span class="fs-6">Mark as completed</span>
127+
</button>
128+
</form>
129+
<form action="{{ route('user-appointments.destroy', $appointment->id) }}" method="post"
130+
class="d-inline-block">
131+
@csrf
132+
@method('DELETE')
133+
<button type="submit" class="btn btn-danger btn-sm">
134+
Delete
135+
</button>
136+
</form>
134137

135138

136-
</td>
137-
@endcan
138-
</tr>
139-
@empty
140-
<tr>
141-
<td colspan="6" class="bg-light">
142-
<div class="text-center text-muted">
143-
No Appointments Found
144-
</div>
145139
</td>
146-
</tr>
147-
@endforelse
148-
</tbody>
140+
@endcan
141+
</tr>
142+
@empty
143+
<tr>
144+
<td colspan="6" class="bg-light">
145+
<div class="text-center text-muted">
146+
No Appointments Found
147+
</div>
148+
</td>
149+
</tr>
150+
@endforelse
151+
</tbody>
149152

150153

151154

152-
</x-backend.table.basic>
155+
</x-backend.table.basic>
153156
</x-backend.ui.section-card>
154157
@endsection

resources/views/backend/user/appointmentsCompleted.blade.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<x-backend.ui.breadcrumbs :list="['User', request('type') == 'consultation' ? 'Consultations' : 'Appointments']" />
1919

2020
<x-backend.ui.section-card name="User {{ request('type') == 'consultation' ? 'Consultations' : 'Appointments' }}">
21+
@if (request('map_id'))
22+
<x-backend.ui.button type="custom" :href="route('user-appointments.completed')" class="btn-dark btn-sm mb-2">Show All</x-backend.ui.button>
23+
@endif
2124
<x-backend.table.basic :items="$appointments">
2225
<thead>
2326
<tr>
@@ -59,9 +62,9 @@
5962
</p>
6063
</div>
6164
</td>
62-
@if(request('type') == 'consultation')
65+
@if (request('type') == 'consultation')
6366
<td>
64-
<p class="mb-1">
67+
<p class="mb-1">
6568
<strong>Expert Name:</strong> <span>{{ $appointment->expertProfile?->name }}</span>
6669
</p>
6770
<p class="mb-1">

0 commit comments

Comments
 (0)