Skip to content

Commit

Permalink
show all button for appointments
Browse files Browse the repository at this point in the history
  • Loading branch information
itsemon245 committed Aug 4, 2024
1 parent d07d090 commit 9718f4a
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 105 deletions.
3 changes: 3 additions & 0 deletions resources/views/backend/user/appointments.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<x-backend.ui.breadcrumbs :list="['User', request('type') == 'consultation' ? 'Consultations' : 'Appointments']" />

<x-backend.ui.section-card name="User {{ request('type') == 'consultation' ? 'Consultations' : 'Appointments' }}">
@if (request('map_id'))
<x-backend.ui.button type="custom" href="{{route('user-appointments.index')}}" class="btn-dark btn-sm mb-2">Show All</x-backend.ui.button>
@endif
<x-backend.table.basic :items="$appointments">
<thead>
<tr>
Expand Down
209 changes: 106 additions & 103 deletions resources/views/backend/user/appointmentsApproved.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,140 +15,143 @@
}
</style>
@endpush
<x-backend.ui.breadcrumbs :list="['User', (request('type')=='consultation' ? 'Consultations' : 'Appointments')]" />
<x-backend.ui.breadcrumbs :list="['User', request('type') == 'consultation' ? 'Consultations' : 'Appointments']" />

<x-backend.ui.section-card name="User {{request('type')=='consultation' ? 'Consultations' : 'Appointments'}}">
<x-backend.table.basic :items="$appointments">
<thead>
<tr>
<th>#</th>
<th>User Info</th>
@if (request('type') == 'consultation')
<x-backend.ui.section-card name="User {{ request('type') == 'consultation' ? 'Consultations' : 'Appointments' }}">
@if (request('map_id'))
<x-backend.ui.button type="custom" href="{{ route('user-appointments.approved') }}" class="btn-dark btn-sm mb-2">Show All</x-backend.ui.button>
@endif
<x-backend.table.basic :items="$appointments">
<thead>
<tr>
<th>#</th>
<th>User Info</th>
@if (request('type') == 'consultation')
<th>Appointment With</th>
@endif
<th>Date & Time</th>
<th>Status</th>
<th>Location</th>
<th>Created at</th>
<th>Date & Time</th>
<th>Status</th>
<th>Location</th>
<th>Created at</th>

@can('delete appointment')
<th>Action</th>
@endcan
</tr>
</thead>
@can('delete appointment')
<th>Action</th>
@endcan
</tr>
</thead>

<tbody>
@forelse ($appointments as $appointment)
<tr>
<td>1</td>
<td>
<tbody>
@forelse ($appointments as $appointment)
<tr>
<td>1</td>
<td>
<p class="mb-1">
<strong>Name:</strong> <span>{{ $appointment->name }}</span>
</p>
<p class="mb-1">
<strong>Email:</strong> <span>{{ $appointment->email }}</span>
</p>
<p class="mb-1">
<strong>Phone:</strong> <span>{{ $appointment->phone }}</span>
</p>
<div class="d-flex gap-3">
<p class="mb-1">
<strong>District:</strong> <span>{{ $appointment->district }}</span>
</p>
<p class="mb-1">
<strong>Name:</strong> <span>{{ $appointment->name }}</span>
<strong>Thana:</strong> <span>{{ $appointment->thana }}</span>
</p>
</div>
</td>
@if (request('type') == 'consultation')
<td>
<p class="mb-1">
<strong>Email:</strong> <span>{{ $appointment->email }}</span>
<strong>Expert Name:</strong> <span>{{ $appointment->expertProfile?->name }}</span>
</p>
<p class="mb-1">
<strong>Phone:</strong> <span>{{ $appointment->phone }}</span>
<strong>Post:</strong> <span
class="badge bg-success p-2">{{ $appointment->expertProfile?->post }}</span>
</p>
<div class="d-flex gap-3">
<p class="mb-1">
<strong>District:</strong> <span>{{ $appointment->district }}</span>
</p>
<p class="mb-1">
<strong>Thana:</strong> <span>{{ $appointment->thana }}</span>
</p>
</div>
</td>
@if(request('type') == 'consultation')
<td>
<p class="mb-1">
<strong>Expert Name:</strong> <span>{{ $appointment->expertProfile?->name }}</span>
</p>
<p class="mb-1">
<strong>Post:</strong> <span
class="badge bg-success p-2">{{ $appointment->expertProfile?->post }}</span>
</p>
</td>
@endif
<td>
<strong class="d-block">Date:
{{ Carbon\Carbon::parse($appointment->date)->format('d M, Y') }}</strong>
<strong class="d-block">Time: {{ $appointment->time }}</strong>
@endif
<td>
<strong class="d-block">Date:
{{ Carbon\Carbon::parse($appointment->date)->format('d M, Y') }}</strong>
<strong class="d-block">Time: {{ $appointment->time }}</strong>

</td>
<td>
@if ($appointment->is_completed)
<span class="badge bg-soft-success text-success p-1 fs-6">Completed</span>
@elseif($appointment->approved_at)
<span class="badge bg-soft-success text-success p-1 fs-5">Approved At:
{{ $appointment->approved_at?->format('d F, Y') }}</span>
@else
</td>
<td>
@if ($appointment->is_completed)
<span class="badge bg-soft-success text-success p-1 fs-6">Completed</span>
@elseif($appointment->approved_at)
<span class="badge bg-soft-success text-success p-1 fs-5">Approved At:
{{ $appointment->approved_at?->format('d F, Y') }}</span>
@else
<span>No approved date</span>
@endif
</td>
@if($appointment->map)
<td>
@endif
</td>
@if ($appointment->map)
<td>
@if ($appointment->map)
<strong>Location: {{ $appointment->map->location }}</strong>
<strong class="d-block">Address:</strong>
<p class="text-muted">
{{ $appointment->map->address }}
</p>
@else
@else
No branch selected
@endif

</td>
@else
<td>
<span class="badge bg-info p-1 fs-6">
Virtual
</span>
</td>
@endif
</td>
@else
<td>
<span class="fw-bold">
{{ $appointment->created_at->format('d F, Y') }}
<span class="badge bg-info p-1 fs-6">
Virtual
</span>
</td>
@can('delete appointment')
<td>
<form action="{{ route('user-appointments.complete', $appointment->id) }}" method="post"
class="d-inline-block">
@csrf
@method('PATCH')
<button type="submit" class="btn btn-success waves-effect waves-light btn-sm">
<span class="mdi mdi-check-all fs-5"></span>
<span class="fs-6">Mark as completed</span>
</button>
</form>
<form action="{{ route('user-appointments.destroy', $appointment->id) }}" method="post"
class="d-inline-block">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger btn-sm">
Delete
</button>
</form>
@endif
<td>
<span class="fw-bold">
{{ $appointment->created_at->format('d F, Y') }}
</span>
</td>
@can('delete appointment')
<td>
<form action="{{ route('user-appointments.complete', $appointment->id) }}" method="post"
class="d-inline-block">
@csrf
@method('PATCH')
<button type="submit" class="btn btn-success waves-effect waves-light btn-sm">
<span class="mdi mdi-check-all fs-5"></span>
<span class="fs-6">Mark as completed</span>
</button>
</form>
<form action="{{ route('user-appointments.destroy', $appointment->id) }}" method="post"
class="d-inline-block">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger btn-sm">
Delete
</button>
</form>


</td>
@endcan
</tr>
@empty
<tr>
<td colspan="6" class="bg-light">
<div class="text-center text-muted">
No Appointments Found
</div>
</td>
</tr>
@endforelse
</tbody>
@endcan
</tr>
@empty
<tr>
<td colspan="6" class="bg-light">
<div class="text-center text-muted">
No Appointments Found
</div>
</td>
</tr>
@endforelse
</tbody>



</x-backend.table.basic>
</x-backend.table.basic>
</x-backend.ui.section-card>
@endsection
7 changes: 5 additions & 2 deletions resources/views/backend/user/appointmentsCompleted.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<x-backend.ui.breadcrumbs :list="['User', request('type') == 'consultation' ? 'Consultations' : 'Appointments']" />

<x-backend.ui.section-card name="User {{ request('type') == 'consultation' ? 'Consultations' : 'Appointments' }}">
@if (request('map_id'))
<x-backend.ui.button type="custom" :href="route('user-appointments.completed')" class="btn-dark btn-sm mb-2">Show All</x-backend.ui.button>
@endif
<x-backend.table.basic :items="$appointments">
<thead>
<tr>
Expand Down Expand Up @@ -59,9 +62,9 @@
</p>
</div>
</td>
@if(request('type') == 'consultation')
@if (request('type') == 'consultation')
<td>
<p class="mb-1">
<p class="mb-1">
<strong>Expert Name:</strong> <span>{{ $appointment->expertProfile?->name }}</span>
</p>
<p class="mb-1">
Expand Down

0 comments on commit 9718f4a

Please sign in to comment.