<!--#include file="html_Fun.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="<%=sitepath%>css/bootstrap.min.css" rel="stylesheet">
<link href="<%=sitepath%>css/font-awesome.min.css" rel="stylesheet">
<link href="<%=sitepath%>css/animate.min.css" rel="stylesheet">
<link href="<%=sitepath%>css/style.min.css" rel="stylesheet">
<link href="<%=sitepath%>plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<link href="<%=sitepath&adminPath%>css/adminstyle.css" rel="stylesheet">
<script src="<%=sitepath%>js/jquery.min.js"></script>
<script src="<%=sitepath&adminPath%>js/adminjs.js"></script>
<!--[if lte IE 9]>
<script src="<%=sitepath%>js/respond.min.js"></script>
<script src="<%=sitepath%>js/html5.js"></script>
<![endif]-->
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content">
  <div class="row">
    <div class="col-sm-3">

<div class="panel">
								<div class="panel-heading">
									<h3 class="panel-title">文件目录</h3>
									<div class="panel-aj">
										<button type="button" class="btn-toggle-collapse"><i class="fa fa-chevron-down"></i></button>
										<button type="button" class="btn-remove"><i class="fa fa-times"></i></button>
									</div>
								</div>
<div class="panel-body">
<div class="panel-body no-padding">		
<div class="ibox float-e-margins">
        <div class="ibox-content">
          <div class="file-manager">
            <h5><a href="?<%=sitePath&CachePath%>">返回根目录</a></h5>
            <ul class="folder-list" style="padding: 0">
              <%call folder_list(CachePath,0)%>
            </ul>
          </div>
        </div>        
      </div>
</div>
</div>
    </div>

	</div>
	
    <div class="col-sm-9">

<div class="panel">
								<div class="panel-heading">
									<h3 class="panel-title">当前文件夹</h3>
									<div class="panel-aj">
										<button type="button" class="btn-toggle-collapse"><i class="fa fa-chevron-down"></i></button>
										<button type="button" class="btn-remove"><i class="fa fa-times"></i></button>
									</div>
								</div>
<div class="panel-body">
<div class="panel-body no-padding">		
<div class="ibox float-e-margins">
        <div class="ibox-content">
          <h5>当前文件夹：<%=CparentPath%></h5>       
    <button class="btn btn-danger" type="button" onClick="delfile('allCache')"><i class="fa fa-trash">　</i>删除全部缓存</button>
    <button id="remove" class="btn btn-danger" type="button" disabled><i class="fa fa-trash">　</i>删除文件</button>
         <button onClick="location.reload()" class="btn btn-primary1" type="button"><i class="fa fa-refresh"></i>　刷新</button>
         <div id="moswf"></div>
            <table id="table"
           data-toggle="table"
           data-pagination="true"  
           data-id-field="state"       
           data-id-table="advancedTable"
           data-page-size="50"
           data-page-list="[50,100,200]">
            <thead>
              <tr> 
              	<th class="tableid" data-field="state" data-checkbox="true"></th>
                <th  data-field="name" data-sortable="true">文件名</th>  
                <th data-sortable="true">查看</th>
                <th data-sortable="true">大小</th>
                <th data-sortable="true">时间</th>
                <th class="tablename" data-field="edit">操作</th>
              </tr>
            </thead>
              <%			  
			  dim fileList
			  fileList= getFolderList(CparentPath)			  
			  if instr(fileList(0),",")>0 then		  	
				  for  i = 0 to ubound(fileList)				  	 
					  fileAttr=split(fileList(i),",")
					  echo "<tr id='folder0'><td></td><td><i class='fa fa-folder'></i> <a title='"&fileAttr(2)&"' href=""?CparentPath="&fileAttr(4)&""">"&fileAttr(0)&"</a></td><td>"&fileAttr(1)&"</td><td>"&fileAttr(2)&"</td><td>"&fileAttr(3)&"</td><td></td></tr>"								  
				  next						
			  end if
				if isnul(CparentPath) then
				   echo "<tr><td colspan='6'>未选择目录</td></tr>"	
				else  
				  fileListArray= getFileList(CparentPath)
				  if instr(fileListArray(0),",")>0 then	
					  for  i = 0 to ubound(fileListArray)
						  fileAttr=split(fileListArray(i),",")
						  echo"<tr>"&vbcrlf  
						   echo "<td>"&fileAttr(0)&"</td>" 
						  echo "<td>"&fileAttr(4)&"</td>"
							if ifstrin("jpg,jpeg,png,gif,",LCase(fileAttr(1))) then
						 		echo "<td class='social-avatar'><a title='"&fileAttr(0)&"' rel='group1' href="&fileAttr(4)&" class='fancybox img-circle' ><img src="&fileAttr(4)&"></a>"
							elseif ifstrin("htm,html,css,js,asp,",LCase(fileAttr(1))) then
								echo "<td><a  target=""_blank"" href="""&fileAttr(4)&""">"&fileAttr(0)&"</a></td>"
							else
								echo "<td>"&fileAttr(0)&"</td>"
							end if
						  echo "<td>"&fileAttr(2)&"</td>"&vbcrlf  
						  echo "<td>"&fileAttr(3)&"</td>"&vbcrlf															
						 echo  "<td><a onclick=delfile('"&fileAttr(4)&"') class=""txt_C1"" >删除</a></td>"&vbcrlf& _	
						   "</tr>"&vbcrlf  
					  next		
				  end if				  
						
					  echo "<tr bgcolor=""#FFFFFF"" align=""center""><td></td><td><a href=?"&sitePath&CachePath&"><i class='fa fa-level-up'></i> 返回</a></td></tr>"
				 
				end if
				%>           
          </table>
        </div>
      </div>
</div>
</div>
      
    </div>

    </div>
</div>
</div>
<script src="<%=sitepath%>js/klorofil-common.js"></script>
<script src="<%=sitepath%>js/bootstrap.min.js"></script> 
<script src="<%=sitepath%>plugins/bootstrap-table/bootstrap-table.min.js"></script> 
<script src="<%=sitepath%>plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> 
<script src="<%=sitepath%>plugins/layer/layer.min.js"></script> 
<script src="<%=sitepath&adminPath%>js/content.min.js"></script> 
<script>
 var $table = $('#table')
 var $remove = $('#remove')
 $(function () {
        $table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table', function () {
            $remove.prop('disabled', !$table.bootstrapTable('getSelections').length);
        });
 $remove.click(function () {
            var ids = $.map($table.bootstrapTable('getSelections'), function (row) {
               return row.name
            });	
			delfile (ids)	
        });		
});
function delfile(path){parent.layer.confirm('确定删除吗？', function(){$.post("html_Fun.asp?act=del&filepath="+path,function(data){parent.layer.msg(data,{icon: 1});location.reload()});});}
 </script>
</BODY>
</HTML>