<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:42:"themes/admin_h/user\admin_asset\index.html";i:1615187961;s:61:"D:\jsur\quant-server\public\themes\admin_h\public\header.html";i:1615187961;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->
    <link href="/themes/admin_h/public/assets/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="/themes/admin_h/public/assets/css/animate.css" rel="stylesheet">
    <link href="/themes/admin_h/public/assets/css/style.css?v=4.1.0" rel="stylesheet">
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script type="text/javascript">
        //全局变量
        var GV = {
            ROOT: "/",
            WEB_ROOT: "/",
            JS_ROOT: "static/js/",
            APP: '<?php echo \think\Request::instance()->module(); ?>'/*当前应用名*/
        };
    </script>
    <style type="text/css">
        .form-required{
            color:red;
        }
    </style>
    <script src="/themes/admin_h/public/assets/js/jquery-1.10.2.min.js"></script>
    <script src="/static/js/wind.js"></script>
    <script src="/themes/admin_h/public/assets/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="/themes/admin_h/public/assets/js/content.js?v=1.0.0"></script>
    <script>
        Wind.css('artDialog');
        Wind.css('layer');
        $(function () {
            $("[data-toggle='tooltip']").tooltip({
                container:'body',
                html:true,
            });
            $("li.dropdown").hover(function () {
                $(this).addClass("open");
            }, function () {
                $(this).removeClass("open");
            });
        });
    </script>

</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInUp">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>资源列表</h5>
                    </div>
                    <?php $status=['不可用', '可用']; ?>
                    <div class="ibox-content">
                        <table class="table table-hover">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>用户</th>
                                    <th>文件大小</th>
                                    <th>文件名</th>
                                    <th>图像</th>
                                    <th>文件路径</th>
                                    <th>状态</th>
                                    <th><?php echo lang('ACTIONS'); ?></th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php 
                                    $asset_img_suffixes=['bmp','jpg','jpeg','png','gif','tiff'];/*TODO ADD MORE*/
                                 if(is_array($assets) || $assets instanceof \think\Collection || $assets instanceof \think\Paginator): if( count($assets)==0 ) : echo "" ;else: foreach($assets as $key=>$vo): ?>
                                    <tr>
                                        <td><?php echo $vo['id']; ?></td>
                                        <td>
                                            <span class="line">用户ID:<?php echo $vo['user_id']; ?> <?php echo $vo['user_login']; ?> <?php echo $vo['user_nickname']; ?></span>
                                        </td>
                                        <td><?php echo round($vo['file_size']/1024); ?>KB</td>
                                        <td><?php echo $vo['filename']; ?></td>
                                        <td>
                                            <?php if(in_array(strtolower($vo['suffix']),$asset_img_suffixes)): ?>
                                            <a href="javascript:parent.imagePreviewDialog('<?php echo cmf_get_image_preview_url($vo['file_path']); ?>');">
                                                <img width="25" height="25" src="<?php echo cmf_get_image_url($vo['file_path']); ?>">
                                                </a>
                                            <?php endif; ?> 
                                                                <!-- <?php if(in_array(strtolower($vo['suffix']),$asset_img_suffixes)): ?>
                                                                     <img width="25" height="25" src="<?php echo cmf_get_image_url($vo['file_path']); ?>">
                                                                <?php endif; ?>  -->
                                        </td>
                                        <td>
                                            <?php echo $vo['file_path']; if(!file_exists('upload/'.$vo['file_path'])): ?>
                                                <span style='color:red;'>&nbsp;&nbsp(文件丢失)</span>
                                            <?php endif; ?>
                                        </td>
                                        <td><?php echo $status[$vo['status']]; ?></td>
                                        <td>
                                            <a href="<?php echo url('AdminAsset/delete',array('id'=>$vo['id'])); ?>" class="js-ajax-delete"><?php echo lang('DELETE'); ?></a>
                                        </td>
                                    </tr>
                                <?php endforeach; endif; else: echo "" ;endif; ?>
                            </tbody>
                        </table>
                        <div class="pagination"><?php echo (isset($page) && ($page !== '')?$page:''); ?></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<script src="/static/js/admin.js"></script>
</body>
</html>