From 11b00e484be3fb1f74299f147c1c64310b68c457 Mon Sep 17 00:00:00 2001 From: Yuan Chiu Date: Thu, 9 Apr 2020 22:22:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=A0=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/index.php | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index 2c5aca1..23f50c8 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -1,24 +1,15 @@ getList(); -// $list = [ -// [ -// 'id' => 1, -// 'title' => 'text', -// 'updated_at' => '2020-04-01 12:13', -// ], -// [ -// 'id' => 2, -// 'title' => 'text', -// 'updated_at' => '2020-04-01 12:13', -// ], -// ]; +$page = !empty($_GET["p"])?$_GET["p"]:1; +$max_count = $db->getCount(); +$max_page = ceil($max_count/$list_max_count); +$list = $db->getList($page, $list_max_count); ?> @@ -40,6 +31,11 @@ $list = $db->getList();
+
+
    +
  • +
+
0) { echo ' @@ -80,6 +76,14 @@ $list = $db->getList(); echo '無資料'; } ?> +
+ +