<!--#include file="conn.asp"-->
<%
if session("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');location.href='index.asp' ;</script>"
response.End
else
if request.cookies("sundxshop")("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');location.href='index.asp' ;</script>"
response.End
end if
end if

dim action,menuid
menuid=SafeRequest("id",1)
action=FormatSQL(SafeRequest("action",0))
select case action

case "add" 
if session("rank")>1 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权添加菜单！');history.go(-1);</script>"
response.End
end if
if Not isNumeric(request.form("menuTop")) then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('推荐必须是数字！');history.go(-1);</script>"
response.End
end if
if Not isNumeric(request.form("menuNum")) then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('排序必须是数字！');history.go(-1);</script>"
response.End
end if
if request.form("menutitle") ="" then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('请填写名称！');history.go(-1);</script>"
response.End
end if

conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你好，只要正版用户才能使用该功能！');history.go(-1);</script>"
response.End
case "edit"
if session("rank")>1 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权编辑菜单栏目！');history.go(-1);</script>"
response.End
end if

if Not isNumeric(request.form("menuTop")) then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('推荐必须是数字！');history.go(-1);</script>"
response.End
end if
if Not isNumeric(request.form("menuNum")) then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('排序必须是数字！');history.go(-1);</script>"
response.End
end if
if request.form("menutitle") ="" then
conn.close
set conn = nothing
response.Write "<script language=javascript>alert('请填写名称！');history.go(-1);</script>"
response.End
end if

conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你好，只要正版用户才能使用该功能！');history.go(-1);</script>"
response.End
case "del"
if session("rank")>1 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权删除标题栏目！');history.go(-1);</script>"
response.End
end if

conn.close
set conn = nothing
response.Redirect "adminmenu.asp"
end select
%>
<title>管理文章分类</title>
  <script language="javascript">
function ChangeColor(n){
 var clr = window.showModalDialog('Color.htm',"ColorWin",'dialogWidth:508px;dialogHeight:412px;status:no');
   if(clr==null)return;
   if(n==null)return;
   if(n==1){form1.bgclr1.value=clr;}
   if(n==2){form1.bgclr2.value=clr;}
   if(n==3){form1.bgclr3.value=clr;}
   if(n==4){form1.bgclr4.value=clr;}
   if(n==5){form1.bgclr5.value=clr;}
   if(n==6){form1.bgclr6.value=clr;}
   if(n==7){form1.bgclr7.value=clr;}
   if(n==8){form1.bgclr8.value=clr;}
 //变量名自己改myColor 等号后面的就是调用语句.

 }
</script>
<script language = "JavaScript">
<!--
function CheckAdd()
{
    if(checkspace(document.AddForm.menutitle.value)) {
	document.AddForm.menutitle.focus();
    alert("请输入名称！");
	return false;
  }

    
 
}
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
	function regInput(obj, reg, inputStr)
	{
		var docSel	= document.selection.createRange()
		if (docSel.parentElement().tagName != "INPUT")	return false
		oSel = docSel.duplicate()
		oSel.text = ""
		var srcRange	= obj.createTextRange()
		oSel.setEndPoint("StartToStart", srcRange)
		var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
		return reg.test(str)
	}
//-->
</script>
 <table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" BGCOLOR="#39867B">
        <tr> 
          <td align="center" colspan="6"><font color="#FFFFFF">网站菜单栏目信息设置</font></td>
        </tr>
        <tr bgcolor="#FFFFFF" align="center"> 
                <td width="10%">菜单名称</td>
                 <td width="8%">文字颜色<A HREF="#" onClick="ChangeColor(1)"><IMG SRC=../images/cgcolor.gif ALT="颜色选择" BORDER="0" WIDTH="9" HEIGHT="10"></A></td>
                 <td width="6%">文字大小</td>
                  <td width="7%">宽度</td>
                <td width="6%">排序</td>
                <td width="7%">是否显示</td>
                 <td width="7%">显示类型</td>
                 <td width="7%">窗口方式</td>
                <td width="30%">链接地址(系统菜单无法修改地址和删除)</td>
                <td width="13%">操作</td>
           </tr>
		  
                <%set rs=server.CreateObject("adodb.recordset")
		  rs.Open "select * from menu order by menuNum",conn,1,1
		  dim follows
		  if rs.EOF and rs.BOF then
		  response.Write "<div align=center><font color=red>还没有菜单栏目</font></center>"
		  follows=0
		  else
		  do while not rs.EOF
		  %>
              <tr bgcolor="#FFFFFF" align="center" height="20"> 
               <form name="form1" method="post" action="adminmenu.asp?action=edit&id=<%=rs("menuid")%>">
                 <td><input name="menutitle" type="text" id="menutitle" value="<%=trim(rs("menutitle"))%>" size="20" ></td>
                 <td><input name="menuclr" type="text" id="menuclr" value="<%=rs("menuclr")%>" size="8" ></td>
                 <td><input name="menusize" type="text" id="menusize" value="<%=int(rs("menusize"))%>" size="4" ></td>
                 <td><input name="menuwidth" type="text" id="menuwidth" value="<%=int(rs("menuwidth"))%>" size="4" ></td>
                 <td><input name="menuNum" type="text" id="menuNum" value="<%=int(rs("menuNum"))%>" size="4" ></td>
                 <td>
                   <select name="menuTop" id="menuTop">
		    <option value="0" <% if rs("menuTop")=0 Then Response.write("Selected") %>>显示</option>
                    <option value="1" <% if rs("menuTop")=1 Then Response.write("Selected") %>>隐藏</option> 
                   </select>
                 </td>
                  <td>
                   <select name="menuType" id="menuType">
		    <option value="0" <% if rs("menuType")=0 Then Response.write("Selected") %>>上导航</option>
                    <option value="1" <% if rs("menuType")=1 Then Response.write("Selected") %>>下导航</option>
                    <option value="2" <% if rs("menuType")=2 Then Response.write("Selected") %>>其他</option>      
                   </select>
                 </td>
                 <td>
                  <select name="new" id="new">
		   <option value="0" <% if rs("new")=0 Then Response.write("Selected") %>>新窗口</option>
                   <option value="1" <% if rs("new")=1 Then Response.write("Selected") %>>原窗口</option>      
                  </select>
                </td>
                <td ><input name="menuaddress" type="text" id="menuaddress" value="<%=trim(rs("menuaddress"))%>" size="30" <% if rs("onlyread")=1 Then Response.write("readonly") %> ></td>
                 <td><input type="submit" name="Submit" value="修 改"> &nbsp; <% if rs("onlyread")=0 Then %><a href="adminmenu.asp?id=<%=int(rs("menuid"))%>&action=del" onClick="return confirm('您确定进行删除操作吗？')"><font color=red>删除</font></a> <%else%>系统菜单
 <%end if%>           </td></form>
              </tr>
               <%rs.MoveNext
          loop
          follows=rs.RecordCount
          end if
    rs.Close
    set rs=nothing
         %>
              
            
       
      </table>

<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" BGCOLOR="#39867B">
  <tr> 
    <td height="20" BGCOLOR="#39867B" align="center"><font color="#FFFFFF">添加菜单栏目</font></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF">
	<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
         <tr bgcolor="#FFFFFF" align="center"> 
               <td width="16%">菜单名称</td>
                <td width="8%">排序</td>
                <td width="8%">是否显示</td>
                 <td width="8%">显示类型</td>
                <td width="8%">窗口方式</td>
                 <td width="8%">是否可改</td>
                <td width="32%">链接地址(外部链接需要加http://)</td>
                <td width="12%">操作</td>
                
           </tr>
        <form name="AddForm" method="post" action="adminmenu.asp?action=add">
          <tr align="center" bgcolor="#FFFFFF"> 
             <td ><input name="menutitle" type="text" id="menutitle"  size="20" ></td>
              <td ><input name="menuNum" type="text" id="menuNum"  size="4" value="<%=follows+1%>"></td>
              <td ><select name="menuTop" id="menuTop">
			  <option value="0" selected>显示</option>
                         <option value="1">隐藏</option>
                     </select>
                </td> 
             <td ><select name="menuType" id="menuType">
		  <option value="0" selected>上导航</option>
                  <option value="1" >下导航</option>
                  <option value="2" >其他</option>
                   
              </select></td>
            <td ><select name="new" id="new">
		  <option value="0" >新窗口</option>
                  <option value="1" Selected>原窗口</option>
                   
              </select></td> 
              <td ><select name="onlyread" id="onlyread">
			  <option value="0" selected>可改</option>
                         <option value="1">不可改</option>
                     </select>
                </td> 
               <td ><input name="menuaddress" type="text" id="menuaddress"  size="30" ></td> 
            <td ><input type="submit" name="Submit3" value="添 加" onClick="return CheckAdd();"></td>
          </tr>
        </form>
      </table></td>
  </tr>
</table>

<!--#include file="footer.asp"-->