You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

2 rivejä
3.1 KiB

  1. $(".contact_btn").on("click",function(){$(".contact_btn i").removeClass("d-none");var e,i="true",l=$("#contact-form-data").serializeArray();if($("#contact-form-data input").each(function(){$(this).val()||(i="false")}),i==="true"){var n=window.location.pathname.split("/"),r=n[3],a;r?a="../vendor/contact-mailer.php":a="vendor/contact-mailer.php",$.ajax({type:"POST",url:a,data:l,dataType:"json",success:function(t){t.type=="error"?e='<div class="alert-danger" style="padding:10px 15px; margin-bottom:30px;">'+t.text+"</div>":(e='<div class="alert-success" style="padding:10px 15px; margin-bottom:30px;">'+t.text+"</div>",$(".contact-form input").val(""),$(".contact-form textarea").val("")),$("#result").length?($("#result").hide().html(e).slideDown(),$(".contact_btn i").addClass("d-none")):t.type=="error"?(Swal.fire({type:"error",icon:"error",title:"Oops...",html:'<div class="text-danger">'+t.text+"</div>"}),$(".contact_btn i").addClass("d-none")):(Swal.fire({type:"success",icon:"success",title:"Success!",html:'<div class="text-success">'+t.text+"</div>"}),$(".contact_btn i").addClass("d-none"))},error:function(){alert("Failer")}})}else $("#result").length?(e='<div class="alert-danger" style="padding:10px 15px; margin-bottom:30px;">Please provide the missing fields.</div>',$("#result").hide().html(e).slideDown(),$(".contact_btn i").addClass("d-none")):(Swal.fire({icon:"error",type:"error",title:"Oops...",html:'<div class="text-danger">Please provide the missing fields.</div>'}),$(".contact_btn i").addClass("d-none"))});$(".modal_contact_btn").on("click",function(){$(".modal_contact_btn i").removeClass("d-none");var e,i="true",l=$("#modal-contact-form-data").serializeArray();if($("#modal-contact-form-data input").each(function(){$(this).val()||(i="false")}),i==="true"){var n=window.location.pathname.split("/"),r=n[3],a;r?a="../vendor/contact-mailer.php":a="vendor/contact-mailer.php",$.ajax({type:"POST",url:a,data:l,dataType:"json",success:function(t){t.type=="error"?e='<div class="alert-danger" style="padding:10px 15px; margin-bottom:30px;">'+t.text+"</div>":(e='<div class="alert-success" style="padding:10px 15px; margin-bottom:30px;">'+t.text+"</div>",$(".contact-form input").val(""),$(".contact-form textarea").val("")),$("#quote_result").length?($("#quote_result").hide().html(e).slideDown(),$(".modal_contact_btn i").addClass("d-none")):t.type=="error"?(Swal.fire({type:"error",icon:"error",title:"Oops...",html:'<div class="text-danger">'+t.text+"</div>"}),$(".modal_contact_btn i").addClass("d-none")):(Swal.fire({type:"success",icon:"success",title:"Success!",html:'<div class="text-success">'+t.text+"</div>"}),$(".modal_contact_btn i").addClass("d-none"))},error:function(){alert("Failer")}})}else $("#quote_result").length?(e='<div class="alert-danger" style="padding:10px 15px; margin-bottom:30px;">Please provide the missing fields.</div>',$("#quote_result").hide().html(e).slideDown(),$(".modal_contact_btn i").addClass("d-none")):(Swal.fire({icon:"error",type:"error",title:"Oops...",html:'<div class="text-danger">Please provide the missing fields.</div>'}),$(".modal_contact_btn i").addClass("d-none"))});