<!--#include file="../../../inc/cms_admin.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>图片管理</title>
<script src="../../../js/jquery.min.js"></script>
<link href="<%=sitepath%>css/bootstrap.min.css" rel="stylesheet">
<link href="<%=sitepath%>plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<style>
body { font-size: 12px }
.table { margin-bottom: 20px !important }
#imageList { width: 620px; height: 315px; margin-top: 10px; overflow: hidden; overflow-y: auto }
#imageList img { cursor: pointer; border: 2px solid #fff }
#imgManager #imageList div { float: left; width: 100px; height: 100px; margin: 5px 10px }
.alignBar { widows: 100%; }
.alignBar label { float: left; margin: 10px; text-align: right; padding: 6px }
.alignBar #upfolder, #fileExt { background-color: #FFF; background-image: none; border: 1px solid #e5e6e7; border-radius: 1px; color: inherit; display: block; padding: 6px 12px; -webkit-transition: border-color .15s ease-in-out 0s, box-shadow .15s ease-in-out 0s; transition: border-color .15s ease-in-out 0s, box-shadow .15s ease-in-out 0s; width: 200px; font-size: 14px; float: left; margin: 10px 30px 10px 10px }
.alignBtn { position: fixed; width: 100%; height: 48px; background: #fff; z-index: 9; bottom: 0px; left: 0px; padding:5px 20px}
.check { width: 20px; height: 20px; display: block; position: relative; overflow: hidden; }
.check:before { content: ""; display: inline-block; position: absolute; width: 17px; height: 17px; left: 0; margin-left: 0px; border: 1px solid #cccccc; border-radius: 50%; background-color: #fff; -webkit-transition: border 0.15s ease-in-out; -o-transition: border 0.15s ease-in-out; transition: border 0.15s ease-in-out; }
.check::after { display: inline-block; position: absolute; content: " "; width: 11px; height: 11px; left: 3px; top: 3px; margin-left: 0px; border-radius: 50%; background-color: #555555; -webkit-transform: scale(0, 0); -ms-transform: scale(0, 0); -o-transform: scale(0, 0); transform: scale(0, 0); -webkit-transition: -webkit-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33); -moz-transition: -moz-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33); -o-transition: -o-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33); transition: transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33); }
.selected .check::after { transform: scale(1, 1); }
</style>
</head>

<body>
<div id="imgManager" class="panel">
  <div class="alignBar">
    <label>选择目录</label>
    <select id="upfolder">
      <%
	 dim upfolder,filePath,objFolder,objSubFolder,objSubFolders,i,selected
	 upfolder=getform("upfolder","both")
      set objFolder=fso.GetFolder(setfolder(sitepath&uploadpath))
	  set objSubFolders=objFolder.Subfolders
	  for each objSubFolder in objSubFolders
	  	if objSubFolder.name=upfolder then selected="selected" else selected=""
	   	echo  "<option value='"&objSubFolder.name&"' "&selected&">"&objSubFolder.name&"</option>"
	   next 
	  set objFolder=nothing
	  set objSubFolders=nothing
	  %>
    </select>
  </div>
  <table id="table"  class="table table-hover"   data-show-refresh="true"  data-show-toggle="true"  data-search="true" data-showColumns="true">
    <thead>
      <tr>
        <th data-field="name"  data-sortable="true">文件名</th>
        <th data-field="ext"  data-sortable="true">类型</th>
        <th data-field="url"  data-sortable="true">路径</th>
        <th data-field="size"  data-sortable="true">大小</th>
        <th data-field="date"  data-sortable="true">时间</th>
      </tr>
    </thead>
    <tbody></tbody>
  </table>
  <div class="alignBtn">  
    <button  class="btn btn-primary" id="upbutton"> 确 定 </button>   <button class="btn btn-primary" id="cancel">取 消</button>
  </div>
</div>
<script src="<%=sitepath%>plugins/bootstrap-table/bootstrap-table.min.js"></script> 
<script src="<%=sitepath%>plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> 
<script src="<%=sitepath%>plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> 
<script>
var index = parent.layer.getFrameIndex(window.name); 
$('#upbutton').on('click', function(){
   $("#table .success").each(function(){  
   var ext=$(this).find("td:eq(1)").text()
   var title=$(this).find("td:eq(0)").text()
   var url=$(this).find("td:eq(2)").text()
   parent.$("#file_list").show();
   parent.$("#file_tbody").prepend("<tr class='fileli'><td>"+ext+"</td><td><input name='C_Downname' value='"+title+"'></td><td><input name='C_DownURL' value='"+url+"'></td><td><i class='fa fa-arrow-up'></i> <i class='fa fa-arrow-down'></i> <i class='fa fa-remove'></i></td></tr>");
    parent.layer.close(index);
  });
});
$("#cancel").click(function(){ parent.layer.close(index);})
  function uploadlist(){
	   var upfolder = $("#upfolder").val()
	    $('#table').bootstrapTable('destroy');	  
        $("#table").bootstrapTable({
            url: "Manager.asp?upfolder="+upfolder+"&uptype=file"         
        })
  }
$(function () {        
  uploadlist()
  $("#upfolder").change(function(){uploadlist()})
})
$("#table tbody").on("click","tr",function(){
	 var o=$(this)
        if (o.hasClass("success")) {
            o.removeClass("success");           
        } else {
			o.addClass("success")
        }
    })
</script>
</body>
</html>
