theFunc.asp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1.  <META http-equiv=Content-Type content="text/html; charset=utf-8">
  2. <%'---------------------类别修改----------------
  3. function Clachg(kao)
  4. dim wtr
  5. set rs=server.CreateObject("ADODB.RECORDSET")
  6. if kao=0 then
  7. SQL="Select * from nbclass order by nb_id asc"
  8. end if
  9. if kao=1 then
  10. SQL="Select * from cbclass order by cb_id asc"
  11. end if
  12. if kao=2 then
  13. SQL="Select * from dbclass order by db_id asc"
  14. end if
  15. rs.open SQL,conn,1,3
  16. if not(rs.eof and rs.bof) then
  17. wtr=wtr&"<select name='theclass'>"
  18. wtr=wtr&"<option value="&rssmall(3)&" selected='selected'>"&TheB&"</option>"
  19. do while not rs.eof
  20. wtr=wtr&"<option value="&rs(0)&">"&rs(1)&"</option>"
  21. rs.movenext
  22. loop
  23. rs.close
  24. set rs=nothing
  25. wtr=wtr&"</select>"
  26. end if
  27. Clachg=wtr
  28. end function%>
  29. <%'信息修改类别
  30. Sub npdclassm(Cla)
  31. dim wtr
  32. set rsnpd=server.CreateObject("ADODB.RECORDSET")
  33. if Cla=0 then
  34. SQL="Select * from nbclass order by nb_id asc"
  35. end if
  36. if Cla=1 then
  37. SQL="Select * from cbclass order by cb_id asc"
  38. end if
  39. if Cla=2 then
  40. SQL="Select * from dbclass order by db_id asc"
  41. end if
  42. rsnpd.open SQL,conn,1,3
  43. if rsnpd.eof then
  44. response.write"尚无分类!"
  45. else%>
  46. <select name="npdcla">
  47. <%do while not rsnpd.eof%>
  48. <option value="<%=rsnpd(0)%>|0" <%if rs(2)=rsnpd(0) then%>selected="selected"<%end if%>><%=rsnpd(1)%></option>
  49. <%set rsnpd1=server.CreateObject("ADODB.RECORDSET")
  50. if Cla=0 then
  51. SQL="Select * from nsclass where nb_id="&rsnpd("nb_id")&" order by ns_id asc"
  52. end if
  53. if Cla=1 then
  54. SQL="Select * from csclass where cb_id="&rsnpd("cb_id")&" order by cs_id asc"
  55. end if
  56. if Cla=2 then
  57. SQL="Select * from dsclass where db_id="&rsnpd("db_id")&" order by ds_id asc"
  58. end if
  59. rsnpd1.open SQL,conn,1,3
  60. if rsnpd1.eof then
  61. else
  62. do while not rsnpd1.eof%>
  63. <option value="<%=rsnpd1(3)%>|<%=rsnpd1(0)%>"<%if rs(2)=rsnpd1(3) and rs(3)=rsnpd1(0) then%>selected="selected"<%end if%>>----<%=rsnpd1(1)%></option>
  64. <%rsnpd1.movenext
  65. loop
  66. end if
  67. rsnpd1.close
  68. set rsnpd1=nothing
  69. rsnpd.movenext
  70. loop
  71. end if
  72. rsnpd.close
  73. set rsnpd=nothing%>
  74. </select>
  75. <%End Sub%>
  76. <%'信息一动
  77. Function npdclassY(Cla)
  78. dim wtr
  79. set rs=server.CreateObject("ADODB.RECORDSET")
  80. if Cla=0 then
  81. SQL="Select * from nbclass order by nb_id asc"
  82. end if
  83. if Cla=1 then
  84. SQL="Select * from cbclass order by cb_id asc"
  85. end if
  86. if Cla=2 then
  87. SQL="Select * from dbclass order by db_id asc"
  88. end if
  89. rs.open SQL,conn,1,3
  90. if rs.eof then
  91. wtr=wtr&"尚无分类!"
  92. else
  93. wtr=wtr&"<select name=""npdclaY"">"
  94. wtr=wtr&"<option value=>请选择类别</option>"
  95. do while not rs.eof
  96. wtr=wtr&"<option value="&rs(0)&"|0>"&rs(1)&"</option>"
  97. set rs1=server.CreateObject("ADODB.RECORDSET")
  98. if Cla=0 then
  99. SQL="Select * from nsclass where nb_id="&rs("nb_id")&" order by ns_id asc"
  100. end if
  101. if Cla=1 then
  102. SQL="Select * from csclass where cb_id="&rs("cb_id")&" order by cs_id asc"
  103. end if
  104. if Cla=2 then
  105. SQL="Select * from dsclass where db_id="&rs("db_id")&" order by ds_id asc"
  106. end if
  107. rs1.open SQL,conn,1,3
  108. if rs1.eof then
  109. else
  110. do while not rs1.eof
  111. wtr=wtr&"<option value="&rs1(3)&"|"&rs1(0)&">----"&rs1(1)&"</option>"
  112. rs1.movenext
  113. loop
  114. end if
  115. rs1.close
  116. set rs1=nothing
  117. rs.movenext
  118. loop
  119. end if
  120. rs.close
  121. set rs=nothing
  122. wtr=wtr&"</select>"
  123. npdclassY=wtr
  124. End Function%>