<!--#include file="check.asp"-->
<!--#include file="webconn.asp"-->
<%
Action=request("action")
if Action="" then 
%>
<link href="web_jspok.css" rel="stylesheet" type="text/css" />

<form action="addmenu.asp?action=save" method="post">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#A3BFE8">
  <tr>
    <td height="20" colspan="2" align="center" bgcolor="#E9F1F8">网站菜单</td>
  </tr>
  <tr>
    <td height="20" colspan="2" align="center" bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  
  <tr>
    <td height="20" align="center" bgcolor="#E9F1F8">菜单名称:</td>
    <td align="left" bgcolor="#E9F1F8"><label>
      <input name="txt_name" type="text" class="txtinput" id="txt_name" />
    </label></td>
  </tr>
  <tr>
    <td height="20" align="center" bgcolor="#E9F1F8">父目录：</td>
    <td align="left" bgcolor="#E9F1F8"><label>
      <select name="txt_top" class="txtinput" id="txt_top">
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from webmenu where m_top='root' order by m_id desc"
rs.open sql,conn,1,3
if not rs.eof and not rs.bof then
%>
	  <%while not rs.eof %>
	  <option value="<%=rs("m_name")%>"><%=rs("m_name")%></option>
	  <%rs.movenext
	  wend%>
	   <option value=root>根目录</option>
<%else%>
		<option value=root>根目录</option>
<%end if%>
      </select>
    </label></td>
  </tr>
  <tr>
    <td height="20" align="center" bgcolor="#E9F1F8">菜单类型：</td>
    <td align="left" bgcolor="#E9F1F8"><label>
      <select name="txt_type" class="txtinput" id="txt_type">
        <option value="单页图文">单页图文</option>
        <option value="产品类型" selected="selected">产品类型</option>
        <option value="新闻类型">新闻类型</option>
        <option value="超链接">超链接</option>
      </select>
    </label></td>
  </tr>
  <tr>
    <td width="40%" height="20" align="center" bgcolor="#E9F1F8">URL地址：</td>
    <td width="60%" align="left" bgcolor="#E9F1F8"><input name="txt_url" type="text" class="txtinput" id="txt_url" /></td>
  </tr>
  <tr>
    <td height="20" colspan="2" align="center" bgcolor="#E9F1F8">&nbsp;</td>
  </tr>
  <tr>
    <td height="20" colspan="2" align="center" bgcolor="#E9F1F8"><label>
      <input type="submit" name="Submit" value=" 发 布 ">
    </label></td>
  </tr>
</table>
</form>
<%
rs.close
set rs=nothing
%>
<%else%>
<%
Tname=request("txt_name")
Ttype=request("txt_type")
Ttop=request("txt_top")
Turl=request("txt_url")
if Tname="" then 
response.write "<script>alert('信息提示：\n\n内容不能为空！');history.go(-1);</Script>"
else
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from webmenu where m_name='"& Tname &"'"
rs.open sql,conn,1,3 
rs.addnew
rs("m_name")=Tname
rs("m_type")=Ttype
rs("m_top")=Ttop
rs("m_url")=Turl
rs.update
rs.close
set rs=nothing
response.write "<script language='javascript'>alert('信息提示：\n\n操作成功!');location='main.asp?adminjob=webmenu';</script>"
end if
%>
<%end if%>