コード例 #1
0
//Sorting options...
if ($_REQUEST['sort']) {
    $order_column = $sortOptions[$_REQUEST['sort']];
}
if ($_REQUEST['order']) {
    $order = $orderWays[$_REQUEST['order']];
}
$order_column = $order_column ? $order_column : 'ipaddr';
$order = $order ? $order : 'ASC';
$order_by = " ORDER BY {$order_column} {$order} ";
$total = db_count('SELECT count(*) ' . $from . ' ' . $where);
$pagelimit = 1000;
//No limit.
$page = $_GET['p'] && is_numeric($_GET['p']) ? $_GET['p'] : 1;
$pageNav = new PageNate($total, $page, $pagelimit);
$pageNav->setURL('admin.php', $qstr . '&sort=' . urlencode($_REQUEST['sort']) . '&order=' . urlencode($_REQUEST['order']));
$query = "{$select} {$from} {$where} {$order_by}";
//echo $query;
$result = db_query($query);
$showing = db_num_rows($result) ? $pageNav->showing() : '';
$negorder = $order == 'DESC' ? 'ASC' : 'DESC';
//Negate the sorting..
$deletable = 0;
?>
<div class="msg"><?php 
echo _('API Keys');
?>
</div>
<hr>
<div><b><?php 
echo $showing;
コード例 #2
0
        $qstr .= '&startDate=' . urlencode($_REQUEST['startDate']);
    }
    if ($endTime) {
        $qwhere .= ' AND created<=FROM_UNIXTIME(' . $endTime . ')';
        $qstr .= '&endDate=' . urlencode($_REQUEST['endDate']);
    }
}
$qselect = 'SELECT log.* ';
$qfrom = ' FROM ' . SYSLOG_TABLE . ' log ';
//get log count based on the query so far..
$total = db_count("SELECT count(*) {$qfrom} {$qwhere}");
$pagelimit = 30;
$page = $_GET['p'] && is_numeric($_GET['p']) ? $_GET['p'] : 1;
//pagenate
$pageNav = new PageNate($total, $page, $pagelimit);
$pageNav->setURL('admin.php', $qstr);
$query = "{$qselect} {$qfrom} {$qwhere} ORDER BY log.created DESC LIMIT " . $pageNav->getStart() . "," . $pageNav->getLimit();
//echo $query;
$result = db_query($query);
$showing = db_num_rows($resp) ? $pageNav->showing() : "";
?>
<div class="msg"><?php 
echo _('System Logs');
?>
</div>
<div id='filter'  style="margin-bottom:8px;">
  <form action="admin.php?t=syslog" method="get">
    <input type="hidden" name="t" value="syslog" />
    <div style="padding-left:15px;">
      <?php 
echo _('Date Span:');