<?php include 'view/admin_top.php'; ?>
<?php include 'view/article_top.php'; ?>
<p>
<a href="index.php?c=article&action=admin&menu=1" class="btn btn-success"> 新闻 </a>
<a href="index.php?c=article&action=admin&menu=2" class="btn btn-success"> 回顾 </a>
</p>
<table class="table">
    <tr>
        <td>名称</td>
        <td>时间</td>
        <td>操作</td>
    </tr>
    <?php
    if ($result) {
        foreach ($result as $row) {
            ?>
            <tr>
                <td><a href="index.php?c=article&action=edit&id=<?php echo $row['id'] ?>"><?php echo $row['title'] ?></a></td>
                <td><?php echo $row['add_time'] ?></td>
                <td><a href="index.php?c=article&action=edit&id=<?php echo $row['id'] ?>" class="btn btn-primary">编辑</a>
                    <a href="index.php?c=article&action=article_msg&id=<?php echo $row['id'] ?>" target="_blank" class="btn btn-success">预览</a>
                    <a href="index.php?c=article&action=del&id=<?php echo $row['id'] ?>" class="btn btn-danger">删除</a></td>
            </tr>
            <?php
        }
    } else {
        ?>
        <tr>
            <td colspan="3">没有数据</td>
        </tr>
        <?php
    }
    ?>
</table>