<!-- Footer Start -->
<div class="container-fluid bg-dark text-light footer pt-5 wow fadeIn" data-wow-delay="0.1s">
    <div class="container py-5">
        <div class="row g-5">
            <div class="col-lg-4 col-md-6">
                <h3 class="text-light mb-4">Get Connected:</h3>
                <p class="mb-2"><a class="text-white" href="tel:+91 <?php echo $h_row["uothcontact"]; ?>"><i
                            class="fa fa-phone-alt me-3"></i> +91
                        <?php echo $h_row["uothcontact"]; ?></a></p>
                <p class="mb-2"><a class="text-white"
                        href="https://api.whatsapp.com/send?phone=91<?php echo $h_row['uwhatsapp']; ?>"><i
                            class="fab fa-whatsapp me-3"></i> +91 <?php echo $h_row['uwhatsapp']; ?></p>
                <p class="mb-2"><a class="text-white" href="mailto:<?php echo $h_row["umail"]; ?>"><i
                            class="fa fa-envelope me-3"></i>
                        <span><?php echo $h_row["umail"]; ?></span></a></p>
                <p class="mb-2"><i class="fa fa-map-marker-alt me-3"></i><?php echo $h_row['uaddress1']; ?></p>

                <div class="d-flex pt-2">
                    <a class="btn btn-sm-rounded bg-white text-primary me-1" href="<?php echo $h_row["ufburl"]; ?>"><i
                            class="fab fa-facebook-f"></i></a>
                    <a class="btn btn-sm-rounded bg-white text-primary me-1" href="<?php echo $h_row["linkdin"]; ?>"><i
                            class="fab fa-linkedin-in"></i></a>
                    <a class="btn btn-sm-rounded bg-white text-primary me-0" href="<?php echo $h_row["uinsta"]; ?>"><i
                            class="fab fa-instagram"></i></a>
                </div>
            </div>
            <div class="col-lg-4 col-md-6">
                <div class="footer-form">
                    <form method="POST" action="">
                        <div class="row g-3">
                            <div class="col-12 col-sm-12">
                                <input type="text" class="form-control form-inp-css" name="name"
                                    placeholder="Your Name">
                            </div>
                            <div class="col-12 col-sm-12">
                                <input type="email" class="form-control form-inp-css" name="email"
                                    placeholder="Your Email">
                            </div>
                            <div class="col-12 col-sm-12">
                                <input type="text" class="form-control form-inp-css" name="phone"
                                    placeholder="Your Mobile">
                            </div>
                            <div class="col-12 col-sm-12">
                                <input type="text" class="form-control form-inp-css" name="subject"
                                    placeholder="Subject">
                            </div>
                            <div class="col-12">
                                <textarea class="form-control form-inp-css" name="message" placeholder="Message"
                                    style="height: 45px;"></textarea>
                            </div>
                            <div class="col-12">
                                <div class="row">
                                    <div class="col-8">
                                        <input type="text" name="otp_input" maxlength="4"
                                            class="form-control form-inp-css" placeholder="Enter OTP shown">
                                    </div>
                                    <div class="col-4">
                                        <!-- OTP Row -->
                                        <?php $capcha_code = rand(1000, 9999);?>
                                        <input type="text" class="form-control text-center text-success fw-bold"
                                            name="capcha_code" value="<?php echo $capcha_code; ?>" readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="col-12">
                                <button class="btn btn-primary w-100 py-3" name="send_footer"
                                    type="submit">Submit</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <div class="col-lg-4 col-md-6">
                <iframe
                    src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d14737.060839605498!2d88.3452396!3d22.5691821!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3a0277a3bfffffff%3A0x6bd85e50f8bd8469!2sHastings%20Chambers!5e0!3m2!1sen!2sin!4v1714375713945!5m2!1sen!2sin"
                    width="100%" height="300" style="border:0;" allowfullscreen="" loading="lazy"
                    referrerpolicy="no-referrer-when-downgrade"></iframe>
            </div>
        </div>
    </div>
    <div class="container">
        <div class="copyright">
            <div class="row">
                <div class="col-md-6 text-center text-md-start mb-3 mb-md-0">
                    &copy; <a class="border-bottom" href="https://ayushlpo.com/">Ayush LPO</a>, All Right Reserved.
                </div>
                <div class="col-md-6 text-center text-md-end">
                    Designed By <a class="border-bottom" href="https://www.digix.in/">DigiX Technology</a>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Footer End -->


<!-- Back to Top -->
<a href="#" class="btn btn-lg btn-primary btn-lg-square rounded-0 back-to-top"><i class="bi bi-arrow-up"></i></a>

<?php
if (isset($_POST['send_footer'])) {
	$name = $_POST["name"];
	$email = $_POST["email"];
	$phone = $_POST["phone"];
	$subject = $_POST["subject"]; 
	$userMessage = $_POST["message"];

	$otp_input = $_POST["otp_input"];
	$capcha_code = $_POST["capcha_code"];

    if ($otp_input != $capcha_code) {
    ?>
<script>
alert("Code Mismatch. Please enter the correct code.");
window.location = "<?php echo $_SERVER['PHP_SELF']; ?>";
</script>
<?php
    exit;
}
						
                          
    $conref = $x;
    $concreatedon = date("j F, Y, g:i a");

    $ins_sql = "INSERT INTO contact (conname, conno, consubject, conemail, conmessage, conref, concreatedon) VALUES ( '$name', '$phone', '$subject', '$email', '$userMessage', '$conref', '$concreatedon')";

    // echo "<pre>";print_r($ins_sql);exit();
    if( mysqli_query($con, $ins_sql) ){
	?>
<script>
alert("Details Sent Successfully");
window.location = "<?php echo $_SERVER['PHP_SELF']; ?>";
</script>
<?php
	} else {
	?>
<script>
alert("Something's Wrong");
window.location = "<?php echo $_SERVER['PHP_SELF']; ?>";
</script>
<?php
	}
}
?>