I want to create pagination using while loop.
I already show data limit to 10. But I have no idea how to show the pagination number in time calculation below.
Any solutions?
Thank you.
<table border=0 width=800 cellspacing=1 cellpadding=2>
<tr height=22>
<td align=center bgColor=red width=5%>No.</td>
<td align=center bgColor=red width=15%>Date</td>
<td align=center bgColor=red width=20%>Time</td>
<td align=center bgColor=red width=15%>Status</td>
</tr>
<?php
$start_hour = "05";
$start_min = "00";
$end_hour = "15";
$end_min = "00";
$start = new DateTime("$start_hour$start_min");
$end = new DateTime("$end_hour$end_min");
$article_num = 1;
$resultPerPage = 10;
$pageNum = 1;
while (($start < $end) && ($article_num <= $resultPerPage)) {
$start_time = $start->format('H:i');
$key_time = $start->format('Hi');
$start->modify('+10 minute');
$end_time = $start->format('H:i');
$link_reserv = "#";
echo ("<tr>");
echo ("<td align=center>$article_num</td>");
echo ("<td align=center>2013/12/16</td>");
echo ("<td align=center>$start_time - $end_time</td>");
echo ("<td align=center><input type=button value=Book Now onclick=\"window.location.href='$link_reserv';\"></td>");
echo ("</tr>");
$article_num++;
}
?>
</table>
pages = floor(total / recordsPerPage).while (($start < $end)) ...I remove the($article_num <= $resultPerPage), and the pages number successfully i get. And one problem is. How to limit the while loop?