
<!-- #include file="conn.asp"-->
<%
select case request("action")
	case "mod_orders"'修改次序
		for i=1 to request.form("ID").count
			orders=request.form("orders")(i)
			conn.execute("update  news set orders="&orders&" where ID="&request.form("ID")(i))
		next
		response.Redirect("?classid="&request("classID"))
	case "del"
		for i=1 to request.form("delID").count
			id=request.form("delID")(i)
			conn.execute("update  news set del=1 where id="&id)
			response.Write("<script>parent.tr"&id&".style.display='none';</script>")
		next
		response.End()
	case "undel"
		for i=1 to request.form("delID").count
			id=request.form("delID")(i)
			conn.execute("update  news set del=0 where id="&id)
			response.Write("<script>parent.tr"&id&".style.display='none';</script>")
		next
		response.End()
	case "deldel"
		for i=1 to request.form("delID").count
			id=request.form("delID")(i)
			conn.execute("delete from news  where id="&id)
			response.Write("<script>parent.tr"&id&".style.display='none';</script>")
		next
		response.End()
end select
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>商品清单</title>

<link href="css.css" rel="stylesheet" type="text/css">
<script>
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 deldel(form)

{
confirm('确定要删除？')
	{
		document.all.action.value='deldel';
		form.target='blank';
		form.submit()
	}
}
function undel(id)
{
	blank.location="?action=undel&id="+id
}
</script>
<style type="text/css">
<!--
body {
	background-color: #6F97DB;
}
-->
</style></head>

<body>

<%
if request("del")=1 then del=1 else del=0 end if
	set rs=server.createobject("adodb.recordset") 
	sql="select * from news where del="&del&" and classID="&request("classID")&" order by orders" 
	rs.open sql,conn,1,1
%><form action="?classID=<%=request("classID")%>" method="post" name="form" id="form">
<table width="99%" border="0" cellspacing="1" class="table">
  <tr bgcolor="#0042CA" class="tr">
    <td width="5%" height="24" align="center" nowrap><span class="bg3">
      <input type="checkbox" name="chkall" onClick="CheckAll(this.form)" class=but1>
    </span></td>
    <td width="8%" align="center" nowrap>序号</td>
    <td width="64%" align="center" nowrap>名称</td>
    <td width="16%" align="center" nowrap>加入时间</td>
    <td width="7%" align="center" nowrap>次序</td>
    </tr>
<%
for i=1 to rs.recordcount
if i mod 2 =0 then bgcolor="#ECF5FF" else bgcolor="#ffffff"
%><tr bgcolor=<%=bgcolor%> id="tr<%=rs("id")%>" align="center">
<td><input name="delID" type="checkbox" id="delID" value="<%=rs("id")%>"><input name="id" type="hidden" id="id" value="<%=rs("id")%>"></td>
<td><%=i%></td>
<td align=left><a href="news_exe.asp?action=mod&id=<%=rs("id")%>"><%=rs("title")%>&nbsp;</a></td>
<td nowrap><%=rs("addTime")%></td>
<td ><input name="orders" type="text" id="orders" value="<%=rs("orders")%>" size="3"></td>
</tr><%
rs.movenext
next
rs.close
set rs=nothing
  %>
</table>
<table width="99%" bgcolor="#F0F0F0">
    <tr>
      <td width="29%">
	  <%if request("del")<>1 then%>
	<input type="button" onClick="action.value='del';this.form.target='blank';this.form.submit()"  value="删除所选">
	<%else%>
	<input type="button" onClick="deldel(this.form)"  value="彻底删除">
	<input type="button" onClick="action.value='undel';this.form.target='blank';this.form.submit()"  value="还原">
	<%end if%>
	     </td>
      <td width="18%"><input name="action" type="hidden" id="action" value="mod_orders"></td>
      <td width="45%">&nbsp;</td>
      <td width="8%"><input type="button"  onClick="action.value='mod_orders';this.form.target='';this.form.submit()"   value="修改次序"></td>
    </tr>
  </table>
</form>
<iframe name="blank" width="0" height="0"></iframe>
</body>
</html>



