<%
'程序名称：千纸鹤网站管理系统
'程序作者：千纸鹤
'作者邮箱：qzhxxw@sina.com
'作者 Q Q：138999501
'作者电话：0000000000
'官方主页：http://www.qqzzhh.com/
'官方论坛：http://www.qqzzhh.com/bbs
%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/set.asp"-->
<!--#include file="inc/dll.asp"-->
<%call hacker()
if session("superlogin")<>yecao then
response.Write "<script>alert('您还没有登陆！');this.location.href='index.asp';</script>"
Response.End
end if
if session("superadmin")<>"admin" then
response.Write "<script>alert('\n错误提示：您的权限不足！\n\n您不是超级管理员！');this.location.href='index.asp';</script>"
Response.End
end if%>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="STYLESHEET" type="text/css" href="img/admin.css"><body>
<%
sql="select * from YC_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()%>
<form method="post" name="form" id="form">
<table  align=center border="0" cellpadding="0" cellspacing="0" rules=none class=3d width=300>
<tr class="title"  height="22"><td><b>&nbsp;<img src=img/ie.gif border=0 width=15 height=15 align=absMiddle>&nbsp;添加菜单</b></td></tr>	
<tr class=bg height="25"><td>&nbsp;菜单名称：<input name="title" type="text" id="title" size="20" class=yecao style="width:120px"></td></tr>
<tr class=bg height="25"><td>&nbsp;菜单顺序：<input name="menuid" type="text" id="menuid" size="20" value="<%=newmenuid%>" class=yecao style="width:120px"></td></tr>
<tr height="25" class=bg><td>&nbsp;菜单地址：<input name="url" type="text" id="url" size="20" class=yecao style="width:200px" onMouseOver='this.focus()' onFocus='this.select()'></td></tr>
<tr height="25" class=bg><td>&nbsp;打开方式：<input type="radio" name="open" value=true>&nbsp;新窗口&nbsp;<input name="open" type="radio" value=false checked> &nbsp;原窗口</td></tr>
<tr height="25" class=bg><td>&nbsp;显示方式：<input type="radio" name="foot" value=false checked>&nbsp;在顶部&nbsp;<input name="foot" type="radio" value=true > &nbsp;在底部</td></tr>
<tr><td class="hr"></td></tr>
<tr height="30" class=foot><td  align="center"><input name="pass" value="1" type="hidden">
<input name="new" type="submit" class="adminbutton" id="new" value="发 布">&nbsp;<input name="Submit2" type="reset" class="adminbutton" value="清 空"></td></tr>
</table> 
</form>
<%end sub
sub menu()%>
<table align=center width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="<%=border%>" rules=none class=3d>
<tr><td height="22" colspan="8" class=title><b>&nbsp;<img src=img/ie.gif border=0 width=15 height=15 align=absMiddle>&nbsp;菜单管理</b></td></tr>
<tr class=bg height="25">
<td width=30 align=center>开关</td>
<td width=60 align=center>菜单顺序</td>
<td width=70 align=center>菜单名称</td>
<td  width=100 align=center>菜单地址</td>
<td align=center>显示方式</td><td align=center>打开方式</td>
<td  width=100 align=center>菜单操作</td></tr><tr><td class=hr colspan=8></td></tr>
<%if not rs.bof and not rs.eof then
num=1
do while not rs.eof%><tr height="25" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#efefef'"><form method="post">
<td align=center><input name="pass" type="checkbox" id="pass" value=true <%if rs("pass")=true then response.write "checked" end if%>></td>
<td align=center><input name="menuid" type="text" id="menuid" value="<%=rs("menuid")%>" size="3" class=yecao></td>
<td align=center><input name="title" type="text" id="title" value="<%=rs("title")%>" size="8" class=yecao></td>
<td align=center><input name="url" type="text" id="url" value="<%=rs("url")%>" size="12" class=yecao onMouseOver='this.focus()' onFocus='this.select()'></td>
<td align=center>
<select name=foot class=yecao>
<option value=false <%if rs("foot")=false then response.write "selected"%>>在顶部</option>
<option value=true <%if rs("foot")=true then response.write "selected"%>>在底部</option>>
</select>
</td>
<td align=center>
<input type="radio" name="open" value=true <%if rs("open")=true then response.Write"checked" end if%>>&nbsp;新窗口<br><input name="open" type="radio" value=false <%if rs("open")=false then response.Write"checked" end if%>>&nbsp;原窗口 </td>
<td align=center> <input type="submit" name="edit" id=edit value="修改" class=button>&nbsp;<input name="del" type="submit" id="del" value="删除" class=button>
<input name="id" type="hidden" id="id" value="<%=rs("id")%>"></td></tr>
<tr><td class=hr colspan=8></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 YC_menu Where id="&Request.Form("id"))
Response.Write("<script language=javascript>alert('删除成功！');this.location.href='admin_menu.asp?action=menu';</script>")
response.end
elseif request.form("edit")<>"" then
set rs=server.CreateObject("adodb.recordset")
sql="select * from YC_menu where id="&request("id")
rs.open sql,conn,1,3
rs("title")=request.Form("title")
rs("menuid")=request.Form("menuid")
rs("url")=request.Form("url")
rs("open")=request.Form("open")
rs("foot")=request.Form("foot")
rs("pass")=request.Form("pass")
rs.update
rs.close
Response.Write("<script language=javascript>alert('修改成功！');this.location.href='admin_menu.asp?action=menu';</script>")
response.end
set rs=nothing
elseif  request.form("new")<>"" then
set rs=server.CreateObject("adodb.recordset")
rs.open "YC_menu",conn,1,3
rs.addnew
rs("title")=request.Form("title")
rs("menuid")=request.Form("menuid")
rs("url")=request.Form("url")
rs("open")=request.Form("open")
rs("foot")=request.Form("foot")
rs("pass")=request.Form("pass")
rs.update
rs.close
set rs=nothing
response.write"<script>alert('添加成功！');location.href='admin_menu.asp?action=menu';</script>"
end if
call closedata()
%>
