📄 admin_add_hostshouming.asp
字号:
<!--#include file="conn.asp"-->
<%
id=session("userid")
username=session("username")
if id="" or username="" then
response.Redirect("adminloginerror.asp")
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from adminuser where username='"& username &"' and id=" & id &""
rs.open sql,conn,3,3
if rs.eof then
response.Redirect("adminloginerror.asp")
else
hosttyp=request.QueryString("hosttyp")
typid=request.QueryString("typid")
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" style="background-color: #D6DFF7">
<div align="center">
<center>
<table width="98%" border="1" cellpadding="5" cellspacing="0" bordercolor="#6687BA" style="border-collapse: collapse">
<tr>
<td height="17" bgcolor="#EAF1FB" background="images/admin/admin_bg_1.gif">
<div align="center" class="f1" >全 部 主 机 类 型 </div>
</td>
</tr>
<tr>
<td height="17">
<font color="#FF0000">
<%
set rs=server.createobject("adodb.recordset")
sql="select * from hosttyp order by id desc"
rs.open sql,conn,3,3
if rs.eof then
response.write"<tr><td><div align=center> 暂 时 没 有 主 机 类 型 </div></td></tr>"
else
response.Write"<table width=100% border=0 cellspacing=0 cellpadding=0>"
response.Write"<tr>"
do while not rs.eof
response.Write"<td align=center height=20>"
response.Write"<a href=admin_add_hostshouming.asp?typid="& rs("id") &"&hosttyp="& rs("hosttyp") &">"& rs("hosttyp") &"</a>"
response.Write"</td>"
a=a+1
if a=4 then
response.Write"</tr><tr>"
a=0
end if
rs.movenext
loop
response.Write"</table>"
end if
%>
</font>
</td>
</tr>
</table> </center>
</div>
<br>
<% if request.QueryString("cmd")="del" then
typid=request.querystring("typid")
hosttyp=request.querystring("hosttyp")
hostid=request.querystring("hostid")
id=request.QueryString("id")
set rs=server.createobject("adodb.recordset")
sql="select * from hostshouming where id="&id &""
rs.open sql,conn,3,3
rs.delete
response.Redirect"admin_add_hostshouming.asp?typid="& typid &"&hosttyp="& hosttyp &"&cmd=up&id="& hostid &""
end if
if request.QueryString("cmd")="upadd" then
typid=request.form("typid")
hosttyp=request.form("hosttyp")
hostid=request.form("hostid")
hostshouming=request.form("hostshouming")
id=request.QueryString("id")
set rs=server.createobject("adodb.recordset")
sql="select * from hostshouming where id="& id&""
rs.open sql,conn,3,3
rs("hostid")=hostid
rs("hostshouming")=hostshouming
rs.update
response.Redirect"admin_add_hostshouming.asp?typid="& typid &"&hosttyp="& hosttyp &"&cmd=up&id="& hostid &""
end if
%>
<div align="center">
<center>
<table width="98%" border="1" cellpadding="5" cellspacing="0" bordercolor="#6687BA" style="border-collapse: collapse">
<tr>
<td height="17" bgcolor="#EAF1FB" background="images/admin/admin_bg_1.gif">
<div align="center" class="f1" >现有 [<b><font color="#FF0000"><%=hosttyp%></font></b>] 类型</div>
</td>
</tr>
<tr>
<td height="17">
<font color="#FF0000">
<%
set rs=server.createobject("adodb.recordset")
sql="select * from hostcontent where typid="& typid &" order by id desc"
rs.open sql,conn,3,3
if rs.eof then
response.write"<tr><td><div align=center> 暂 时 没 有 主 机 存 在</div></td></tr>"
else
response.Write"<table width=100% border=0 cellspacing=0 cellpadding=0>"
response.Write"<tr>"
do while not rs.eof
response.Write"<td align=center height=20>"
response.Write"<a href=admin_add_hostshouming.asp?cmd=up&id="& rs("id") &"&typid="& typid &"&hosttyp="& hosttyp &">"& rs("hostname") &"</a>"
response.Write"</td>"
a=a+1
if a=3 then
response.Write"</tr><tr>"
a=0
end if
rs.movenext
loop
response.Write"</table>"
end if
%>
</font>
</td>
</tr>
</table> </center>
</div>
<br>
<font color="#FF0000">
<span style="font-size: 9pt">
<%
if request.querystring("cmd")<>"up" then
response.write"<div align=center><br>请 点 击 上 面 相 应 的 主 机 类 型 进 行 管 理</div>"
else
set rs=server.createobject("adodb.recordset")
sql="select * from hostshouming where hostid="& request.QueryString("id") &""
rs.open sql,conn,3,3
if rs.eof then
response.write"<div align=center>没 有 此 类 主 机 的 附 加 说 明</div>"
else
%></span></font>
<br>
<div align="center">
<center>
<table width="98%" border="1" cellspacing="0" bordercolor="#6687BA" style="border-collapse: collapse">
<form name="form1" method="post" action="admin_add_hostshouming.asp?cmd=upadd&id=<%=rs("id")%>">
<tr>
<% do while not rs.eof %>
<td width="5%" height="33"><div align="center"><%=rs("id")%></div></td>
<td>
<input name="hostshouming" type="text" id="hostshouming" value="<%=rs("hostshouming")%>" size="63">
<input name="hostid" type="hidden" id="hostid" value="<%=rs("hostid")%>">
<input name="typid" type="hidden" id="typid" value="<%=typid%>">
<input name="hosttyp" type="hidden" id="hosttyp" value="<%=hosttyp%>"></td>
<td width="15%"><div align="center"><a href="admin_add_hostshouming.asp?cmd=del&id=<%=rs("id")%>&typid=<%=typid%>&hosttyp=<%=hosttyp%>&hostid=<%=rs("hostid")%>" class="f1">删除</a></div></td>
</td>
</tr>
<% rs.movenext
loop
%>
</form>
</table>
</center>
</div>
<% end if %>
<% end if %>
</body>
</html>
<% rs.close
set rs=nothing
set conn=nothing
%>
<% end if %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -