本文整理汇总了PHP中pagination::makePagination方法的典型用法代码示例。如果您正苦于以下问题:PHP pagination::makePagination方法的具体用法?PHP pagination::makePagination怎么用?PHP pagination::makePagination使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pagination
的用法示例。
在下文中一共展示了pagination::makePagination方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _make_html_table
function _make_html_table($table, $item, $urlPrefix, $n, &$data)
{
$dbh = getdbh();
//pagination
$stmt = $dbh->query("SELECT count(OID) total FROM {$table}");
$total = $stmt->fetchColumn();
$limit = $GLOBALS['pagination']['per_page'];
$data['body'][] = '<p>Showing records ' . ($n + 1) . ' to ' . min($total, $n + $limit) . ' of ' . $total . '</p>';
$data['body'][] = pagination::makePagination($n, $total, myUrl("{$urlPrefix}/manage"), $GLOBALS['pagination']);
//table
$fields = "URL,stationId,lastContact,debug";
$stmt = $dbh->query("SELECT OID,CID,{$fields} FROM {$table} LIMIT {$n},{$limit}");
if ($stmt === false) {
var_dump($dbh->errorInfo());
return;
}
$tablearr[] = explode(',', $fields);
while ($rs = $stmt->fetch(PDO::FETCH_ASSOC)) {
$OID = $rs['OID'];
$CID = $rs['CID'];
$row = null;
foreach ($tablearr[0] as $f) {
$row[] = htmlspecialchars($rs[$f]);
}
$row[] = '<a href="' . myUrl("{$urlPrefix}/ops_reset/{$OID}/{$CID}") . '">Reset</a> | ' . '<a href="' . myUrl("{$urlPrefix}/ops_shutdown/{$OID}/{$CID}") . '">Shutdown</a> | ' . '<a href="' . myUrl("{$urlPrefix}/edit/{$OID}/{$CID}") . '">Edit</a> | ' . '<a href="javascript:jsconfirm(\'Really Delete ' . $item . '?\',\'' . myUrl("{$urlPrefix}/ops_delete/{$OID}/{$CID}") . '\')">Delete</a>';
$tablearr[] = $row;
}
$data['body'][] = table::makeTable($tablearr);
$data['head'][] = '<script type="text/javascript" src="' . myUrl('js/jsconfirm.js') . '"></script>';
}
示例2: _make_user_table
function _make_user_table($n, &$data)
{
$dbh = getdbh();
//pagination
$stmt = $dbh->query('SELECT count(*) "total" FROM "users"');
$rs = $stmt->fetch(PDO::FETCH_ASSOC);
$total = $rs['total'];
$limit = $GLOBALS['pagination']['per_page'];
$data['body'][] = '<p>Showing records ' . ($n + 1) . ' to ' . min($total, $n + $limit) . ' of ' . $total . '</p>';
$data['body'][] = pagination::makePagination($n, $total, myUrl('users/manage'), $GLOBALS['pagination']);
//table
$stmt = $dbh->query("SELECT * FROM \"users\" LIMIT {$n},{$limit}");
$tablearr[] = explode(',', 'uid,username,password,fullname,created_dt,Action');
while ($rs = $stmt->fetch(PDO::FETCH_ASSOC)) {
$uid = $rs['uid'];
$row = null;
foreach ($rs as $k => $v) {
$row[$k] = htmlspecialchars($v);
}
$row[] = '<a href="' . myUrl("users/edit/{$uid}") . '">Edit</a> | <a href="javascript:jsconfirm(\'Really Delete User?\',\'' . myUrl("users/ops_delete/{$uid}") . '\')">Delete</a>';
$tablearr[] = $row;
}
$data['body'][] = table::makeTable($tablearr);
$data['head'][] = '<script type="text/javascript" src="' . myUrl('js/jsconfirm.js') . '"></script>';
}
示例3: _make_html_table
function _make_html_table($n, &$data)
{
$dbh = getdbh();
//pagination
$stmt = $dbh->query('SELECT count(OID) total FROM t_event');
$total = $stmt->fetchColumn();
$limit = $GLOBALS['pagination']['per_page'];
$data['body'][] = '<p>Showing records ' . ($n + 1) . ' to ' . min($total, $n + $limit) . ' of ' . $total . '</p>';
$data['body'][] = pagination::makePagination($n, $total, myUrl('mgmt_main/manage'), $GLOBALS['pagination']);
//table
$stmt = $dbh->query("SELECT created_dt,teamId,stationId,points,data FROM t_event LIMIT {$n},{$limit}");
$tablearr[] = explode(',', 'created_dt,teamId,stationId,points,data');
while ($rs = $stmt->fetch(PDO::FETCH_ASSOC)) {
$row = null;
foreach ($tablearr[0] as $f) {
$row[] = htmlspecialchars($rs[$f]);
}
$tablearr[] = $row;
}
$data['body'][] = table::makeTable($tablearr);
$data['body'][] = '<p><a href="' . myUrl("mgmt_main") . '">Back</a></p>';
$data['head'][] = '<script type="text/javascript" src="' . myUrl('js/jsconfirm.js') . '"></script>';
}