📄 productsort.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<% Option Explicit %>
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>产品分类</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
<META NAME="copyright" CONTENT="Copyright 2008-2010 - GLGK.COM-STUDIO" />
<META NAME="Author" CONTENT="冠龙科技,www.glgk.com" />
<META NAME="Keywords" CONTENT="" />
<META NAME="Description" CONTENT="" />
<link rel="stylesheet" href="Images/CssAdmin.css">
<script language="javascript" src="../Script/Admin.js"></script>
</HEAD>
<!--#include file="../Include/Const.asp" -->
<!--#include file="../Include/ConnSiteData.asp" -->
<!--#include file="CheckAdmin.asp"-->
<%
if Instr(session("AdminPurview"),"|31,")=0 then
response.write ("<font color='red')>你不具有该管理模块的操作权限,请返回!</font>")
response.end
end if
'========判断是否具有管理权限
%>
<BODY>
<%
Dim Action
Action=request.QueryString("Action")
Select Case Action
Case "Add"
addFolder
CallFolderView()
Case "Del"
Dim rs,sql,SortPath
Set rs=server.CreateObject("adodb.recordset")
sql="Select * from glProductsort where ID="&request.QueryString("id")
rs.open sql,conn,1,1
SortPath=rs("SortPath")
conn.execute("update Products set SortID2=null,SortPath2='' where Instr(SortPath2,'"&SortPath&"')>0")
conn.execute("delete from glProductsort where Instr(SortPath,'"&SortPath&"')>0")
conn.execute("delete from glProducts where Instr(SortPath,'"&SortPath&"')>0")
response.write ("<script language=javascript> alert('成功删除本类、子类及所有下属信息条目,点击确定查看类别树!');location.replace('ProductSort.asp');</script>")
Case "Save"
saveFolder ()
Case "Edit"
editFolder
CallFolderView()
Case "Move"
moveFolderForm ()
CallFolderView()
Case "MoveSave"
saveMoveFolder ()
Case Else
CallFolderView()
End Select
%>
</BODY>
</HTML>
<%
'调用显示节点------------------------------
Function CallFolderView()
%>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6298E1">
<tr>
<td height="24" nowrap><font color="#FFFFFF"><strong>类别树查看管理:</strong></font></td>
</tr>
<tr>
<td height="24" align="center" nowrap bgcolor="#EBF2F9"><a href="ProductSort.asp?Action=Add&ParentID=0">添加一级分类</a><font color="#0000FF"> | </font><a href="ProductList.asp" onClick='changeAdminFlag("产品列表")'>查看所有产品</a></td>
</tr>
<tr>
<td height="24" nowrap bgcolor="#EBF2F9"><% Folder(0) %></td>
</tr>
</table>
<%
End Function
'列出所有节点------------------------------
Function Folder(id)
Dim rs,sql,i,ChildCount,FolderType,FolderName,onMouseUp,ListType,ViewFlag
Set rs=server.CreateObject("adodb.recordset")
sql="Select * from glProductsort where ParentID="&id&" order by Sequence"
rs.open sql,conn,1,1
if id=0 and rs.recordcount=0 then
response.write ("暂无分类!")
response.end
end if
i=1
response.write("<table border='0' cellspacing='0' cellpadding='0'>")
while not rs.eof
ChildCount=conn.execute("select count(*) from glProductsort where ParentID="&rs("id"))(0)
if rs("ViewFlagCh") then
ViewFlag="<font color='blue'>√</font>"
else
ViewFlag="<font color='red'>×</font>"
end if
if rs("ViewFlagEn") then
ViewFlag=ViewFlag&"<font color='blue'>√</font>"
else
ViewFlag=ViewFlag&"<font color='red'>×</font>"
end if
if ChildCount=0 then
if i=rs.recordcount then
FolderType="SortFileEnd"
else
FolderType="SortFile"
end if
FolderName=rs("SortNameCh")&" "&ViewFlag
onMouseUp=""
else
if i=rs.recordcount then
FolderType="SortEndFolderClose"
ListType="SortEndListline"
onMouseUp="EndSortChange('a"&rs("id")&"','b"&rs("id")&"');"
else
FolderType="SortFolderClose"
ListType="SortListline"
onMouseUp="SortChange('a"&rs("id")&"','b"&rs("id")&"');"
end if
FolderName=rs("SortNameCh")&" "&ViewFlag
end if
response.write("<tr>")
response.write("<td nowrap id='b"&rs("id")&"' class='"&FolderType&"' onMouseUp="&onMouseUp&"></td><td nowrap><font color='#FF0000'>"&rs("Sequence")&"</font> "&FolderName&" ")
response.write("<font color='#FF0000'>分类:</font><a href='reg.asp'>添加</a>")
response.write("<font color='#367BDA'> | </font><a href='reg.asp'>修改</a>")
response.write("<font color='#367BDA'> | </font><a href='ProductSort.asp?Action=Move&ID="&rs("id")&"&ParentID="&rs("Parentid")&"&SortNameCh="&rs("SortNameCh")&"&SortPath="&rs("SortPath")&"'>移</a>")
response.write("→<a href='#' onclick='SortFromTo.rows[4].cells[0].innerHTML=""→ "&rs("SortNameCh")&""";MoveForm.toID.value="&rs("ID")&";MoveForm.toParentID.value="&rs("ParentID")&";MoveForm.toSortPath.value="""&rs("SortPath")&""";'>至</a>")
response.write("<font color='#367BDA'> | </font><a href=javascript:ConfirmDelSort('ProductSort',"&rs("id")&")>删除</a>")
response.write(" <font color='#FF0000'>产品:</font><a href='reg.asp' onClick='changeAdminFlag(""添加产品"")'>添加</a>")
response.write("<font color='#367BDA'> | </font><a href='reg.asp' onClick='changeAdminFlag(""产品列表"")'>列表</a>")
response.write("</td></tr>")
if ChildCount>0 then
%>
<tr id="a<%= rs("id")%>" style="display:yes"><td class="<%= ListType%>" nowrap></td><td ><% Folder(rs("id")) %></td></tr>
<%
end if
rs.movenext
i=i+1
wend
response.write("</table>")
rs.close
set rs=nothing
end function
'添加节点---------------------------------
Function addFolder()
Dim ParentID
ParentID=request.QueryString("ParentID")
addFolderForm ParentID
end function
'添加节点表单------------------------------
Function addFolderForm(ParentID)
Dim SortPath,SortTextPath,Sequence,SummaryCh,SummaryEn,Picture,rs,sql
if ParentID=0 then
SortPath="0,"
SortTextPath=""
Picture="../System/Images/NoSortPicture.jpg"
SummaryCh=""
SummaryEn=""
Sequence=0
else
Set rs=server.CreateObject("adodb.recordset")
sql="Select * from glProductsort where ID="&ParentID
rs.open sql,conn,1,1
SortPath=rs("SortPath")
Picture="../System/Images/NoSortPicture.jpg"
SummaryCh=""
SummaryEn=""
Sequence=0
end if
%>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6298E1">
<form name="FolderForm" method="post" action="ProductSort.asp?Action=Save&From=Add">
<tr>
<td height="24" nowrap><font color="#FFFFFF"><img src="Images/Explain.gif" width="18" height="18" border="0" align="absmiddle"> <strong>添加类别:通过"显示"可控制每种分类是否在相应语言版网站里显示出来。</strong></font></td>
</tr>
<tr>
<td height="24" nowrap bgcolor="#EBF2F9">| 根类 → <% if ParentID<>0 then TextPath(ParentID)%></td>
</tr>
<tr>
<td height="24" bgcolor="#EBF2F9">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="190" nowrap>中文:<input name="SortNameCh" type="text" class="textfield" id="SortNameCh" size="22"></td>
<td width="100" nowrap>显示:<input name="ViewFlagCh" type="radio" value="1" checked="checked" />是<input name="ViewFlagCh" type="radio" value="0" />否</td>
<td nowrap>父类ID:<input readonly name="ParentID" type="text" class="textfield" id="ParentID" size="6" value="<%=ParentID %>">父类数字路径:<input readonly name="SortPath" type="text" class="textfield" id="SortPath" size="44" value="<%=SortPath%>"></td>
</tr>
<tr>
<td nowrap>英文:<input name="SortNameEn" type="text" class="textfield" id="SortNameEn" size="22"></td>
<td nowrap>显示:<input name="ViewFlagEn" type="radio" value="1" />是<input name="ViewFlagEn" type="radio" value="0" checked="checked" />否</td>
<td colspan="2" nowrap>排序号:<input name="Sequence" type="text" class="textfield" id="Sequence" size="4" value="<%=Sequence%>" onKeyDown="if(event.keyCode==13)event.returnValue=false" onChange="if(/\D/.test(this.value)){alert('只能在排序号内输入整数!');this.value='<%=Sequence%>';}"></td>
</tr>
<tr>
<td rowspan="3" nowrap valign="top"> <img src="<%=Picture%>" name="SortPicture" align="absmiddle" id="SortPicture" style="cursor:pointer;" title="点击更新刚修改的图片..." onClick="UpSortPicture()"/></td>
<td colspan="4" nowrap >图片:<input name="Picture" type="text" class="textfield" id="Picture" style="WIDTH:530;" maxlength="100" value="<%=Picture%>"> <a href="javaScript:OpenScript('UpFileForm.asp?Result=Picture',460,180)"><img src="Images/Upload.gif" width="30" height="16" border="0" align="absmiddle"></a></td>
</tr>
<tr>
<td colspan="2" nowrap ><textarea name="SummaryCh" id="SummaryCh" rows="3" class="textfield" style="WIDTH:603;background:#fff url(Images/SummaryCh_bg.jpg) center no-repeat;"><%=SummaryCh%></textarea></td>
</tr>
<tr>
<td colspan="2" nowrap ><textarea name="SummaryEn" id="SummaryEn" rows="3" class="textfield" style="WIDTH:603;background:#fff url(Images/SummaryEn_bg.jpg) center no-repeat;"><%=SummaryEn%></textarea></td>
</tr>
<tr>
<td colspan="3" align="center" height="30" valign="bottom" nowrap><input name="submitSave" type="submit" class="button" id="保存" value=" 保存 "></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -