2020-04-04 18:17:47 +08:00

83 lines
2.1 KiB
PHP

<?php
require_once 'config.php';
require_once FOLDER_ROOT.'/lib/Database/DbMessage.php';
$list = [
[
'id' => 1,
'title' => 'text',
'updated_at' => '2020-04-01 12:13',
],
[
'id' => 2,
'title' => 'text',
'updated_at' => '2020-04-01 12:13',
],
];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<header>
<h1>留言板</h1>
</header>
<div id="main">
<div class="func-btn">
<ul>
<li><a href="edit.php" class="btn">New</a></li>
</ul>
</div>
<section>
<!-- 主表格 -->
<?php
if (count($list) > 0) {
echo '
<table>
<thead>
<tr>
<th>id</th>
<th>title</th>
<th>updated_at</th>
<th>action</th>
</tr>
</thead>
<tbody>
';
foreach ($list as $key => $item) {
echo '
<tr>
<th>id</th>
<td>title</td>
<td>updated_at</td>
<td>
<ul>
<li><a href="" class="btn">Edit</a></li>
<li><a href="" class="btn">Delete</a></li>
</ul>
</td>
</tr>
';
}
echo '
</tbody>
</table>
';
}
else {
echo '無資料';
}
?>
</section>
</div>
</body>
</html>