';
if ($current_page == 1) {
$html .= '
First';
} else {
$html .= 'First';
}
// Show pagination links
//var i = (Number(data.page) > 5 ? Number(data.page) - 4 : 1);
if ($current_page > 5) {
$i = $current_page - 4;
} else {
$i = 1;
}
for (; $i <= ($current_page + 4) && ($i <= $total_pages); $i++) {
($current_page == $i) ? $li_class = ' class="active"' : $li_class = '';
$link = $base_url . $http_query;
$html = $html . '' . $i . '';
if ($i == $current_page + 4 && $i < $total_pages) {
$html = $html . '...';
}
}
if ($current_page == $total_pages) {
$html .= 'Last';
} else {
$html .= 'Last';
}
$html = $html . '';
return $html;
}
function base_url(){
return sprintf(
"%s://%s:%s",
isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',
$_SERVER['SERVER_NAME'],
$_SERVER['SERVER_PORT']
);
}