File: /var/www/html/sarvodayahospital/resources/views/pages/appointment-thanks.blade.php
@extends('layouts.main')
@section('content')
<section class="thank-you-sec py-md-5 py-4">
<div class="container">
<div class="row">
<div class="col-md-4 mb-4 order-md-0 order-2">
<div class="thank-you-box-left">
<div id="feedback-form">
<h3 class="clrBlueDark f-20 f-sm-20 mb-2 text-center fw-700">Got Suggestions? We'd love to hear from you!</h3>
<p class="f-16 mb-2 f-sm-16 clr5c text-center">Rate your overall experience </p>
<div class="reviews-wrapper text-center starrr" id='star1'>
</div>
@if (($order_status == 'hospital') || ($order_status=="Success"))
<input type="hidden" id="orderid" name="orderid" value="{{$book['OrderID']}}">
<input type="hidden" id="PatientName" name="PatientName" value="{{$book['patient_name']}}">
<input type="hidden" id="PatientMobile" name="PatientMobile" value="{{$book['patient_mobile']}}">
@else
<input type="hidden" id="orderid" name="orderid" value="{{@$data['order_id']}}">
<input type="hidden" id="PatientName" name="PatientName" value="{{@$data['billing_name']}}">
<input type="hidden" id="PatientMobile" name="PatientMobile" value="{{@$data['billing_tel']}}">
@endif
<input type="hidden" id="rating" name="rating" value="">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<textarea placeholder="Please share your feedback" class="form-control mt-3" id="feedback" name="feedback"></textarea>
<input class="submit" type="submit" value="Submit" name=""/>
{{-- <button class="submit btn" name="" >Submit</button> --}}
</div>
</div>
</div>
<div class="col-md-8">
@if ($order_status == 'hospital')
@include('partials.cc-success')
@elseif($order_status=="Success")
@include('partials.cc-success')
@elseif($order_status=="Aborted")
<p> Transaction Aborted</p>
@include('partials.cc-failed')
@elseif($order_status=="Failure")
<p> Transaction Failure</p>
@include('partials.cc-failed')
@elseif($order_status=="NotBooked")
<p> Booking Not Done slot already booked</p>
@include('partials.cc-failed')
@else
<p>Security Error. Illegal access detected</p>
@endif
<div class=" mt-md-3 text-center">
<a href="{{ route('home') }}" class="back-to-home-btn btn">Back to Home Page</a>
</div>
</div>
</div>
</div>
</section>
@endsection
@section('javascript')
<script src="{{ asset('js/starrr.js') }}"></script>
<script type="text/javascript">
$(function() {
var ratingsField = $('#rating');
$('.starrr').on('starrr:change', function(e, value) {
ratingsField.val(value);
});
});
</script>
<script type="text/javascript">
$(document).ready(function() {
window.history.pushState(null, "", window.location.href);
window.onpopstate = function() {
window.history.pushState(null, "", window.location.href);
};
});
</script>
<script type="text/javascript">
$.ajaxSetup({
headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'}
});
$(document).ready(function() {
$(".submit").click(function(e){
$.ajax({
type: "POST",
url: "{{ route('appointment.feedback') }}",
dataType: "json",
data: {
PatientName: $("#PatientName").val(),
PatientMobile: $("#PatientMobile").val(),
Rating:$("#rating").val(),
orderid:$("#orderid").val(),
Feedback:$("#feedback").val(),
},
success: function(response) {
if ((response.ok == 'success')) {
$('#feedback-form').hide();
$('.thank-you-box-left').html('<p>Your feedback is valuable to us</p>');
} else {
$(".thank-you-box-left").prepend("<b>Some error happend</b>. ");
}
}
});
});
});
</script>
@endsection