<?php
include("admin/connection.php");
include('include/header.php');
?>
<?php
$query = "SELECT * FROM `header` LIMIT 1";
$sql = mysqli_query($con, $query);
$row = mysqli_fetch_assoc($sql);
?>
<div class="breadcumb-wrapper" data-bg-src="assets/img/hero/banner1.webp">
    <div class="container">
        <div class="breadcumb-content">
            <h1 class="breadcumb-title">Contact</h1>
            <ul class="breadcumb-menu">
                <li><a href="<?php path(); ?>/index.php">Home</a></li>
                <li>Contact Us</li>
            </ul>
        </div>
    </div>
</div>
<div class="contact-area-2 space-top" id="contact-sec">
    <div class="container">
        <div class="row gy-4 justify-content-center">
            <div class="col-xl-4 col-lg-6 contact-feature-wrap">
                <div class="contact-feature">
                    <div class="contact-feature-icon"><i class="fas fa-location-dot"></i></div>
                    <div class="media-body">
                        <p class="contact-feature_label">Address</p>
                        <a href="" class="contact-feature_link">
                            <?php echo $row['address']; ?></a>
                    </div>
                </div>
            </div>
            <div class="col-xl-4 col-lg-6 contact-feature-wrap">
                <div class="contact-feature">
                    <div class="contact-feature-icon"><i class="fas fa-phone"></i></div>
                    <div class="media-body">
                        <p class="contact-feature_label">Phone Number</p>
                        <?php
                        $phones = strip_tags($row['phone']);
                        $phoneList = preg_split('/<br\s*\/?>|,/', $phones);

                        foreach ($phoneList as $phone) {
                            $cleanDisplay = trim($phone);
                            $cleanTel = preg_replace('/\D/', '', $cleanDisplay); // Remove non-numeric characters

                            if (!empty($cleanTel)) {
                                echo '<a href="tel:+91' . $cleanTel . '" class="contact-feature_link">+91 ' . htmlspecialchars($cleanTel) . '</a><br>';
                            }
                        }
                        ?>

                    </div>
                </div>
            </div>
            <div class="col-xl-4 col-lg-6 contact-feature-wrap">
                <div class="contact-feature">
                    <div class="contact-feature-icon"><i class="fas fa-envelope"></i></div>
                    <div class="media-body">
                        <p class="contact-feature_label">Email Address</p>
                        <a href="mailto:admission@examplemail.edu" class="contact-feature_link">
                            <?php echo $row['email']; ?></a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="contact-form-area mb-5">
    <div class="container">
        <div class="row gx-0">
            <div class="col-xl-12">
                <div class="contact-all-wrapper">
                    <div class="contact-form-wrap">
                        <form action="" method="POST" class="contact-form" onsubmit="return gotoChatService(event)">
                            <h3 class="form-title">Do you have questions? Contact Us</h3>
                            <div class="row">
                                <div class="form-group col-md-6">
                                    <input type="text" class="form-control" name="name" id="Name" placeholder="Name *"
                                        oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')" required>
                                </div>
                                <div class="form-group col-md-6">
                                    <input type="tel" class="form-control" name="number" id="Phone" placeholder="Phone *"
                                        maxlength="10" oninput="this.value = this.value.replace(/[^0-9]/g, '')" required>
                                </div>
                                <div class="form-group col-md-12">
                                    <input type="email" class="form-control" name="email" id="Email" placeholder="Email Address *" required>
                                </div>
                                <div class="form-group col-md-12">
                                    <select name="subject" id="Service" class="orderby" required>
                                        <option value="" disabled selected hidden>Select Service</option>
                                        <option value="Sliding UPVC Door">Sliding UPVC Door</option>
                                        <option value="Casement UPVC Door">Casement UPVC Door</option>
                                        <option value="Slide & Fold UPVC Door">Slide & Fold UPVC Door</option>
                                        <option value="Designer UPVC Door">Designer UPVC Door</option>
                                        <option value="Casement UPVC Windows">Casement UPVC Windows</option>
                                        <option value="Sliding Windows">Sliding Windows</option>
                                        <option value="Top Hung Windows">Top Hung Windows</option>
                                        <option value="Tilt and Turn UPVC Windows">Tilt and Turn UPVC Windows</option>
                                        <option value="Coloured upvc Window">Coloured upvc Window</option>
                                        <option value="Villa Window">Villa Window</option>
                                        <option value="Bay Window">Bay Window</option>
                                    </select>
                                </div>
                                <div class="form-group col-12">
                                    <textarea name="message" id="Message" cols="30" rows="3" class="form-control" placeholder="Your Message *" required></textarea>
                                </div>
                                <div class="form-btn text-start col-12">
                                    <button name="submit" class="th-btn radius">Send message</button>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="contact-form-thumb overflow-hidden">
                        <img src="assets/img/about/contact.png" alt="img">
                    </div>
                </div>
            </div>
            <div class="col-lg-12 mt-5">
                <iframe src="https://www.google.com/maps/embed?pb=!1m17!1m12!1m3!1d3516.3870524095796!2d76.62035747548485!3d28.195550875906267!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m2!1m1!2zMjjCsDExJzQ0LjAiTiA3NsKwMzcnMjIuNiJF!5e0!3m2!1sen!2sin!4v1753789070156!5m2!1sen!2sin"
                    width="100%" height="200" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
            </div>
        </div>
    </div>
</div>

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