<%@ LANGUAGE = VBScript.Encode %>
<!-- #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/class_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 CLASS WHERE CLASS_NO = '" & LK(J) & "'"
					CONN.Execute (SQL)
	NEXT
	Response.Redirect ("class_search.asp?PageNo=" & PageNo1 & "&search=all")

END IF
IF Request("SEARCH") <> "" THEN
	SQL ="SELECT * FROM CLASS "
	RS.Open SQL,CONN,adOpenKeyset,adLockReadOnly
		;W!UY,@*TP:C3H@#@&zfgAAA==^#~@%>
<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="class_search.asp" name="un">
  <table width="100%" border="1" class="main" bordercolor="#99CCFF" cellspacing="0" height="50" bordercolorlight="#FFFFFF">
    <tr bgcolor="#6699FF"> 
      <td width="6%"> 
        <div align="center"><font color="#FFFF33">删除</font></div>
      </td>
      <td width="23%"> 
        <div align="center"><font color="#FFFF33">类别编号</font></div>
      </td>
      <td width="23%"> 
        <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 > ~~P,VV0AAA==^#~@%> 
    <tr> 
      <td width="6%"> 
        <div align="center"> 
          <input type="checkbox" name="caozuo" value=<%=RS("class_no")%>>
        </div>
      </td>
      <td width="23%"> 
        <div align="center"><a href="class_update.asp?No=<%=Rs("Class_no")%>"><%=RS("class_no")%></a></div>
      </td>
      <td width="23%"> 
        <div align="center"><%=RS("class_name")%></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="15%"> 
        <div align="center"><%=PAGE%>页</div>
      </td>
      <td width="9%"> 
        <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="submit" name="add" value="填加" >
        </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="class_search.aspPageNo=<%=PageNo-1%>&amp;search=all"> 
          上一页 </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="search.asp">下一页</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="class_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不蜛==^#~@%>
	<%
	END IF	'记录大于0
	
	END IF	'search不蜛==^#~@%>
