<!doctype html>
<html class="no-js">
<head>

<include file="Common/head" />

</head>
<body>

<include file="Common/header" />

<div class="am-cf admin">

    <!-- sidebar start -->
    <include file="Common/sidebar" nav="$nav"/>
    <!-- sidebar end -->

    <!-- Start right Content here -->
        <div class="content-page" style="background: white;">
            <!-- Start content -->
            <div class="content">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf">
                    <strong class="am-text-primary am-text-lg">Announcement Management</strong> / <small>Announcement List</small>
                </div>
            </div>
            <hr style="margin-top:0px;">
            
            <div class="am-g">
                  <div class="am-u-sm-12 am-u-md-4">
                    <div class="am-btn-toolbar">
                    <?php if ($xinzen) : ?>
                      <div class="am-btn-group am-btn-group-xs">
                        <a class="am-btn am-btn-secondary" href="{:U('add')}">
                          <span class="am-icon-plus">Add Announcement </span></a>
                      </div>
                      <?php endif;?>

                    </div>
                  </div>
                  
                </div>

            <div class="am-g">
                <div class="am-u-sm-12">
                    <table class="am-table am-table-hover table-main am-text-nowrap">
                        <thead>
                            <tr>
                                <th>ID</th>
                                
                                <th>Title</th>
                               
                                <th>Status</th>
                                <th>Created Date</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <volist name="list" id="vo">
                                <tr>
                                    <td>{$vo.id}</td>
                                   
                                    <td>{$vo.title}</td>
                                    
                                    
                                    <td>
                                        <?php if ($vo['status'] == 1) : ?>
                                           Enable
                                        <?php else : ?>
                                            Disable
                                        <?php endif;?>
                                    </td>
                                    <td>
                                        <if condition="$vo[create_time] gt 0">
                                            {$vo.create_time|date="Y-m-d H:i:s", ###}
                                        </if>
                                    </td>
                                    <td>
                                        <div class="am-dropdown" data-am-dropdown>
                                            <button class="am-btn am-btn-default am-btn-xs am-dropdown-toggle" data-am-dropdown-toggle>
                                                <span class="am-icon-cog"></span>
                                                <span class="am-icon-caret-down"></span>
                                            </button>
                                            <ul class="am-dropdown-content">
                                                <li>
                                                    <a href="{:U('edit',array('id' => $vo['id']))}">Edit</a>
                                                </li>
                                                <li>
                                                    <a class="del_link" data-name="{$vo.nickname}" data-url="{:U('del', array('id' => $vo[id]))}" href="javascript:;">
                                                        Delete
                                                    </a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                            </volist>
                        </tbody>
                    </table>
                    {$page}
                </div>
            </div>
        </div>
    </div>
    <!-- content end -->
</div>

<include file="Common/footer" />

<script type="text/javascript">
    $(function(){
        // 删除
        $(".del_link").on("click",function(){
            var name=$(this).attr("data-name");
            var the_link=$(this).attr("data-url");
            var bool = confirm("Confirm Delete");
            if (bool) {
                location.href = the_link;
            };
        });
    });
</script>
</body>
</html>