Server IP : 108.163.255.210 / Your IP : 18.119.118.237 Web Server : Apache System : Linux blossom.urlnameserver.com 3.10.0-1160.80.1.el7.x86_64 #1 SMP Tue Nov 8 15:48:59 UTC 2022 x86_64 User : ( 1172) PHP Version : 7.2.34 Disable Function : eval,escapeshellarg,proc_close,proc_get_status,proc_nice,proc_open,symlink,system,pcntl_exec,getrusage,chown,chgp,closelog,openlog,syslog,define_syslog_variables,php_ini_loaded_file,getservbyname,getservbyport,posix_getgid,posix_getgrgid,proc_terminate,pfsockopen,apache_child_terminate,posix_mkfifo,posix_setpgid,posix_setuid,hypot,pg_host,pos,posix_access,posix_getcwd,posix_getservbyname,myshellexec,getpid,posix_getsid,posix_isatty,posix_kill,posix_mknod,posix_setgid,posix_setsid,posix_setuid,posix_times,posix_uname,ps_fill,posix_getpwuid,global,ini_restore,zip_open,zip_read,rar_open,bzopen,bzread,bzwrite,apache_get_modules,apache_get_version,phpversionphpinfo,php_ini_scanned_files,get_current_user,disk_total_space,diskfreespace,leak,imap_list,hypo,filedump,safe_mode,getmygid,apache_getenv,apache_setenv,bzread,bzwrite,bzopen,phpini,higlight_file,dos_conv,get_cwd,er_log,cmd,e_name,vdir,get_dir,only_read,ftok,ftpexec,posix_getpwnam,mysql_list_dbs,disk_free_space,session_save_path,confirm_phpdoc_compiled,zip_entry_rea,php_u,psockopen,crack_opendict,crack_getlastmessage,crack_closedict,crack_check,fpassthru,posix_get_last_error,posix_getlogin,posix_getgroups,posix_strerror,posix_getrlimit,posix_getpgrp,posix_getgrnam,pos,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/unilinki/www/Development/includes/ |
Upload File : |
<?php /** * @link: http://www.Awcore.com/dev */ function pagination($row,$per_page = 10,$page = 1, $url = '?'){ //$query = "SELECT COUNT(*) as `num` FROM {$query}"; //$row = mysql_fetch_array(mysql_query($query)); $total = $row; //$row['num']; $adjacents = "2"; $page = ($page == 0 ? 1 : $page); $start = ($page - 1) * $per_page; $firstPage = 1; $prev = ($page == 1)? 1:$page - 1; //$prev = $page - 1; $next = $page + 1; $lastpage = ceil($total/$per_page); $lpm1 = $lastpage - 1; $pagination = ""; if($lastpage > 1) { $pagination .= "<ul class='pagination'>"; $pagination .= "<li class='details'>Page $page of $lastpage</li>"; if ($page == 1) { $pagination.= "<li><a class='current'>First</a></li>"; $pagination.= "<li><a class='current'>Prev</a></li>"; } else { $pagination.= "<li><a href='{$url}page=$firstPage'>First</a></li>"; $pagination.= "<li><a href='{$url}page=$prev'>Prev</a></li>"; } if ($lastpage < 7 + ($adjacents * 2)) { for ($counter = 1; $counter <= $lastpage; $counter++) { if ($counter == $page) $pagination.= "<li><a class='current'>$counter</a></li>"; else $pagination.= "<li><a href='{$url}page=$counter'>$counter</a></li>"; } } elseif($lastpage > 5 + ($adjacents * 2)) { if($page < 1 + ($adjacents * 2)) { for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) { if ($counter == $page) $pagination.= "<li><a class='current'>$counter</a></li>"; else $pagination.= "<li><a href='{$url}page=$counter'>$counter</a></li>"; } $pagination.= "<li class='dot'>...</li>"; $pagination.= "<li><a href='{$url}page=$lpm1'>$lpm1</a></li>"; $pagination.= "<li><a href='{$url}page=$lastpage'>$lastpage</a></li>"; } elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) { $pagination.= "<li><a href='{$url}page=1'>1</a></li>"; $pagination.= "<li><a href='{$url}page=2'>2</a></li>"; $pagination.= "<li class='dot'>...</li>"; for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) { if ($counter == $page) $pagination.= "<li><a class='current'>$counter</a></li>"; else $pagination.= "<li><a href='{$url}page=$counter'>$counter</a></li>"; } $pagination.= "<li class='dot'>..</li>"; $pagination.= "<li><a href='{$url}page=$lpm1'>$lpm1</a></li>"; $pagination.= "<li><a href='{$url}page=$lastpage'>$lastpage</a></li>"; } else { $pagination.= "<li><a href='{$url}page=1'>1</a></li>"; $pagination.= "<li><a href='{$url}page=2'>2</a></li>"; $pagination.= "<li class='dot'>..</li>"; for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++) { if ($counter == $page) $pagination.= "<li><a class='current'>$counter</a></li>"; else $pagination.= "<li><a href='{$url}page=$counter'>$counter</a></li>"; } } } if ($page < $counter - 1){ $pagination.= "<li><a href='{$url}page=$next'>Next</a></li>"; $pagination.= "<li><a href='{$url}page=$lastpage'>Last</a></li>"; }else{ $pagination.= "<li><a class='current'>Next</a></li>"; $pagination.= "<li><a class='current'>Last</a></li>"; } $pagination.= "</ul>\n"; } return $pagination; } ?>