File: /var/www/html/sarvodayahospital/resources/views/pages/reports/user.blade.php
@extends('layouts.main')
@section('content')
<section class="py-4 py-md-3 banner-c">
<div class="container">
<div class="row align-items-center">
<div class="col-md-6">
<h1 class="text-white f-sm-30 f-30 fw-500 mb-0">
<!-- <img src="{{ asset('img/bread7.png') }}" alt="" class="img-fluid pe-3" width="70px" height="70px" /> -->
My Account
</h1>
</div>
<div class="col-md-6 text-end">
</div>
</div>
</div>
</section>
<section class="my-reports-sec py-4">
<div class="container">
<!-- ++ -->
<div class="booking-doctor-tab mt-4">
<div class="tab-content">
<div class="tab-pane container active p-0" id="my-booking">
@forelse ($data as $d)
<div class="doctor-booking-box mb-4 transition-3">
<div class="row align-items-center">
<div class="col-lg-3 mb-lg-0 mb-2">
<h4 class="clr5c f-18 mb-3 fw-500">Doctor Information</h4>
<div class="d-md-flex align-items-start d-lg-block">
<div class="d-flex booking-dr-profile mb-3 align-items-center">
<div class="text-center report-sh-icon align-items-center d-flex justify-content-center me-3">
@if (!is_null($d->doctors->media))
<img src="{{ $d->doctors->media->banner_url }}" class="img-fluid" alt="" />
@elseif ($d->doctors->gender->Gender == 'Male')
<img src="{{ asset('img/default-doctor-male.jpg') }}" class="img-fluid" alt="" />
@else
<img src="{{ asset('img/default-doctor-female.jpg') }}" class="img-fluid" alt="" />
@endif
</div>
<div>
<p class="clr5c f-16 mb-0">{{$d->doctors->DoctorName}}</p>
<p class="clrAc f-14 mb-0">{{$d->doctors->CurrentDesignation}}</p>
<p class="clrAc f-14 mb-0">{{ $d->doctors->specialities->pluck('SpecialityName')->implode(', ')}}</p>
</div>
</div>
<div class="d-flex booking-SH-img align-items-center ps-md-4 ps-lg-0">
<div class="text-center report-sh-icon align-items-center d-flex justify-content-center me-3">
<img src="{{ asset('img/SH-icon.svg') }}" class="img-fluid rounded-0 shadow-none" alt="...">
</div>
<div>
<p class="clr5c f-16 mb-0">{{$d->hospitals->HospitalShortName}}</p>
<p class="clrAc f-14 mb-0">{{$d->hospitals->Location}}</p>
</div>
</div>
</div>
</div>
<!-- == -->
<div class="col-lg-6">
<div class="pateint-info-box bg-f7f7f7">
<h3 class="clrBlueDark f-18 fw-500 py-2 mb-0">Patient Information</h3>
<table class="table">
<tbody>
<tr>
<td class="fw-500 clr545454 f-16">Name</td>
<td class="fw-500 clr545454 f-16">Appointment ID</td>
<td class="fw-500 clr545454 f-16">Booking Timing</td>
</tr>
<tr>
<td class="clr8e8e8e f-16">{{ ucwords($d->patient_name) }}</td>
<td class="clr8e8e8e f-16"> {{ $d->slots }} </td>
<td class="clr8e8e8e f-16">{{\Carbon\Carbon::parse($d->BookingDate)->format('d-m-Y')}} / {{ $d->BookingTime }}</td>
</tr>
<tr>
<td class="fw-500 clr545454 f-16">Payment Mode</td>
<td class="fw-500 clr545454 f-16">Payment Status</td>
<td class="fw-500 clr545454 f-16">Appointment Status</td>
</tr>
<tr>
<td class="clr8e8e8e f-16">{{ $d->PayAtHospital ? 'Pay at Hospital':'Online' }}</td>
<td class="clr8e8e8e f-16">{{ $d->TransactionStatus }}</td>
<td class="clr8e8e8e f-16">{{ $d->UserAppointmentStatus =='CancelledByUser' ? 'Cancelled' : 'Pending' }}</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- == -->
<div class="col-lg-3">
@php
$newdate = \Carbon\Carbon::parse($d->BookingDate .' '. $d->BookingTime);
$currentDateTime =\Carbon\Carbon::now();
if ($newdate->gt($currentDateTime)){
if((($d->TransactionStatus =='NA') || ($d->TransactionStatus =='Success')) && ($d->published_at != null) && ($d->UserAppointmentStatus != 'CancelledByUser')){
echo '<a href="javascript:fxCancelBooking(\'' . $d->hospitals->FacilityGUID .'\','. $phone. ', '. $d->id. ', '. $d->slots. ', \''.$d->hospitals->HospitalShortName. '\')" class="btn schedule-appointment-report d-block cancel-appointment-btn">Cancel Appointment</a>';
}
}
@endphp
</div>
</div>
</div>
@empty
<p>No Record found.</p>
@endforelse
<!-- Pagination -->
{{ $data->links() }}
</div>
</div>
</div>
</div>
</section>
@endsection
@section('javascript')
<script type="text/javascript">
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
}
});
</script>
<script>
function fxCancelBooking(facilityGUID, mobileNo, id, appointmentID, hospital) {
if (confirm("Are you sure you want to cancel this Appointment?")) {
$.ajax({
type: "POST",
url: "{{ route('report.cancel-booking') }}",
dataType: "json",
data: {
facilityGUID: facilityGUID,
mobileNo: mobileNo,
appointmentID: appointmentID,
cancellationNote: 'NA',
id: id,
hospital: hospital
},
success: function(response) {
if (response.data) {
location.reload(true);
}
}
});
}
}
</script>
@endsection