コード例 #1
0
ファイル: funcs.php プロジェクト: jessp01/php-aware
function aware_paginate($current_page, $limit = 10)
{
    $str = "";
    if ($current_page > 0) {
        $str .= "<a href=?page=" . ($current_page - 1) . ">Previous page</a> | ";
    } else {
        $str .= "Previous page | ";
    }
    $start = $current_page * $limit;
    $events = aware_event_get_list(STORAGE_MODULE, $start + $limit, $limit);
    if (count($events)) {
        $str .= "<a href=?page=" . ($current_page + 1) . ">Next page</a>";
    } else {
        $str .= 'Next page';
    }
    return $str;
}
コード例 #2
0
ファイル: aware.php プロジェクト: jessp01/php-aware
        $page = isset($_GET['page']) ? $_GET['page'] : 0;
        echo aware_paginate($page, $limit);
        $start = $page * $limit;
        ?>
	<table>
		<thead>
			<tr>
				<td width='50'></td>
				<td>error message</td>
				<td>filename</td>
				<td>error</td>
				<td>host</td>
			</tr>
		</thead>
<?php 
        $events = aware_event_get_list(STORAGE_MODULE, $start, $limit);
        foreach ($events as $uuid) {
            echo aware_event_row($uuid);
        }
        ?>
	</table>

<?php 
        break;
        ?>

<?php 
    case 'view':
        ?>

	<a href="?">To listing</a>