Al hocam kendine göre ayarla


                <?php

                $split = explode("?page=", $_SERVER['REQUEST_URI']);

                if($split[count($split)-1]>1){

                    $_GET['page']=$split[count($split)-1];
                }

                $limit = 5;
                $query = "SELECT * FROM sayfalar WHERE sayfa_durum=1 AND secenekHaber=1 ORDER BY sayfa_id DESC";

                $s = $db->prepare($query);
                $s->execute();
                $total_results = $s->rowCount();
                $total_pages = ceil($total_results/$limit);

                if (!isset($_GET['page'])) {
                    $page = 1;
                } else{
                    $page = $_GET['page'];
                }



                $starting_limit = ($page-1)*$limit;
                $show = "SELECT * FROM sayfalar WHERE sayfa_durum=1 AND secenekHaber=1   ORDER BY sayfa_id DESC LIMIT $starting_limit, $limit";

                $r = $db->prepare($show);
                $r->execute();

                while($res = $r->fetch(PDO::FETCH_ASSOC)):
                    $haberUrl = LURL.$res["sayfa_url"].'/'
                    ?>


                    <div class="col-md-6 col-lg-4">
                        <div class="single-blog-card card border-0 shadow-sm">
                            <div class="blog-img">
                                <!--    <a href="<?php echo $haberUrl;?>"><span class="category position-absolute"></span></a>-->
                                <a href="<?php echo $haberUrl;?>"><img src="<?php echo URL.'images/sayfalar/big/'.$res["sayfa_resim"];?>" class="card-img-top position-relative img-fluid" alt="<?php echo $res[$lehce."sayfa_adi"];?>"></a>
                            </div>
                            <div class="card-body">
                                <h3 class="h5 mb-2 card-title"><a href="<?php echo $haberUrl;?>"><?php echo $res[$lehce."sayfa_adi"];?></a></h3>
                                <p class="card-text"><?php echo $res[$lehce."sayfa_desc"];?></p>
                            </div>
                            <div class="card-footer border-0 d-flex align-items-center justify-content-between">
                                <div class="author-meta d-flex align-items-center">
                                    <span class="fa fa-user mr-2 p-3 bg-white rounded-circle border"></span>
                                    <div class="author-content">
                                        <a href="<?php echo $haberUrl;?>" class="d-block"><?php echo $ayar["site_title"];?></a>
                                        <small> <?php echo tarih($res["sayfa_tarih"]);?></small>
                                    </div>
                                </div>
                       <!-- <div class="author-like">
                            <a href="<?php echo $haberUrl;?>"><span class="fa fa-share-alt"></span> 50</a>
                        </div>-->
                    </div>
                </div>
            </div>


        <?php endwhile; ?>








    </div>


    <!--pagination start-->
    <div class="row">
        <div class="col-md-12">
            <nav class="custom-pagination-nav mt-4">
                <ul class="pagination justify-content-center">





                    <?php if($page>1){ ?>
                        <li class="page-item"><a class="page-link" href="?page=<?php echo $page-1;?>"><span class="ti-angle-left"></span></a></li>
                    <?php } for ($i=$page; $i <=$total_pages ; $i++){ ?>
                        <?php if($i==$page){ ?>
                           
                            <li class="page-item active"><a class="page-link" href="javascript:void(0);"><?php echo $i;?></a></li>
                        <?php }else{ ?>
                         <li class="page-item"><a class="page-link" href='?page=<?php echo $i;?>'><?php echo $i;?></a></li>
                     <?php   } } if ($total_pages>$page) { ?>
                         <li class="page-item"><a class="page-link" href="?page=<?php echo $page+1;?>"><span class="ti-angle-right"></span></a></li>
                     <?php } ?>


                 </ul>
             </nav>
         </div>
     </div>
     <!--pagination end-->