<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en"> <!--<![endif]-->

<head>
    <?php include 'topincludes.php' ?>
</head>

<body data-spy="scroll" data-target="#navmenu" data-offset="70">
   <?php include 'header.php' ?>

    <div class="header-height"></div>
    <section class="page-header padding">
        <div class="container">
            <div class="page-content text-center">
                <h2>Contact Us </h2>
                <p>Let’s build your vision, contact us today</p>
            </div>
        </div>
    </section><!--/.page-header-->

    <section class="contact-section bg-grey padding">
        <div class="dots"></div>
        <div class="container">
            <div class="contact-wrap d-flex align-items-center row">
                <div class="col-md-6 padding-15">
                    <div class="contact-card" style="border: 2px solid black;">

                        <div class="contact-block">
                            <i class="fas fa-headset"></i>
                            <h3>Need Assistance</h3>
                            <p>+91 82705 27575</p>
                        </div>

                        <div class="contact-block">
                            <i class="fas fa-envelope"></i>
                            <h3>Email Us</h3>
                            <p>sparkbuildgroups@gmail.com</p>
                        </div>

                        <div class="contact-block">
                            <i class="fas fa-map-marker-alt"></i>
                            <h3>Visit Us</h3>
                            <p>
                                122/3 Main Road, Opp. GK Hypermarket,<br>
                                Kuthukalvalasai, Tenkasi - 627803,<br>
                                Tamil Nadu.
                            </p>
                        </div>

                    </div>

                </div>
                <div class="col-md-6 padding-15">
                    <div class="contact-form">
    <form action="sendmail.php" method="post" id="ajax_form" class="form-horizontal">
        
        <div class="form-group row">
            <div class="col-sm-6">
                <input type="text" id="name" name="name" class="form-control" placeholder="Name" required>
            </div>

            <div class="col-sm-6">
                <input type="email" id="email" name="email" class="form-control" placeholder="Email" required>
            </div>
        </div>

        <div class="form-group row">
            <div class="col-sm-6">
                <input type="text" id="mobile" name="mobile" class="form-control" placeholder="Mobile Number" required>
            </div>

            <div class="col-sm-6">
                <select id="service" name="service" class="form-control" required>
                    <option value="Select Service" >Select Service</option>
                    <option value="Design & Architect">Design & Architect</option>
                    <option value="Building Construction">Building Construction</option>
                    <option value="Plan & Estimation">Plan & Estimation</option>
                    <option value="Real Estate">Real Estate</option>
                    <option value="Container House">Container House</option>
                </select>
            </div>
        </div>

        <div class="form-group row">
            <div class="col-md-12">
                <textarea id="message" name="message" cols="30" rows="5" class="form-control message" placeholder="Message" required></textarea>
            </div>
        </div>

        <div class="form-group row">
            <div class="col-md-12">
                <button id="submit" class="default-btn" type="submit">Send Message</button>
            </div>
        </div>

        <div id="form-messages" class="alert"></div>
    </form>
</div>


                </div>

            </div>
        </div>
    </section><!--/.contact-section-->
<?php include 'footer.php' ?>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function(){

    // Only allow numbers in mobile
    $('#mobile').on('input', function(){
        this.value = this.value.replace(/[^0-9]/g,'');
    });

    // Display selected text (already handled by HTML, but style can help)
    $('#service').on('change', function(){
        $(this).css('color', '#000'); // ensure selected text is visible
    });

    // AJAX form submit
    $('#ajax_form').submit(function(e){
        e.preventDefault();

        var formData = $(this).serialize();

        $.ajax({
            type: 'POST',
            url: 'sendmail.php', // Your PHP mail script
            data: formData,
            success: function(response){
                $('#form-messages').removeClass('alert-danger').addClass('alert-success').html('Submitted successfully. We will get back to you soon.').show();
                $('#ajax_form')[0].reset();
            },
            error: function(){
                $('#form-messages').removeClass('alert-success').addClass('alert-danger').html('An error occurred. Please try again later.').show();
            }
        });
    });

});
</script>

</body>



</html>