<!--#include file="pysjzx_conn.asp"-->
<!--#include file="session.asp"-->
<html>
<head>
<title>县(市)管理</title>
<script>
function IsDigit()
{
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
</script>
<meta http-equiv="目录类型" content="文本/html; 字符集=gb2312">
<link href="css/style.css" rel="stylesheet" type="text/css">
<body>
<div align="center">
<table cellpadding="3" cellspacing="1" border="1" width="100%" class="tableBorder" style="border-collapse: collapse" bordercolor="#C0C0C0">
<form method="post" action="shiset.asp?action=update">
	<tr> 
	  <th class="tableHeaderText" colspan=6 height=25 bgcolor="#E8F1FF">县(市)设置</th>
  </tr>
      <tr> 
        <td colspan="6" align="center" class="forumRowHighlight" bgcolor="#F7F7F7">&nbsp;
<%
Set rs_s = Server.CreateObject("ADODB.Recordset")
rs_s.open "SELECT  * from province  order by shengorder",conn,1,1
while not rs_s.eof
response.write "[<a href=ManageCity.asp?shengid="&rs_s("id")&">"&rs_s("shengname")&"</a>]&nbsp;"
rs_s.movenext
wend
rs_s.close
set rs_s=nothing
%>
        </td>
      </tr>
      <tr align=center height=25> 
        <td class="forumRowHighlight" bgcolor="#F7F7F7">序号</td>
        <td class="forumRowHighlight" bgcolor="#F7F7F7">所属市</td>
        <td class="forumRowHighlight" bgcolor="#F7F7F7">市名称</td>
        <td class="forumRowHighlight" bgcolor="#F7F7F7">市编号</td>
        <td class="forumRowHighlight" bgcolor="#F7F7F7">排序(必填项，数字)</td>
        <td class="forumRowHighlight" bgcolor="#F7F7F7">删除</td>
      </tr>
<%
dim shengid
shengid=int(request("shengid"))
Set rs = Server.CreateObject("ADODB.Recordset")
if shengid<>"" then
  rs.open "SELECT  * from city  where shengid="&shengid&" order by shengid,shiorder",conn,1,1
else
  rs.open "SELECT  * from city  where 1<> 1 order by shengid,shiorder",conn,1,1
end if
if rs.recordcount=0 then 
%>
      <tr> 
        <td colspan="6"align="center" width="100%" class="forumRowHighlight" bgcolor="#F7F7F7"> 还没有添加县 </td>
      </tr>
<%
else
    do while not rs.eof
%>
      <tr> 
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"><%=rs("ID")%></td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <select name="shengid" size="1">
<%
Set rs_s = Server.CreateObject("ADODB.Recordset")
rs_s.open "SELECT  * from province  order by shengorder",conn,1,1
while not rs_s.eof
%>
<option value="<%=rs_s("id")%>" <%if rs_s("id")=rs("shengid") then%>selected<%end if%>><%=rs_s("shengname")%></option>
<%
rs_s.movenext
wend
rs_s.close
set rs_s=nothing
%>
          </select>
        </td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <input type="hidden" name="shiid" value="<%=rs("id")%>">
          <input class=text type="text" name="shiname" size="10" value="<%=trim(rs("shiname"))%>">
        </td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <input class=text type="text" name="shino" size="10" value="<%=trim(rs("shino"))%>" ONKEYPRESS="event.returnValue=IsDigit();" >
        </td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <input class=text type="text" name="shiorder" size="10" value="<%=rs("shiorder")%>" ONKEYPRESS="event.returnValue=IsDigit();" >
        </td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
   <a href="shikill.asp?shiid=<%=rs("id")%>">删除</a> 
        </td>
      </tr>
      <%
    rs.MoveNext
    Loop
%>
      <tr> 
        <td colspan="6" align="center" width="100%" class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <input class=button type="submit" name="Submit2" value="保存修改" >
          &nbsp; 
          <input class=button type="reset" value="重新设定" name="重置" >
          <input type="hidden" name="id" value="<%=shengid%>">
        </td>
      </tr>
<%
end if

%>
    </form>
    <form method="post" action="shiset.asp?action=add">
      <tr> 
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7">添加县 
        </td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <select name="shengid" size="1">
<%
Set rs_s = Server.CreateObject("ADODB.Recordset")
rs_s.open "SELECT  * from province  order by shengorder",conn,1,1
while not rs_s.eof
%>
<option value="<%=rs_s("id")%>" <%if rs_s("id")=shengid then%>selected<%end if%>><%=rs_s("shengname")%></option>

<%
rs_s.movenext
wend
rs_s.close
set rs_s=nothing
rs.close
set rs=nothing
%>
          </select>
        </td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <input class=text type="text" name="shiname" size="10">
        </td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <input class=text type="text" name="shino" size="10" ONKEYPRESS="event.returnValue=IsDigit();">
        </td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <input class=text type="text" name="shiorder" size="10" ONKEYPRESS="event.returnValue=IsDigit();">
        </td>
        <td align=center class="forumRowHighlight" bgcolor="#F7F7F7"> 
          <input class=button type="submit" name="Submit2" value="添加">
          <input type="hidden" name="id" value="<%=shengid%>">
        </td>
      </tr>
    </form>
</table>
</div>
</body>
</html> 
  