コード例 #1
0
ファイル: borrow_list.php プロジェクト: yunsite/baoxu-project
            <a class = "btn" href = "?type=">全部</i></a>';
            break;
        case "return":
            //归还状态记录条数
            $borrowCount = getListCount("borrow", $conn, array("type", 2));
            //选择所有归还状态的数据
            $sql = "SELECT * FROM `borrow` WHERE `type` = '2' ORDER BY `borrow_id` DESC LIMIT " . ($nowPage - 1) * PAGE_SIZE . "," . PAGE_SIZE;
            //分类导航
            $subNav = '<a class = "btn" href = "?type=apply">申请中</a>
            <a class = "btn" href = "?type=borrow">借阅中</a>
            <a class = "btn btn-primary" href = "?type=return">已归还</a>
            <a class = "btn" href = "?type=">全部</i></a>';
            break;
        default:
            //全部记录条数
            $borrowCount = getListCount("borrow", $conn, array());
            //默认选取全部数据
            $sql = "SELECT * FROM `borrow` ORDER BY `borrow_id` DESC LIMIT " . ($nowPage - 1) * PAGE_SIZE . "," . PAGE_SIZE;
            //分类导航
            $subNav = '<a class = "btn" href = "?type=apply">申请中</a>
            <a class = "btn" href = "?type=borrow">借阅中</a>
            <a class = "btn" href = "?type=return">已归还</a>
            <a class = "btn btn-primary" href = "?type=">全部</i></a>';
            break;
    }
}
//总页数
$borrowPageCount = ceil($borrowCount / PAGE_SIZE);
//设置分页导航
if ($nowPage == 1) {
    if ($borrowPageCount == 1) {
コード例 #2
0
ファイル: index.php プロジェクト: yunsite/baoxu-project
</head>
<body>

<!--引入导航文件-->
<?php 
include "../common/nav.php";
?>

<!--判断用户权限-->
<?php 
include "../common/check_user_permission.php";
?>

<!--读取数据库,获取数目列表-->
<?php 
$bookCount = getListCount("book", $conn, array());
$bookPageCount = ceil($bookCount / PAGE_SIZE);
//判断GET中是否有page参数
if (!array_key_exists("page", $_GET)) {
    $nowPage = 1;
} else {
    if ($_GET["page"] <= 0) {
        $nowPage = 1;
    } else {
        $nowPage = $_GET["page"];
    }
}
if ($nowPage == 1) {
    if ($bookPageCount == 1) {
        $pageNav = '<li class="active"><span>&laquo; Prev</span></li>
                    <li class="active"><span>Next &raquo;</span></li>';
コード例 #3
0
ファイル: user_list.php プロジェクト: yunsite/baoxu-project
</head>
<body>

<!--引入导航文件-->
<?php 
include "../common/nav.php";
?>

<!--判断用户权限-->
<?php 
include "../common/check_admin_permission.php";
?>

<!--读取数据库,获取用户列表-->
<?php 
$userCount = getListCount("user", $conn, array());
$userPageCount = ceil($userCount / PAGE_SIZE);
//判断GET中是否有page参数
if (!array_key_exists("page", $_GET)) {
    $nowPage = 1;
} else {
    if ($_GET["page"] <= 0) {
        $nowPage = 1;
    } else {
        $nowPage = $_GET["page"];
    }
}
if ($nowPage == 1) {
    //当前是第一页而且总共只有一页的时候,禁用翻页按钮
    if ($userPageCount == 1) {
        $pageNav = '<li class="active"><span>&laquo; Prev</span></li>