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


    <!-- Breadcrumb Section Begin -->
 <!--     <section class="ban_sec">-->
	<!--	<div class="container-fluid">-->
	<!--		<div class="ban_img">-->
	<!--<img src="https://i.ibb.co/NVjsGWG/banner.jpg" alt="banner" border="0">-->
	<!--			<div class="ban_text">-->
	<!--				<strong>-->
	<!--					<span>Meeting current</span><br> needs now-->
	<!--				</strong>-->
	<!--				<p>You can prioritize a child’s mental, emotional, <br>-->
	<!--					behavioral, and physical health </p>-->
	<!--				<a href="#">Lend a hand</a>-->
	<!--			</div>-->
	<!--		</div>-->
	<!--	</div>-->
	<!--</section>-->
    <!-- Breadcrumb Section End -->

    <!-- Blog Section Begin -->
    <section class="blog-section blog-page spad mt-5">
        <div class="container">
            <div class="section-title">
                        <!--<span>Our Service</span>-->
                        <h2>Our Gallery</h2>
                    </div>
            <div class="row"> 
  
  <!-- COLUMN 1 -->
  
   <?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="col-md-4 mb-4">
   
    <img class="myImages" id="myImg" src="<?php path(); ?>/admin/assets/images/gallery/<?php echo $row['photo']; ?>" href="#popup1" style="width:100%">
    <div id="myModal" class="modal">
  <span class="close">&times;</span>
  <img class="modal-content" id="img01">
    </div>

  </div>
  <?php
    }
    ?>


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

    <?php include('inc/footer.php'); ?>
    
    <script>
        var modal = document.getElementById('myModal');
// to all images -- note I'm using a class!
var images = document.getElementsByClassName('myImages');
// the image in the modal
var modalImg = document.getElementById("img01");
// and the caption in the modal
var captionText = document.getElementById("caption");

// Go through all of the images with our custom class
for (var i = 0; i < images.length; i++) {
  var img = images[i];
  // and attach our click listener for this image.
  img.onclick = function(evt) {
    modal.style.display = "block";
    modalImg.src = this.src;
    captionText.innerHTML = this.alt;
  }
}

var span = document.getElementsByClassName("close")[0];

span.onclick = function() {
  modal.style.display = "none";
}
    </script>
