c5_labsci/web/www/listpage.php

59 lines
1.9 KiB
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Ciyon - 众产全栈开发框架</title>
<meta name="keywords" content="全栈开发框架,Golang开发框架,PHP开发框架,移动端开发框架,Vue3开发框架" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0, shrink-to-fit=no" />
<link rel="stylesheet" href="/jscss/web.css" />
<script src="/jscss/theme.js"></script>
</head>
<body>
<div class="title">
<?php
$cate = getint('cate');
$pageno = getint('pageno');
$pagecount = 5;
$current_page = '/wlist/2';
if ($pageno > 1)
$current_page = '/wlist/2/2';
include_once("www/_header.php");
?>
</div>
<div class="vtitle">/web/www/listpage.php</div>
<div>
<?php
$csql = new \ciy\sql('www_list_cate');
$csql->where('id', $cate);
$row = $db->getone($csql);
clog($row);
$csql = new \ciy\sql('www_list_art');
$csql->where('cateid', $cate);
$csql->where('bshow', 1);
$csql->limit($pageno, $pagecount);
$csql->order('id desc');
$csql->column('id,name');
$count = -1;
$rows = $db->get($csql, $count);
foreach ($rows as $row) {
echo '  <a href="/wlist/' . $cate . '/art/' . $row['id'] . '">' . $row['name'] . '</a><br>';
}
clog('总条数: ' . $count);
?>
</div>
<div class="vpage">
<?php
\web\cwebcomon::www_showpage($count, $pageno, $pagecount, '/wlist/' . $cate, function ($pageno) {
if ($pageno < 2)
return '';
return '/' . $pageno;
});
?>
</div>
<?php include_once("www/_footer.php"); ?>
</body>
</html>