📄 admin_menu.asp
字号:
<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/code.asp"-->
<!--#include file="../inc/SqlIn.Asp"-->
<!--#include file="../inc/check.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="STYLESHEET" type="text/css" href="admin_style.css">
<body>
<table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
<tr>
<th>网站菜单管理</th>
</tr>
<tr>
<td class=tablerow1><b>管理选项:</b><a href="?action=menu">菜单列表</a> | <a href="?action=newmenu">添加菜单</a></td>
</tr>
</table>
<br>
<%
sql="select * from Gq_menu order by menuid asc"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
newmenuid=rs.recordcount+1
select case request("action")
case "menu"
call menu()
case "newmenu"
call newmenu()
end select
sub newmenu()%>
<table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
<form method="post" name="form" id="form">
<tr>
<th colspan="2">菜单管理--添加菜单</th>
</tr>
<tr>
<td width="15%" align="right" class="TableRow1">菜单名称:</td>
<td class="TableRow1"><input name="menutitle" type="text" id="menutitle" size="20"></td>
</tr>
<tr>
<td width="15%" align="right" class="TableRow1">菜单顺序:</td>
<td class="TableRow1"><input name="menuid" type="text" id="menuid" size="20" value="<%=newmenuid%>"></td>
</tr>
<tr>
<td width="15%" align="right" class="TableRow1">菜单地址:</td>
<td class="TableRow1"><input name="menuurl" type="text" id="menuurl" size="20"></td>
</tr>
<tr>
<td width="15%" align="right" class="TableRow1">图片地址:</td>
<td class="TableRow1"><input name="menuimg" type="text" id="menuimg" size="20"></td>
</tr>
<tr>
<td width="15%" align="right" class="TableRow1">打开方式:</td>
<td class="TableRow1"><input type="radio" name="menuopen" value=true> 新窗口 <input name="menuopen" type="radio" value=false checked> 原窗口</td>
</tr>
<tr>
<td width="15%" align="right" class="TableRow1">显示方式:</td>
<td class="TableRow1"><input type="radio" name="menufoot" value=false checked> 文字菜单 <input name="menufoot" type="radio" value=true > 图片菜单</td>
</tr>
<tr>
<td class="TableRow1" colspan="2" height="30" align="center"><input name="menupass" value="1" type="hidden"><input name="new" type="submit" id="new" value=" 发 布 "> <input name="Submit2" type="reset" value=" 清 空 "></td>
</tr>
</form>
</table>
<%end sub
sub menu()%>
<table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
<tr>
<th width="4%">开关</th>
<th width="8%">菜单顺序</th>
<th width="18%">菜单名称</th>
<th width="*">菜单地址</th>
<th width="15%">菜单图片</th>
<th width="12%">显示方式</th>
<th width="12%">打开方式</th>
<th width="12%">操作</th>
</tr>
<%if not rs.bof and not rs.eof then
num=1
do while not rs.eof%>
<tr height="25" class="TableRow2" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#efefef'">
<form method="post">
<td align=center class="TableRow2"><input name="menupass" type="checkbox" id="menupass" value=true <%if rs("menupass")=true then response.write "checked" end if%>></td>
<td align=center class="TableRow2"><input name="menuid" type="text" id="menuid" value="<%=rs("menuid")%>" size="3"></td>
<td align=center class="TableRow2"><input name="menutitle" type="text" id="menutitle" value="<%=rs("menutitle")%>" size="12"></td>
<td align=center class="TableRow2"><input name="menuurl" type="text" id="menuurl" value="<%=rs("menuurl")%>" size="16" onMouseOver='this.focus()' onFocus='this.select()'></td>
<td align=center class="TableRow2"><input name="menuimg" type="text" id="menuimg" value="<%=rs("menuimg")%>" size="12" onMouseOver='this.focus()' onFocus='this.select()'></td>
<td align=center class="TableRow2">
<select name=menufoot>
<option value=false <%if rs("menufoot")=false then response.write "selected"%>>文字菜单</option>
<option value=true <%if rs("menufoot")=true then response.write "selected"%>>图片菜单</option>>
</select>
</td>
<td align=center class="TableRow2"><input type="radio" name="menuopen" value=true <%if rs("menuopen")=true then response.Write"checked" end if%>> 新窗口<br><input name="menuopen" type="radio" value=false <%if rs("menuopen")=false then response.Write"checked" end if%>> 原窗口 </td>
<td align=center class="TableRow2"><input type="submit" name="edit" id=edit value="修改"> <input name="del" type="submit" id="del" value="删除">
<input name="id" type="hidden" id="id" value="<%=rs("id")%>"></td></tr>
</form>
<%
num=num+1
rs.movenext
loop
end if
rs.close
set rs=nothing
Response.Write("</table>")
end sub
if request.Form("del")<>""then
Conn.Execute("Delete * From Gq_menu Where id="&Request.Form("id"))
Response.Write("<script language=javascript>alert('删除成功!');this.location.href='admin_menu.asp?action=menu';</script>")
call CloseConn()
response.end
elseif request.form("edit")<>"" then
set rs=server.CreateObject("adodb.recordset")
sql="select * from Gq_menu where id="&request("id")
rs.open sql,conn,1,3
rs("menutitle")=request.Form("menutitle")
rs("menuid")=request.Form("menuid")
rs("menuurl")=request.Form("menuurl")
rs("menuopen")=request.Form("menuopen")
rs("menufoot")=request.Form("menufoot")
if trim(request.form("menupass"))="" then
rs("menupass")="false"
end if
if trim(request.form("menupass"))="true" then
rs("menupass")="true"
end if
if trim(request.form("menufoot"))="false" then
rs("menuimg")="文字导航"
end if
if trim(request.form("menufoot"))="true" then
rs("menuimg")=request.Form("menuimg")
end if
rs.update
rs.close
Response.Write("<script language=javascript>alert('修改成功!');this.location.href='admin_menu.asp?action=menu';</script>")
call CloseConn()
response.end
set rs=nothing
elseif request.form("new")<>"" then
set rs=server.CreateObject("adodb.recordset")
rs.open "Gq_menu",conn,1,3
rs.addnew
rs("menutitle")=request.Form("menutitle")
rs("menuid")=request.Form("menuid")
rs("menuurl")=request.Form("menuurl")
rs("menuopen")=request.Form("menuopen")
rs("menufoot")=request.Form("menufoot")
rs("menupass")=request.Form("menupass")
if trim(request.form("menufoot"))="true" then
rs("menuimg")=request.Form("menuimg")
end if
rs.update
rs.close
set rs=nothing
response.write"<script>alert('添加成功!');location.href='admin_menu.asp?action=menu';</script>"
end if
call closeconn()
%>
<table width=98% align="center" border="0" cellspacing="0" cellpadding="0">
<tr align="middle">
<td height="30" valign="bottom">Copyright (c) 2004-2006 <a target="_blank" href="http://www.xuncms.cn"><b><font color="#708796">XunCms</font><font color="#cc0000">.Cn</font></b></font></a>. All Rights Reserved .</td>
</tr>
<tr align="middle">
<td>Powered by:<a href="http://www.xuncms.cn" target="_blank"><b><font color="#708796">讯图</font><font color="#cc0000">设计</font></b></font> XunCms <%=Version%></a></td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -