<!--#include file="conn.asp"-->
<%if session("nyeee_admin")="" then
response.redirect "login.asp"
end if%>
<%dim action,id
id=request.QueryString("id")
action=request.querystring("action")
select case action
case "add" 
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from city",conn,1,3
rs.AddNew
rs("city")=trim(request("city"))
rs.Update
rs.Close
set rs=nothing
response.Redirect "qydiqu.asp"
case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from city where id="&id,conn,1,3
rs("city")=trim(request("city"))
rs.Update
rs.Close
set rs=nothing
response.Redirect "qydiqu.asp"

case "del"
conn.execute ("delete from city where id="&id)
'conn.execute ("delete from daili where id="&id)
response.Redirect "qydiqu.asp"
end select%>
<title>区域管理</title>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#6699cc">
  <tr> 
    <td height="20" bgcolor="#6699cc" align="center"><font color="#FFFFFF">区域管理</font></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"> <br>
	<table width="80%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
        <tr align="center" bgcolor="#FFFFFF" height="20"> 
          <td width="20%">区域名称</td>
          <td width="30%">确定操作</td>
        </tr>
        <%set rs=server.CreateObject("adodb.recordset")
		  rs.Open "select * from city order by id",conn,1,1
		  dim follows
		  if rs.EOF and rs.BOF then
		  response.Write "<div align=center><font color=red>还没有区域分类</font></center>"
		  follows=0
		  else
		  do while not rs.EOF%>
        <form name="form1" method="post" action="qydiqu.asp?action=edit&id=<%=int(rs("id"))%>">
          <tr bgcolor="#FFFFFF" align="center">
		  <td><input name="city" type="text" id="city" size="12" value="<%=trim(rs("city"))%>"></td>
		  
            <td><input type="submit" name="Submit" value="修 改">
                &nbsp; <a href="qydiqu.asp?id=<%=int(rs("id"))%>&action=del" onClick="return confirm('您确定进行删除操作吗？')"><font color=red>删除</font></a> 
              </td>
          </tr>
        </form>
        <%rs.MoveNext
          loop
          follows=rs.RecordCount
          end if%>
      </table><br></td>
  </tr>
</table>
<br>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#6699cc">
  <tr> 
    <td height="20" bgcolor="#6699cc" align="center"><font color="#FFFFFF">添加区域名称</font></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF">
	<table width="80%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
        <tr align="center" bgcolor="#FFFFFF" height="20"> 
          <td width="30%"> 区域名称</td>
          <td width="30%">确定操作</td>
        </tr>
        <form name="form1" method="post" action="qydiqu.asp?action=add">
          <tr align="center" bgcolor="#FFFFFF"> 
            <td><input name="city" type="text" id="city" size="12"></td>
	        <td><input type="submit" name="Submit3" value="添 加"></td>
          </tr>
        </form>
      </table></td>
  </tr>
</table>
<br>
<br>
