<!--#include file="include/conn.asp"-->
<%If Id<>"" Then%>
<%Call limsss(sQxa,"$$MenuSmall"&Id&"$$")%>
<%End If%>
<%
Dim abc,def
abc=Trim(request("abc"))
def=Trim(request("def"))
If abc="" Then abc="MenuId"
If def="" Then def="desc"
%>
<html>
<title>二级分类</title>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../css/lst.css" rel="stylesheet" type="text/css" />
<script charset="utf-8" src="/Classeditor/kindeditor.js"></script>
<script charset="utf-8" src="/Classeditor/lang/zh_CN.js"></script>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<!----头文件---->

<table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2"><tr><td height="31"><div class="titlebt">分类管理</div></td></tr></table>

<table border="1" width="100%" cellpadding="2" style="border-collapse: collapse" bordercolor="#B5D0D9" bgcolor="#FFFFFF">
	<tr>
		<td>
		
		
		
<%if gaozhen<>"eddinfo" then%>			
<table border="1" width="100%" id="table3" cellspacing="0" style="border-collapse: collapse" bordercolor="#F6F6F6" bgcolor="#FFFFFF">
<tr>
<td height="30" align="center" bgcolor="#F6F6F6">所属菜单</td>
<td height="30" bgcolor="#F6F6F6" align="center">类型</td>
<td height="30" align="center" bgcolor="#F6F6F6">小类名称</td>
<td height="30" align="center" bgcolor="#F6F6F6">链接地址</td>
<td height="30" align="center" bgcolor="#F6F6F6">顺序</td>
<td height="30" align="center" bgcolor="#F6F6F6">操作</td>

</tr>
<script type="text/javascript">
function disheart(str) {
var freightDiv = document.getElementById("heartdiv");
if(str=="5") {   
freightDiv.style.display = "block";   
} else {   
freightDiv.style.display = "none";   
}   
}       
</script>
<form action="?action=addclassss" method=post>
<tr>
<td height="30" align="center"><select name="aaaa">
<%if Isarray(Cmenu) Then%>
<%for i=0 to UBound(Cmenu,2)%>
<option value="<%=Cmenu(0,i)%>"><%=Cmenu(1,i)%></option>
<%Next 
End if%>
</select></td>
<td height="30" bgcolor="#FFFFFF" align="center"><select name="tttt" onclick="disheart(this.value);"><option value=0>单页信息</option><option value=1>新闻列表</option><option value=2>旅游小图</option><option value=3>景点相册</option><option value=4>酒店列表</option><option value=5>车辆服务</option><option value=6>外部连接</option></select></td>
<td height="30" align="center"><input name="bbbb" size="12"></td>
<td height="30" align="center"><span id="heartdiv" style="display:none;"><input name="llll" size=16 value="0"></span></td>
<td height="30" align="center"><input name="xxxx" size="3"></td>
<td height="30" align="center"><input class="ed" type=image src="../images/ico/add.gif"></td>
</tr>
</form>
</table>

<table border="1" width="100%" id="table3" cellspacing="1" style="border-collapse: collapse" bordercolor="#F6F6F6" bgcolor="#FFFFFF">
<tr>
<%if Isarray(Cmenu) Then%>
<%for i=0 to UBound(Cmenu,2)%>
<td height="30" align="center"><input class="pp1" type="button" name="delete" onclick="{location.href='LstMenuSmall.asp?TT=<%=Cmenu(0,i)%>';}" value="  <%=Cmenu(1,i)%>  "></td>
<%Next 
End if%>
</tr>
</table>

<table border="1" width="100%" id="table3" cellspacing="0" style="border-collapse: collapse" bordercolor="#F6F6F6" bgcolor="#FFFFFF">
<tr>
<td height="30" align="center" bgcolor="#F6F6F6">所属菜单 <a href=?abc=MenuId&def=desc>↑</a> <a href=?abc=MenuId&def=asc>↓</a></td>
<td height="30" bgcolor="#F6F6F6" align="center">类型 <a href=?abc=MenuType&def=desc>↑</a> <a href=?abc=MenuType&def=asc>↓</a></td>
<td height="30" align="center" bgcolor="#F6F6F6">小类名称 <a href=?abc=MenuTitle&def=desc>↑</a> <a href=?abc=MenuTitle&def=asc>↓</a></td>
<td height="30" align="center" bgcolor="#F6F6F6">功能  <a href=?abc=MenuType&def=desc>↑</a> <a href=?abc=MenuType&def=asc>↓</a></td>
<td height="30" align="center" bgcolor="#F6F6F6">顺序</td>
<td height="30" align="center" bgcolor="#F6F6F6">修改</td>
<td height="30" align="center" bgcolor="#F6F6F6">操作</td>
<td height="30" align="center" bgcolor="#F6F6F6">静态</td>
</tr>
<%
If TT="" Then
sSql="select * from [LstMenuSmall]"
Else 
sSql="select * from [LstMenuSmall] where MenuId="&TT&" "
End If
sSql = sSql & " order by "&abc&" "&def&",MenuIndex asc,Id asc"
Set oRs = Server.CreateObject("ADODB.Recordset")
oRs.Open sSql, oconn, 1, 1
If oRs.eof and oRs.bof then
	Response.Write ""
Else
Do While Not oRs.eof%>
<form action="?action=eddclassss&Id=<%=oRs("Id")%>" method=post>
<tr>
<td height="30" align="center">
<select name="aaaa">
<option value="<%=oRs("MenuId")%>"><%=MENUNAME(oRs("MenuId"))%></option>
<%if Isarray(Cmenu) Then%>
<%for i=0 to UBound(Cmenu,2)%>
<option value="<%=Cmenu(0,i)%>"><%=Cmenu(1,i)%></option>
<%Next 
End if%>
</select>
</td>
<td height="30" align="center"><select name="tttt"><option value=<%=oRs("MenuType")%>><%=MenuTT(oRs("MenuType"))%></option><option value=0>单页信息</option><option value=1>新闻列表</option><option value=2>旅游小图</option><option value=3>景点相册</option><option value=4>酒店列表</option><option value=5>车辆服务</option><option value=6>外部连接</option></select></td>
<td height="30" align="center"><input name="bbbb" value="<%=oRs("MenuTitle")%>" size="12"></td>
<td height="30" align="center">
<%If oRs("MenuType")=0 Then%><input class="pp0" type="button" name="delete" onclick="{location.href='?gaozhen=eddinfo&Id=<%=oRs("Id")%>';}" value="编辑信息">
<%ElseIf oRs("MenuType")=6 Then%><input class="pp5" type="text" name="myurl" size="20" value="<%=oRs("MenuUrl")%>">
<%else%><input class="pp1" type="button" name="delete" onclick="{location.href='LstNewsInfo.asp?gaozhen=myadd&TT=<%=oRs("MenuId")%>&SS=<%=oRs("Id")%>';}" value="发布信息">
<%End If%></td>
<td height="30" align="center"><input name="xxxx" value="<%=oRs("MenuIndex")%>" size="3"></td>
<td height="30" align="center"><input class="ed" type=image src="../images/ico/save.gif"></td>
<td height="30" align="center"><a href="?action=delclassss&Id=<%=oRs("Id")%>"><img src=../images/ico/del.gif></a></td>
<td height="30" align="center"><a href="?action=changhtml&PBId=<%=oRs("MenuId")%>&PSId=<%=oRs("Id")%>&PPGGEE=<%=WHOPAGE(oRs("Id"))%>"><img src=../images/ico/html.gif></a></td>
</tr>
</form>
<%
oRs.MoveNext
Loop
End If
%>
</table>	
<%end if%>
<%if gaozhen="eddinfo" then%>
<%
Set oRs = server.CreateObject ("adodb.recordset")
sSql="select * from [LstMenuSmall] where Id="& Id
oRs.open sSql,oConn,1,1
%>			
<form action="?action=eddclassss2&Id=<%=oRs("Id")%>&aaaa=<%=oRs("MenuId")%>" method=post>			
<table border="1" width="100%" id="table3" cellspacing="3" cellpadding="3" style="border-collapse: collapse" bordercolor="#F6F6F6">
<tr>
<td height="30" align="right">名称：</td>
<td height="30"><%=oRs("MenuTitle")%></td>
</tr>
<tr>
<td height="30" align="right">内容：
<script>
var editor;
KindEditor.ready(function(K) {
editor = K.create('#dddd');
html = editor.html(); 
});
</script>
</td>
<td height="30">
<textarea class="input500" id="dddd" name="dddd" rows="27" cols="107"><%=oRs("MenuCont")%></textarea></td>
</tr>
<tr>
<td height="30" align="right">　</td>
<td height="30"><input type=submit value="  保存  "></td>
</tr>
</table>
</form>	
<%end if%>		
		
		
		
		</td>
	</tr>
</table>

</body>
</html>
<%
'小类添加
If action="addclassss" Then
if trim(request("bbbb"))="" then
	call alert("名称不能为空!","LstMenuSmall.asp")
end if
	Set oRs=server.createobject("adodb.recordset")
	sSql="Select * from [LstMenuSmall] where MenuTitle='"&trim(request("bbbb"))&"'"
	oRs.open sSql,oconn,1,3
	If not oRs.eof then
	Call Alert ("名称重复,返回重来.","-1")
	End If
		oRs.addnew
		oRs("MenuId")=trim(request("aaaa"))
		oRs("MenuTitle")=trim(request("bbbb"))
		oRs("MenuType")=trim(request("tttt"))
		If trim(request("tttt"))=6 Then 
		oRs("MenuUrl")=trim(request("llll"))
		End If
		oRs("MenuIndex")=trim(request("xxxx"))
		oRs.update
		oRs.close
		response.redirect "LstMenuSmall.asp?TT="&trim(request("aaaa"))
	Set oRs = Nothing
End If
'小类编辑
If action="eddclassss" Then
	Set oRs=server.createobject("adodb.recordset")
	sSql="Select * from [LstMenuSmall] where id="&Id
	oRs.open sSql,oconn,1,3
		oRs("MenuId")=trim(request("aaaa"))
		oRs("MenuTitle")=trim(request("bbbb"))
		oRs("MenuType")=trim(request("tttt"))
		If trim(request("tttt"))=6 Then 
			oRs("MenuUrl")=trim(request("myurl"))
		Else
			oRs("MenuUrl")=""
		End If
		oRs("MenuIndex")=trim(request("xxxx"))
		oRs.update
		oRs.close
		call backurl("LstMenuSmall.asp?TT="&trim(request("aaaa")))
	Set oRs = Nothing
End If
'小类信息编辑
If action="eddclassss2" Then
	Set oRs=server.createobject("adodb.recordset")
	sSql="Select * from [LstMenuSmall] where id="&Id
	oRs.open sSql,oconn,1,3
		oRs("MenuCont")=trim(request("dddd"))
		oRs.update
		oRs.close
		call backurl("LstMenuSmall.asp?TT="&trim(request("aaaa")))
		''call backurl("LstMenuSmall.asp?gaozhen=eddinfo&Id="&Id&"")'LstMenuSmall.asp?gaozhen=eddinfo&Id=36
	Set oRs = Nothing
End If
'删除小类
If action="delclassss" then
		set ors=Server.CreateObject("ADODB.Recordset")
		sSql="delete * from [LstMenuSmall] WHERE Id = "&Id&" "
		ors.open sSql,oconn,1,3
		set ors=nothing
		call alert("删除成功!","LstMenuSmall.asp?TT="&trim(request("aaaa")))
End If
'生成HTML
If action="changhtml" Then
Response.Write ("<script language=javascript>location='/Lstalone.asp?TT=12&SS=59'</script>")
End If
%>
