<?php
/*
* 项目: iOrange(橘子)
* 作者: 离家出走(yzxh24)
* Email: yzxh24@gmail.com
* 主页: www.iorange.cc
*/
/* vim: set ts=4 sw=4: */
define('IN_IORANGE', true);
require 'include/init.php';

if (!isWebRequest())
{
    iexit('禁止访问');
}
$page = S::gp('page', 'G');
$page = max(1, $page);
$total = $db->getValue('SELECT COUNT(*) FROM '.Book::table().' WHERE view = 1');
$pageSize = 2000;
$pageObj = new iPage();
$pageObj->setPageSize($pageSize);
$pageObj->setTotalRecord($total);
$sql = 'SELECT bookid,bookname FROM '.Book::table() . ' WHERE view = 1 ORDER BY bookid DESC LIMIT '.$pageObj->getOffset().','.$pageObj->getPageSize();
$books = $db->setQueryString($sql)->find();

include_once tpl('sitemap');