<?php include('inc/header.php'); ?>



    <!-- Hero Section Begin -->
    <section class="hero-section">
        <div class="container">
            <div class="row">
                <div class="col-lg-6">
                    <div class="hero-text">
                        <h1>Let us exceed your expectations </h1>
                        <p>and make your special day unforgettable at Vedantara Farms</p>
                        <!--<a href="#" class="primary-btn">Discover Now</a>-->
                    </div>
                </div>
                <div class="col-xl-3 col-lg-4 offset-xl-2 offset-lg-1">
                    <div class="booking-form">
                        <!--<h4>Booking Now</h4>-->
                        <form method="POST">
                            <div class="check-date">
                                <label>Name:</label>
                                <input type="text" name="name">
                                
                            </div>
                            <div class="check-date">
                                <label>Phone No:</label>
                                <input type="text" class="phone" name="phone" required> 
                            </div>
                            <div class="check-date">
                                <label>Gathering:</label>
                                <input type="text" name="subject">
                            </div>
                            <div class="check-date">
                                <label for="date-out">Date of function:</label>
                                <input type="text" class="date-input" name="email" id="date-out">
                                <!--<i class="icon_calendar"></i>-->
                            </div>
                            <div class="check-date">
                                <label>Message:</label>
                                <textarea type="text" row="4" name="message" cols="4" style="width: 100%;
    height: 80px;
    border: 1px solid #ebebeb;
    border-radius: 2px;
    font-size: 16px;
    color: #2B4279;
    font-weight: 500;
    padding-left: 20px;"></textarea> 
                            </div>
                            
                            <button type="submit" name="send-message">Secure Your Booking</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <div class="hero-slider owl-carousel">
        <?php   
$statement = $pdo->prepare("SELECT banners,mbanner FROM banners where page_name='Home'");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) {
?>
            <div class="hs-item set-bg" data-setbg="admin/assets/images/banner-image/<?php echo $row['banners']; ?>"></div>

            <?php  }  ?>
            <!-- <div class="hs-item set-bg" data-setbg="img/hero/hero-2.jpg"></div>
            <div class="hs-item set-bg" data-setbg="img/hero/hero-3.jpg"></div> -->
        </div>
    </section>
    <!-- Hero Section End -->

    <!-- About Us Section Begin -->
    <section class="aboutus-section spad">
        <div class="container">
            <div class="row">
                <div class="col-lg-6">
                    <div class="about-text">
                        <div class="section-title">
                            <span>About Us</span>
                            <?php   
$statement = $pdo->prepare("SELECT * FROM tbl_slider");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) { }
?>
                            <h2><?php echo $row['heading']; ?></h2>
                        </div>
                        <p class="f-para" style="text-align: justify;"><?php echo $row['content']; ?></p>
                        
                        <a href="about-us.php" class="primary-btn about-btn">Read More</a>
                    </div>
                   
                </div>

                <div class="col-lg-6">
                    
                   <img src="admin/assets/images/slider-image/<?php echo $row['photo']; ?>" alt="" style="height:100%; width:100%; border-top-left-radius: 40%; border-bottom-right-radius: 40%; ">

                </div>
                
            </div>
        </div>
    </section>
    <!-- About Us Section End -->

    <!-- Services Section End -->
    <section class="services-section spad">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <div class="section-title">
                        <span>Our Service</span>
                        <h2>Meetings & Celebrations</h2>
                    </div>
                </div>
            </div>
             <div class="about-page-services">
                <div class="row">

                <?php   
$statement = $pdo->prepare("SELECT * FROM tbl_product limit 6");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) { 
    $p_id = $row['p_id'];
?>
                    <div class="col-md-4">
                        <a href="<?php path(); ?>facilities/<?php echo $row['slug'] ?>">
                            <?php
                            $statement = $pdo->prepare("SELECT * FROM tbl_product_photo WHERE p_id=$p_id");
$statement->execute();
$result1 = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result1 as $row1) { }
                            ?>
                        <div class="ap-service-item set-bg" data-setbg="https://vedantarafarms.com/admin/assets/images/product-image/<?php echo $row1['photo']; ?>">
                            <div class="api-text">
                                <h3><?php echo $row['p_name']; ?></h3>
                            </div>
                        </div>
                        </a>
                    </div>
<?php } ?>
                   <div class="col-md-4 mx-auto">
                       <center>
                           <a href="<?php path(); ?>facilities" class="btn btn-danger">View More Facilities</a>
                       </center>
                   </div>
                </div>
            </div>
        </div>
    </section>
    <!-- Services Section End -->
    
    <section class="services-section spad">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <div class="section-title">
                        <span>Our Service</span>
                        <h2>Why Choose Us?</h2>
                    </div>
                </div>
            </div>
            <div class="row">

           
                <div class="col-lg-4 col-sm-6 mb-3">
                    <div class="service-item-event" style="height: 265px;">
                        
                        <p style="text-align: justify;">Choosing Vedantara Farms for your luxury farmhouse experience means immersing yourself in unparalleled elegance and comfort. Nestled in a serene landscape, our farmhouses boast state-of-the-art amenities, ensuring your stay is both relaxing and indulgent.</p>
                    </div>
                </div>
                
                <div class="col-lg-4 col-sm-6 mb-3">
                    <div class="service-item-event" style="height: 265px;">
                        
                        <p style="text-align: justify;">Our commitment to sustainable luxury sets us apart, with eco-friendly practices that enhance your experience without compromising the environment. At Vedantara Farms, personalized services meet exquisite design, creating an intimate haven where every detail is tailored to your preferences. </p>
                    </div>
                </div>
                
                <div class="col-lg-4 col-sm-6 mb-3">
                    <div class="service-item-event" style="height: 265px;">
                        
                        <p style="text-align: justify;">Whether you seek a tranquil retreat or an adventurous getaway, Vedantara Farms offers a unique blend of natural beauty, innovative comforts, and impeccable hospitality, making it the quintessential choice for discerning guests who desire the best.</p>
                    </div>
                </div>

            </div>
        </div>
    </section>
    
    <section class="services-section spad">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <div class="section-title">
                        <span>Our Gallery</span>
                        <h2>Our Gallery</h2>
                    </div>
                </div>
            </div>
           <div id="marquee">
        <div class="container">
            <div class="pic-container">
                <?php
    $statement = $pdo->prepare("SELECT photo FROM tbl_photo where caption='Image'");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) {

    ?>
                <div class="pic">
                    <img src="admin/assets/images/gallery/<?php echo $row['photo']; ?>" alt="img" style="height: 200px;">
                </div>
<?php
    }
    ?>
            </div>
        </div>
    </div>
        </div>
    </section>
    
    

    <!-- Home Room Section Begin -->
    <!--<section class="hp-room-section">-->
    <!--    <div class="container-fluid">-->
    <!--        <div class="hp-room-items">-->
    <!--            <div class="row">-->

                <?php   
// $statement = $pdo->prepare("SELECT * FROM tbl_product");
// $statement->execute();
// $result = $statement->fetchAll(PDO::FETCH_ASSOC);
// foreach ($result as $row) {

//     $statement = $pdo->prepare("SELECT * FROM tbl_product_photo WHERE p_id=?");
// 			                        	$statement->execute(array($row['p_id']));
// 			                        	$result = $statement->fetchAll(PDO::FETCH_ASSOC);
// 			                        	foreach ($result as $row1) {}
?>

                    <!--<div class="col-lg-3 col-md-6">-->
                        <!--<div class="hp-room-item set-bg" data-setbg="admin/assets/images/product-image/<?php //echo $row1['photo']; ?>">-->
                    <!--        <div class="hr-text">-->
                                <!--<h3><?php //echo $row['p_name'];  ?></h3>-->
                                <!--<h2>Rs. <?php //echo $row['p_current_price'];  ?><span>/Pernight</span></h2>-->
                    <!--            <table>-->
                    <!--                <tbody>-->
                    <!--                    <tr>-->
                    <!--                        <td class="r-o">Size:</td>-->
                    <!--                        <td>30 ft</td>-->
                    <!--                    </tr>-->
                    <!--                    <tr>-->
                    <!--                        <td class="r-o">Capacity:</td>-->
                    <!--                        <td>Max persion 5</td>-->
                    <!--                    </tr>-->
                    <!--                    <tr>-->
                    <!--                        <td class="r-o">Bed:</td>-->
                    <!--                        <td>King Beds</td>-->
                    <!--                    </tr>-->
                    <!--                    <tr>-->
                    <!--                        <td class="r-o">Services:</td>-->
                    <!--                        <td>Wifi, Television, Bathroom,...</td>-->
                    <!--                    </tr>-->
                    <!--                </tbody>-->
                    <!--            </table>-->
                    <!--            <a href="room-details.php?id=<?php echo $row['p_id']; ?>" class="primary-btn">More Details</a>-->
                    <!--        </div>-->
                    <!--    </div>-->
                    <!--</div>-->

<?php //} ?>

                   
              
    <!--            </div>-->
    <!--        </div>-->
    <!--    </div>-->
    <!--</section>-->
    <!-- Home Room Section End -->
    
    <div id="projectFacts" class="sectionClass">
    <div class="fullWidth eight columns">
        <div class="projectFactsWrap ">
            <div class="item wow fadeInUpBig animated animated" data-number="12" style="visibility: visible;">
                <i class="fa fa-briefcase"></i>
                <p id="number1" class="number">12</p>
                <span></span>
                <p>Projects done</p>
            </div>
            <div class="item wow fadeInUpBig animated animated" data-number="55" style="visibility: visible;">
                <i class="fa fa-smile-o"></i>
                <p id="number2" class="number">55</p>
                <span></span>
                <p>Happy clients</p>
            </div>
            <div class="item wow fadeInUpBig animated animated" data-number="359" style="visibility: visible;">
                <i class="fa fa-coffee"></i>
                <p id="number3" class="number">359</p>
                <span></span>
                <p>Cups of coffee</p>
            </div>
            <div class="item wow fadeInUpBig animated animated" data-number="246" style="visibility: visible;">
                <i class="fa fa-camera"></i>
                <p id="number4" class="number">246</p>
                <span></span>
                <p>Photos taken</p>
            </div>
        </div>
    </div>
</div>


 <section class="blog-section pb-0">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <div class="section-title">
                        <span>Video</span>
                        <h2>Our Event Video</h2>
                    </div>
                </div>
            </div>
            <div class="row">
                 <?php
    $statement = $pdo->prepare("SELECT Video FROM tbl_photo where caption='Video'");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) {

    ?> 
                <div class="col-lg-6 mb-3">
                  
                    <div class="embed-responsive embed-responsive-16by9">
                        <iframe class="embed-responsive-item" src="<?php echo $row['Video']; ?>" allowfullscreen></iframe>
                    </div>
                     
                </div>
      <?php
}
?>
 
            </div>
        </div>
    </section>
    
    <!-- Testimonial Section Begin -->
    <section class="testimonial-section spad">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <div class="section-title">
                        <span>Testimonials</span>
                        <h2>What Customers Say?</h2>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-8 offset-lg-2">
                    <div class="testimonial-slider owl-carousel">

                    <?php   
$statement = $pdo->prepare("SELECT * FROM tbl_faq");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) {

   
			                        	
?>
                        <div class="ts-item">
                            <p><?php echo $row['faq_content'];  ?></p>
                            <div class="ti-author">
                                <div class="rating">
                                <?php for ($i=1; $i <= $row['rating'] ; $i++) { 
                                    ?>
                                    <i class="icon_star"></i>
                                   <?php } ?>
                                    <!-- <i class="icon_star-half_alt"></i> -->
                                </div>
                                <h5> - <?php echo $row['faq_title'];  ?></h5>
                            </div>
                        </div>
                        <?php  } ?>

                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- Testimonial Section End -->

    <!-- Blog Section Begin -->
    <section class="blog-section spad">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <div class="section-title">
                        <span>Farm News</span>
                        <h2>Our Blog & News</h2>
                    </div>
                </div>
            </div>
            
            
            <div class="row">
            <?php   
$statement = $pdo->prepare("SELECT id,name,banner,created_at,short_description,slug FROM blogs");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) {
?>
                <div class="col-lg-4">
                    
                    <div class="card">
                        
                            <img src="admin/assets/images/blog-image/<?php echo $row['banner']; ?>" style="height: 250px;">
                           <a href="<?php path(); ?>blogs/<?php echo 
                           $row['slug'];  ?>"> <h5 style="font-weight: bold; margin-top: 10px; color: #2B4279; text-align: center;"><?php echo $row['name']; ?></h5></a>
                           <p class="blog-para" style="color: #000; padding: 10px;"><?php echo $row['short_description']; ?></p>
                            <!--<div class="b-time text-dark"><i class="icon_clock_alt"></i> <?php //echo $row['created_at']; ?></div>-->
                            <a href="<?php path(); ?>blogs/<?php echo $row['slug']  ?>" style="text-align: center; font-size: 18px; color: red; padding-bottom: 15px; font-weight: bold;">Read More</a>
                       
                    </div>
             
                </div>

     <?php  } ?>
               
               
                
            </div>
        </div>
    </section>
    <!-- Blog Section End -->

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.slim.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>

<div class="modal fade" id="myModal">
    <div class="modal-dialog" role="document">
        <div class="modal-content" style="border: 9px solid #2B4279; border-radius: 20px;">
            <div class="modal-header">
                <h4 class="modal-title"><b>"Escape to the Farm, Book Now"</b></h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
            </div>
            <div class="modal-body">
                <form method="POST">
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="form-group">
                                <label for="date-in">Name:</label>
                                <input type="text" class="form-control" name="name">
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group">
                                <label for="date-in">Phone No:</label>
                                <input type="text" class="form-control phone" name="phone">
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group">
                                <label for="date-in">Gathering:</label>
                                <input type="text" class="form-control" name="subject">
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group">
                                <label for="date-in">Date Of function:</label>
                                <input type="text" class="date-input form-control" name="email" id="date-in">
                            </div>
                        </div>
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label for="date-in">Message:</label>
                                <textarea class="form-control" rows="2" cols="5" name="message"></textarea>
                            </div>
                        </div>
                        
                        
                    </div>
                    <center>
                        <button type="submit" name="send-message" class="btn btn-primary" style="background: #2B4279;">Secure Your Booking</button>
                    </center>
                            
                        </form>
            </div>
            <div class="modal-footer">
               
            </div>
        </div>
    </div>
</div>

<script>
    $(window).on('load',function(){
    var delayMs = 1500; // delay in milliseconds
    
    setTimeout(function(){
        $('#myModal').modal('show');
    }, delayMs);
});
</script>

<script>
    function checkInputPhoneValidation(element) {
  let phoneNumber = element.value.replace(/\D/g, ''); // Filter to numbers
  if (phoneNumber.length > 10) {
    phoneNumber = phoneNumber.substr(0, 10); // Keep only the first 10 digits
  }
  element.value = phoneNumber;

  // Display warning if the phone number is less than 10 characters
  const warningElement = element.parentNode.querySelector('span.warning');
  if (phoneNumber.length < 10 && phoneNumber.length > 0) {
    if (!warningElement) {
      const warning = document.createElement('span');
      warning.textContent = 'The phone number should consist of 10 digits.';
      warning.style.color = 'red';
      warning.classList.add('warning');
      element.parentNode.appendChild(warning);
    }
    element.removeAttribute('valid'); // Remove 'valid' attribute if not meeting rules
    // or can use: element.setAttribute('valid', 'false');
  } else if (phoneNumber.length < 10 && element.hasAttribute('required') && element.getAttribute('required').toLowerCase() !== 'false') {
    element.removeAttribute('valid');
    // or can use: element.setAttribute('valid', 'false');
  } else {
    if (warningElement) {
      warningElement.remove();
    }
    element.setAttribute('valid', 'true'); // Add 'valid' attribute if meeting rules
  }
}

function addInputPhoneValidation(element) {
  element.addEventListener('input', function () {
    checkInputPhoneValidation(this);
  });
}

/**
 * Querying all input fields with the 'phone' class
 * and associating an event listener with each of them.
 */
const phoneElements = document.querySelectorAll('input.phone');
phoneElements.forEach((phoneElement) => {
  addInputPhoneValidation(phoneElement);
  // Perform initial validation without triggering the input event
  checkInputPhoneValidation(phoneElement);
});

/**
 * Function to log the 'phoneElements' to the console
 * - JUST DEBUG FUNCTION
 */
function logPhoneElements() {
  document.querySelectorAll('input.phone').forEach((e) => console.log(e, `- Valid? ${isValidInputPhone(e)}`));
}

/**
 * Function to check if the input phone field is valid
 * - The input element to check
 * - True if valid, false otherwise
 */
function isValidInputPhone(element) {
  if (element.hasAttribute('required') && element.getAttribute('required').toLowerCase() !== 'false') {
    return element.value.length === 10 && Boolean(element.getAttribute('valid'));
  } else {
    return Boolean(element.getAttribute('valid'));
  }
}

/**
 * Submit function that checks if all input phone fields are valid
 */

</script>

     <?php   include('inc/footer.php'); ?>
     