<?php include('_header.php'); ?>

  <main class="main">

    <!-- Hero Section -->
    <section id="hero" class="hero section dark-background">

      <div id="hero-carousel" data-bs-interval="5000" class="container carousel carousel-fade" data-bs-ride="carousel">

        <!-- Slide 1 -->
        <div class="carousel-item active">
			
          <div class="carousel-container" style="background-image: url('images/slide2.jpg')">
		  
            <h2 class="animate__animated animate__fadeInDown">Welcome to LASUMA</h2>
            <p class="animate__animated animate__fadeInUp">
			 <?php
	                    $query5  = "SELECT * FROM page_tbl WHERE  page_name ='home_slide_welcome'";
						$result5 = mysqli_query($conn, $query5) or die(mysqli_error($conn));	
						$info5 = mysqli_fetch_array($result5);
						$text = $info5['text'];
						$text = str_replace("\n", '<br />', $text);	
						print $text;
	           ?> 
			</p>
            <a href="about.php" class="btn-get-started animate__animated animate__fadeInUp scrollto">More About Us</a>
          </div>
        </div>

        <!-- Slide 2 -->
        <div class="carousel-item">
          <div class="carousel-container" style="background-image: url('images/slide1.jpg')">
            <h2 class="animate__animated animate__fadeInDown">Meeting point</h2>
            <p class="animate__animated animate__fadeInUp">
			<?php
	                    $query5  = "SELECT * FROM page_tbl WHERE  page_name ='home_slide_meeting'";
						$result5 = mysqli_query($conn, $query5) or die(mysqli_error($conn));	
						$info5 = mysqli_fetch_array($result5);
						$text = $info5['text'];
						$text = str_replace("\n", '<br />', $text);	
						print $text;
	           ?> 
			</p>
            <a href="programmes.php" class="btn-get-started animate__animated animate__fadeInUp scrollto">Programmes and Activities</a>
          </div>
        </div>

       

        <a class="carousel-control-prev" href="#hero-carousel" role="button" data-bs-slide="prev">
          <span class="carousel-control-prev-icon bi bi-chevron-left" aria-hidden="true"></span>
        </a>

        <a class="carousel-control-next" href="#hero-carousel" role="button" data-bs-slide="next">
          <span class="carousel-control-next-icon bi bi-chevron-right" aria-hidden="true"></span>
        </a>

      </div>

      <svg class="hero-waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28 " preserveAspectRatio="none">
        <defs>
          <path id="wave-path" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"></path>
        </defs>
        <g class="wave1">
          <use xlink:href="#wave-path" x="50" y="3"></use>
        </g>
        <g class="wave2">
          <use xlink:href="#wave-path" x="50" y="0"></use>
        </g>
        <g class="wave3">
          <use xlink:href="#wave-path" x="50" y="9"></use>
        </g>
      </svg>

    </section><!-- /Hero Section -->

    <!-- About Section -->
    <section id="about" class="about section">

      <!-- Section Title -->
      <div class="container section-title" data-aos="fade-up">
        <h2>Lagos State University Muslim Alumni</h2>
        <p>LASUMA</p>
      </div><!-- End Section Title -->

      <div class="container">

        <div class="row gy-4">

          <div class="col-lg-6 content" data-aos="fade-up" data-aos-delay="100">
            <p>
              <?php
	                    $query5  = "SELECT * FROM page_tbl WHERE  page_name = 'home_intro'";
						$result5 = mysqli_query($conn, $query5) or die(mysqli_error($conn));	
						$info5 = mysqli_fetch_array($result5);
						$text = $info5['text'];
						$text = str_replace("\n", '<br />', $text);	
						print $text;
	           ?> 
            </p>
			
			<?php
			$query_aof  = "SELECT * FROM post WHERE image_name <> '' AND category='media'  ORDER BY RAND() DESC LIMIT 0, 1";
			$result_aof = mysqli_query($conn,$query_aof) or die(mysqli_error($conn));
			
			
			while($data = mysqli_fetch_array($result_aof)){
			 		 $id_aof=$data['id'];
					 $title=$data['title'];
					 $image_name=$data['image_name'];
					 
					
					print "<img src=\"admin/piks/$image_name\" width='90%'>
					<br/>
					<b>$title</b>
					<br/><br/>";
			}	
			?>
			<br/>
			<a href="about.php" class="read-more"><span>About Us</span><i class="bi bi-arrow-right"></i></a>
          </div>

          <div class="col-lg-6" data-aos="fade-up" data-aos-delay="200">
            

<?php
$query  = "SELECT * FROM post WHERE category = 'event' ORDER BY id DESC";
$result = mysqli_query($conn,$query) or die(mysqli_error($conn));

if (mysqli_num_rows($result) == 0) {
	print "No record";

}else{
	$info = mysqli_fetch_array($result);
 		 
		$id=$info['id'];
		$artist_id=$info['artist_id'];
		$image_name=$info['image_name'];
		$title=$info['title'];
		$date_day=$info['date_day'];
		$date_month=$info['date_month'];
		$date_year=$info['date_year'];
		$body=$info['body'];
		$posted_by=$info['posted_by'];
		$category=$info['category'];
		
		print "<h2><a href=\"update_detail.php?id=$id&type='event'\">$title</a></h2>";
		if($image_name !=""){
			print "<img src=\"admin/piks/$image_name\" width='90%'><br/><br/>";
		}
				 
		
		$limit_body = substr($body, 0, 300)."...";
		$limit_body = str_replace("\n", '<br />', $limit_body);	
	
		print $limit_body;
		
}

?>	
<br/><br/>		
            <a href="detail.php" class="read-more"><span>Read More</span><i class="bi bi-arrow-right"></i></a>
          </div>

        </div>

      </div>

    </section><!-- /About Section -->

    <!-- Features Section -->
    <section id="features" class="features section">

      <div class="container">

        <ul class="nav nav-tabs row  d-flex" data-aos="fade-up" data-aos-delay="100">
          <li class="nav-item col-3">
            <a class="nav-link active show" data-bs-toggle="tab" data-bs-target="#features-tab-1">
              <i class="bi bi-webcam"></i>
              <h4 class="d-none d-lg-block">Monthly/Quarterly Webinar Series</h4>
            </a>
          </li>
          <li class="nav-item col-3">
            <a class="nav-link" data-bs-toggle="tab" data-bs-target="#features-tab-2">
              <i class="bi bi-house-door"></i>
              <h4 class="d-none d-lg-block">LASUMA Estate/Housing Scheme </h4>
            </a>
          </li>
          <li class="nav-item col-3">
            <a class="nav-link" data-bs-toggle="tab" data-bs-target="#features-tab-3">
              <i class="bi bi-moon"></i>
              <h4 class="d-none d-lg-block">LASUMA Target Savings</h4>
            </a>
          </li>
          <li class="nav-item col-3">
            <a class="nav-link" data-bs-toggle="tab" data-bs-target="#features-tab-4">
              <i class="bi bi-mortarboard"></i>
              <h4 class="d-none d-lg-block">Scholarship for Indigent LASU MSSN Members</h4>
            </a>
          </li>
        </ul><!-- End Tab Nav -->

        <div class="tab-content" data-aos="fade-up" data-aos-delay="200">

          <div class="tab-pane fade active show" id="features-tab-1">
            <div class="row">
              <div class="col-lg-6 order-2 order-lg-1 mt-3 mt-lg-0">
                <h3>Monthly/Quarterly Webinar Series</h3>
               
                <p>
                  <?php
	                    $query5  = "SELECT * FROM page_tbl WHERE  page_name = 'programme2_webinar_series'";
						$result5 = mysqli_query($conn, $query5) or die(mysqli_error($conn));	
						$info5 = mysqli_fetch_array($result5);
						$text = $info5['text'];
						$text = str_replace("\n", '<br />', $text);	
						print $text;
					?> 
                </p>
              </div>
              <div class="col-lg-6 order-1 order-lg-2 text-center">
                
					<?php
	                    $query5  = "SELECT * FROM  post_more_picture WHERE  art_id = 'programme2_webinar_series'";
						$result5 = mysqli_query($conn, $query5) or die(mysqli_error($conn));	
						$info5 = mysqli_fetch_array($result5);
						$filename = $info5['filename'];
						
						print "<img src=\"admin/piks/$filename\" alt='' class='img-fluid'>";
					?> 
              </div>
            </div>
          </div><!-- End Tab Content Item -->

          <div class="tab-pane fade" id="features-tab-2">
            <div class="row">
              <div class="col-lg-6 order-2 order-lg-1 mt-3 mt-lg-0">
                <h3>LASUMA Estate/Housing Scheme</h3>
                <p>                
                  <?php
	                    $query5  = "SELECT * FROM page_tbl WHERE  page_name = 'programme5_housing'";
						$result5 = mysqli_query($conn, $query5) or die(mysqli_error($conn));	
						$info5 = mysqli_fetch_array($result5);
						$text = $info5['text'];
						$text = str_replace("\n", '<br />', $text);	
						print $text;
					?>                
                </p>
                
              </div>
              <div class="col-lg-6 order-1 order-lg-2 text-center">                
					<?php
	                    $query5  = "SELECT * FROM  post_more_picture WHERE  art_id = 'programme5_housing'";
						$result5 = mysqli_query($conn, $query5) or die(mysqli_error($conn));	
						$info5 = mysqli_fetch_array($result5);
						$filename = $info5['filename'];
						
						print "<img src=\"admin/piks/$filename\" alt='' class='img-fluid'>";
					?>
              </div>
            </div>
          </div><!-- End Tab Content Item -->

          <div class="tab-pane fade" id="features-tab-3">
            <div class="row">
              <div class="col-lg-6 order-2 order-lg-1 mt-3 mt-lg-0">
                <h3>LASUMA Target Savings</h3>
                <p>
                   <?php
	                    $query5  = "SELECT * FROM page_tbl WHERE  page_name = 'programme6_savings'";
						$result5 = mysqli_query($conn, $query5) or die(mysqli_error($conn));	
						$info5 = mysqli_fetch_array($result5);
						$text = $info5['text'];
						$text = str_replace("\n", '<br />', $text);	
						print $text;
					?> 
                </p>
                
              </div>
              <div class="col-lg-6 order-1 order-lg-2 text-center">
					<?php
	                    $query5  = "SELECT * FROM  post_more_picture WHERE  art_id = 'programme6_savings'";
						$result5 = mysqli_query($conn, $query5) or die(mysqli_error($conn));	
						$info5 = mysqli_fetch_array($result5);
						$filename = $info5['filename'];
						
						print "<img src=\"admin/piks/$filename\" alt='' class='img-fluid'>";
					?>
              </div>
            </div>
          </div><!-- End Tab Content Item -->

          <div class="tab-pane fade" id="features-tab-4">
            <div class="row">
              <div class="col-lg-6 order-2 order-lg-1 mt-3 mt-lg-0">
                <h3>Scholarship for Indigent LASU MSSN Members</h3>
                <p>
                   <?php
	                    $query5  = "SELECT * FROM page_tbl WHERE  page_name = 'programme8_scholarship'";
						$result5 = mysqli_query($conn, $query5) or die(mysqli_error($conn));	
						$info5 = mysqli_fetch_array($result5);
						$text = $info5['text'];
						$text = str_replace("\n", '<br />', $text);	
						print $text;
					?> 
                </p>
                
              </div>
              <div class="col-lg-6 order-1 order-lg-2 text-center">
					<?php
	                    $query5  = "SELECT * FROM  post_more_picture WHERE  art_id = 'programme8_scholarship'";
						$result5 = mysqli_query($conn, $query5) or die(mysqli_error($conn));	
						$info5 = mysqli_fetch_array($result5);
						$filename = $info5['filename'];
						
						print "<img src=\"admin/piks/$filename\" alt='' class='img-fluid'>";
					?>
              </div>
            </div>
          </div><!-- End Tab Content Item -->

        </div>

      </div>

    </section><!-- /Features Section -->

    <!-- Call To Action Section -->
    <section id="call-to-action" class="call-to-action section dark-background">

      <div class="container">

        <div class="row" data-aos="zoom-in" data-aos-delay="100">
          <div class="col-xl-12 text-center text-xl-start">
            <h3><font color="#FFCC00">
			<?php
	                    $query5  = "SELECT * FROM page_tbl WHERE  page_name ='home-focus'";
						$result5 = mysqli_query($conn, $query5) or die(mysqli_error($conn));	
						$info5 = mysqli_fetch_array($result5);
						$text = $info5['text'];
						$text = str_replace("\n", '<br />', $text);	
						print $text;
	                    ?> 
			</p>
			</font>
			</h3>
          </div>
          
        </div>

      </div>

    </section><!-- /Call To Action Section -->


   <!-- Recent Posts Section -->
    <section id="recent-posts" class="recent-posts section">

      <!-- Section Title -->
      <div class="container section-title" data-aos="fade-up">
        <h2>LASUMA</h2>
        <p>Picture Gallery<br></p>
      </div><!-- End Section Title -->

      <div class="container">

        <div class="row gy-4">



			
<?php
$query  = "SELECT * FROM post WHERE category = 'media'  ORDER BY id DESC LIMIT 0, 4";
$result = mysqli_query($conn,$query) or die(mysqli_error($conn));

if (mysqli_num_rows($result) == 0) {
 print "SORRY: no data...";
 
}else{
			while($info = mysqli_fetch_array($result))
			{
			 		 
				$id=$info['id'];
				
				$image_name=$info['image_name'];
				$title=$info['title'];
				$date_day=$info['date_day'];
				$date_month=$info['date_month'];
				$date_year=$info['date_year'];
				$body=$info['body'];
				$posted_by=$info['posted_by'];
				$category=$info['category'];
				$cat=$info['artist_id'];
				
				
					$query_artist  = "SELECT * FROM series WHERE id = '$cat'";
					$result_artist = mysqli_query($conn,$query_artist) or die(mysqli_error($conn));
						$data = mysqli_fetch_array($result_artist);
							$name=$data['series_name'];
					
				$date="$date_day-$date_month-$date_year";	
				$date = strtotime($date); 	
				$date = date('d M Y', $date);
				
				$body = str_replace("\n", '<br />', $body);	
				
				$limit_body = substr($body, 0, 200)."...";
				$limit_body = str_replace("\n", '<br />', $limit_body);	
				
				if($image_name != ""){
					$image_path="<img src=\"admin/piks/$image_name\" class='img-fluid'>";
				}else{
					$image_path="<img src=\"images/lasuma_logo.png\" class='img-fluid'>";
				}
				
				print '
				<div class="col-xl-4 col-md-6" data-aos="fade-up" data-aos-delay="100">
				<article>

				  <div class="post-img">
					'.$image_path.'
				  </div>

				 

				  <h2 class="title">
					<a href="blog-details.html">'.$title.'</a>
				  </h2>

				</article>
			  </div><!-- End post list item -->
                ';
				
			}
			
	}		
			
?> 



        </div><!-- End recent posts list -->

      </div>

    </section><!-- /Recent Posts Section -->




 


  </main>

<?php include('_footer.php'); ?>