abu edit sample

This commit is contained in:
Yuan Chiu 2020-04-10 16:25:35 +08:00
parent 2a8971d2cb
commit 4717fec6cc
2 changed files with 26 additions and 2 deletions

View File

@ -67,6 +67,12 @@ section>form label textarea{
<label> <label>
<span>Content: </span> <span>Content: </span>
<textarea name="content"><?php echo $content; ?></textarea> <textarea name="content"><?php echo $content; ?></textarea>
<textarea name="content">
111
222
333
</textarea>
</label> </label>
</li> </li>
</ul> </ul>

View File

@ -6,10 +6,13 @@ use MessageBoard\Database\DbMessage;
$db = new DbMessage(); $db = new DbMessage();
$page = !empty($_GET["p"])?$_GET["p"]:1; $page = !empty($_GET["p"])?(int)$_GET["p"]:1;
$max_count = $db->getCount(); $max_count = !empty($_GET['rowcount']) ? (int)$_GET['rowcount'] : $db->getCount();
$max_page = ceil($max_count/$list_max_count); $max_page = ceil($max_count/$list_max_count);
$list = $db->getList($page, $list_max_count); $list = $db->getList($page, $list_max_count);
// $db->query("SELECT SQL_CALC_FOUND_ROWS * FROM xxx WHERE name='abc' LIMIT 100,10");
// $max_count = $db->getOne("SELECT FOUND_ROWS()");
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
@ -86,6 +89,21 @@ div.table-func {
</div> </div>
<section> <section>
<!-- 主表格 --> <!-- 主表格 -->
<?php
if (!empty($list) && count($list) > 0) {
?>
<table>
<thead>
<tr>
<th>id</th>
<th>title</th>
<th>updated_at</th>
<th>action</th>
</tr>
</thead>
<tbody>
<?php } ?>
<?php <?php
if (count($list) > 0) { if (count($list) > 0) {
echo ' echo '