本文整理汇总了PHP中pagination::generate方法的典型用法代码示例。如果您正苦于以下问题:PHP pagination::generate方法的具体用法?PHP pagination::generate怎么用?PHP pagination::generate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pagination
的用法示例。
在下文中一共展示了pagination::generate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlentities
$_msg .= htmlentities($db_name) . ", ";
} else {
$_err = 1;
$_msg = $db->error;
}
}
}
}
} else {
// get all dbs
$_q = "SHOW DATABASES {$search};";
if ($data = $db->query($_q)) {
while ($_d = $data->fetch_array()) {
$db_data[] = $_d;
}
$_total = count($db_data);
}
if ($_total > 0) {
// pagination
$perP = (int) $_SESSION['perp'] == 0 ? "10" : (int) $_SESSION['perp'];
$_pag = new pagination();
$db_dt = $_pag->generate($db_data, $perP);
foreach ($db_dt as $db_d) {
$db_dat[] = $db_d;
}
}
}
$pma->title = $lang->databases;
include $pma->tpl . "header.tpl";
include $pma->tpl . "main.tpl";
include $pma->tpl . "footer.tpl";
示例2: while
if ($nr == '0') {
echo $lang["no_tables"] . " !";
} else {
echo "<form action='mtb.php?k={$k}' method='post' align='left'>";
while ($row = mysql_fetch_row($result)) {
$vmi[] = $row[0];
}
// calculate tbl size and rows
$result = mysql_query("SHOW TABLE STATUS");
function convert($size)
{
$unit = array('B', 'KB', 'MB', 'GB', 'TB', 'PB');
return @round($size / pow(1024, $i = floor(log($size, 1024))), 2) . ' ' . $unit[$i];
}
while ($row = mysql_fetch_array($result)) {
$total_size = convert($row["Data_length"] + $row["Index_length"]);
$size[$row['Name']] = $total_size . "^" . $row['Rows'];
}
include 'pagination.class.php';
$pagination = new pagination();
$vmi = $pagination->generate($vmi, $perp);
foreach ($vmi as $tb) {
$a = explode("^", $size[$tb]);
echo "<input type='checkbox' name='tb[]' value='{$tb}'> <a href='table.php?k={$k}&tb={$tb}'>" . htmlentities($tb) . "</a> | " . $a[0] . " | " . ($a[1] == 1 ? '1 ' . $lang["row"] : $a[1] . ' ' . $lang["rows"]) . "<br/>";
}
echo "<br/>\r\n<select name='act'>\r\n<option value=''>" . $lang["With_selected"] . "...</option>\r\n<option value='DROP'>" . $lang["Drop"] . "</option>\r\n<option value='EXPORT'>" . $lang["Export"] . "</option>\r\n<option value='EMPTY'>" . $lang["Empty"] . "</option>\r\n<option value='RENAME'>" . $lang["Rename"] . "</option>\r\n</select>\r\n<input type='submit' value='" . $lang["Go"] . "'></form><p align='left'>";
echo $pagination->links();
mysql_free_result($result);
}
echo "<br/>- - -<br/>\r\n<form action='?' align='left'>" . $lang["Show"] . "<input type='text' name='perp' value='{$perp}' size='3'> <input type='hidden' value='{$k}' name='k'> <input type='submit' value='" . $lang["Per_Page"] . "'> </form><br/>\r\n<a href='addtable.php?k={$k}'>" . $lang["Add_table"] . "</a> | \r\n<a href='sql.php?k={$k}'>" . $lang["Sql_code"] . "</a> | \r\n<a href='export.php?k={$k}'>" . $lang["Export"] . "</a> | \r\n<a href='upl.php?k={$k}'>" . $lang["Upload_sql"] . "</a> |\r\n<a href='import.php?k={$k}'>" . $lang["Import_sql"] . "</a> | \r\n<a href='data/index.php?k={$k}'>" . $lang["Files"] . "</a><br/>\r\n <br/> {$nr} " . strtolower($lang["tables"]) . "\r\n</div>";
include 'foot.php';
示例3: header
if (!$ff) {
header("Location: ?");
}
foreach ($ff as $f) {
if ($_POST['ok']) {
@unlink($f);
$_msg .= basename($f) . ", ";
} else {
$_m .= "<input type='hidden' name='i[]' value='{$f}'>";
}
}
} else {
$files = glob("data/{$search}");
$_total = count($files) - 1;
// files - index.php
if ($_total > 0) {
// pagination
$perP = (int) $_SESSION['perp'] == 0 ? "10" : (int) $_SESSION['perp'];
$_pag = new pagination();
$f_dt = $_pag->generate($files, $perP);
foreach ($f_dt as $f_dt) {
if ($f_dt != 'data/index.php') {
$fl_dt[] = $f_dt;
}
}
}
}
$pma->title = $lang->Files;
include $pma->tpl . "header.tpl";
include $pma->tpl . "files.tpl";
include $pma->tpl . "footer.tpl";