Linux puskom-ProLiant-DL385-Gen10 5.4.0-150-generic #167~18.04.1-Ubuntu SMP Wed May 24 00:51:42 UTC 2023 x86_64
/
var
/
www
/
html
/
bkd
/
admin
/
/var/www/html/bkd/admin/paging.php
<style type="text/css"> .paging { padding:10px 0px 0px 0px; text-align:center; font-size:13px;} .paging.display{text-align:right;} .paging a, .paging span {padding:2px 8px 2px 8px; font-weight :normal} .paging span {font-weight:bold; color:#000; font-size:13px; } .paging a, .paging a:visited {color:#000; text-decoration:none; border:1px solid #dddddd;} .paging a:hover { text-decoration:none; background-color:#6C6C6C; color:#fff; border-color:#000;} .paging span.prn { font-size:13px; font-weight:normal; color:#aaa; } .paging a.prn, .paging a.prn:visited { border:2px solid #dddddd;} .paging a.prn:hover { border-color:#000;} .paging p#total_count{color:#aaa; font-size:12px; font-weight: normal; padding-top:8px; padding-left:18px;} .paging p#total_display{color:#aaa; font-size:12px; padding-top:10px;} </style> <? function check_integer($which) { if(isset($_REQUEST[$which])){ if (intval($_REQUEST[$which])>0) { return intval($_REQUEST[$which]); } else { return false; } } return false; }//end of check_integer() function get_current_page() { if(($var=check_integer('page'))) { //return value of 'page', in support to above method return $var; } else { //return 1, if it wasnt set before, page=1 return 1; } }//end of method get_current_page() function doPages($page_size, $thepage, $query_string, $total=0, $form) { $kode_fak=''; if ( isset($_GET['kode_fak']) ) {$kode_fak = str_replace("'", "\'", $_GET['kode_fak']);} $str = app::serialize64('Admin'); $str2 = app::serialize64($form); $str3 = $kode_fak; //per page count $index_limit = 10; //set the query string to blank, then later attach it with $query_string $query=''; if(strlen($query_string)>0){ $query = "&".$query_string; } //get the current page number example: 3, 4 etc: see above method description $current = get_current_page(); $total_pages=ceil($total/$page_size); $start=max($current-intval($index_limit/2), 1); $end=$start+$index_limit-1; echo '<br /><br /><div class="paging">'; if($current==1) { echo '<span class="prn">< Previous</span> '; } else { $i = $current-1; $str4 = app::serialize64($i); $str4 = $i; echo '<a href="?frm='.$str.'&act='.$str2.'&kode_fak='.$str3.'&page='.$str4.'" class="prn" rel="nofollow" title="go to page '.$i.'">< Previous</a> '; echo '<span class="prn">...</span> '; } if($start > 1) { $i = 1; $str4 = app::serialize64($i); $str4 = $i; echo '<a href="?frm='.$str.'&act='.$str2.'&kode_fak='.$str3.'&page='.$str4.'" title="go to page '.$i.'">'.$i.'</a> '; } for ($i = $start; $i <= $end && $i <= $total_pages; $i++){ if($i==$current) { echo '<span>'.$i.'</span> '; } else { $str4 = app::serialize64($i); $str4 = $i; echo '<a href="?frm='.$str.'&act='.$str2.'&kode_fak='.$str3.'&page='.$str4.'" title="go to page '.$i.'">'.$i.'</a> '; } } if($total_pages > $end){ $i = $total_pages; $str4 = app::serialize64($i); $str4 = $i; echo '<a href="?frm='.$str.'&act='.$str2.'&kode_fak='.$str3.'&page='.$str4.'" title="go to page '.$i.'">'.$i.'</a> '; } if($current < $total_pages) { $str4 = app::serialize64($i); $i = $current+1; $str4 = $i; echo '<span class="prn">...</span> '; echo '<a href="?frm='.$str.'&act='.$str2.'&kode_fak='.$str3.'&page='.$str4.'" class="prn" rel="nofollow" title="go to page '.$i.'">Next ></a> '; } else { echo '<span class="prn">Next ></span> '; } //if nothing passed to method or zero, then dont print result, else print the total count below: if ($total != 0){ //prints the total result count just below the paging echo '<p id="total_count">(total '.$total.' results)</p></div>'; } }//end of method doPages() ?>