<!--#include file="conn.asp"-->
<!--#include file="cookies.asp"-->
<!--#include file="../sd_site.asp"-->
<%IF request("C")="S" THEN
set rsc = Server.CreateObject("ADODB.RecordSet")
sql = "select sd_shenhe from [sd_show] where id="&request("id")&""
rsc.open sql, conn,1,3
if rsc("sd_shenhe")=1 then
rsc("sd_shenhe")=0
else
rsc("sd_shenhe")=1
end if
rsc.update
rsc.close
set rsc=nothing
Response.redirect"sd_listsj.asp"
Response.end
END IF

IF request("C")="F" THEN
set rsc = Server.CreateObject("ADODB.RecordSet")
sql = "select sd_indexxs from [sd_show] where id="&request("id")&""
rsc.open sql, conn,1,3
if rsc("sd_indexxs")=1 then
rsc("sd_indexxs")=0
else
rsc("sd_indexxs")=1
end if
rsc.update
rsc.close
set rsc=nothing
Response.redirect"sd_listsj.asp"
Response.end
END IF

Set fs=Server.CreateObject("Scripting.FileSystemObject")
IF request("C")="D" THEN
id=trim(request("id"))
ArrayID = Split(id,",")
For i=0 TO ubound(ArrayID)
Conn.execute("delete * from [sd_show] where id="&CInt(ArrayID(i))&"")
Next
For i=0 TO ubound(ArrayID)
Conn.execute("delete * from [sd_pinglun] where sd_show_id in("&CInt(ArrayID(i))&")")
Next
response.Write("<script>alert(""删除成功"");window.location.href='sd_listsj.asp';</script>")
Response.end
END IF
%>
<HTML>
<HEAD>
<title>商奇评测系统 www.583344.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<LINK href="images/Admin_css.css" type=text/css rel=stylesheet>
<SCRIPT language=javascript>
function loadThreadFollow(t_id,b_id){
	var targetImg =eval("document.all.followImg" + t_id);
	var targetDiv =eval("document.all.follow" + t_id);
	
	if ("object"==typeof(targetImg)){
		if (targetDiv.style.display!='block'){
			targetDiv.style.display="block";
			
		}else{
			targetDiv.style.display="none";
		}
	}
}
function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall')
       e.checked = form.chkall.checked;
    }
  }
function INtitle(addtitle) { 
var revisedtitle; 
revisedtitle = addtitle; 
document.form1.title.value=revisedtitle + document.form1.title.value; 
document.form1.title.focus(); 
return; 
}
function loadForm()
{
  editor.HtmlEdit.document.body.innerHTML=document.form1.Content.value;
  return true
}
</SCRIPT>
</HEAD>
<BODY>
<table width="95%" border="0" cellspacing="2" cellpadding="3"  align=center class="admintable" style="margin-bottom:5px;">
    <tr>
      <td height="25" bgcolor="f7f7f7">
<FORM name=sou1 action="?seo=1" method=POST>
    按帐号：
    <input type="text" name="T1" size="10" class="s26">
    <input type="submit" value="查 找" name="B1" class="bnt">
    </form></td>
      <td width="550" bgcolor="f7f7f7">
<input type="button" name="button" value="所有商家" class="bnt" onClick="window.location.href='?seo='" />
<input type="button" name="button" value="未审商家" class="bnt" onClick="window.location.href='?seo=2'" />
</td>
    </tr>
</table>

<FORM name=thisForm action="?C=D" method=POST>
<%
dim ThisPage,Pagesize,Allrecord,Allpage
if request("page")="" then
  ThisPage=1		
else
  ThisPage=request("page")
end if
seo=request("seo")
set rs = Server.CreateObject("ADODB.RecordSet")
set rs1 = Server.CreateObject("ADODB.RecordSet")
Select Case seo
Case "1"
sql="select * from sd_show where sd_name like '%"&trim(request("T1"))&"%' order by id desc"
Case "2"
sql="select * from sd_show where sd_shenhe=0 order by id desc"
Case Else
sql="select * from sd_show order by id desc"
End Select
rs.open sql,conn,1,1
if rs.eof then
response.write "<li>还没有用户数据！"
response.end
end if
rs.Pagesize=20
Pagesize=rs.Pagesize
Allrecord=rs.Recordcount
Allpage=rs.Pagecount
if ThisPage<1 then                           
ThisPage=1
end if
On Error Resume Next
rs.move (ThisPage-1)*Pagesize
k=0
%>
<table height="1" border="0" cellpadding="3"  cellspacing="1" bgcolor="#F2F9E8" class="admintable1">
  <tr>
    <td colspan="16" class="admintitle">所有商家</td>
  </tr>
  <tr bgcolor="E8FBD1" align="center">
    <td width="4%" height="30">序号</td>
    <td>商家名称</td>
    <td width="14%">商家网址</td>
    <td width="8%">添加时间</td>
    <td width="6%">地区</td>
    <td width="4%">审核</td>
    <td width="4%">首页</td>
    <td width="4%">级别</td>
    <td width="4%">密码</td>
    <td width="6%">静态</td>
    <td width="4%">点击</td>
    <td width="4%">排序</td>
    <td width="4%">积分</td>
    <td width="4%">评论</td>
    <td width="4%">操作</td>
    <td width="4%">选择</td>
  </tr>
  <%
  dim id
  do while not rs.eof
  id=rs("id")
  %>
	<tr align="center" bgcolor="#FFFFFF">
	<td height="30"><%=k+1%></td>
	<td><a href="<%if JT=1 then%>../sd_<%=rs("id")%>.htm<%else%>../sd_show.asp?id=<%=rs("id")%><%end if%>" target="_blank"><%=rs("sd_name")%></a></td>
	<td><%=replace(rs("sd_url"),"http://","")%></td>
	<td><%=datevalue(rs("sd_datas"))%></td>
	<td><%set rsc = Server.CreateObject("ADODB.RecordSet")
sql = "select id,sd_title from sd_yys where id="&rs("sd_classid")&""
rsc.open sql, conn,1,1
%><a href="../sd_fox.asp?fox=<%=rsc("id")%>" target="_blank"><%=rsc("sd_title")%></a><%rsc.close
set rsc=nothing%></td>
	<td><a href="?C=S&id=<%=id%>"><%IF rs("sd_shenhe")=0 then%><font color="#FF0000">未审</font><%else%><font color="#008000">已审</font></a><%end if%></a></td>
	<td><a href="?C=F&id=<%=id%>" title="首页分类显示"><%if rs("sd_indexxs")=1 then%><font color="#FF0000">是</font><%else%>否<%end if%></a></td>
	<td><%if rs("sd_cn_rz")=3 then%><font color="#FF9900">金钻</font><%end if%><%if rs("sd_cn_rz")=2 then%><font color="#0000FF">蓝钻</font><%end if%><%if rs("sd_cn_rz")=1 then%><font color="#999999">灰钻</font><%end if%><%if rs("sd_cn_rz")=0 then%>普通<%end if%></td>
	<td><%if rs("sd_password")<>"" then%><font color="#FF0000">有密</font><%else%>无密<%end if%></td>
	<td><%if JT=1 then%><%If (fs.FileExists(server.MapPath("/")&"\sd_"&id&".htm")) Then%><font color="#008000"><a href="sd_htmlnid.asp?id=<%=id%>">已生成</a></font><%else%><a href="sd_htmlnid.asp?id=<%=id%>"><font color="#FF0000">未生成</font></a><%end if%><%end if%><%if JT=0 then%>动态<%end if%></td>
	<td><%=rs("sd_hits")%></td>
	<td><%=rs("sd_tj_px")%></td>
	<td><%=rs("sd_jifen")%></td>
	<td><%=rs("sd_pinglun")%></td>
	<td><font color="#FF0000"><span id="followImg<%=k%>" style="CURSOR: hand" onClick="loadThreadFollow(<%=k%>,5)">面版</span></font></td>
	<td><input type="checkbox" name="id" value="<%=trim(rs("id"))%>"></td>
	</tr>
  <tr style="display:none" id="follow<%=k%>" height="30">
    <td colspan="6">&nbsp;地址：<%=rs("sd_address")%>&nbsp;&nbsp;简称：<%=rs("sd_namejx")%></td>
    <td colspan="10"><div align="center">
&nbsp;<a href="sd_Manage.asp?C=CC&id=<%=trim(rs("id"))%>">修改商家信息</A>
&nbsp;<a href="sd_Manage.asp?C=P&id=<%=trim(rs("id"))%>">修改点击、排序、积分，级别</A>
&nbsp;<a href="sd_Manage.asp?C=E&id=<%=trim(rs("id"))%>">设置管理密码</A>
&nbsp;<a onclick='{if(confirm("您确定删除吗？！")){return true;}return false;}' href="?C=D&id=<%=trim(rs("id"))%>">直接删除</a></div></td>
  </tr>
    <%
    k=k+1
    rs.movenext
    if k>=Pagesize then exit do
	loop
	rs.close
    set rs=nothing
    set rs1=nothing
    closedb
	%>
<tr><td height="30" colspan="16"><input type="checkbox" name="chkall" onClick="javascript:CheckAll(this.form)"> 
  全选记录
  <input type="submit" value="删除" name="action" onClick="{if(confirm('确定删除选定的吗?')){this.document.thisForm.submit();return true;}return false;}">
  共有&nbsp;<font color="#CC5200"><%=Allrecord%></font>&nbsp;条记录 共 <font color="#CC5200"><%=Allpage%></font> 页 现在是第 <font color="#CC5200"><%=ThisPage%></font> 页
<%
if ThisPage<2 then     
response.write "<font color=""#808080"">首页</font>&nbsp;"
response.write "<font color=""#808080"">上一页</font>&nbsp;"     
else     
response.write "<a href=?page=1&t1="&trim(request("t1"))&"&seo="&seo&">首页</a>&nbsp;"
response.write "<a href=?page=1&t1="&trim(request("t1"))&"&seo="&seo&">上一页</a>&nbsp;"     
end if
if Allpage-ThisPage<1 then     
response.write "<font color=""#808080"">下一页</font>&nbsp;"
response.write "<font color=""#808080"">尾页</font>&nbsp;"  
else     
response.write "<a href=?page="&(ThisPage+1)&"&t1="&trim(request("t1"))&"&seo="&seo&">下一页</a>&nbsp;"   
response.write "<a href=?page="&Allpage&"&t1="&trim(request("t1"))&"&seo="&seo&">尾页</a>&nbsp;"     
end if
%></td></tr>
</table>
</form>
<!--#include file="sd_copy.asp"-->
</BODY> 
</HTML>
