<?php $batas = 5; $halaman = @$_GET['halaman']; if(empty($halaman)){ $posisi = 0; $halaman = 1; } else{ $posisi = ($halaman - 1) * $batas; } $query = mysqli_query($con, "select * from schedule where status='PROCESS'"); $sql = mysqli_query($con, "select * from schedule LIMIT $posisi, $batas"); $jumlah = mysqli_num_rows($query); $jumlahhalaman = ceil($jumlah/$batas); if(mysqli_num_rows($sql) > 0){ $no = $posisi + 1; $urut = 1; while($sched = mysqli_fetch_array($sql)){ if($sched['status']=='PROCESS'){ echo " <tr style='cursor: pointer;'> <td>$no</td> <td>$sched[name]</td> <td>$sched[address]</td> <td style='color:red'>$sched[status]</td> <td><button type='button' class='btn btn-default' data-toggle='modal' data-target='#myModal$no'>Edit</button> <a href='#'><button type='delete' class='btn btn-default' >delete</button></a></td> </tr>" ;} $no++; } } ?>