<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.3/js/bootstrap.min.js"></script>
<script src="<?=site_url;?>/designer/js/wow.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
<script src="<?=site_url;?>/designer/js/themes.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.9.0/jquery.validate.min.js"></script>

<?php include "app_modal.php"; ?>
<script>
setTimeout(function(){ 
   $.getScript("https://www.google.com/recaptcha/api.js");   
 }, 10000)
</script>
<script>
$(document).ready(function() {

$("#contact_form").validate({
    rules: {
            name: "required",
            message: {
                required: true,
           
            },
            location: {
                required: true,
               
            },
            email: {
                required: true,
              
            },
            mobile: {
                required: true,
                number: true,
                minlength: 8,
                maxlength: 12,
            }
        },
        messages: {
            name: "Please enter your name",
            message: {
                required: "Please enter your message",
            
            },

            email: {
                required: "Please enter your email address"
            },
            location: {
                required: "Please enter your location",
            
            },
            mobile: {
                required: "Please enter your mobile no.",
                number: "Mobile No. contains only numbers",
                minlength: "Your Mobile No. must be at least 8-12 digits long",
                maxlength: "Your Mobile No. must be at least 8-12 digits long",
            }
        },
    submitHandler: function(form) { 
        $.ajax({
                url: '<?=site_url;?>/contact.php',
                type: 'POST',
                data: $('#contact_form').serialize(),
                dataType: 'json',
                success: function(response) {
                    if (response.status == true) {
                        $('#pop_up').text(response.message_response).css('color',
                            'green');
                        $('#contact_form')[0].reset();
                        grecaptcha.reset();

                    } else {
                        $('#pop_up').text(response.message_response).css('color',
                            'red');

                    }
                }
            });

    }
});
});

$(document).ready(function() {

$("#enq_pop_form1").validate({
    rules: {
            name: "required",
            message: {
                required: true,
           
            },
            location: {
                required: true,
               
            },
            email: {
                required: true,
              
            },
            mobile: {
                required: true,
                number: true,
                minlength: 8,
                maxlength: 12,
            }
        },
        messages: {
            name: "Please enter your name",
            message: {
                required: "Please enter your message",
            
            },

            email: {
                required: "Please enter your email address"
            },
            location: {
                required: "Please enter Your Location",
            
            },
            mobile: {
                required: "Please enter your mobile no.",
                number: "Mobile No. contains only numbers",
                minlength: "Your Mobile No. must be at least 8-12 digits long",
                maxlength: "Your Mobile No. must be at least 8-12 digits long",
            }
        },
    submitHandler: function(form) { 
        $.ajax({
                url: '<?=site_url;?>/enquiry_popup.php',
                type: 'POST',
                data: $('#enq_pop_form1').serialize(),
                dataType: 'json',
                success: function(response) {
                    if (response.status == true) {
                        $('#enq_pop_up').text(response.message_response).css('color',
                            'green');
                        $('#enq_pop_form1')[0].reset();
                        grecaptcha.reset();

                    } else {
                        $('#enq_pop_up').text(response.message_response).css('color',
                            'red');

                    }
                }
            });

    }
});
});

$(document).ready(function() {

$("#product_pop_form").validate({
    rules: {
            name: "required",
            message: {
                required: true,
           
            },
            location: {
                required: true,
               
            },
            email: {
                required: true,
              
            },
            mobile: {
                required: true,
                number: true,
                minlength: 8,
                maxlength: 12,
            }
        },
        messages: {
            name: "Please enter your name",
            message: {
                required: "Please enter your message",
            
            },

            email: {
                required: "Please enter your email address"
            },
            location: {
                required: "Please enter Your Location",
            
            },
            mobile: {
                required: "Please enter your mobile no.",
                number: "Mobile No. contains only numbers",
                minlength: "Your Mobile No. must be at least 8-12 digits long",
                maxlength: "Your Mobile No. must be at least 8-12 digits long",
            }
        },
    submitHandler: function(form) { 
        $.ajax({
                url: '<?=site_url;?>/enquirycat_popup.php',
                type: 'POST',
                data: $('#product_pop_form').serialize(),
                dataType: 'json',
                success: function(response) {
                    if (response.status == true) {
                        $('#cat_pop_up').text(response.message_response).css('color',
                            'green');
                        $('#product_pop_form')[0].reset();
                        grecaptcha.reset();

                    } else {
                        $('#cat_pop_up').text(response.message_response).css('color',
                            'red');

                    }
                }
            });

    }
});
});
$(document).ready(function() {

$("#callback_form").validate({
    rules: {
        name: "required",
           
            mobile: {
                required: true,
                number: true,
                minlength: 8,
                maxlength: 12,
            }
        },
        messages: {
            name: "Please enter your name",
            mobile: {
                required: "Please enter your mobile no.",
                number: "Mobile No. contains only numbers",
                minlength: "Your Mobile No. must be at least 8-12 characters long",
            }
        },
    submitHandler: function(form) { 
        $.ajax({
                url: '<?=site_url;?>/ajax_enq_action.php',
                type: 'POST',
                data: $('#callback_form').serialize(),
                dataType: 'json',
                success: function(response) {
                    if (response.status == true) {
                        $('#cpop_up').text(response.message_response).css('color',
                            'green');
                        $('#callback_form')[0].reset();
                        grecaptcha.reset();

                    } else {
                        $('#cpop_up').text(response.message_response).css('color',
                            'red');

                    }
                }
            });

    }
});
});


$(document).ready(function(){
  $('#whatsEnq').click(function(e){
      
    
         e.preventDefault();
     var wname = $('#wmname').val();
     var wmobile = $('#wmobile').val();
     $.ajax({
          url: "<?=site_url;?>/whatsapp_enq.php",
          data:$('#contact_id').serialize(),
         type : "POST",
         success : function(data){
               
             if(data.trim() == 'success')
                 {
                    
                 $('#whatsapp_response').html('<div class="alert alert-success">Whatsapp Enquiry Submitted successfully</div>');
                    $('#whatsappEnq').trigger('reset');
                     
                     window.open("https://api.whatsapp.com/send?phone=919372076067&text=&source=&data=&app_absent=","_blank");
                     $('#contact_id')[0].reset();
                     document.getElementById('contact_id').reset();
                 }
             else{
                
                 $('#whatsapp_response').html(data);
             }
         }
        
     })
          
      })
  })  

</script>
