<!DOCTYPE html>
<html lang="en">

<head>
    <?php include("include/meta.php");?>
    <?php include("include/css.php");?>
</head>

<body>
    <?php include("include/preloader.php");?>
    <?php include("include/header.php");?>


    <!-- Page Header Start -->
    <div class="container-fluid page-header py-5 position-relative overflow-hidden">
        <video class="bg-video" autoplay muted loop playsinline>
            <source src="./images/banner.mp4" type="video/mp4">
            Your browser does not support the video tag.
        </video>
        <div class="video-overlay"></div>
        <div class="container py-5 position-relative z-1">
            <h1 class="display-3 text-white mb-3 animated slideInDown">Contact Us</h1>
            <nav aria-label="breadcrumb animated slideInDown">
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a class="text-white" href="index.php">Home</a></li>
                    <li class="breadcrumb-item text-white active" aria-current="page">Contact</li>
                </ol>
            </nav>
        </div>
    </div>
    <!-- Page Header End -->

    <!-- Quote Start -->
    <div class="container-fluid overflow-hidden px-lg-0 pt-5">
        <div class="container quote px-lg-0">
            <div class="section-title text-center">
                <h1 class="display-5 mb-4">For More Information Contact</h1>
            </div>
            <div class="row align-items-center pt-5">
                <div class="col-lg-6 ps-lg-0 pb-5">
                    <div class="" style="position: relative;">
                        <div class="contact_info_sec">
                            <h4>Contact Info</h4>
                            <div class="d-flex info_single align-items-center">
                                <a href="tel:<?php echo $h_row['uothcontact']; ?>">
                                    <i class="fas fa-phone-alt"></i>
                                    <span><?php echo $h_row['uothcontact']; ?></span></a>
                            </div>
                            <div class="d-flex info_single align-items-center">
                                <a href="https://api.whatsapp.com/send?phone=91<?php echo $h_row['uwhatsapp']; ?>"><i
                                        class="fab fa-whatsapp"></i><?php echo $h_row['uwhatsapp']; ?></a>
                            </div>
                            <div class="d-flex info_single align-items-center">
                                <a class="" href="mailto:<?php echo $h_row["umail"]; ?>"><i
                                        class="fas fa-envelope-open-text"></i>
                                    <span><?php echo $h_row["umail"]; ?></span></a>
                            </div>
                            <div class="d-flex info_single align-items-center">
                                <i class="fas fa-map-marked-alt"></i>
                                <span><?php echo $h_row['uaddress1']; ?></span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-6 pb-5 quote-text wow fadeIn" data-wow-delay="0.5s">
                    <div class="p-lg-5 me-lg-0 p-3 pt-4" style="border: 2px solid #0184bc;border-radius: 7px;">
                        <h4 class="text-center mb-3" style="color:#0184bc">Contact Us</h4>
                        <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: 65px;"></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="submit"
                                        type="submit">Submit</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- Quote End -->

    <!-- Map Start -->
    <div class="container-fluid overflow-hidden">
        <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>
    <!-- Map end -->


    <?php include("include/footer.php");?>
    <?php include("include/js.php");?>
</body>

</html>

<?php
if (isset($_POST['submit'])) {
	$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
	}
}
?>