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

<%
If Request("Assort")="" Then Assort=2 Else Assort=CInt(Request("Assort"))

Set Rs= Server.CreateObject("Adodb.RecordSet")
Sql="Select * From CFCount_User Where UserName='"&UserName&"'"
Rs.Open Sql,Conn,1,1
ImgFileName=Rs("ImgFileName")
%>
<table class="tb_1">

<form name="form5" method="post" action="?Action=imgmodifysave&Assort=<%=Assort%>">
<tr class="tr_1">
<td colspan="2">你的设置效果如下：</td>
</tr>
<tr> 
<td colspan="2"><img src="<%=Tmp%>cf.asp?c=<%=UserName%>" border="0">
</td>
</tr>
<tr class="tr_1">
<td colspan="2">网店类</td>
</tr>
<tr> 
<td colspan="2">
<a href="?Action=<%=Action%>&Assort=1"><b>使用自定义图片</b></a>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="?Action=<%=Action%>&Assort=2"><b>使用系统自带图片</b></a>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="?Action=<%=Action%>&Assort=3"><b>使用系统默认图片</b></a>&nbsp;&nbsp;&nbsp;&nbsp;
</td>
</tr>

<%
If Assort=1 Then
%>
<tr id="a_1"> 
<td colspan="2">  
<iframe style="top:2px" ID="UploadFiles" src="Upfile.asp?UserType=1&CheckCode=<%=Rs("UserCode")%>" frameborder=0 scrolling=no width="450" height="25" allowtransparency="true"></iframe>
</td>
</tr>
<%
ElseIf Assort=2 Then
%>
<tr id="a_2"> 
<td colspan="2" >
<table border="0" cellpadding="0" cellspacing="0" width=100%>
<tr><td height="25" colspan='6' bgcolor='#FFFFFF'>请选择以下图片：</td></tr>
<%
PageUrl = "?Action="&Action

'列出有效并为共享状态的图片
Sql="Select * From CFCount_Upfile 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 "<input type='radio' name='filename_2' value='"&Rs("FileName")&"'"
If ImgFileName=Rs("FileName") Then Response.write " checked"
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>"
%>
</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></td>
</tr>
<%
ElseIf Assort=3 Then
%>
<tr> 
<td colspan="2">
使用这个默认图片<br />
<img src="upload/default.jpg" border="0"></td>
</tr>

<%
End If
%>

<%
If Assort=2 or Assort=3 Then
%>
<tr id="a_3"> 
<td colspan="2"> <input type="submit" name="Submit" value="确定"> 
</td>
</tr>
<%End If%>

</form>

<%
If Assort=2 Then
%>

<tr id="a_4"> 
<td colspan="2"> 
<%
Response.write GetPageList(TotalRs,TotalPage,Page,PageUrl,Px)
%>      
</td>
</tr>
<%End If%>

</table>