<%
'乘风多用户计数器
'作者QQ：178575
'作者EMail：yliangcf@163.com
'作者网站：http://www.qqcf.com
'详细简介：http://www.qqcf.com/cfcount.htm
'上面有程序在线演示，安装演示，使用疑难解答，最新版本下载等内容
'因为这些内容可能时常更新，没有放在程序里，请自己上网站上查看
%>
<%If SysCode="" Then Response.End%>

<table class="tb_1">
<tr class="tr_1"> 
<td colspan="3">网店类图片上传</td>
</tr>
<tr> 
<td colspan="3"><iframe style="top:2px" ID="UploadFiles" src="Upfile.asp?UserType=0&CheckCode=<%=RsSet("AdminCode")%>" frameborder=0 scrolling=no width="450" height="25" allowtransparency="true"></iframe></td>
</tr>


<tr class="tr_1"> 
<td colspan="3">网店类图片列表</td>
</tr>
<%
If ChkStr(Request("ImgType"),2)="" Then
 ImgType=0
Else
 ImgType=CInt(ChkStr(Request("ImgType"),2))
End If


PageUrl = "?Action="&Action&"&ImgType="&ImgType

'列出有效并为共享状态的图片
Sql="Select * From CFCount_Upfile where 1=1"

If ImgType=1 Then Sql=Sql&" and username=''"
If ImgType=2 Then Sql=Sql&" and username<>''"

Sql=Sql&" Order By AddTime Desc"

Set Rs=Server.CreateObject("Adodb.RecordSet")
Rs.open Sql,Conn,1,1

linenum=3
tdwidth=int(100/linenum)&"%"
jishu=1

If Not rs.eof then
 rs.pagesize=6
 totalrs=rs.RecordCount
 totalpage=rs.pageCount
 mypagesize=rs.pagesize
 Page=CLng(ChkStr(Request("Page"),2))
 If Page<=0 Then Page=1
 If Page>TotalPage Then Page=TotalPage
 rs.absolutepage=page
End If
While Not Rs.Eof And MyPageSize>0

if jishu mod linenum=1 or linenum=1 then
Response.write "<tr>"
end if%>
<td width="<%=tdwidth%>" valign="top">
<%
Response.write "<img src='Upload/"&Rs("FileName")&"'><br>"
 
Response.write "编号："&Rs("ID")&"<br>"

Response.write "上传人："
If Rs("UserName")="" Then
 Response.write "管理员"
Else
 Response.write Rs("UserName")
End If

Response.write "<br>"

Response.write "文件大小：" & CInt(Rs("FileSizeNum")/1024) &"k<br>"

Response.write "使用人数："
Sql="Select Count(1) From CFCount_User Where ImgFileName='"&Rs("FileName")&"'"
Set Rs2=Conn.Execute(Sql)
Response.write Rs2(0)
Rs2.Close()
Response.write "<br>"

Response.write "上传时间："&Rs("AddTime")&"<br>"

 Response.write "<a href='javascript:;' onclick=""$(function () { confirm('确定要删除吗?', '', function (isConfirm) {if (isConfirm) {gotoUrl('?Action=imgdel&ID="&Rs("ID")&"')}}, {confirmButtonText: '确定', cancelButtonText: '取消', width: 400});});"">删除</a>"
%>

</td>
<%
if jishu mod linenum=0 then
Response.write "</tr>"
Response.write "<tr><td colspan='6' height='1'></td></tr>"
end if
jishu=jishu+1
mypagesize=mypagesize-1
Rs.movenext
wend '写tr和td,jishu mod 列数为1时开始tr,为0时结束tr
Rs.Close

jishu=jishu-1
if jishu mod linenum <> 0 then
for i= 1 to linenum-(jishu mod linenum)
	response.write "<td width='"&tdwidth&"'>&nbsp;</td>"
	if  i = linenum-(jishu mod linenum) then response.write "</tr>"
next
end if '判断最后一行tr是否正好闭合,否则增加td,里面填入空格
%>
</table>


<%
Response.write GetPageList(TotalRs,TotalPage,Page,PageUrl,Px)
%>

<form name="form1" method="post" action="?action=<%=action%>">
<table class="tb_3">
<tr><td height="25" colspan='6'>
上传用户类型：<select name="imgtype">
<option value='0'<% If imgtype=0 Then Response.write " selected"%>>全部</option>
<option value='1'<% If imgtype=1 Then Response.write " selected"%>>系统管理员上传</option>
<option value='2'<% If imgtype=2 Then Response.write " selected"%>>用户上传</option>
</select>
<input type=submit name="submit" value="搜索">
</tr>
</table>
</form>
