Example #1
0
			</button>
			<a type="button"
				href="<?php 
echo pmx_getactionurl_delOfflineHost();
?>
"
				onclick="return confirm('Are sure to delete all of the offline sessions ?');"
				class="btn btn-default btn-xs btn-del-offline"><span
				class="glyphicon"></span> Delete Offline Session</a>
		</div>
		<div class="pagination">
			<span><small><?php 
echo get_host_page_range();
?>
, Total <?php 
echo get_host_num();
?>
 </small></span>
			<a type="button" class="btn btn-default btn-xs btn-page"
				href="<?php 
echo get_host_prevpageurl();
?>
"><span
				class="glyphicon glyphicon-chevron-left"></span> Prev</a> <a
				type="button" class="btn btn-default btn-xs btn-page"
				href="<?php 
echo get_host_nextpageurl();
?>
">Next <span
				class="glyphicon glyphicon-chevron-right"></span></a>
		</div>
Example #2
0
/**
 * 获取当前页的主机数量范围
 * 
 * @param string $page        	
 * @return string
 */
function get_host_page_range($page = NULL)
{
    if ($page == NULL) {
        $page = get_host_current_page();
    }
    $per_page = 24;
    $page = $page <= 0 ? 1 : $page;
    $item_num = get_host_num();
    if ($item_num == 0) {
        return "Empty";
    }
    $first_item = $per_page * ($page - 1) + 1;
    $last_item = $first_item + $per_page - 1;
    if ($last_item > $item_num) {
        $last_item = $item_num;
    }
    return "{$first_item} - {$last_item}";
}