<%@ LANGUAGE = VBScript.Encode %> 价格类别 <% if Instr(session("AdminPurview"),"|11,")=0 then response.write ("

您没有管理该模块的权限!
") response.end end if %>
价格检索及分类查看:添加,修改,删除价格信息
添加价格信息 | 查看所有价格信息 | 添加价格类别
<% 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 PriceSort where ID="&request.QueryString("id") rs.open sql,conn,1,1 SortPath=rs("SortPath") conn.execute("delete from PriceSort where Instr(SortPath,'"&SortPath&"')>0") conn.execute("delete from Price where Instr(SortPath,'"&SortPath&"')>0") response.write ("") Case "Save" saveFolder () Case "Edit" editFolder CallFolderView() Case "Move" moveFolderForm () CallFolderView() Case "MoveSave" saveMoveFolder () Case Else CallFolderView() End Select %> <%Function CallFolderView()%>
【管理价格类别】
添加一级分类 | 查看所有价格
<%Folder(0)%>
<% End Function Function Folder(id) Dim rs,sql,i,ChildCount,FolderType,FolderName,onMouseUp,ListType Set rs=server.CreateObject("adodb.recordset") sql="Select * From PriceSort where ParentID="&id&" order by id" rs.open sql,conn,1,1 if id=0 and rs.recordcount=0 then response.write ("
暂无价格分类
") response.end end if i=1 response.write("") while not rs.eof ChildCount=conn.execute("select count(*) from PriceSort where ParentID="&rs("id"))(0) if ChildCount=0 then if i=rs.recordcount then FolderType="SortFileEnd" else FolderType="SortFile" end if FolderName=rs("SortNameCH") 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") end If datafrom="PriceSort" response.write("") response.write("") if ChildCount>0 then %> " style="display:yes"> <% end if rs.movenext i=i+1 wend response.write("
"&FolderName&" ") if rs("ViewFlagCH") then Response.Write "" else Response.Write "×" end if if rs("ViewFlagEN") then Response.Write "" else Response.Write "×" end if response.write("        操作:") 'If rs("ParentID") < 1 Then response.write("添加 | ") 'End If response.write("修改") response.write(" | ") response.write("→") response.write(" | 删除") response.write("    价格:添加") response.write(" | 列表") response.write("
<% Folder(rs("id")) %>
") rs.close set rs=nothing end Function Function addFolder() Dim ParentID ParentID=request.QueryString("ParentID") addFolderForm ParentID end Function Function addFolderForm(ParentID) Dim ParentPath,SortTextPath,rs,sql if ParentID=0 then ParentPath="0," SortTextPath="" else Set rs=server.CreateObject("adodb.recordset") sql="Select * From PriceSort where ID="&ParentID rs.open sql,conn,1,1 ParentPath=rs("SortPath") end if %>
【添加价格类别】
| 根类 → <% if ParentID<>0 then TextPath(ParentID)%>
价格类别(:Registration Fee/Package A/Package B): 生效: 否 父类ID: 父类数字路径:
<% End Function Function TextPath(ID) Dim rs,sql,SortTextPath Set rs=server.CreateObject("adodb.recordset") sql="Select * From PriceSort where ID="&ID rs.open sql,conn,1,1 SortTextPath=rs("SortNameCH")&" → " if rs("ParentID")<>0 then TextPath rs("ParentID") response.write(SortTextPath) End Function Function saveFolder if len(trim(request.Form("SortNameCH")))=0 then response.write ("") response.end end if Dim From,Action,rs,sql,SortTextPath From=request.QueryString("From") Set rs=server.CreateObject("adodb.recordset") if From="Add" then sql="Select * From PriceSort" rs.open sql,conn,1,3 rs.addnew Action="添加价格类别" rs("SortPath")=request.Form("ParentPath") & rs("ID") &"," else sql="Select * From PriceSort where ID="&request.QueryString("ID") rs.open sql,conn,1,3 Action="修改价格类别" rs("SortPath")=request.Form("SortPath") end if rs("SortNameCh")=request.Form("SortNameCh") rs("ViewFlagCh")=request.Form("ViewFlagCh") rs("SortNameEn")=request.Form("SortNameEn") rs("ParentID")=request.Form("ParentID") rs.update response.write ("") End Function Function editFolder() Dim ID ID=request.QueryString("ID") editFolderForm ID end function Function editFolderForm(ID) Dim SortNameCh,ViewFlagCh,SortNameEn,ViewFlagEn,ParentID,SortPath,rs,sql Set rs=server.CreateObject("adodb.recordset") sql="Select * From PriceSort where ID="&ID rs.open sql,conn,1,1 SortNameCh=rs("SortNameCh") ViewFlagCh=rs("ViewFlagCh") SortNameEn=rs("SortNameEn") ViewFlagEn=rs("ViewFlagEn") ParentID=rs("ParentID") SortPath=rs("SortPath") %>
【修改价格类别】
| 根类 → <% if ParentID<>0 then TextPath(ParentID)%>
价格类别(:Opening/Track/Session:1 ): 发布: /> 是 /> 否 父类ID: 父类数字路径:
<% End Function Function moveFolderForm() Dim ID,ParentID,SortNameCH,SortPath ID=request.QueryString("ID") ParentID=request.QueryString("ParentID") SortNameCH=request.QueryString("SortNameCH") SortPath=request.QueryString("SortPath") %>
【移动价格类别】
→<% response.write (SortNameCH) %>
移动类ID: 移动类父ID: 移动类数字路径:
目标位置:通过点击"至"选择将要放置到的类别。
目标类ID: 目标类父ID: 目标类数字路径:
<% End Function Function saveMoveFolder() Dim rs,sql,fromID,fromParentID,fromSortPath,toID,toParentID,toSortPath,fromParentSortPath fromID=request.Form("ID") fromParentID=request.Form("ParentID") fromSortPath=request.Form("SortPath") toID=request.Form("toID") toParentID=request.Form("toParentID") toSortPath=request.Form("toSortPath") if toID="" or toParentID="" or toSortPath="" then response.write ("") response.end end if if fromParentID=0 then response.write ("") response.end end if if fromSortPath=toSortPath then response.write ("") response.end end if if Instr(toSortPath,fromSortPath)>0 or fromParentID=toID then response.write ("") response.end end if Set rs=server.CreateObject("adodb.recordset") sql="Select * From PriceSort where ID="&fromParentID rs.open sql,conn,0,1 fromParentSortPath=rs("SortPath") conn.execute("update PriceSort set SortPath='"&toSortPath&"'+Mid(SortPath,Len('"&fromParentSortPath&"')+1) where Instr(SortPath,'"&fromSortPath&"')>0") conn.execute("update PriceSort set ParentID='"&toID&"' where ID="&fromID) conn.execute("update Price set SortPath='"&toSortPath&"'+Mid(SortPath,Len('"&fromParentSortPath&"')+1) where Instr(SortPath,'"&fromSortPath&"')>0") response.write ("") End Function %>