<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<%
  if session("admin")="" then
  response.redirect "admin_login.asp"
  else
	if session("flag")>1 then
		response.write "<br><p align=center>您没有操作的权限</p>"
		response.end
	end if
  end if
  %>
<%
set rs=server.createobject("adodb.recordset") 
sql="select * from city order by a_id desc" 
rs.open sql,conn,1,3
rs.pagesize=pagesize_2
page=request("page")
if not rs.eof then
if page="" or page<1 then page=1
rs.absolutepage=page
end if
%>
<html><head><meta http-equiv="Content-city" content="text/html; charset=gb2312"><title></title>
<link rel="stylesheet" city="text/css" href="css/css.css">
</head>
<script language="vbscript">
<!--
sub  del(c_id)
dim msg
dim t
t=c_id
msg=msgbox ("删除该值会导致数据丢失，你真的要删除吗？",16+4,"删除地区类型！")
if msg=6 then
window.location.href= "delcity.asp?id="&t
end if
end sub
-->
</script>
<body leftmargin="0" topmargin="0" bgcolor="#FFFFFF">
<table border="1" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="600">
  <tr>
    <td bgcolor="#CCCCCC">
    <p align="center"><strong>二级地区</strong></td>
    <td bgcolor="#CCCCCC">
    <p align="center"><strong>所属地区</strong></td>
    <td bgcolor="#CCCCCC">
    <p align="center"><strong>修 改</strong></td>
    <td bgcolor="#CCCCCC">
    <p align="center"><strong>删 除</strong></td>
  </tr>
<% 
if not rs.eof then
for i=1 to rs.pagesize
 if rs.eof then exit for %><tr>
    <td align="center"><%=rs("city")%></td>
    <td align="center"><%
sql = "select * from area where a_id="& Rs("a_id") &""
set Rs1 = Server.CreateObject("ADODB.Recordset")
Rs1.open sql,conn,1,1
do while not Rs1.eof
%><%=Rs1("area")%></td>
    <td>
    <p align="center"><a href="admin_modify_city.asp?id=<%=rs("c_id")%>"><img border="0" src="images/button_edit.gif"></a>&nbsp;&nbsp;
    </td>
    <td>
    <p align="center">
<input type="image" border="0" name="imageField2" src="images/button_del.gif" width="42" height="18" onClick="vbscript:del(<%=rs("c_id")%>)"></td>
  </tr><%
Rs1.movenext
loop
Rs1.close
set Rs1 = nothing
%>
    <% rs.movenext
next
if rs.pagecount>0 then rs.moveprevious
end if
%>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><%=rs.pagesize%>条/页　第<%=page%>页 
        <% if rs.absolutepage>1 then response.write("<a href='?"&page=1&"'>")%>
        首页</a> 
        <% if rs.absolutepage>1 then response.write("<a href='?page="&rs.absolutepage-1&"'>")%>
        上一页</a> 
        <% if rs.absolutepage<rs.pagecount then response.write("<a href='?page="&rs.absolutepage+1&"'>")%>
        下一页</a> 
        <% if rs.absolutepage<rs.pagecount then response.write("<a href='?page="&rs.pagecount&"'>")%>
        尾页</a> </div></td>
  </tr>
</table>
</body></html>