<!-- #include virtual = "/include/myopen.asp" -->
<%
	set RS = Server.CreateObject("ADODB.RecordSet")
	set RS1 = Server.CreateObject("ADODB.RecordSet")
%>
<%	'判断用户是否登陆过
	IF Request.Cookies ("Admin_name") = "" OR Request.Cookies ("Admin_Pass") ="" THEN
	'没有登陆
	Response.Redirect ("/manage/Admin_Login.ASP")
	END IF
	IF REQUEST("HOME") <> "" THEN
	Response.Redirect ("/manage/default.asp")
	END IF
	IF REQUEST("Add") <> "" THEN
	Response.Redirect ("/manage/name_add.asp")
	END IF
	'用户已经成功注册

	DIM LK(20)
'第一次查询

IF REQUEST("DEL") <> "" THEN
	PageNo = Request("PageNo1")
	CAOZUO = TRIM(REQUEST("CAOZUO"))
	POP = INSTR(CAOZUO,",")
		I = 0
		WHILE POP >0
			LK(I) = TRIM(MID(CAOZUO,1,POP-1))
			CAOZUO = TRIM(MID(CAOZUO,POP+1))
			POP=INSTR(CAOZUO,",")
			I = I + 1
		WEND
		LK(I)=TRIM(MID(CAOZUO,1))
	FOR J = 0 TO I
	'删除记录
		'判断有无子类别
				SQL = "DELETE * FROM QIANBI WHERE NUM = " & LK(J) & ""
				CONN.Execute (SQL)
			
	NEXT
	Response.Redirect ("name_search.asp?PageNo=" & PageNo1 & "&Lb=" & Request("Lb") & "&search=all&class1=" & request("class1") & "&class2=" & request("class2") & "&card_name=" & request("card_name") & "&jg1=" & request("jg1") & "&no1=" & request("no1") & "&jg2=" & request("jg2") & "&fxsj=" & request("fxsj") & "")

END IF
IF Request("SEARCH") <> "" THEN
		IF REQUEST("CLASS1") <> "" THEN
			AA= " AND CLASS = '" & REQUEST("CLASS1") & "' "
		END IF
		IF REQUEST("CLASS2") <> "" THEN
			BB= " AND ZLB = '" & REQUEST("CLASS2") & "' "
		END IF
		IF REQUEST("Jg1") <> "" THEN
			CC= " AND Jg >= " & REQUEST("Jg1") & " "
		END IF
		IF REQUEST("Jg2") <> "" THEN
			DD= " AND Jg < " & REQUEST("Jg2") & " "
		END IF
		IF REQUEST("Lb") <> "" THEN
			EE= " AND Lb Like '%" & REQUEST("Lb") & "%' "
		END IF
		IF REQUEST("No1") <> "" THEN
			EE= " AND No1 ='" & REQUEST("No1") & "' "
		END IF

	SQL ="SELECT * FROM QIANBI WHERE  No1 <> '' " & AA & BB & CC & DD & EE
	RS.Open SQL,CONN,adOpenKeyset,adLockReadOnly
		IF RS.RecordCount >0 THEN
%>
<html>
<head>
<title>网站后台类别管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.main {  font-size: 9pt}
-->
</style>
</head>

<body bgcolor="#FFFFFF">
<script language="javascript">
var lsdz = "";
function checkIn()
{    
   if(confirm("你现在真的要删除您选择的记录吗?"))
      return true
   else
      return false;
}
</script>
<p align="center" class="main">本站中的商品明细（每页20条记录） 
<form method="post" action="name_search.asp" name="un">
  <input type=hidden name=class1 value="<%=request("class1")%>">
  <input type=hidden name=no1 value="<%=request("no1")%>">
  <input type=hidden name=class2 value="<%=request("class2")%>">
<input type=hidden name=Lb value="<%=request("Lb")%>">
<input type=hidden name=jg1 value="<%=request("jg1")%>">
<input type=hidden name=jg2 value="<%=request("jg2")%>">
  <table width="100%" border="1" class="main" cellspacing="0" height="50" bordercolor="#99CCFF" bordercolorlight="#FFFFFF">
    <tr bgcolor="#6699FF"> 
      <td width="4%"> 
        <div align="center"><font color="#FFFF33">删除</font></div>
      </td>
      <td width="9%"> 
        <div align="center"><font color="#FFFF99">总类别</font></div>
      </td>
      <td width="20%"> 
        <div align="center"><font color="#FFFF33">类别</font></div>
      </td>
      <td width="34%"> 
        <div align="center"><font color="#FFFF33">名称</font></div>
      </td>
      <td width="16%"> 
        <div align="center"><font color="#FFFF33">零售价</font></div>
      </td>
      <td width="6%"> 
        <div align="center"><font color="#FFFF33">优惠价</font></div>
      </td>
      <td width="11%"> 
        <div align="center"><font color="#FFFF33">商品编号</font></div>
      </td>
    </tr>
    <%
		'判断显示的总页数
			RS.MoveLast 
			RECO=RS.RecordCount 
			AA = RECO MOD 20
			IF AA = 0 THEN
			PAGE = INT(RECO/20)
			ELSE
			PAGE = INT(RECO/20)+1
			END IF
			RS.MoveFirst 
				'定位页数
				PageNo = Request("PageNo")
				if PageNo <> "" Then
				
				else
					PageNo=1
				
				End if
			RS.PageSize = 20	'每页一10条
			RS.AbsolutePage = PageNo
		RowCount = RS.PageSize
		Do While Not RS.EOF and RowCount > 0 
		
    %> 
    <tr> 
      <td width="4%"> 
        <div align="center"> 
          <input type="checkbox" name="caozuo" value=<%=RS("num")%>>
        </div>
      </td>
      <td width="9%"> 
        <div align="center"><%=Rs("Class")%></div>
      </td>
      <td width="20%"> 
        <div align="center"> <%=Rs("Zlb")%> </div>
      </td>
      <td width="34%"> 
        <div align="center"><a href="name_update.asp?No=<%=Rs("num")%>&PageNo=<%=PageNo%>&search=all&class1=<%=Request("Class1")%>&Class2=<%=Request("Class2")%>&lb=<%=REquest("Lb")%>&jg1=<%=REquest("Jg1")%>&jg2=<%=Request("jg2")%>&No1=<%=Request("No1")%>"><%=RS("Lb")%></a></div>
      </td>
      <td width="16%"> 
        <div align="center"><%=RS("Jg")%></div>
        <div align="center"></div>
      </td>
      <td width="6%"> 
        <div align="center"><%=RS("Bjg")%></div>
      </td>
      <td width="11%"> 
        <div align="center"><%=RS("No1")%></div>
      </td>
    </tr>
    <%
			RS.MoveNext
			RowCount = RowCount - 1
			Loop
			RS.Close 
			%> 
  </table>
  <table width="100%" border="1" class="main" cellspacing="0" bordercolor="#99CCFF" bordercolorlight="#FFFFFF">
    <tr> 
      <td width="9%"> 
        <div align="center">总计：</div>
      </td>
      <td width="7%"> 
        <div align="center"><%=PAGE%>页</div>
      </td>
      <td width="17%"> 
        <div align="center"> 
          <input type="submit" name="Home" value="主页">
        </div>
      </td>
      <td width="9%"> 
        <div align="center"> 
          <input type="submit" name="Del" value="删除" onClick="return checkIn();">
        </div>
      </td>
      <td width="9%"> 
        <div align="center"> 
          <input type="button" name="Button" value="取消" onClick=history.back()>
        </div>
      </td>
      <td width="18%"> 
        <div align="center">显示 
          <input type="text" name="PageNo" size="4" maxlength="6">
          页 
          <input type="submit" name="Search" value="Go">
        </div>
      </td>
      <td width="14%"> 
        <div align="center"> <%
                IF INT(PageNo) >1 THEN
                %><a href="name_search.asp?PageNo=<%=PageNo-1%>&search=all&class1=<%=Request("Class1")%>&Class2=<%=Request("Class2")%>&lb=<%=REquest("Lb")%>&jg1=<%=REquest("Jg1")%>&jg2=<%=Request("jg2")%>&No1=<%=Request("No1")%>&fxsj=<%=request("fxsj")%>">  上一页 </a> <%
                ELSE
                %> 上一页 <%
                END IF
                %> </div>
      </td>
      <td width="17%"> 
        <div align="center"> <%
                IF INT(PageNo) <=INT(PAGE) AND INT(PageNo+1) <INT(PAGE) THEN
                %> <a href="name_search.asp?PageNo=<%=PageNo+1%>&search=all&class1=<%=Request("Class1")%>&Class2=<%=Request("Class2")%>&lb=<%=REquest("Lb")%>&jg1=<%=REquest("Jg1")%>&jg2=<%=Request("jg2")%>&No1=<%=Request("No1")%>&fxsj=<%=request("fxsj")%>">下一页</a> <%
                ELSE
                %> 下一页 <%
                END IF
                %> </div>
      </td>
    </tr>
  </table>
</form>
</body>
</html>

<%
	ELSE
	%>
	<html>
<head>
<title>后台管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.main {  font-size: 9pt}
-->
</style>
</head>

<body bgcolor="#FFFFFF">
<div align="center"><span class="main">没有查询到相应内容，请核对查询条件！ </span></div>
<form method="post" action="name_search.asp" name="un">
  <div align="center"> <span class="main">
    <input type="submit" name="add" value="增加内容">
    <input type="submit" name="home" value="返回主页">
    </span></div>
</form>
<p>&nbsp;</p></body>
</html>
	<%
	END IF	'记录大于0
	
	END IF	'search不为空
%>
