<!--#include virtual="inc/General.inc.asp"-->
<%
CheckManageUser()
code = replace(request("code"),"'","''")
set rs = server.createobject("adodb.recordset")
set rs1 = server.createobject("adodb.recordset")
rs.open "select a.*,b.MenuName from [Index] a left join [Menu] b on b.MenuCode=a.MenuCode order by a.AddressCode",conn,1,1
%>
<html>

<head>
<title>后台管理系统</title>
<link rel="stylesheet" href="../../css/main.css">
<script language="javascript" src="../../js/yzqm.js.asp"></script>
</head>

<body topmargin="0" leftmargin="0">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
	<td height="25" bgcolor="#EFEFEF" class="dtd" style="color:#FF6600">&nbsp;当前位置：首页设置</td>
  </tr>
  <tr>
	<td>
	  <table border="0" cellpadding="1" cellspacing="0" width="99%" align="right"><!--
		<form name="AddForm" method="post" action="SaveMenu.asp" onsubmit="if(this.MenuCode.value==''){alert('请输入编号！');this.MenuCode.focus();return false;}else if(this.MenuName.value==''){alert('请输入名称！');this.MenuName.focus();return false;}else{return true;}">
		<tr>
		  <td height="25">编号：<input type="text" name="MenuCode" onchange="this.value=this.value.replace(/\D/gi,'')" size="6" class="inbox">　　名称：<input type="text" name="MenuName" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" size="10" class="inbox">　　<input type="submit" value=" 添加 " class="in1"></td>
		</tr>
		</form>
		<tr>
		  <td height="25"></td>
		</tr>-->
		<tr>
		  <td>
			<table border="0" cellpadding="1" cellspacing="1" width="100%" bgcolor="#00599C">
			  <tr bgcolor="#A5CCFF">
				<td height="23" align="center">编号</td>
				<td align="center">名称</td>
				<td align="center">类型</td>
				<td align="center">内容ID</td>
				<td align="center">修改</td>
				<td align="center">操作</td>
			  </tr>
			  <%while not rs.eof%>
			  <%if code=rs("AddressCode")&"" then%>
			  <form name="EditForm" method="get" action="SaveIndex.asp">
			  <tr bgcolor="#FFFFFF">
				<td height="25" align="center">&nbsp;<input type="hidden" name="AddressCode" value="<%=rs("AddressCode")%>"><%=rs("AddressCode")%>&nbsp;&nbsp;</td>
				<td align="center">&nbsp;<input type="text" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" name="AddressName" value="<%=rs("AddressName")%>">&nbsp;&nbsp;</td>
				<td align="center"><select name="MenuCode" class="inbox"><option value=""></option>
				  <%rs1.open "select * from [Menu] order by MenuCode",conn,1,1
				  while not rs1.eof%>
				  <option value="<%=rs1("MenuCode")%>" <%if rs("MenuCode")&""=rs1("MenuCode")&"" then response.write " selected" end if%>><%=replace(space((len(rs1("MenuCode"))-2) \ 2) & rs1("MenuName")," ","　")%></option>
				  <%rs1.movenext
				  wend
				  rs1.cancel:rs1.close%>
				</select>
				</td>
				<td align="center">&nbsp;<input type="text" onchange="this.value=this.value.replace(/\D/gi,'')" name="NewsID" value="<%=rs("NewsID")%>" size="4">&nbsp;&nbsp;</td>
				<td align="center"><a href="#" onclick="javascirpt:if(EditForm.AddressName.value==''){alert('请输入名称！');EditForm.AddressName.focus();}else{EditForm.submit();}">确定</a></td>
				<td align="center"><a href="Index.asp">取消</a></td>
			  </tr>
			  </form>
			  <%else%>
			  <tr bgcolor="#FFFFFF">
				<td height="25" align="center">&nbsp;<%=rs("AddressCode")%>&nbsp;&nbsp;</td>
				<td align="center">&nbsp;<%=rs("AddressName")%>&nbsp;&nbsp;</td>
				<td align="center"><%=rs("MenuName")%></td>
				<td align="center"><%=rs("NewsID")%></td>
				<td align="center"><a href="Index.asp?code=<%=rs("AddressCode")%>">修改</a></td>
				<td align="center"><a href="javascript:if(confirm('你确定要删除此菜单吗？')) window.location.href='DeleteIndex.asp?AddressCode=<%=rs("AddressCode")%>'">删除</a></td>
			  </tr>
			  <%end if%>
			  <%rs.movenext
			  wend%>
			</table>
			<%rs.cancel:rs.close%>
		  </td>
		</tr>
	  </table>
	</td>
  </tr>
</table>
</body>

<html>
<%set rs = nothing
set rs1 = nothing
CloseConnection()%>