|
15 | 15 | }
|
16 | 16 | </style>
|
17 | 17 | @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']" /> |
19 | 19 |
|
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') |
27 | 30 | <th>Appointment With</th>
|
28 | 31 | @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> |
33 | 36 |
|
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> |
39 | 42 |
|
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> |
45 | 61 | <p class="mb-1">
|
46 |
| - <strong>Name:</strong> <span>{{ $appointment->name }}</span> |
| 62 | + <strong>Thana:</strong> <span>{{ $appointment->thana }}</span> |
47 | 63 | </p>
|
| 64 | + </div> |
| 65 | + </td> |
| 66 | + @if (request('type') == 'consultation') |
| 67 | + <td> |
48 | 68 | <p class="mb-1">
|
49 |
| - <strong>Email:</strong> <span>{{ $appointment->email }}</span> |
| 69 | + <strong>Expert Name:</strong> <span>{{ $appointment->expertProfile?->name }}</span> |
50 | 70 | </p>
|
51 | 71 | <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> |
53 | 74 | </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> |
62 | 75 | </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> |
78 | 81 |
|
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 |
87 | 90 | <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> |
92 | 95 | @if ($appointment->map)
|
93 | 96 | <strong>Location: {{ $appointment->map->location }}</strong>
|
94 | 97 | <strong class="d-block">Address:</strong>
|
95 | 98 | <p class="text-muted">
|
96 | 99 | {{ $appointment->map->address }}
|
97 | 100 | </p>
|
98 |
| - @else |
| 101 | + @else |
99 | 102 | No branch selected
|
100 | 103 | @endif
|
101 | 104 |
|
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 |
110 | 107 | <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 |
113 | 110 | </span>
|
114 | 111 | </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> |
134 | 137 |
|
135 | 138 |
|
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> |
145 | 139 | </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> |
149 | 152 |
|
150 | 153 |
|
151 | 154 |
|
152 |
| - </x-backend.table.basic> |
| 155 | + </x-backend.table.basic> |
153 | 156 | </x-backend.ui.section-card>
|
154 | 157 | @endsection
|
0 commit comments