aplus/#9
Mahesh Sharma 2 years ago
parent de651972f3
commit f0ed8eaba0
  1. 22
      app/Http/Controllers/HomeController.php
  2. 100
      resources/views/contact.blade.php
  3. 5
      routes/web.php

@ -20,7 +20,7 @@ use Mail;
use App\Models\User;
use App\Models\Partner;
use PDF;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
class HomeController extends Controller
{
@ -60,11 +60,11 @@ class HomeController extends Controller
return view('ndis-scheme');
}
public function contact(){
// $services = Service::where('status',1)->get();
$services = Service::where('status',1)->get();
$phone = Setting::where(['key' => 'phone','status' => '1'])->first();
$email = Setting::where(['key' => 'email','status' => '1'])->first();
$address = Setting::where(['key' => 'address','status' => '1'])->first();
return view('contact',compact('phone','email','address'));
return view('contact',compact('phone','email','address','services'));
}
public function accommodation_details($id){
@ -73,11 +73,18 @@ class HomeController extends Controller
}
public function send_contact_mail(Request $request){
$this->validate(\request(),[
'fullname' => 'required',
'phone' => 'required',
'email' => 'required',
'service_id' => 'required|numeric',
'entered_captcha_code' => 'required|same:displayed_captcha_code'
]);
$contact = new Contact();
$subject = 'Quick Enquiry';
$check = '';
if(isset($request['firstname'])){
$subject = 'Quick Enquiry';
if(isset($request['check'])){
$subject = 'Contact Enquiry';
$check = '1';
}
$name = ($request['firstname'] != null) ? ($request['firstname'].' '.$request['lastname']) : $request['fullname'] ;
@ -307,4 +314,9 @@ class HomeController extends Controller
return view('blog.single',compact('blog'));
}
public function refreshCaptcha()
{
return response()->json(['captcha_code'=> Str::random(5)]);
}
}

@ -3,6 +3,7 @@
<title>Contact Us</title>
@endsection
@section('content')
<section class="contact-us-section">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
@ -26,69 +27,90 @@
one of our migration agents will be in touch.
</p>
<div class="contact-desc">
<a href="tel: +61 - 047 817 7809" class="contact-phone">
@if($phone !== null)
<a href="tel: {{$phone->value}}" class="contact-phone">
<img src="{{url('frontend/icons/contact-call-icon.svg')}}" alt="">
<h5>+61 - 047 817 7809</h5>
<h5>{{$phone->value}}</h5>
</a>
<a href="mailto: info@aplusagency.com.au" class="contact-phone">
@endif
@if($email !== null)
<a href="mailto: {{$email}}" class="contact-phone">
<img src="{{url('frontend/icons/contact-mail-icon.svg')}}" alt="">
<h5>info@aplusagency.com.au</h5>
<h5>{{$email->value}}</h5>
</a>
@endif
@if($address !== null)
<a href="https://goo.gl/maps/P4Y2PYGMpGa83L2R8" target="_blank" class="contact-phone">
<img src="{{url('frontend/icons/contact-location-icon.svg')}}" alt="">
<h5>Suite 503, Level 5, 368 Sussex Street Sydney, NSW 2000</h5>
<h5>{{$address->value}}</h5>
</a>
@endif
</div>
</div>
</div>
<div class="col-md-7">
<div class="contact-form">
<h2>Please fill-up the form</h2>
<form action="">
@include('success.success')
@include('errors.error')
<form action="{{route('send_contact_mail')}}" method = "post">
@csrf
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="">Full name</label>
<input type="text" class="form-control" placeholder="Enter your name" name="" id="">
<input type="text" class="form-control" placeholder="Enter your name" name="fullname" id="">
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="">Email address</label>
<input type="email" class="form-control" placeholder="Enter your email adress" name="" id="">
<input type="email" class="form-control" placeholder="Enter your email adress" name="email" id="">
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="">Phone</label>
<input type="text" class="form-control" placeholder="Enter your phone number" name="" id="">
<input type="text" class="form-control" placeholder="Enter your phone number" name="phone" id="">
</div>
</div>
<input type = "hidden" name = "check" value = "1"/>
<div class="col-md-6">
<div class="mb-3">
<label for="">Nationality</label>
<select name="" class="form-select" id="">
<option hidden class="hidden-select">Select your Nationality</option>
<option value="1" class="aplus-display-select">China</option>
<option value="2" class="aplus-display-select">Nepal</option>
<option value="3" class="aplus-display-select">India</option>
<label for="">Services</label>
<select name="service_id" id="" class="form-select">
<option hidden>Choose service</option>
@foreach($services as $service)
<option value="{{$service->id}}" class="aplus-display-select">{{$service->name}}</option>
@endforeach
</select>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="">Course</label>
<select name="" id="" class="form-select">
<option hidden>Choose course</option>
<option value="" class="aplus-display-select">Cookery</option>
</select>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="">Enter Captcha</label>
<input type="text" class="form-control" placeholder="Captcha">
</div>
<div class="col-md-12">
@php
$code = Str::random(5);
@endphp
<div class="captcha-field">
<div>
<label>Enter Your Captcha</label>
<input id="captcha" type="text" name = "entered_captcha_code" class="form-control" placeholder="Enter Captcha as Shown" required>
<input type = "hidden" id = "displayed_captcha_code" name = "displayed_captcha_code" value = "{{$code}}"/>
</div>
<div>
<label>Captcha</label>
<div class="captcha-ref">
<input type = "text" id = "captcha_code" readonly class="form-control" name = "captcha_code" value = "{{$code}}"/>
<button id = "refresh"><i class="fas fa-sync-alt"></i></button>
</div>
</div>
</div>
@if ($errors->has('captcha'))
<span class="help-block">
<strong>{{ $errors->first('captcha') }}</strong>
</span>
@endif
</div>
<div class="col-md-12">
<div class="mb-5">
@ -109,4 +131,24 @@
<section class="map-section">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3312.514012872817!2d151.2047258!3d-33.8764135!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x6b12ae3c9ed85d5f%3A0x778da1aae43c7216!2sSuite%20503%2C%20Level%205%2F368%20Sussex%20St%2C%20Sydney%20NSW%202000%2C%20Australia!5e0!3m2!1sen!2snp!4v1670397808126!5m2!1sen!2snp" width="100%" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
</section>
@section('script')
<script>
$('#refresh').click(function(event){
event.preventDefault();
$.ajax({
type:'GET',
url:'refreshcaptcha',
success:function(data){
document.getElementById('captcha_code').readOnly
= false;
document.getElementById('captcha_code').value = (data.captcha_code);
document.getElementById('displayed_captcha_code').value = (data.captcha_code);
document.getElementById('captcha_code').readOnly
= true;
}
});
});
</script>
@endsection
@endsection

@ -47,6 +47,8 @@ Route::get('/about', function () {
return view('about');
});
Route::get('/refreshcaptcha', [HomeController::class,'refreshCaptcha']);
Route::get('/contact', [HomeController::class, 'contact']);
Route::get('/referral', [ReferralController::class, 'create']);
@ -191,9 +193,6 @@ Route::group(['middleware'=>['auth']],function (){
Route::post('clients/{id}',[ClientController::class,'update']);
Route::get('service_faqs',[ServiceFaqController::class,'index']);
Route::get('service_faqs/create',[ServiceFaqController::class,'create']);
Route::post('service_faqs',[ServiceFaqController::class,'store']);

Loading…
Cancel
Save