<%@ page language="C#" autoeventwireup="true" inherits="admin_attachment_attachment, kfenlei" %><%@ Register Src="../inc/adminTop.ascx" TagName="adminTop" TagPrefix="qth8" %><!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>
<title>框分类信息系统 后台管理</title>
<link href="../css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div align="center">
<div class="main" align="left">
<qth8:adminTop ID="AdminTop1" runat="server" />
<div class="d01">
<div class="tabTitle">附件管理<span class="tabTitleCom">文件数量：<span style="color:#CC1100;"><%=iRecordCount%></span>&nbsp;&nbsp;Upload目录文件数量：<span style="color:#CC1100; width:100px;" id="attachmentCount"><a href="#nogo" onclick="showCount()" style="cursor:pointer;">[检测]</a></span>
</span></div>
<form name="fSearch" id="fSearch" class="layui-form" action="attachment.aspx" method="get">
<table border="0" width="100%" class="layui-table" cellspacing="0" cellpadding="0">
<tr>
<td><strong>筛选：</strong><input type="radio" value="0" name="a" lay-filter="a" checked="checked" title="全部" /><input type="radio" value="1" name="a" lay-filter="a" title="过期" /><input type="radio" value="2" name="a" lay-filter="a" title="正常" /><input type="radio" value="3" name="a" lay-filter="a" title="未知" />  <strong>缩略图：</strong><input type="radio" value="0" name="m" lay-filter="m" title="不显示" checked="checked" /><input type="radio" value="1" name="m" lay-filter="m" title="显示" /> 用户Id搜索： <input type="text" size="5" name="u" value="<%=u%>" class="inputText" />  文件名搜索： <input type="text" name="k" value="<%=k%>" class="inputText" size="10" style="width:100px;" /> 每页 <input type="text" style="width:50px;" name="c" class="inputText" value="<%=c%>" /> 条 <input type="submit" value="筛选" class="layui-btn layui-btn-small" /></td></tr>
</table>
</form>
<form id="fDel" class="layui-form" onsubmit="if(getRadio('e')=='3'){q$('fDel').action='check.aspx';}else{q$('fDel').action='../action.aspx?s=attachment';}" action="../action.aspx?s=attachment" method="post" name="del">
<table border="0" width="100%" class="layui-table" cellspacing="0" cellpadding="0">
<tr><td class="head" colspan="7"><strong>操作：</strong><input type="radio" value="1" name="e" title="删除（包括文件）" /><input type="radio" value="2" name="e" title="删除（不包括文件）" /><input type="radio" value="3" name="e" checked="checked" title="检查" /><input type="submit" value="执行" class="layui-btn layui-btn-small" /></td></tr>
</table>
<table border="0" width="100%" class="layui-table" cellspacing="0" cellpadding="0">
<thead>
<tr><td class="head"><input type="checkbox" id="checkAll" lay-skin="primary" lay-filter="checkAll" /> 全选 ID</td><td class="head">是否无用</td><td class="head">类别</td><td class="head">所属用户</td><td class="head">附件地址</td><td class="head">上传IP/日期</td><td class="head">操作</td></tr>
</thead>
<%=sList %>
<tr>
<td colspan="7">页码 <%=iPageIndex.ToString() %>/<%=iPageCount.ToString() %> <span class="color3">|</span> <a href="attachment.aspx?p=1&a=<%=a%>&c=<%=c%>&m=<%=m%>&k=<%=k%>&u=<%=u %>">首页</a> <a href="attachment.aspx?p=<%=iTp.ToString()%>&a=<%=a%>&c=<%=c%>&m=<%=m%>&k=<%=k%>&u=<%=u %>">上一页</a> <a href="attachment.aspx?p=<%=iNp.ToString()%>&a=<%=a%>&c=<%=c%>&m=<%=m%>&k=<%=k%>&u=<%=u %>">下一页</a> <a href="attachment.aspx?p=<%=iPageCount.ToString()%>&a=<%=a%>&c=<%=c%>&m=<%=m%>&k=<%=k%>&u=<%=u %>">尾页</a> <span class="color3">|</span> <input type="text" size="5" id="iPageIndex" class="inputText" /> <input type="button" value="转到" onclick="goPage()" class="bt1" /></td>
		  </tr>
	</table>
	</form>
</div>
</div>
</div>
<script type="text/javascript"> 
ckRadio("a","<%=a%>");
ckRadio("m","<%=m%>");
layui.use(['form','laydate'], function(){
var form = layui.form();
form.render();
form.on('radio(a)', function(data){
$("#fSearch").submit();
});
form.on('radio(m)', function(data){
$("#fSearch").submit();
});
form.on('checkbox(checkAll)', function(data){
if(data.elem.checked)
{
	$("input[name='id']").prop("checked",true);
}
else
{
	$("input[name='id']").prop("checked",false);
}
	form.render();
});
});
var sPathArr=new Array();
sPathArr[0]="/upload/";
var iP=0;
var iC=1;
var iCount=0;
var iDot=0;
function showCount()
{
	$("#attachmentCount").html("载入中……");
	setTimeout("searchDir(sPathArr[iP])", 1000);
	
}
function searchDir(sPath)
{

	$.get("insert.aspx",{s:"searchFile",p:encodeURI(sPath),t:Math.random()},function(data,status)
    {
		var sPathArrTemp=data.split(',');
		for(i=0;i<sPathArrTemp.length;i++)
		{
			var sFile=sPathArrTemp[i].split('|');
			if(sFile.length==2)
			{
				if(sPathArrTemp[i]!="")
				{
					sPathArr[iC]=sFile[0];
					iC++;
					iCount=iCount+parseInt(sFile[1]);
				}
			}
		}
		iP++;
		if(sPathArr.length>iP)
		{
			iDot++;
			if(iDot>3) iDot=0;
			var sDot="";
			for(n=0;n<iDot;n++)
			{
				sDot+=".";
			}
			$("#attachmentCount").html("载入中"+iCount+sDot);
			setTimeout("searchDir(sPathArr[iP])", 10);
		}
	   else
	   {
	   		$("#attachmentCount").html("载入完成"+iCount);
	   }
    });
}
function goPage()
{
	window.location.replace("attachment.aspx?p="+document.getElementById("iPageIndex").value+"&a=<%=a%>&c=<%=c%>&m=<%=m%>&k=<%=k%>&u=<%=u %>")
}
</script>
</body>
</html>
