<?php
require('db.php');
include "x.php";
?>
<!doctype html>
<html lang="en">
  <head>
    
     <?php include "include/meta.php"; ?>

     <?php include "include/css.php"; ?>


  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
  </head>
  <body>
<?php include "include/header.php"; ?>


<section class="w3l-main-slider" id="home">
  <!-- main-slider -->
              <div id="myCarousel" class="carousel slide" data-ride="carousel">
                

                <!-- Wrapper for slides -->
                <div class="carousel-inner">


                <?php 
                    $slider_sql = "SELECT * FROM slider where sby=$x ORDER BY  spos ASC LIMIT 1";
                    $slider_run = mysqli_query($con, $slider_sql);
                    while ( $slider_rows = mysqli_fetch_assoc($slider_run) )
                    {
                      $sliderPath = substr($slider_rows['slgimage'], 3);
                      $sliderPath = "login//".$sliderPath;
                      
                  ?>

                  <div class="item active">
                    <img src="<?php echo "$sliderPath"; ?>" alt="" style="width:100%;">
                  </div>
                  <?php  

                  } 

                      $slider_sql = "SELECT * FROM slider where sby=$x ORDER BY  spos ASC LIMIT 1,10";
                      $slider_run = mysqli_query($con, $slider_sql);
                      while ( $slider_rows = mysqli_fetch_assoc($slider_run) )
                      {
                        $sliderPath = substr($slider_rows['slgimage'], 3);
                        $sliderPath = "login//".$sliderPath;

                  ?>

                  <div class="item">
                    <img src="<?php echo "$sliderPath"; ?>" alt="" style="width:100%;">
                  </div>
                
                 <?php  

                  } 
                  ?>


                </div>

                <!-- Left and right controls -->
                <a class="left carousel-control" href="#myCarousel" data-slide="prev">
                  <span class="glyphicon glyphicon-chevron-left"></span>
                  <span class="sr-only">Previous</span>
                </a>
                <a class="right carousel-control" href="#myCarousel" data-slide="next">
                  <span class="glyphicon glyphicon-chevron-right"></span>
                  <span class="sr-only">Next</span>
                </a>


  <!-- /main-slider -->
</section>


     

   <!-- marquee -->
<div style="background: rgba(0, 33, 71, 0.75); padding: 3px  10px 3px 10px;">
                <marquee direction="left" scrollamount="6" scrolldelay="1" width="auto" height="20" onmouseover="this.stop();" onmouseout="this.start();">
                            <ul style="list-style-type: none;padding-left:0px;">
                                
                                    <?php
                                        $not_sql = "SELECT * FROM notice_table WHERE n_by = '$x' And type = 'notice' ORDER BY n_date DESC LIMIT 10";
                                        $not_run = mysqli_query($con, $not_sql);
                                        while ( $not_rows = mysqli_fetch_assoc($not_run) ) 
                                        {
                                    ?>
                                
                                    <a href="notice_total.php?n=<?php echo $not_rows['n_sl']; ?>" target="_blank">
                                     <i class="fa fa-paper-plane" aria-hidden="true" style="color: yellow;"></i> &nbsp;&nbsp; <font color="white"><?php echo $not_rows['n_title']; ?> </font>&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;
                                    </a>
                                    
                                    <?php 
                                        }
                                         ?>
                               
                               
                            </ul>
                        </marquee>
        </div>
        <!-- marquee -->
  
<!-- features-4 block -->

<?php                    
        $about_sql = "SELECT * FROM about WHERE a_by ='$x' ";
        $about_run = mysqli_query($con, $about_sql);
        $about_rows = mysqli_fetch_assoc($about_run);
       
?>
<section class="w3l-index1" id="about">
  <div class="calltoaction-20  py-5 editContent">
    <div class="container py-md-3">
    
      <div class="calltoaction-20-content row">
        <div class="column center-align-self col-lg-6 pr-lg-5">
          <h5 class="editContent">Welcome to Saint Xavier's School, Kailashahar</h5>
          
             <div class="more-gap editContent" align="justify"> 
              <?php echo $about_rows['about'];?>
</div>
              <a class="btn btn-secondary btn-theme2 mt-3" href="about.php"> Read More</a>
        </div>
        <div class="column ccont-left col-lg-6">
          <img src="assets/images/g1.jpg" class="img-responsive" alt="">
        </div>
      </div>
    </div>
  </div>
</section>



<?php 

    
                                         
        $message_sql = "SELECT * FROM message WHERE m_by ='$x'  ORDER BY  m_pos ASC limit 1";
        $message_run = mysqli_query($con, $message_sql);
        $message_rows = mysqli_fetch_assoc($message_run);
       
               $newsPath = substr($message_rows['m_img'], 3);
               $newsPath = "login/".$newsPath;
               $trimmedTitle = mb_strimwidth($message_rows['message'], 0, 200, "...");
?>

<!-- customers4 block -->
<section class="w3l-customers-4" id="testimonials">
  <div id="customers4-block" class="py-5">
    <div class="container py-md-3">
  
     <div class="section-title align-center row">
    
          <div class="item-top col-md-6 mt-md-0 mt-4">
            <div class="item text-center">
             <div class="imgTitle">
               <img src="<?php echo $newsPath; ?>"  height="200px" width="200px"class="img-responsive" alt="" />
              </div>
              <h6 class="mt-3"><?php echo $message_rows['m_name']; ?></h6>
              <p class=""><?php echo $message_rows['m_design']; ?> </p>
              <p></p>
              
          </div>
         </div>
         
         
         
           <div class="item-top col-md-6 pr-md-5">
        <div class="heading">
          <h3 class="head text-white"><?php echo $message_rows['m_design']; ?> Desk</h3>
          <p class="my-3 head text-white" align="justify"> <span class="mt-3">
   <?php echo $trimmedTitle; ?> <a href="president.php"> <font color="red">.....more </font></a> </span></p>
            <p class="my-3 head text-white"> </p>
          </div>
     </div>
    </div>
  </div>
  </div>
  
 
</section>












<!--  form-12 --
<section class="w3l-form-12">
    <div class="form-12-content py-5" id="services">
      <div class="container py-md-3">
        <div class="grid grid-column-2 py-md-5">
            
          <div class="column1">
            <h4 class="tagline" align="center">SXSK Infrastructure  </h4>
            
                
              <img src="assets/images/g1.jpg" width="300px" Style="border-radius: 25px;" class="img-responsive" alt="">
                

              
            </div>
            <div class="column2">
            <div class="row">
                
                
                
                	  <?php
            $cat_run = mysqli_query($con, "SELECT cname, cid FROM category where catby=65 ORDER BY  cpositon ASC limit 1,1 ");
            while ( $cat_rows = mysqli_fetch_assoc($cat_run) ) {
              echo '   
	
	 
	 
	 
          
            

		  ';
              
               
				
				 $news_sql = "SELECT * FROM blog WHERE bcat = '$cat_rows[cid]' ORDER BY bid ASC LIMIT 20";
                $news_run = mysqli_query($con, $news_sql);
                while ( $news_rows = mysqli_fetch_assoc($news_run) ) {
                   $newsPath = substr($news_rows['bimage'], 3);
				  	$newsPath = "login/".$newsPath;
                  $trimmedTitle = mb_strimwidth($news_rows['btitle'], 0, 80, "...");
                  echo "
				  	 
             
		              

 <div class='col-md-3 col-sm-6 col-6' style='padding:3px 3px;'>
 
		              <a class='' href='blog-single.php?id=$news_rows[bid]$news_rows[btag]/' title='$news_rows[btitle]'> 
                 <div class='courses-item'>
                  <span class='fa fa-industry'></span>
                  <p>$trimmedTitle</p>
                </div>
                
                </a>
              </div>
              
			              
                 
                
      
                  ";
                }
				
            }
          ?>
   
                
       
              
              
              
            </div>
            </div>
        </div>
      </div>
    </div>
  </section>
<!-- // form-12 -->

<?php 

    
                                         
        $message_sql = "SELECT * FROM message WHERE m_by ='$x'  ORDER BY  m_pos ASC limit 1,1";
        $message_run = mysqli_query($con, $message_sql);
        $message_rows = mysqli_fetch_assoc($message_run);
       
               $newsPath = substr($message_rows['m_img'], 3);
               $newsPath = "login/".$newsPath;
               $trimmedTitle = mb_strimwidth($message_rows['message'], 0, 200, "...");
?>

<!-- customers4 block --
<section class="w3l-customers-4" id="testimonials">
  <div id="customers4-block" class="py-5">
    <div class="container py-md-3">
  
     <div class="section-title align-center row">
      <div class="item-top col-md-6 pr-md-5">
        <div class="heading">
          <h3 class="head text-white"><?php echo $message_rows['m_design']; ?> Desk</h3>
          <p class="my-3 head text-white" align="justify"> <span class="mt-3">
   <?php echo $trimmedTitle; ?> <a href="hm.php"> <font color="red">.....more </font></a> </span></p>
            <p class="my-3 head text-white"> </p>
          </div>
     </div>
          <div class="item-top col-md-6 mt-md-0 mt-4">
            <div class="item text-center">
             <div class="imgTitle">
               <img src="<?php echo $newsPath; ?>"  height="200px" width="200px"class="img-responsive" alt="" />
              </div>
              <h6 class="mt-3"><?php echo $message_rows['m_name']; ?></h6>
              <p class=""><?php echo $message_rows['m_design']; ?> </p>
              <p></p>
              
          </div>
         </div>
    </div>
  </div>
  </div>
  
 
</section>


<!-- gallery -->
<section class="gallery py-5" style="bac kground: rgb(215,234,255);" > 
  <div class="container py-xl-5 py-lg-3">
     <!-- <h3 class="title text-capitalize font-weight-light text-dark text-center mb-5">our
      <span class="font-weight-bold">Photo Gallery</span>
    </h3>-->
    <div class="inner-sec pt-md-4">
      <div class="row proj_gallery_grid">
        <?php                    
            $news_sql = "SELECT * FROM gallery   WHERE tby ='$x' ORDER BY id DESC LIMIT 4";
            $news_run = mysqli_query($con, $news_sql);
            while ( $news_rows = mysqli_fetch_assoc($news_run) ) {
              $newsPath = substr($news_rows['image'], 3);
      $newsPath = "login/".$newsPath;
            
             
                echo "
        
        <div class='col-sm-3 section_1_gallery_grid'>
          
            <div class='section_1_gallery_grid1' '>
              <img src='$newsPath' 
   alt='PSHM' style=' height: 200px; width:100%; border: 2px solid #002147;
  border-radius: 5px;'  class='img-fluid'  />
              
              <div class='proj_gallery_grid1_pos'>
              
                
               
              </div>
            </div>
         
          <br>
        </div>
        
        ";
                }
              ?>
      </div>
    </div>
  </div>
</section>
<!--//gallery-->


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



<script src="assets/js/jquery-3.3.1.min.js"></script>
<!-- //footer-28 block -->
</section>
<script>
  $(function () {
    $('.navbar-toggler').click(function () {
      $('body').toggleClass('noscroll');
    })
  });
</script>
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
  integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous">
</script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
  integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous">
</script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
  integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous">
</script>

<!-- Template JavaScript -->

<!-- Smooth scrolling -->
<!-- <script src="assets/js/smoothscroll.js"></script> -->
<script src="assets/js/owl.carousel.js"></script>

<!-- script for -->
<script>
  $(document).ready(function () {
    $('.owl-one').owlCarousel({
      loop: true,
      margin: 0,
      nav: true,
      responsiveClass: true,
      autoplay: false,
      autoplayTimeout: 5000,
      autoplaySpeed: 1000,
      autoplayHoverPause: false,
      responsive: {
        0: {
          items: 1,
          nav: false
        },
        480: {
          items: 1,
          nav: false
        },
        667: {
          items: 1,
          nav: true
        },
        1000: {
          items: 1,
          nav: true
        }
      }
    })
  })
</script>
<!-- //script -->

 

</body>

</html>
<!-- // grids block 5 -->