Edit File: contactUs.blade.php
@extends('layouts.delegates_dashboard_layout') @section('title') {{Session::has('lang')&&Session::get('lang')=='en'?'contact us':' تواصل معنا'}} @endsection @section('style') @endsection @section('content') <div class="table-cont p-2 "> <div class="row align-items-center"> <div class="dash-title col-md p-0 mt-0"> <h6 class="bold"> {{ __('dashboard.site.contact_us') }}</h6> <p class="mb-1"> {{ __('delegates_dashboard.contact_with_us') }}</p> </div> </div> <form id="sendForm" method="POST" > @csrf <div class=" white-bg round7 mb-3 mt-2 p-3"> <h6 class="bold border-bottom pt-3 pb-3 mb-4"> {{ __('dashboard.site.contact_us') }}</h6> <div class="w-md-75 "> <div class="form-group"> <label class="bold font14" for="exampleInputEmail1"> {{ trans('delegates_dashboard.company_name') }} <span style="color: #ff3333;margin: auto 20px;"> * </span></label> <input type="text" name='name' class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="{{ __('validation.attributes.name') }} "> </div> <div class="form-group"> <label class="bold font14" for="Password1"> {{ trans('delegates_dashboard.email') }} </label> <input type="email" name='email' class="form-control" aria-describedby="emailHelp" placeholder="{{ __('dashboard.site.enter_your_email_address') }}"> </div> <div class="form-group"> <label class="bold font14" for="exampleInputEmail1"> {{ __('dashboard.contact_us.message_content') }} <span style="color: #ff3333;margin: auto 20px;"> * </span></label> <textarea type="text" rows="6" name='message' class="form-control" id="exampleInputEmail1" placeholder=" {{ __('dashboard.messages.write_your_message_here') }} "></textarea> </div> </div> </div> <button type='submit' id="sendbtn" class="button1 mt-3 material-button" > {{ __('delegates_dashboard.send') }} </button> </form> </div> @endsection @section('scripts') <script> $("#sendbtn").on('click',function(e){ e.preventDefault(); var form = $('#sendForm').get(0); var formData = new FormData(form); var oldText = $(this).text(); $(this).prop('disabled', true).css({ opacity:'0.5' }).text("{{trans('delegates_dashboard.loading')}}"); $.ajax({ url:"{{route('delegates_dashboard.postContactUs')}}", type:"POST", data: formData, dataType: "json", processData: false, contentType: false, cache: false, success:function(data){ $('#sendbtn').removeAttr("disabled").css({ opacity:'1' }).text(oldText); if(data.key =='success'){ Swal.fire({ title: data.title, position:'top', timer: 15000, type:'success', showCloseButton: false, showConfirmButton:false, animation: true }) location.assign(data.msg); }else{ Swal.fire({ title: data.msg, position:'top', timer: 3000, type:'error', showCloseButton: false, showConfirmButton:false, animation: true }) } } }); }); </script> @endsection
Back to File Manager