= $pages) && $pages != 1){ $last = $_GET['offset'] + $limit; } else{ $last = $numrows; } // ************** end of pager ************************** if (!$page){ $page = 0; } $pagelimit = $page+$limit; $columns = 3; $counter = 0; for ($i = $page; $i < $pagelimit; $i++) { if ($i < $numrows){ $filename = $item[$i]; $extention = explode(".", $filename); if ( $extention[1] != "gif" && $extention[1] != "zip" ){ $templatedisplay .= "
"; $templatedisplay .= "
"; $templatedisplay .= "\"" "; $templatedisplay .= "
"; $templatedisplay .= "
View
"; $templatedisplay .= "
Download
"; $templatedisplay .= "
"; } ++$counter; if($counter == $columns) { $counter = 0; } } } $templatedisplay .= "
"; $ptot = (count($item)/$limit); $pnum = ($page/$limit+1); $ptot = ceil($ptot); $templatedisplay .= "Page $pnum of $ptot
"; // ************** bottom pager ************************** if (!empty($_GET['offset']) && $_GET['offset'] > 0) { $back_page = $_GET['offset'] - $limit; $url = "templates.html?offset=$back_page"; $templatedisplay .= "« Back "; } if($pages > 1) { for ($i=1; $i <= $pages; $i++) { $ppage = $limit*($i - 1); if ($ppage == $_GET['offset']) $templatedisplay .= "$i "; else { $url = "templates.html?offset=$ppage"; $templatedisplay .= "$i "; } } } if(((($_GET['offset']+$limit) / $limit) < $pages) && $pages != 1) { $next_page = $_GET['offset'] + $limit; $url = "templates.html?offset=$next_page"; $templatedisplay .= " Next » "; } // ************** end of bottom pager ************************** $templatedisplay .= "
"; echo $templatedisplay; ?>