D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafrica
/
spre.dominicaninstitute.edu.ng
/
Filename :
blogs.php
back
Copy
<?php $page_title; $page_title = ucfirst(basename(__FILE__, '.php')); if ($page_title === 'index') { $page_title = 'Home'; } include 'sections/pages-header.php'; include './inc/functions.php'; $Functions = new Functions(); ?> <div class="container"> <section class="blog-section"> <div class="container"> <div class="row"> <div class="col-md-8 col-sm-12"> <div class="post-area sec-padd"> <?php include_once 'inc/config.php'; if (isset($_GET['page']) && $_GET['page'] !== '') { $page_no = $_GET['page']; } else { $page_no = 1; } $total_records_per_page = 5; $offset = ($page_no - 1) * $total_records_per_page; $previous_page = $page_no - 1; $next_page = $page_no + 1; $adjacents = '2'; $result_count = mysqli_query( $con, 'SELECT COUNT(*) As total_records FROM `news`' ); $total_records = mysqli_fetch_array($result_count); $total_records = $total_records['total_records']; $total_no_of_pages = ceil( $total_records / $total_records_per_page ); $second_last = $total_no_of_pages - 1; // total pages minus 1 $result = mysqli_query( $con, "SELECT * FROM `news` LIMIT $offset, $total_records_per_page" ); if (mysqli_num_rows($result) > 0) { // output data of each row while ($row = mysqli_fetch_assoc($result)) { ?> <article class="classic-blog-news"> <figure class="img-holder"> <a href="blog-details?sn=<?= $row[ 'sn' ] ?>"><img src="uploads/news/<?= $row[ 'image' ] ?>" alt="News" style="max-height:400px; object-fit: cover"> </a> </figure> <div class="lower-content"> <div class="category"><?= $row['category'] ?></div> <div class="content"> <div class="post-meta"><span><i class="fa fa-calendar"></i><?= $row[ 'dater' ] ?></span> | <span><i class="fa fa-comments"></i>0 Comments</span></div> <a href="blog-details?sn=<?= $row[ 'sn' ] ?>"><h3><?= $row['titler'] ?></h3></a> <div class="text"> <?= $Functions->limit_text( $row['contenter'], 30 ) ?> <div class="link"><a href="blog-details?sn=<?= $row[ 'sn' ] ?>" class="thm-btn style-2">read more</a></div> </div> </div> </article> <?php } } else { ?> <?php } // mysqli_close($con); ?> <!-- <ul class="page_pagination center"> <li><a href="#" class="tran3s"><i class="fa fa-angle-left" aria-hidden="true"></i></a></li> <li><a href="#" class="active tran3s">1</a></li> <li><a href="#" class="tran3s">2</a></li> <li><a href="#" class="tran3s"><i class="fa fa-angle-right" aria-hidden="true"></i></a></li> </ul> --> <?php include_once './sections/pagination-buttons.php'; ?> </div> </div> <div class="col-md-4 col-sm-12"> <?php include_once 'sections/sidebar-one.php'; ?> </div> </div> </div> </section> </div> <?php include_once 'sections/footer.php'; ?>