精品判断执行代码
转www.载for网站制作学习asp必.cn究
<%SMT_id=request("id")%>
<!--#include file="co.asp"--><!--数据库连接文件-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>友好小区管理页面</title>
</head>
<%
dim mood,mod2
mood=request.QueryString("mood")
mod2=request.QueryString("mod2")
select case mood
case "add"
lustm=request.Form("lustm")
lustm=split(lustm,",")
sql="select SMT_id,friend_id,friend_nam from ["&mod2&"]"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew()
rs("SMT_id")=SMT_id
rs("friend_id")=lustm(0)
rs("friend_nam")=lustm(1)
rs.update
set rs=nothing
response.Redirect "admin_info8.asp?id="&SMT_id
case "del"
sql="delete * from ["&mod2&"] where id="&request.QueryString("delid")
conn.execute(sql)
response.Redirect "admin_info8.asp?id="&SMT_id
case else
end select
'所有小区
dim allsql,allrs,allnam
allsql="select SMT_id,SMT_coname from SMT_yp order by SMT_id desc"
set allrs=server.CreateObject("adodb.recordset")
allrs.open allsql,conn,1,1
if not allrs.eof or not allrs.bof then
do while not allrs.eof
nam="<option value="&allrs("SMT_id")&","&allrs("SMT_coname")&">"&allrs("SMT_coname")&"</option>"
allnam=allnam&nam
allrs.movenext
loop
set allrs=nothing
end if
'友好小区
dim yhsql,yhrs
set yhrs=server.CreateObject("adodb.recordset")
yhsql="select id,friend_nam from friend_xiaoqu where SMT_id="&SMT_id
yhrs.open yhsql,conn,1,1
if not yhrs.eof or not yhrs.bof then
do while not yhrs.eof
yhlist1="<tr><td width=141 height=24 align=center>"&yhrs("friend_nam")&"</td><td width=117 align=center><a href=""admin_info8.asp?id="&SMT_id&"&delid="&yhrs("id")&"&mood=del&mod2=friend_xiaoqu"">删除</a></td></tr>"
yhlist=yhlist&yhlist1
yhrs.movenext
loop
set yhrs=nothing
end if
'相邻小区
dim xlsql,xlrs
set xlrs=server.CreateObject("adodb.recordset")
xlsql="select id,friend_nam from xianglin_xiaoqu where SMT_id="&SMT_id
xlrs.open xlsql,conn,1,1
if not xlrs.eof or not xlrs.bof then
do while not xlrs.eof
xllist1="<tr><td width=141 height=24 align=center>"&xlrs("friend_nam")&"</td><td width=117 align=center><a href=""admin_info8.asp?id="&SMT_id&"&delid="&xlrs("id")&"&mood=del&mod2=xianglin_xiaoqu"">删除</a></td></tr>"
xllist=xllist&xllist1
xlrs.movenext
loop
set xlrs=nothing
end if
%>
<body>
<br />
<br />
<table width="258" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="24" align="center">友好小区管理页面</td>
</tr>
</table>
<br />
<br />
<br />
<table width="258" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="136" height="24" align="center">友好小区</td>
<td width="122" align="center">管理</td>
</tr>
</table>
<table width="258" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
<%=yhlist%>
</table>
<form name="form2" action="?mood=add&mod2=friend_xiaoqu&id=<%=SMT_id%>" method="post" >
<table width="258" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="138" height="24" align="center"><select name="lustm"><%=allnam%></select></td>
<td width="120" align="center"><input type="button" onclick="form2.submit();" value="确定" /></td>
</tr></table>
</form>
<br />
<br />
<table width="258" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="24" align="center">相邻小区管理页面</td>
</tr>
</table>
<br /><br />
<table width="258" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="136" height="24" align="center">相邻小区</td>
<td width="122" align="center">管理</td>
</tr>
</table>
<table width="258" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
<%=xllist%>
</table>
<form name="form1" action="?mood=add&mod2=xianglin_xiaoqu&id=<%=SMT_id%>" method="post" >
<table width="258" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="138" height="24" align="center"><select name="lustm"><%=allnam%></select></td>
<td width="120" align="center"><input type="button" onclick="form1.submit();" value="确定" /></td>
</tr>
</table>
</form>
</body>
</html>