{:extends file="groupuser_layout.tpl"}
{:block name="header_css" append}
    <link rel="stylesheet" href="/Public/static/admin/lib/DataTables-1.10.12/media/css/dataTables.bootstrap4.min.css">
    <link rel="stylesheet" href="/Public/static/admin/lib/DataTables-1.10.12/extensions/Buttons/css/buttons.bootstrap4.css">
    <style type="text/css">
        .headimgUrl {
            width: 300px;
            height: 300px;
        }
        .headposter_url {
            width: 300px;
            height: 300px;
        }
        .poster_url {
            width: 309px;
            height: 500px;
        }
    </style>
{:/block}
{:block name="content_title"}
{:/block}
{:block name="content_breadcrumb"}
    首页
{:/block}
{:block name="content_body"}
    <div class="panel panel-default">
        
        
        
        <div class="panel-heading">
        </div>
        <div class="panel-body">
            <div class="table-responsive">
                <table class="table table-striped table-bordered" id="users_table">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>微信昵称</th>
                            <th>微信头像</th>
                            <th>生成的头像</th>
                            <th>生成头像时间</th>
                            <th>生成的海报</th>
                            <th>生成海报时间</th>
                        </tr>
                        </thead>
                        <tbody class="text-left">
                        {:foreach from=$list item=item}
                            <tr>
                                <td>{:$item['id']}</td>

                                <td>{:$item['nickname']}</td>
                                <td><img class="headimgUrl" style="width:100px;height:100px;object-fit:contain;" src="{:$item['headimgurl']}" /></td>
                                <td>
                                    {:if $item['headposter_url']}
                                        <img class="headposter_url" style="width:100px;height:100px;object-fit:contain;" src="{:$item['headposter_url']}" />
                                        <span style="display:none">{:$item['headposter_url']}</span>
                                    {:/if}
                                </td>

                                <td >
                                    {:if $item['headposter_times'] != 0}
                                        {:$item.headposter_times|date_format:'%Y-%m-%d %H:%M:%S'}
                                    {:/if}
                                </td>

                                <td>
                                    {:if $item['poster_url']}
                                        <img class="poster_url" style="width:100px;height:100px;object-fit:contain;" src="{:$item['poster_url']}" />
                                        <span style="display:none">{:$item['poster_url']}</span>
                                    {:/if}
                                </td>

                                <td>
                                    {:if $item['poster_times'] != 0}
                                        {:$item.poster_times|date_format:'%Y-%m-%d %H:%M:%S'}
                                    {:/if}
                                </td>
                            </tr>
                        {:/foreach}
                        </tbody>
                </table>
            </div>
        </div>
    </div>
{:/block}
{:block name="body_js" append}
    <script type="text/javascript" language="javascript" src="/Public/static/admin/lib/DataTables-1.10.12/media/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" language="javascript" src="/Public/static/admin/lib/DataTables-1.10.12/media/js/dataTables.bootstrap4.min.js"></script>
    <script type="text/javascript" language="javascript" src="/Public/static/admin/lib/DataTables-1.10.12/extensions/Buttons/js/dataTables.buttons.min.js"></script>
    <script type="text/javascript" language="javascript" src="/Public/static/admin/lib/DataTables-1.10.12/extensions/Buttons/js/buttons.bootstrap4.min.js"></script>



    <script type="text/javascript" language="javascript" src="/Public/static/admin/lib/DataTables-1.10.12/extensions/Buttons/js/buttons.html5.min.js"></script>
    <script type="text/javascript" language="javascript" src="/Public/static/admin/lib/DataTables-1.10.12/extensions/Buttons/js/buttons.print.min.js"></script>
    <script type="text/javascript" language="javascript" src="/Public/static/admin/lib/DataTables-1.10.12/extensions/Buttons/js/buttons.colVis.min.js"></script>

    <script>
    
        var a = '{:$a}';
        $(document).ready(function() {
            
            $('.imgUrl').on('click',function(){
               var src = $(this).attr('src');
               $('#big').attr('src',src).show();
               $('.men').show();
            });
            
            $('#big,.men').on('click',function(){
               $('#big,.men').hide(); 
            });
            
            $('.order').on('click',function(){
                if(a == '倒序') {
                    window.location.href = "https://sob-deluxe.dev.izhida.cn/index.php/Admin/Info/index?order=normal"
                } 
                else if(a == '正序')
                {
                    window.location.href = "https://sob-deluxe.dev.izhida.cn/index.php/Admin/Info/index?order=desc"
                }
                else if(a == '默认')
                {
                    window.location.href = "https://sob-deluxe.dev.izhida.cn/index.php/Admin/Info/index?order=asc"
                }
                
            });
            
            var table = $('#users_table').DataTable({
                'bSort': false,
                "pagingType":   "full_numbers",
                lengthChange: false,
                buttons: [
                    {
                        extend: 'csvHtml5',
                        text: 'CSV',
                        exportOptions: {
                            stripHtml: true
                        }
                    },
                    {
                        extend: 'excelHtml5',
                        text: 'Excel',
                        exportOptions: {
                            stripHtml: true
                        }
                    }
                ],
                "bLengthChange": false,
                "iDisplayLength": 15,
                'language': {
                    "sProcessing": "处理中...",
                    "sLengthMenu": "显示 _MENU_ 项结果",
                    "sZeroRecords": "没有匹配结果",
                    "sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
                    "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
                    "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
                    "sInfoPostFix": "",
                    "sSearch": "搜索:",
                    "sUrl": "",
                    "sEmptyTable": "表中数据为空",
                    "sLoadingRecords": "载入中...",
                    "sInfoThousands": ",",
                    "oPaginate": {
                        "sFirst": "首页",
                        "sPrevious": "上页",
                        "sNext": "下页",
                        "sLast": "末页"
                    },
                    "oAria": {
                        "sSortAscending": ": 以升序排列此列",
                        "sSortDescending": ": 以降序排列此列"
                    }
                }
            });
            table.buttons().container().appendTo( '#users_table_wrapper .col-md-6:eq(0)' );

            jQuery("select").chosen({
                'min-width': '100px',
                'white-space': 'nowrap',
                disable_search_threshold: 10
            });
        });
    </script>
{:/block}