<%@ codepage ="936" %>
<%charset="gb2312"%>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<!--#include file="../login/0.asp"-->
<!--#include file="../../mycartconn/conn.asp" -->
<!--#include file="../../mycartconn/Function.asp"-->
<!--#include file="../../mycartconn/page.asp"-->
<%
dim action
action=server.htmlencode(request("action"))
if action="checklogin" then 
	response.write "1"
end If

conn.execute("update A_slide set views=0 where views<0")

if action="manage" then 
	response.write "<style>body, td, input, textarea, select, button{ color:#666; font:12px 'Lucida Grande', Verdana, Lucida, Helvetica, Arial, sans-serif; }</style>"

	where = " where id<>''"
	key=request("key")
	if request("key")<>"" Then
		where = where & " and (name like '%"&request("key")&"%' or tags like '%"&request("key")&"%' or ID like '%"&request("key")&"%' or huiyuan like '%"&request("key")&"%')"
	End If
	cate=request("cate")
	if request("cate")<>"" Then
		where = where & " and cate="&request("cate")&""
	End If
	if request("lx")<>"" Then
		Select Case CInt(request("lx"))
		Case 1
			where = where & " and tui=1"
		Case 2
			where = where & " and flag=1"
		Case 3
			where = where & " and flag=0"
		Case 4
			where = where & " and photoNum<=1"
		Case 5
			where = where & " and tui=0"
		Case 6
			where = where & " and hits<=1 and views=0"
		End select
	End If
	lx=request("lx")
	If lx="" Then lx=0

	orders=request("orders")
	If orders="" Then orders=0
	Select Case orders
	Case 0
		where = where & " order by datetime desc"
	Case 1
		where = where & " order by hits desc"
	Case 2
		where = where & " order by photoNum asc, datetime asc"
	Case 3
		where = where & " order by views desc"
	Case else
		where = where & " order by datetime desc"
	End Select

	Set rs= Server.CreateObject("ADODB.Recordset")
	sql="select id,cate,name,defpic,huiyuan,photoNum,datetime,hits,views,tui,flag from A_slide "&where&""

	rs.open sql,conn,1,1
	rs.CacheSize = 30
	page1("30")%>
	<table border="0" align="center" cellpadding="0" cellspacing="0">
	  <tr>
		<form name="form" method="post" action="?action=manage">
		  <td align="center"> 搜索：名称，标签，ID 
			<input name="key" type="text" class="wenbenkuang" id="key" size="10" maxlength="10">　<input name="lx" type="radio" value="0" <%If lx=0 Then response.write "checked"%>>所有 <input type="radio" name="lx" value="1" <%If lx=1 Then response.write "checked"%>>推荐 <input type="radio" name="lx" value="5" <%If lx=5 Then response.write "checked"%>>未推荐 <input type="radio" name="lx" value="2" <%If lx=2 Then response.write "checked"%>>已审  <input type="radio" name="lx" value="3" <%If lx=3 Then response.write "checked"%>>未审 <input type="radio" name="lx" value="4" <%If lx=4 Then response.write "checked"%>>一张图 <input type="radio" name="lx" value="6" <%If lx=6 Then response.write "checked"%>>零人气&nbsp; 　排序： <input type="radio" name="orders" value="0" <%If orders=0 Then response.write "checked"%>>时间&nbsp;<input type="radio" name="orders" value="1" <%If orders=1 Then response.write "checked"%>>人气&nbsp;<input type="radio" name="orders" value="3" <%If orders=3 Then response.write "checked"%>>外来&nbsp;<input type="radio" name="orders" value="2" <%If orders=2 Then response.write "checked"%>>图片数&nbsp;
			<input name="Submit" type="submit" class="go-wenbenkuang" value="搜索"> 
		  </td>
		</form>
	  </tr>
	</table>
	<TABLE>
	<TR>
		<TD height=10></TD>
	</TR>
	</TABLE>
	<TABLE border="0" align="center" cellpadding="0" cellspacing="0">
	  <TR>
		<TD height=25 bgcolor=#f1f1f1 style="padding-left:5px;padding-right:5px"><a href='?action=manage&key=<%=request("key")%>&lx=<%=request("lx")%>&page=<%=page%>'>全部</a>
	<%
		Set rs_cate= Server.CreateObject("ADODB.Recordset")
		sql_cate="select * from A_cate order by cateid"
		rs_cate.open sql_cate,conn,1,1
		Do While Not rs_cate.eof%>
			　|　<a href='?action=manage&key=<%=request("key")%>&lx=<%=request("lx")%>&page=<%=page%>&orders=<%=orders%>&cate=<%=rs_cate("cateid")%>'><%=Trim(rs_cate("cate"))%></a>
		<%
			rs_cate.movenext
		Loop
		rs_cate.close
		Set rs_cate=nothing%>
		</TD>
	  </TR>
	</TABLE>
	<TABLE>
	<TR>
		<TD height=5></TD>
	</TR>
	</TABLE>
	<%
	if Not (rs.bof And rs.eof) then
	%>
	<table width="100%" align="center">
	  <tr valign="middle"> 
	  <%i=1
	  ii=0

	while not rs.eof and i<=rs.pagesize
		my_id=rs("id")
		my_cate=rs("cate")
		my_catename=conn.execute("select cate from A_cate where cateid="&rs("cate")&"")(0)
		my_name=rs("name")
		my_defpic=rs("defpic")
		my_huiyuan=rs("huiyuan")
		my_photoNum=rs("photoNum")
		my_datetime=rs("datetime")
		my_hits=rs("hits")
		my_views=rs("views")
		my_tui=rs("tui")
		my_flag=rs("flag")
	%>
		<TD width=135 valign=bottom>
			<table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="cccccc" style="border:#dddddd 0px solid;">
			  <tr>
				<td height="100" align="center" bgcolor="#FFFFFF"  style="border:#dddddd 1px solid;" bgcolor=#ECF8FB><a href='<%myurl%>/mofahe.asp?moliheid=<%=my_id%>' title="[<%=my_catename%>] <%=my_name%>" target=_blank><img src="<%=my_defpic%>" width=120 height=90 border="0"></a></td>
			  </tr>
			 </table>
			 <table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="cccccc" style="border:#dddddd 0px solid;">
			  <tr>
				<td height="18" colspan=2  bgcolor=#ECF8FB style="padding:3px">会员：<a href="index.asp?action=manage&key=<%=my_huiyuan%>"><%=strLeft(Split(my_huiyuan,"@")(0),6)%></a></td>
			  </tr>
			  <tr>
				<td height="18" colspan=2  bgcolor=#ECF8FB style="padding:3px">名称：<%=strLeft(my_name,7)%></td>
			  </tr>
			  <tr>
				<td height="18" colspan=2  bgcolor=#ECF8FB style="padding:3px">图片：<%=my_photoNum%>　　<a href='manage.asp?action=reset&moliheid=<%=my_id%>&key=<%=request("key")%>&lx=<%=request("lx")%>&page=<%=page%>&orders=<%=orders%>&cate=<%=cate%>'>重设</a></td>
			  </tr>
			  <tr>
				<td height="18" colspan=2  bgcolor=#ECF8FB style="padding:3px">日期：<%=month(my_datetime)&"-"&day(my_datetime)&" "&hour(my_datetime)&":"&minute(my_datetime)%></td>
			  </tr>
			  <tr>
				<td height="18" colspan=2  bgcolor=#ECF8FB style="padding:3px">人气：<%=my_hits%> + <%=my_views%> 人次</td>
			  </tr>
			  <tr>
				<td width=100% height="20" align="center" bgcolor=#ECF8FB colspan=2 style="padding:3px">
				  <%
					If my_tui=0 Then
						response.write "<a href='manage.asp?action=tui&moliheid="&my_id&"&page="&page&"&lx="&request("lx")&"&key="&request("key")&"&orders="&request("orders")&"&cate="&request("cate")&"'>[推荐]</a>　"
					Else
						response.write "<a href='manage.asp?action=tui_f&moliheid="&my_id&"&page="&page&"&lx="&request("lx")&"&key="&request("key")&"&orders="&request("orders")&"&cate="&request("cate")&"'><font color=red>[已推]</font></a>　"
					End If
					If my_flag=0 Then
						response.write "<a href='manage.asp?action=shen&moliheid="&my_id&"&page="&page&"&lx="&request("lx")&"&key="&request("key")&"&orders="&request("orders")&"&cate="&request("cate")&"'>[审核]</a>　"
					Else
						response.write "<a href='manage.asp?action=shen_f&moliheid="&my_id&"&page="&page&"&lx="&request("lx")&"&key="&request("key")&"&orders="&request("orders")&"&cate="&request("cate")&"'><font color=red>[已审]</font></a>　"
					End if
					response.write "<a href='manage.asp?action=del&moliheid="&my_id&"&page="&page&"&lx="&request("lx")&"&key="&request("key")&"&orders="&request("orders")&"&cate="&request("cate")&"'>[删]</a>"
				  %>
				</td>
			  </tr>
			</table>
		</td>
	  <%i=i+1
	rs.MoveNext
	ii=ii+1
	If ii Mod 6=0 Then response.write "</tr><tr><td colspan=4 height=20></td></tr><tr>"
	wend%>
	  <tr valign="middle"> 
		<td colspan="6" align="center"> <%page2("action=manage&key="&request("key")&"&lx="&request("lx")&"&orders="&request("orders")&"&cate="&request("cate")&"&")%> </td>
	  </tr>
	</table>
	<%
	else
		response.write "<br><center><span style='font-size:14px;color:#CC0000'><b>暂无信息......</b></span></center>"
	end if
	rs.close
	set rs=nothing

end If


conn.close
Set conn=Nothing
%>
