HEX
Server: LiteSpeed
System: Linux premium313.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User: wekawqug (1662)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/wekawqug/ndondocup.sisihub.co.tz/sidebar.php
<!-- ======= Sidebar ======= -->
            <div class="aside-block">

              <ul class="nav nav-pills custom-tab-nav mb-4" id="pills-tab" role="tablist">
                <li class="nav-item" role="presentation">
                  <button class="nav-link active" id="pills-popular-tab" data-bs-toggle="pill" data-bs-target="#pills-popular" type="button" role="tab" aria-controls="pills-popular" aria-selected="true">Popular</button>
                </li>
                <li class="nav-item" role="presentation">
                  <button class="nav-link" id="pills-trending-tab" data-bs-toggle="pill" data-bs-target="#pills-trending" type="button" role="tab" aria-controls="pills-trending" aria-selected="false">Trending</button>
                </li>
                <li class="nav-item" role="presentation">
                  <button class="nav-link" id="pills-latest-tab" data-bs-toggle="pill" data-bs-target="#pills-latest" type="button" role="tab" aria-controls="pills-latest" aria-selected="false">Latest</button>
                </li>
              </ul>

              <div class="tab-content" id="pills-tabContent">

                <!-- Popular -->
                <div class="tab-pane fade show active" id="pills-popular" role="tabpanel" aria-labelledby="pills-popular-tab">
                <?php 
                $popular = $conn->query("SELECT p.*,c.category from post_list p inner join category_list c on c.id = p.category_id where status = 1 AND date_published >= DATE_SUB(NOW(), INTERVAL 1 YEAR) ORDER BY p.views DESC LIMIT 6");
	            
	                while($row=$popular->fetch_assoc()):
	                  ?>
	                 <div class="post-entry-1 border-bottom">
                    <div class="post-meta"><span class="date"><?php echo ucwords($row['category']) ?></span> <span class="mx-1">&bullet;</span> <span><?php echo date("F d,Y", strtotime($row['date_published'])) ?></span></div>
                    <h2 class="mb-2"><a href="./index.php?page=read_news&c=<?php echo md5($row['id']) ?>"><?php echo ucwords($row['title']) ?></a></h2>
                    <span class="author mb-3 d-block">Loveness Majani</span>
                  </div>

	             <?php      
	                endwhile;
	            ?>
                
                  
                </div> <!-- End Popular -->

                <!-- Trending -->
                <div class="tab-pane fade" id="pills-trending" role="tabpanel" aria-labelledby="pills-trending-tab">
                <?php 
                $trending = $conn->query("SELECT p.*,c.category from post_list p inner join category_list c on c.id = p.category_id where status = 1 AND date_published >= DATE_SUB(NOW(), INTERVAL 1 YEAR) ORDER BY p.views DESC LIMIT 6");
	            
	                while($row=$trending->fetch_assoc()):
	                  ?>
	                 <div class="post-entry-1 border-bottom">
                    <div class="post-meta"><span class="date"><?php echo ucwords($row['category']) ?></span> <span class="mx-1">&bullet;</span> <span><?php echo date("F d,Y", strtotime($row['date_published'])) ?></span></div>
                    <h2 class="mb-2"><a href="./index.php?page=read_news&c=<?php echo md5($row['id']) ?>"><?php echo ucwords($row['title']) ?></a></h2>
                    <span class="author mb-3 d-block">Gati Philipo</span>
                  </div>

	             <?php      
	                endwhile;
	            ?>

                  
                </div> <!-- End Trending -->

                <!-- Latest -->
                <div class="tab-pane fade" id="pills-latest" role="tabpanel" aria-labelledby="pills-latest-tab">
                <?php 
                $recent = $conn->query("SELECT p.*,c.category from post_list p inner join category_list c on c.id = p.category_id where status = 1 order by unix_timestamp(date_published) desc limit 6");
                while($row=$recent->fetch_assoc()):
	                  ?>
	                 <div class="post-entry-1 border-bottom">
                    <div class="post-meta"><span class="date"><?php echo ucwords($row['category']) ?></span> <span class="mx-1">&bullet;</span> <span><?php echo date("F d,Y", strtotime($row['date_published'])) ?></span></div>
                    <h2 class="mb-2"><a href="./index.php?page=read_news&c=<?php echo md5($row['id']) ?>"><?php echo ucwords($row['title']) ?></a></h2>
                    <span class="author mb-3 d-block">George Rapemo</span>
                  </div>

	             <?php      
	                endwhile;
	            ?>

                </div> <!-- End Latest -->

              </div>
            </div>

            <div class="aside-block">
              <h3 class="aside-title">Video</h3>
              <div class="video-post">
                <a href="https://www.youtube.com/watch?v=AiFfDjmd0jU" class="glightbox link-video">
                  <span class="bi-play-fill"></span>
                  <img src="assets/img/post-landscape-5.jpg" alt="" class="img-fluid">
                </a>
              </div>
            </div><!-- End Video -->

            <div class="aside-block">
              <h3 class="aside-title">Categories</h3>
              <ul class="aside-links list-unstyled">               
                <?php 
	            $categories = $conn->query("SELECT * FROM category_list where category != 'hero' AND id !=6 order by category asc");
	                while($row=$categories->fetch_assoc()):
	                  ?>
	                  <li><a href="./index.php?page=category&cat=<?php echo md5($row['id']) ?>"><i class="bi bi-chevron-right"></i><?php echo ucwords($row['category']) ?></a></li>
	             <?php      
	                endwhile;
	            ?>
              <li><a href="./index.php?page=category"><i class="bi bi-chevron-right"></i>All</a></li>
              </ul>
            </div><!-- End Categories -->