changes
This commit is contained in:
@@ -47,9 +47,8 @@ class AppointmentController extends Controller
|
|||||||
$validated = $request->validated();
|
$validated = $request->validated();
|
||||||
$this->appointmentRepository->storeAppointmentList($validated);
|
$this->appointmentRepository->storeAppointmentList($validated);
|
||||||
|
|
||||||
toastr()->success('Appointment created successfully.');
|
return redirect("/thankyou")->with('success','Message Sent Successfully');
|
||||||
|
|
||||||
return redirect()->route('doctor_provider');
|
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
report($th);
|
report($th);
|
||||||
toastr()->error('Something went wrong.');
|
toastr()->error('Something went wrong.');
|
||||||
|
@@ -15,12 +15,37 @@ class CreateAppointmentRequest extends FormRequest
|
|||||||
'team_member_id' => 'required|integer',
|
'team_member_id' => 'required|integer',
|
||||||
'full_name' => 'required|string|max:150',
|
'full_name' => 'required|string|max:150',
|
||||||
'email' => 'required|email',
|
'email' => 'required|email',
|
||||||
'contact_no' => 'required|string',
|
'contact_no' => ['required','nullable','regex:/^\+?\d{7,15}$/'],
|
||||||
'subject' => 'required|string|max:500',
|
'subject' => 'required|string|max:500',
|
||||||
'feedback' => 'required|string',
|
'feedback' => 'required|string',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function messages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'team_member_id.required' => 'The team member field is required.',
|
||||||
|
'team_member_id.integer' => 'The team member must be an integer.',
|
||||||
|
|
||||||
|
'full_name.required' => 'The full name field is required.',
|
||||||
|
'full_name.string' => 'The full name must be a string.',
|
||||||
|
'full_name.max' => 'The full name may not be greater than 150 characters.',
|
||||||
|
|
||||||
|
'email.required' => 'The email field is required.',
|
||||||
|
'email.email' => 'Invalid email format.',
|
||||||
|
|
||||||
|
'contact_no.required' => 'The contact number field is required.',
|
||||||
|
'contact_no.regex' => 'The contact number must be a valid phone number',
|
||||||
|
|
||||||
|
'subject.required' => 'The subject field is required.',
|
||||||
|
'subject.string' => 'The subject must be a string.',
|
||||||
|
'subject.max' => 'The subject may not be greater than 500 characters.',
|
||||||
|
|
||||||
|
'feedback.required' => 'The feedback field is required.',
|
||||||
|
'feedback.string' => 'The feedback must be a string.',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if the user is authorized to make this request.
|
* Determine if the user is authorized to make this request.
|
||||||
*/
|
*/
|
||||||
|
@@ -36,7 +36,7 @@ class CreateConsultationRequest extends FormRequest
|
|||||||
'email.max' => 'The email may not be greater than :max characters.',
|
'email.max' => 'The email may not be greater than :max characters.',
|
||||||
|
|
||||||
'contact_no.required' => 'The contact number field is required.',
|
'contact_no.required' => 'The contact number field is required.',
|
||||||
'contact_no.max' => 'The contact number may not be greater than :max characters.',
|
'contact_no.regex' => 'The contact number must be a valid phone number',
|
||||||
|
|
||||||
'age_group.required' => 'The age group field is required.',
|
'age_group.required' => 'The age group field is required.',
|
||||||
'age_group.integer' => 'The age group must be an integer.',
|
'age_group.integer' => 'The age group must be an integer.',
|
||||||
|
@@ -17,7 +17,7 @@ class CreateContactUsRequest extends FormRequest
|
|||||||
'email' => 'sometimes|nullable|email',
|
'email' => 'sometimes|nullable|email',
|
||||||
'subject' => 'sometimes|nullable|string|max:1000',
|
'subject' => 'sometimes|nullable|string|max:1000',
|
||||||
'message' => 'required|string|max:1000',
|
'message' => 'required|string|max:1000',
|
||||||
'phone' => 'sometimes|nullable|numeric|digits:10',
|
'phone' => ['sometimes','nullable','regex:/^\+?\d{7,15}$/'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,7 +42,8 @@ class CreateContactUsRequest extends FormRequest
|
|||||||
'message.max' => 'The message may not be greater than 1000 characters.',
|
'message.max' => 'The message may not be greater than 1000 characters.',
|
||||||
|
|
||||||
'phone.numeric' => 'The phone must be a number.',
|
'phone.numeric' => 'The phone must be a number.',
|
||||||
'phone.digits' => 'The phone must be exactly 10 digits long.'
|
'phone.digits_between' => 'The phone must be a number between 7 and 15 digits long.',
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -223,8 +223,8 @@ class HomeController extends Controller
|
|||||||
$validated = ['email' => $request->email];
|
$validated = ['email' => $request->email];
|
||||||
$this->subscriptionService->storeSubscription($validated);
|
$this->subscriptionService->storeSubscription($validated);
|
||||||
|
|
||||||
toastr()->success('Thanks for subscribing');
|
// toastr()->success('Thanks for subscribing');
|
||||||
return back();
|
return redirect("/thankyou")->with('success','Message Sent Successfully');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function storeContactUs(CreateContactUsRequest $request)
|
public function storeContactUs(CreateContactUsRequest $request)
|
||||||
@@ -247,8 +247,8 @@ class HomeController extends Controller
|
|||||||
try {
|
try {
|
||||||
$consultationController = new ConsultationController();
|
$consultationController = new ConsultationController();
|
||||||
$consultationController->store($request);
|
$consultationController->store($request);
|
||||||
toastr()->success('Thanks for consulting us...');
|
// toastr()->success('Thanks for consulting us...');
|
||||||
return back();
|
return redirect("/thankyou")->with('success','Message Sent Successfully');
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
report($th);
|
report($th);
|
||||||
}
|
}
|
||||||
|
BIN
public/images/bye.jpg
Normal file
BIN
public/images/bye.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 418 KiB |
125
public/source/css/custom.css
Normal file
125
public/source/css/custom.css
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
.ending {
|
||||||
|
padding: 80px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ending .last-picture {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ending .last-picture img {
|
||||||
|
width: 20%;
|
||||||
|
margin: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ending .last-text {
|
||||||
|
margin-top: 18px;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ending .last-text h3 {
|
||||||
|
font-size: 48px;
|
||||||
|
font-weight: 750;
|
||||||
|
line-height: 1.2;
|
||||||
|
color: #3b78af;
|
||||||
|
margin-bottom: 14px;
|
||||||
|
max-width: 380px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ending .last-text p {
|
||||||
|
color: #000;
|
||||||
|
margin: 40px 0;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.whatsapp-icon {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 105px; /* Adjust the distance from the bottom */
|
||||||
|
right: 30px; /* Adjust the distance from the right */
|
||||||
|
z-index: 1000; /* Ensures it stays on top of other elements */
|
||||||
|
}
|
||||||
|
|
||||||
|
.whatsapp-icon img {
|
||||||
|
width: 65px; /* Adjust the size as needed */
|
||||||
|
height: 65px; /* Adjust the size as needed */
|
||||||
|
}
|
||||||
|
|
||||||
|
.ending .last-text a {
|
||||||
|
margin-top: 5px;
|
||||||
|
border: 1px solid #3b78af;
|
||||||
|
padding: 15px;
|
||||||
|
font-weight: 400;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
color: #FFFFFF;
|
||||||
|
background-color: #3b78afe0;
|
||||||
|
-webkit-box-align: center;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
align-items: center;
|
||||||
|
display: -webkit-inline-box;
|
||||||
|
display: -ms-inline-flexbox;
|
||||||
|
display: inline-flex;
|
||||||
|
width: 290px;
|
||||||
|
-webkit-box-pack: center;
|
||||||
|
-ms-flex-pack: center;
|
||||||
|
justify-content: center;
|
||||||
|
border-radius: 30px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ending .last-text a:hover {
|
||||||
|
background: transparent;
|
||||||
|
color: #3b78af;
|
||||||
|
font-weight: 400;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ending .last-text a i {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.consulation-form div {
|
||||||
|
padding-bottom: 4px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Make the intl-tel-input container take full width */
|
||||||
|
.iti {
|
||||||
|
display: block !important;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make the input inside take full width */
|
||||||
|
.iti__selected-dial-code,
|
||||||
|
.iti__flag-container {
|
||||||
|
float: left;
|
||||||
|
height: 100%;
|
||||||
|
padding-top: 5px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Input field inside the container */
|
||||||
|
.iti__country-list,
|
||||||
|
.iti__input {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Optional: spacing below input like other fields */
|
||||||
|
.phone-number {
|
||||||
|
margin-top: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contact-us-form .iti .iti__selected-dial-code {
|
||||||
|
padding-top: 12px !important; /* override for taller inputs */
|
||||||
|
}
|
||||||
|
|
||||||
|
.appointment-form-field .iti .iti__selected-dial-code {
|
||||||
|
padding-top: 2px !important; /* override for taller inputs */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
BIN
public/source/images/favicon.png
Normal file
BIN
public/source/images/favicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
28
resources/views/thankyou.blade.php
Normal file
28
resources/views/thankyou.blade.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
@extends('theme.spade.layouts.main')
|
||||||
|
@section('meta')
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="canonical" href="https://aroginhealthcare.com/thankyou" >
|
||||||
|
@endsection
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
<div class="ending">
|
||||||
|
<section >
|
||||||
|
<div class="last-picture">
|
||||||
|
<img src="./images/bye.jpg" alt="byee">
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<div class="last-text">
|
||||||
|
<h3>Thanks for Visiting Us!</h3>
|
||||||
|
<p>Your form has been submitted. We will get back to you shortly </p>
|
||||||
|
<a href="https://aroginhealthcare.com/">Back to the homepage <i class="fas fa-home"></i></a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endsection
|
@@ -267,7 +267,7 @@
|
|||||||
<div class="flex justify-content-center">
|
<div class="flex justify-content-center">
|
||||||
<div class="w-70; mx-auto">
|
<div class="w-70; mx-auto">
|
||||||
<p>Have any questions? Leave us your contact information, and we’ll reach out to you.</p>
|
<p>Have any questions? Leave us your contact information, and we’ll reach out to you.</p>
|
||||||
<form action="{{ route('contactUsMessage') }}" method="post">
|
<form id="contactForm" action="{{ route('contactUsMessage') }}" method="post">
|
||||||
@csrf
|
@csrf
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
<div class="col-md-6 mb-10">
|
<div class="col-md-6 mb-10">
|
||||||
@@ -296,8 +296,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 mb-10">
|
<div class="col-md-6 mb-10">
|
||||||
<label for="phone-number" class="form-label">Contact Number</label>
|
<label for="phone-number" class="form-label">Contact Number</label>
|
||||||
<input type="text" class="form-control" id="phone-number" name="phone"
|
<input type="tel" class="form-control phone-number" id="phone-number" name="phone" placeholder="98XXXXXXXX">
|
||||||
placeholder="98XXXXXXXX">
|
|
||||||
@error('phone')
|
@error('phone')
|
||||||
<div class="text-danger">{{ $message }}</div>
|
<div class="text-danger">{{ $message }}</div>
|
||||||
@enderror
|
@enderror
|
||||||
@@ -326,3 +325,50 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
@push('js')
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$("#contactForm").on("submit", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
var form = $(this);
|
||||||
|
var url = form.attr("action");
|
||||||
|
|
||||||
|
// Remove any existing errors
|
||||||
|
form.find(".text-danger").remove();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type: "POST",
|
||||||
|
data: form.serialize(),
|
||||||
|
success: function (response) {
|
||||||
|
// Clear the form
|
||||||
|
form[0].reset();
|
||||||
|
|
||||||
|
// Redirect to thank you page
|
||||||
|
window.location.href = "/thankyou";
|
||||||
|
},
|
||||||
|
error: function (xhr) {
|
||||||
|
if (xhr.status === 422) {
|
||||||
|
var errors = xhr.responseJSON.errors;
|
||||||
|
|
||||||
|
$.each(errors, function (key, value) {
|
||||||
|
var field = $("[name='" + key + "']");
|
||||||
|
var wrapper = field.closest(".mb-10"); // Bootstrap column wrapper
|
||||||
|
|
||||||
|
// Remove old errors
|
||||||
|
wrapper.find(".text-danger").remove();
|
||||||
|
|
||||||
|
// Append new error under the field
|
||||||
|
wrapper.append('<div class="text-danger mt-1">' + value[0] + '</div>');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
alert("Something went wrong, please try again later.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
@@ -24,11 +24,15 @@
|
|||||||
<link href="{{ asset('source/css/font-awesome.css') }}" rel="stylesheet">
|
<link href="{{ asset('source/css/font-awesome.css') }}" rel="stylesheet">
|
||||||
<link href="{{ asset('source/css/flaticon.css') }}" rel="stylesheet">
|
<link href="{{ asset('source/css/flaticon.css') }}" rel="stylesheet">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" />
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" />
|
||||||
|
<link rel="stylesheet" href="https://unpkg.com/intl-tel-input@17.0.19/build/css/intlTelInput.min.css"/>
|
||||||
|
|
||||||
|
|
||||||
<link href="https://arogin.thikeniraj.com.np/source/css/style.min.css" rel="stylesheet">
|
<link href="https://arogin.thikeniraj.com.np/source/css/style.min.css" rel="stylesheet">
|
||||||
<link href="https://arogin.thikeniraj.com.np/source/css/custom.css" rel="stylesheet">
|
<link href="https://arogin.thikeniraj.com.np/source/css/custom.css" rel="stylesheet">
|
||||||
|
|
||||||
|
<link href="{{ asset('source/css/custom.css') }}" rel="stylesheet">
|
||||||
|
|
||||||
|
|
||||||
<!-- Responsive -->
|
<!-- Responsive -->
|
||||||
<link href="{{ asset('source/css/responsive.css') }}" rel="stylesheet">
|
<link href="{{ asset('source/css/responsive.css') }}" rel="stylesheet">
|
||||||
|
|
||||||
@@ -54,6 +58,9 @@
|
|||||||
|
|
||||||
@include('theme.spade.layouts.includes.footer')
|
@include('theme.spade.layouts.includes.footer')
|
||||||
|
|
||||||
|
<a class="whatsapp-icon" href="https://wa.me/{{ $generalSetting['mobile_number'] }}" target="_blank"><img src="https://upload.wikimedia.org/wikipedia/commons/6/6b/WhatsApp.svg" alt="WhatsApp" />
|
||||||
|
</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--End pagewrapper-->
|
<!--End pagewrapper-->
|
||||||
@@ -69,6 +76,29 @@
|
|||||||
<script src="{{ asset('source/js/googlemaps.min.js') }}"></script>
|
<script src="{{ asset('source/js/googlemaps.min.js') }}"></script>
|
||||||
<script src="{{ asset('source/js/script.min.js') }}"></script>
|
<script src="{{ asset('source/js/script.min.js') }}"></script>
|
||||||
<script src="https://maps.google.com/maps/api/js?sensor=true"></script>
|
<script src="https://maps.google.com/maps/api/js?sensor=true"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.19/js/intlTelInput.min.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.19/js/utils.min.js"></script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$(".phone-number").each(function() {
|
||||||
|
var input = this;
|
||||||
|
var iti = window.intlTelInput(this, {
|
||||||
|
initialCountry: "auto",
|
||||||
|
geoIpLookup: function(success, failure) {
|
||||||
|
$.get("https://ipinfo.io", function() {}, "jsonp").always(function(resp) {
|
||||||
|
var countryCode = (resp && resp.country) ? resp.country : "us";
|
||||||
|
success(countryCode);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
separateDialCode: true
|
||||||
|
});
|
||||||
|
$(this).closest("form").on("submit", function(e) {
|
||||||
|
$(input).val(iti.getNumber());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@stack('js')
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@@ -69,8 +69,8 @@
|
|||||||
<div class="text-danger">{{ $message }}</div>
|
<div class="text-danger">{{ $message }}</div>
|
||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12">
|
<div class="col-md-12 appointment-form-field">
|
||||||
<input class="form-control" type="text" name="contact_no" placeholder="Phone *"
|
<input class="form-control phone-number" type="text" name="contact_no" placeholder="Phone *"
|
||||||
required>
|
required>
|
||||||
@error('contact_no')
|
@error('contact_no')
|
||||||
<div class="text-danger">{{ $message }}</div>
|
<div class="text-danger">{{ $message }}</div>
|
||||||
@@ -167,3 +167,45 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
@push('js')
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$("form[action='{{ route('consultat_with_us') }}']").on("submit", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
var form = $(this);
|
||||||
|
var url = form.attr("action");
|
||||||
|
|
||||||
|
// Remove existing error messages
|
||||||
|
form.find(".text-danger").remove();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type: "POST",
|
||||||
|
data: form.serialize(),
|
||||||
|
success: function (response) {
|
||||||
|
form[0].reset();
|
||||||
|
window.location.href = "/thankyou"; // redirect after success
|
||||||
|
},
|
||||||
|
error: function (xhr) {
|
||||||
|
if (xhr.status === 422) {
|
||||||
|
var errors = xhr.responseJSON.errors;
|
||||||
|
|
||||||
|
$.each(errors, function (key, value) {
|
||||||
|
var field = form.find("[name='" + key + "']");
|
||||||
|
var wrapper = field.closest(".col-md-12"); // keep errors inside column wrapper
|
||||||
|
|
||||||
|
// Append the error message below the field
|
||||||
|
wrapper.append('<div class="text-danger mt-1">' + value[0] + '</div>');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
alert("Something went wrong, please try again later.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
|
||||||
|
@@ -81,7 +81,7 @@
|
|||||||
<div class="col-md-7 col-sm-6 col-xs-12 contact-form wow fadeInLeft" data-wow-delay="0ms"
|
<div class="col-md-7 col-sm-6 col-xs-12 contact-form wow fadeInLeft" data-wow-delay="0ms"
|
||||||
data-wow-duration="1000ms">
|
data-wow-duration="1000ms">
|
||||||
<h2>Write in details</h2>
|
<h2>Write in details</h2>
|
||||||
<form action="{{ route('contactUsMessage') }}" method="post">
|
<form id="contactForm" action="{{ route('contactUsMessage') }}" method="post">
|
||||||
@csrf
|
@csrf
|
||||||
<div class="field-container clearfix">
|
<div class="field-container clearfix">
|
||||||
<div class="form-group col-md-6 col-sm-12 col-xs-12">
|
<div class="form-group col-md-6 col-sm-12 col-xs-12">
|
||||||
@@ -97,8 +97,8 @@
|
|||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
<div class="form-group col-md-4 col-sm-12 col-xs-12">
|
<div class="form-group col-md-4 col-sm-12 col-xs-12 contact-us-form">
|
||||||
<input type="text" name="phone" placeholder="Contact No*" required="required">
|
<input type="text" class="phone-number" name="phone" placeholder="Contact No*" required="required">
|
||||||
@error('phone')
|
@error('phone')
|
||||||
<div class="text-danger">{{ $message }}</div>
|
<div class="text-danger">{{ $message }}</div>
|
||||||
@enderror
|
@enderror
|
||||||
@@ -136,3 +136,40 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
@push('js')
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$("#contactForm").on("submit", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
var form = $(this);
|
||||||
|
var url = form.attr("action");
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type: "POST",
|
||||||
|
data: form.serialize(),
|
||||||
|
success: function (response) {
|
||||||
|
form[0].reset();
|
||||||
|
window.location.href = "/thankyou";
|
||||||
|
},
|
||||||
|
error: function (xhr) {
|
||||||
|
// handle validation errors
|
||||||
|
if (xhr.status === 422) {
|
||||||
|
var errors = xhr.responseJSON.errors;
|
||||||
|
$(".text-danger").remove();
|
||||||
|
$.each(errors, function (key, value) {
|
||||||
|
$("[name='" + key + "']").after('<div class="text-danger">' + value[0] + "</div>");
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
alert("Something went wrong, please try again later.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
@endpush
|
||||||
|
@@ -66,8 +66,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
<div class="form-group col-md-4 col-sm-12 col-xs-12">
|
<div class="form-group col-md-4 col-sm-12 col-xs-12 contact-us-form">
|
||||||
<input type="text" name="contact_no" placeholder="Contact No*" required="required">
|
<input type="tel" class="phone-number" name="contact_no" placeholder="Contact No*" required="required">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-8 col-sm-12 col-xs-12">
|
<div class="form-group col-md-8 col-sm-12 col-xs-12">
|
||||||
@@ -95,3 +95,46 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
|
||||||
|
@push('js')
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$("form[action='{{ route('make-appointment') }}']").on("submit", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
var form = $(this);
|
||||||
|
var url = form.attr("action");
|
||||||
|
|
||||||
|
// Remove previous error messages
|
||||||
|
form.find(".text-danger").remove();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type: "POST",
|
||||||
|
data: form.serialize(),
|
||||||
|
success: function (response) {
|
||||||
|
// Reset form
|
||||||
|
form[0].reset();
|
||||||
|
// Redirect to thank you page
|
||||||
|
window.location.href = "/thankyou";
|
||||||
|
},
|
||||||
|
error: function (xhr) {
|
||||||
|
if (xhr.status === 422) {
|
||||||
|
var errors = xhr.responseJSON.errors;
|
||||||
|
|
||||||
|
$.each(errors, function (key, value) {
|
||||||
|
var field = form.find("[name='" + key + "']");
|
||||||
|
var wrapper = field.closest(".form-group"); // keep error inside the form group
|
||||||
|
wrapper.append('<div class="text-danger mt-1">' + value[0] + '</div>');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// alert("Something went wrong, please try again later.");
|
||||||
|
toast.error("Something went wrong, please try again later.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
@@ -166,9 +166,8 @@
|
|||||||
<div class="text-danger">{{ $message }}</div>
|
<div class="text-danger">{{ $message }}</div>
|
||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12">
|
<div class="col-md-12 appointment-form-field">
|
||||||
<input class="form-control" type="text" name="contact_no" placeholder="Phone *"
|
<input class="form-control phone-number" type="text" name="contact_no" placeholder="Phone *" required>
|
||||||
required>
|
|
||||||
@error('contact_no')
|
@error('contact_no')
|
||||||
<div class="text-danger">{{ $message }}</div>
|
<div class="text-danger">{{ $message }}</div>
|
||||||
@enderror
|
@enderror
|
||||||
@@ -233,3 +232,45 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
|
||||||
|
@push('js')
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$("form[action='{{ route('consultat_with_us') }}']").on("submit", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
var form = $(this);
|
||||||
|
var url = form.attr("action");
|
||||||
|
|
||||||
|
// Remove existing error messages
|
||||||
|
form.find(".text-danger").remove();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type: "POST",
|
||||||
|
data: form.serialize(),
|
||||||
|
success: function (response) {
|
||||||
|
form[0].reset();
|
||||||
|
window.location.href = "/thankyou"; // redirect after success
|
||||||
|
},
|
||||||
|
error: function (xhr) {
|
||||||
|
if (xhr.status === 422) {
|
||||||
|
var errors = xhr.responseJSON.errors;
|
||||||
|
|
||||||
|
$.each(errors, function (key, value) {
|
||||||
|
var field = form.find("[name='" + key + "']");
|
||||||
|
var wrapper = field.closest(".col-md-12"); // keep errors inside column wrapper
|
||||||
|
|
||||||
|
// Append the error message below the field
|
||||||
|
wrapper.append('<div class="text-danger mt-1">' + value[0] + '</div>');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
alert("Something went wrong, please try again later.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
@@ -26,6 +26,9 @@ Route::controller(HomeController::class)
|
|||||||
Route::get('/faqs', 'faqs')->name('faqs');
|
Route::get('/faqs', 'faqs')->name('faqs');
|
||||||
Route::get('/privacy-policy', 'privacyPolicy')->name('privacyPolicy');
|
Route::get('/privacy-policy', 'privacyPolicy')->name('privacyPolicy');
|
||||||
Route::get('/terms-of-service', 'termsOfService')->name('termsOfService');
|
Route::get('/terms-of-service', 'termsOfService')->name('termsOfService');
|
||||||
|
Route::get('/thankyou',function(){
|
||||||
|
return view('thankyou');
|
||||||
|
});
|
||||||
|
|
||||||
Route::post('/subscribe', 'storeSubscription')->name('subscribe');
|
Route::post('/subscribe', 'storeSubscription')->name('subscribe');
|
||||||
Route::post('/contact-us', 'storeContactUs')->name('contactUsMessage');
|
Route::post('/contact-us', 'storeContactUs')->name('contactUsMessage');
|
||||||
|
Reference in New Issue
Block a user