当前位置: 首页>>代码示例>>PHP>>正文


PHP pagination::makePagination方法代码示例

本文整理汇总了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>';
}
开发者ID:brata-hsdc,项目名称:brata.masterserver,代码行数:30,代码来源:manage.php

示例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>';
}
开发者ID:469306621,项目名称:Languages,代码行数:25,代码来源:manage.php

示例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>';
}
开发者ID:brata-hsdc,项目名称:brata.masterserver,代码行数:23,代码来源:showevents.php


注:本文中的pagination::makePagination方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。