File: /var/www/html/sarvodayahospital/resources/views/pages/appointment-patient-select.blade.php
@extends('layouts.main')
@section('content')
@if(Session::has('message'))
<div id="successMessage class="alert alert-info">{{ Session::get('message') }}</div>
@endif
<!-- appointment sec -->
<section class="appointment-sec py-4 mb-md-3">
<div class="container">
<div class="row align-items-center">
<div class="col-8">
<h3 class="clrBlueDark f-22 fw-500 mb-3">Appointment Details</h3>
</div>
<div class="col-4 text-end">
{{-- <a href="javascript:void(0)" class="btn btn-back btn-outline btn-sm mb-3" >Back</a> --}}
</div>
</div>
<!-- ++ -->
<div class="row">
<x-appointment-left :appointmentleft="$doctor"></x-appointment-left>
<div class="col-lg-8">
<div class="border round-3 appointment-content-right register-form-wrapper p-3">
<h4 class="clrGreyDark f-16 fw-700 mb-1 d-flex align-items-center">There @if (count($data->data) > 1) are {{count($data->data)}} patients @else is 1 patient @endif registered with {{$phone}}
<a href="{{ route('appointment.relogin') }}" class="ps-2">
<img src="{{ asset('img/edit-icon.svg') }}"/>
</a>
</h4>
<p class="f-12">Please select your patient for appointment.</p>
<!-- pateint details box -->
<div class="patient-detail-box">
<div class="row patient-detail-box-row">
@foreach($data->data as $member)
<div class="col-md-6 mb-3">
<button data-name="{{ $member->personName }}" data-formattedDOB="{{ $member->formattedDOB }}" data-facilityGUID="{{ $member->facilityGUID }}" data-gender="{{ ($member->gender == 'M') ? '1' : '2' }}" data-mrn="{{ $member->mrn }}"class="w-100 border-0 text-start patient-content-detail d-flex align-items-center py-2 px-3 d-block no-underline text-white">
<i class="fa-regular fa-circle-user f-22 fw-400"></i>
<div class="patient-meta-right ps-2">
<h4 class="text-white f-16 fw-700 mb-0">{{ $member->personName }}</h4>
<p class="text-white mb-0 f-12">{{ ($member->gender == 'M') ? 'Male' : 'Female' }}, ({{ $member->formattedAge}})</p>
</div>
</button>
</div>
@endforeach
</div>
<!-- ++ -->
<div class="row">
<div class="col-12 text-center">
<span class="f-18 clr5c">or</span>
<div>
<a href="{{ route('appointment.patients-detail',['api_new_user'=>1]) }}" class="add-new-variant-btn">Add New Patient</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- appointment sec end-->
@endsection
@section('javascript')
<script>
$.ajaxSetup({
headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'}
});
$(document).ready(function() {
$(".patient-content-detail").click(function(e){
$.ajax({
type: "POST",
url: "{{ route('appointment.goto-slot') }}",
dataType: "json",
data: {
dataName: $(this).attr("data-name"),
dataGender: $(this).attr("data-gender"),
dataMrn:$(this).attr("data-mrn"),
dataFacilityGUID:$(this).attr("data-facilityGUID"),
dataFormattedDOB:$(this).attr("data-formattedDOB"),
},
success: function(response) {
location.href = response.url;
}
});
});
});
</script>
@endsection