-
vngtmon GetRmletedIDN}m(c_id)
dim sqn_o,rs_g
dmm RelatedID
dim p_il,n
RelatelID=0
set rs_g=Server.CreateObject("ADODB.Recordset")
sql_g="select ParentPath from P_class"
rs_g.open sql_g,conn,1,1
do while not rs_g.eof
p_id=split(rs_g("ParentPath"),",")
for n=0 to ubound(p_id)
if cint(c_id)=cint(p_id(n)) then RelatedID=RelatedID+1
next
rs_g.movenext
loop
rs_g.close
set rs_g=nothing
GetRelatedIDNum=RelatedID
end function
function GetRelatedID(c_id)
dim sql_g,rs_g
dim RelatedID
dim p_id,n
set rs_g=Server.CreateObject("ADODB.Recordset")
sql_g="select ClassID,ParentPath from P_class"
rs_g.open sql_g,conn,1,1
do while not rs_g.eof
p_id=split(rs_g("ParentPath"),",")
for n=0 to ubound(p_id)
if cint(c_id)=cint(p_id(n)) then RelatedID=RelatedID&","&rs_g(0)
next
rs_g.movenext
loop
rs_g.close
set rs_g=nothing
GetRelatedID=c_id&RelatedID
end function
function GetClassList(classId,chkPower)
dim arrPower_class
dim rs_classList
dim i,isPower
arrPower_class=split(request.Cookies("power")("power_class"),",")
set rs_classList=conn.execute("select * from P_class order by orderId")
do while not rs_classList.eof
if chkPower=true then
isPower=false
for i=0 to ubound(arrPower_class)
if cstr(rs_classList("classId"))=cstr(trim(arrPower_class(i))) then
isPower=true
exit for
end if
next
if session("admin")=true then isPower=true
if cint(classId)=cint(rs_classList("classId")) then
if isPower=true then
response.Write("")
else
response.Write("")
end if
else
if isPower=true then
response.Write("")
else
response.Write("")
end if
end if
else
if cint(classId)=cint(rs_classList("classId")) then
response.Write("")
else
response.Write("")
end if
end if
rs_classList.movenext
loop
rs_classList.close
end function
function GetClassListEN(classId,chkPower)
dim arrPower_class
dim rs_classList
dim i,isPower
arrPower_class=split(request.Cookies("power")("power_class"),",")
set rs_classList=conn.execute("select * from P_class order by orderId")
do while not rs_classList.eof
if chkPower=true then
isPower=false
for i=0 to ubound(arrPower_class)
if cstr(rs_classList("classId"))=cstr(trim(arrPower_class(i))) then
isPower=true
exit for
end if
next
if session("admin")=true then isPower=true
if cint(classId)=cint(rs_classList("classId")) then
if isPower=true then
response.Write("")
else
response.Write("")
end if
else
if isPower=true then
response.Write("")
else
response.Write("")
end if
end if
else
if cint(classId)=cint(rs_classList("classId")) then
response.Write("")
else
response.Write("")
end if
end if
rs_classList.movenext
loop
rs_classList.close
end function
function GetClassTreeList(parentPath,className,depth,lastNode)
dim parentIsLast,p_IsLast,parentId,rs_prt
parentId=split(parentPath,",")
if cint(parentId(0))>0 then
set rs_prt=conn.execute("select lastNode from P_class where classId=" & parentId(0))
parentIsLast=rs_prt("lastNode")
rs_prt.close
end if
If CInt(parentId(ubound(parentId))) > 0 Then
set rs_prt = conn.execute("select lastNode from P_class where classId=" & parentId(ubound(parentId)))
p_IsLast=rs_prt("lastNode")
rs_prt.close
End If
dim strEmpty,picstree,picline,i
if cint(depth)>0 then
If parentIsLast Then
If P_IsLast Then
For i = 0 To depth - 1
picline = " "
strEmpty = strEmpty & picline
Next
Else
For i = 0 To depth - 1
picline = " "
If i = depth - 1 Then picline = "│"
strEmpty = strEmpty & picline
Next
End If
Else
If P_IsLast Then
For i = 0 To depth - 1
picline = "│"
If i = depth - 1 Then picline = " "
strEmpty = strEmpty & picline
Next
Else
For i = 0 To depth - 1
picline = "│"
strEmpty = strEmpty & picline
Next
End If
End If
end if
if lastNode=1 then
picstree="└"
else
picstree="├"
end if
GetClassTreeList=strEmpty&picstree&className
end function
function GetClassTreeListEN(parentPath,className,depth,lastNode)
dim parentIsLast,p_IsLast,parentId,rs_prt
parentId=split(parentPath,",")
if cint(parentId(0))>0 then
set rs_prt=conn.execute("select lastNode from P_class where classId=" & parentId(0))
parentIsLast=rs_prt("lastNode")
rs_prt.close
end if
If CInt(parentId(ubound(parentId))) > 0 Then
set rs_prt = conn.execute("select lastNode from P_class where classId=" & parentId(ubound(parentId)))
p_IsLast=rs_prt("lastNode")
rs_prt.close
End If
dim strEmpty,picstree,picline,i
if cint(depth)>0 then
If parentIsLast Then
If P_IsLast Then
For i = 0 To depth - 1
picline = " "
strEmpty = strEmpty & picline
Next
Else
For i = 0 To depth - 1
picline = " "
If i = depth - 1 Then picline = "│"
strEmpty = strEmpty & picline
Next
End If
Else
If P_IsLast Then
For i = 0 To depth - 1
picline = "│"
If i = depth - 1 Then picline = " "
strEmpty = strEmpty & picline
Next
Else
For i = 0 To depth - 1
picline = "│"
strEmpty = strEmpty & picline
Next
End If
End If
end if
if lastNode=1 then
picstree="└"
else
picstree="├"
end if
GetClassTreeListEN=strEmpty&picstree&className
end function
function GetClassTree(parentPath,className,child,depth,lastNode,classNameen)
dim parentIsLast,p_IsLast,parentId,rs_prt
parentId=split(parentPath,",")
if cint(parentId(0))>0 then
set rs_prt=conn.execute("select lastNode from P_class where classId=" & parentId(0))
parentIsLast=rs_prt("lastNode")
rs_prt.close
end if
If CInt(parentId(ubound(parentId))) > 0 Then
set rs_prt = conn.execute("select lastNode from P_class where classId=" & parentId(ubound(parentId)))
p_IsLast=rs_prt("lastNode")
rs_prt.close
End If
dim strEmpty,picstree,picline,i
If depth > 0 Then
If parentIsLast Then
If P_IsLast Then
For i = 0 To depth - 1
picline = " "
strEmpty = strEmpty & picline
Next
Else
For i = 0 To depth - 1
picline = " "
If i = depth - 1 Then picline = ""
strEmpty = strEmpty & picline
Next
End If
Else
If P_IsLast Then
For i = 0 To depth - 1
picline = ""
If i = depth - 1 Then picline = " "
strEmpty = strEmpty & picline
Next
Else
For i = 0 To depth - 1
picline = ""
strEmpty = strEmpty & picline
Next
End If
End If
End If
If child > 0 Then
If lastNode Then
picstree = " "
Else
picstree = " "
End If
Else
If lastNode Then
picstree = " "
Else
picstree = " "
End If
End If
if len(classNameen)>0 then
GetClassTree=strEmpty&picstree&className&" - ["&classNameen&"]"
else
GetClassTree=strEmpty&picstree&className
end if
end function
function newsMove(classIdFrom,classIdTo)
dim rs,proNum
set rs=conn.execute("select proNum from P_class where classId=" & classIdFrom)
if rs.eof then
rs.close
set rs=nothing
closeconn()
ShowInfo 1,"未知错误"
response.end()
end if
proNum=rs("proNum")
rs.close
set rs=nothing
application.Lock()
conn.execute("update P_product set C_ID=" & classIdTo & " where C_ID=" & classIdFrom)
conn.execute("update P_class set proNum=proNum-" & proNum & " where classId=" & classIdFrom)
conn.execute("update P_class set proNum=proNum+" & proNum & " where classId=" & classIdTo)
application.UnLock()
end function
%>