Admin_Common.asp 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. <%
  2. Action = Trim(Request("Action"))
  3. MaxPerPage = 20
  4. ChannelID = Request("ChannelID")
  5. if channelid = "" then channelid = 1
  6. '检查管理员是否登录
  7. Dim AdminID, AdminName, AdminPassword, AdminLoginCode, AdminPurview, PurviewPassed
  8. Dim rsGetAdmin, sqlGetAdmin
  9. AdminName = ReplaceBadChar(Trim(Request.Cookies("AdminName")))
  10. AdminPassword = ReplaceBadChar(Trim(Request.Cookies("AdminPassword")))
  11. if useSiteManageCode = true then
  12. AdminLoginCode = ReplaceBadChar(Trim(Request.Cookies("AdminLoginCode")))
  13. else
  14. AdminLoginCode = SiteManageCode
  15. end if
  16. If AdminName = "" Or AdminPassword = "" Or AdminLoginCode <> SiteManageCode Then
  17. Call CloseConn
  18. Response.redirect "login.asp"
  19. End If
  20. sqlGetAdmin = "select * from t_user_info where uid='" & AdminName & "' and pwd='" & AdminPassword & "'"
  21. Set rsGetAdmin = Server.CreateObject("adodb.recordset")
  22. rsGetAdmin.Open sqlGetAdmin, Conn, 1, 1
  23. If rsGetAdmin.BOF And rsGetAdmin.EOF Then
  24. rsGetAdmin.Close
  25. Set rsGetAdmin = Nothing
  26. Call CloseConn
  27. Response.redirect "login.asp"
  28. End If
  29. AdminID = rsGetAdmin("ID")
  30. AdminName = rsGetAdmin("uid")
  31. '**************************************************
  32. '函数名:IsObjInstalled
  33. '作 用:检查组件是否已经安装
  34. '参 数:strClassString ----组件名
  35. '返回值:True ----已经安装
  36. ' False ----没有安装
  37. '**************************************************
  38. Function IsObjInstalled(strClassString)
  39. On Error Resume Next
  40. IsObjInstalled = False
  41. Err = 0
  42. Dim xTestObj
  43. Set xTestObj = CreateObject(strClassString)
  44. If Err.Number = 0 Then IsObjInstalled = True
  45. Set xTestObj = Nothing
  46. Err = 0
  47. End Function
  48. dim ObjInstalled_FSO, fso
  49. ObjInstalled_FSO = IsObjInstalled("Scripting.FileSystemObject")
  50. If ObjInstalled_FSO = True Then
  51. Set fso = Server.CreateObject("Scripting.FileSystemObject")
  52. Else
  53. Response.Write "<li>FSO组件不可用,各种与FSO相关的功能都将出错!请运行Install.asp或者到后台网站配置处设置好FSO组件名称。</li>"
  54. End If
  55. Sub ShowPageTitle(strTitle)
  56. Response.Write " <tr class='topbg'> " & vbCrLf
  57. Response.Write " <td height='22' colspan='10'><table width='100%'><tr class='topbg'><td align='center'><b>" & strTitle & "</b></td></tr></table></td>" & vbCrLf
  58. Response.Write " </tr>" & vbCrLf
  59. End Sub
  60. '**************************************************
  61. '函数名:ShowJS_Manage
  62. '作 用:通用频道管理js验证(多项诓全选,删除提示,移动)
  63. '参 数:ItemName ---- 项目名称
  64. '返回值:javascript 验证
  65. '**************************************************
  66. Public Sub ShowJS_Manage(ItemName)
  67. Dim strJS
  68. Response.Write "<SCRIPT language=javascript>" & vbCrLf
  69. Response.Write "function CheckItem(CB){" & vbCrLf
  70. Response.Write " var tagname=(arguments.length>1)?arguments[1]:'TR';" & vbCrLf
  71. Response.Write " if(document.myform.chkAll.checked){" & vbCrLf
  72. Response.Write " document.myform.chkAll.checked = document.myform.chkAll.checked&0;" & vbCrLf
  73. Response.Write " }" & vbCrLf
  74. Response.Write " if (CB.checked){hL(CB,tagname)};else{dL(CB,tagname)};" & vbCrLf
  75. Response.Write " var TB=TO=0;" & vbCrLf
  76. Response.Write " for (var i=0;i<myform.elements.length;i++) {" & vbCrLf
  77. Response.Write " var e=myform.elements[i];" & vbCrLf
  78. Response.Write " if ((e.name != 'chkAll') && (e.type=='checkbox')) {" & vbCrLf
  79. Response.Write " TB++;" & vbCrLf
  80. Response.Write " if (e.checked) TO++;" & vbCrLf
  81. Response.Write " }" & vbCrLf
  82. Response.Write " }" & vbCrLf
  83. Response.Write " myform.chkAll.checked=(TO==TB)?true:false;" & vbCrLf
  84. Response.Write "}" & vbCrLf
  85. Response.Write "function CheckAll(form){" & vbCrLf
  86. Response.Write " var tagname=(arguments.length>1)?arguments[1]:'TR';" & vbCrLf
  87. Response.Write " for (var i=0;i<form.elements.length;i++){" & vbCrLf
  88. Response.Write " var e = form.elements[i];" & vbCrLf
  89. Response.Write " if (e.name != 'chkAll' && e.disabled == false && e.type == 'checkbox') {" & vbCrLf
  90. Response.Write " e.checked = form.chkAll.checked;" & vbCrLf
  91. Response.Write " if (e.checked){hL(e,tagname)};else{dL(e,tagname)};" & vbCrLf
  92. Response.Write " }" & vbCrLf
  93. Response.Write " }" & vbCrLf
  94. Response.Write "}" & vbCrLf
  95. Response.Write "function hL(E,tagname){" & vbCrLf
  96. Response.Write " while (E.tagName!=tagname) {E=E.parentElement;}" & vbCrLf
  97. Response.Write " E.className='tdbg2';" & vbCrLf
  98. Response.Write "}" & vbCrLf
  99. Response.Write "function dL(E,tagname){" & vbCrLf
  100. Response.Write " while (E.tagName!=tagname) {E=E.parentElement;}" & vbCrLf
  101. Response.Write " E.className='tdbg';" & vbCrLf
  102. Response.Write "}" & vbCrLf
  103. Response.Write "function ConfirmDel(){" & vbCrLf
  104. Response.Write " if(document.myform.Action.value=='Del'){" & vbCrLf
  105. Response.Write " if(confirm('确定要删除选中的" & ItemName & "吗?本操作将把选中的" & ItemName & "移到回收站中。必要时您可从回收站中恢复!'))" & vbCrLf
  106. Response.Write " return true;" & vbCrLf
  107. Response.Write " else" & vbCrLf
  108. Response.Write " return false;" & vbCrLf
  109. Response.Write " }" & vbCrLf
  110. Response.Write " else if(document.myform.Action.value=='ConfirmDel'){" & vbCrLf
  111. Response.Write " if(confirm('确定要彻底删除选中的" & ItemName & "吗?彻底删除后将不能恢复!'))" & vbCrLf
  112. Response.Write " return true;" & vbCrLf
  113. Response.Write " else" & vbCrLf
  114. Response.Write " return false;" & vbCrLf
  115. Response.Write " }" & vbCrLf
  116. Response.Write " else if(document.myform.Action.value=='ClearRecyclebin'){" & vbCrLf
  117. Response.Write " if(confirm('确定要清空回收站?一旦清空将不能恢复!'))" & vbCrLf
  118. Response.Write " return true;" & vbCrLf
  119. Response.Write " else" & vbCrLf
  120. Response.Write " return false;" & vbCrLf
  121. Response.Write " }" & vbCrLf
  122. Response.Write " else if(document.myform.Action.value=='DelFromSpecial'){" & vbCrLf
  123. Response.Write " if(confirm('确定要将选中的" & ItemName & "从其所属专题中删除吗?操作成功后" & ItemName & "将不属于任何专题。'))" & vbCrLf
  124. Response.Write " return true;" & vbCrLf
  125. Response.Write " else" & vbCrLf
  126. Response.Write " return false;" & vbCrLf
  127. Response.Write " }" & vbCrLf
  128. Response.Write "}" & vbCrLf
  129. Response.Write "</SCRIPT>" & vbCrLf
  130. End Sub
  131. Sub ShowContentManagePath(RootName)
  132. Response.Write "您现在的位置:&nbsp;" & ChannelName & "管理&nbsp;&gt;&gt;&nbsp;<a href='" & FileName & "'>" & RootName & "</a>&nbsp;&gt;&gt;&nbsp;"
  133. If ClassID > 0 Then
  134. If ParentID > 0 Then
  135. Dim sqlPath, rsPath
  136. sqlPath = "select ClassID,ClassName from Class where ClassID in (" & ParentPath & ") order by Depth"
  137. Set rsPath = Conn.Execute(sqlPath)
  138. Do While Not rsPath.EOF
  139. Response.Write "<a href='" & FileName & "&ClassID=" & rsPath(0) & "'>" & rsPath(1) & "</a>&nbsp;&gt;&gt;&nbsp;"
  140. rsPath.MoveNext
  141. Loop
  142. rsPath.Close
  143. Set rsPath = Nothing
  144. End If
  145. Response.Write "<a href='" & FileName & "&ClassID=" & ClassID & "'>" & ClassName & "</a>&nbsp;&gt;&gt;&nbsp;"
  146. End If
  147. If ManageType = "My" Then
  148. Response.Write "<font color=red>" & AdminName & "</font> 添加的" & ChannelShortName & ""
  149. Else
  150. If Keyword = "" Then
  151. Select Case Status
  152. Case -2
  153. Response.Write "退稿"
  154. Case -1
  155. Response.Write "草稿"
  156. Case 0
  157. Response.Write "待审核的" & ChannelShortName & "!"
  158. Case 1
  159. Response.Write "已审核的" & ChannelShortName & "!"
  160. Case Else
  161. Response.Write "所有" & ChannelShortName & "!"
  162. End Select
  163. Else
  164. Select Case strField
  165. Case "Title"
  166. Response.Write "标题中含有 <font color=red>" & Keyword & "</font> "
  167. Case "Content"
  168. Response.Write "内容中含有 <font color=red>" & Keyword & "</font> "
  169. Case "Author"
  170. Response.Write "作者姓名中含有 <font color=red>" & Keyword & "</font> "
  171. Case "Inputer"
  172. Response.Write "<font color=red>" & Keyword & "</font> 添加"
  173. Case "Editor"
  174. Response.Write "<font color=red>" & Keyword & "</font> 审核"
  175. Case "Keyword"
  176. Response.Write "关键字为 <font color=red>" & Keyword & "</font> "
  177. Case "UpdateTime"
  178. Response.Write "更新时间为 <font color=red>" & Keyword & "</font> "
  179. Case "SoftName", "PhotoName"
  180. Response.Write "名称中含有 <font color=red>" & Keyword & "</font> "
  181. Case "SoftIntro", "PhotoIntro"
  182. Response.Write "内容中含有 <font color=red>" & Keyword & "</font> "
  183. Case Else
  184. Response.Write "名称中含有 <font color=red>" & Keyword & "</font> "
  185. End Select
  186. Select Case Status
  187. Case -2
  188. Response.Write "的退稿"
  189. Case -1
  190. Response.Write "的草稿"
  191. Case 0
  192. Response.Write "并且未审核的" & ChannelShortName & "!"
  193. Case 1
  194. Response.Write "并且已审核的" & ChannelShortName & "!"
  195. Case Else
  196. Response.Write "的" & ChannelShortName & "!"
  197. End Select
  198. End If
  199. End If
  200. End Sub
  201. '**************************************************
  202. '函数名:ShowPage
  203. '作 用:显示“上一页 下一页”等信息
  204. '参 数:sFileName ----链接地址
  205. ' TotalNumber ----总数量
  206. ' MaxPerPage ----每页数量
  207. ' CurrentPage ----当前页
  208. ' ShowTotal ----是否显示总数量
  209. ' ShowAllPages ---是否用下拉列表显示所有页面以供跳转。
  210. ' strUnit ----计数单位
  211. ' ShowMaxPerPage ----是否显示每页信息量选项框
  212. '返回值:“上一页 下一页”等信息的HTML代码
  213. '**************************************************
  214. Function ShowPage(sfilename, totalnumber, MaxPerPage, CurrentPage, ShowTotal, ShowAllPages, strUnit, ShowMaxPerPage)
  215. Dim TotalPage, strTemp, strUrl, i
  216. If totalnumber = 0 Or MaxPerPage = 0 Or IsNull(MaxPerPage) Then
  217. ShowPage = ""
  218. Exit Function
  219. End If
  220. If totalnumber Mod MaxPerPage = 0 Then
  221. TotalPage = totalnumber \ MaxPerPage
  222. Else
  223. TotalPage = totalnumber \ MaxPerPage + 1
  224. End If
  225. If CurrentPage > TotalPage Then CurrentPage = TotalPage
  226. strTemp = "<div class=""show_page"">"
  227. If ShowTotal = True Then
  228. strTemp = strTemp & "共 <b>" & totalnumber & "</b> " & strUnit & "&nbsp;&nbsp;"
  229. End If
  230. If ShowMaxPerPage = True Then
  231. strUrl = JoinChar(sfilename) & "MaxPerPage=" & MaxPerPage & "&"
  232. Else
  233. strUrl = JoinChar(sfilename)
  234. End If
  235. If CurrentPage = 1 Then
  236. strTemp = strTemp & "首页 上一页&nbsp;"
  237. Else
  238. strTemp = strTemp & "<a href='" & strUrl & "page=1'>首页</a>&nbsp;"
  239. strTemp = strTemp & "<a href='" & strUrl & "page=" & (CurrentPage - 1) & "'>上一页</a>&nbsp;"
  240. End If
  241. If CurrentPage >= TotalPage Then
  242. strTemp = strTemp & "下一页 尾页"
  243. Else
  244. strTemp = strTemp & "<a href='" & strUrl & "page=" & (CurrentPage + 1) & "'>下一页</a>&nbsp;"
  245. strTemp = strTemp & "<a href='" & strUrl & "page=" & TotalPage & "'>尾页</a>"
  246. End If
  247. strTemp = strTemp & "&nbsp;页次:<strong><font color=red>" & CurrentPage & "</font>/" & TotalPage & "</strong>页 "
  248. If ShowMaxPerPage = True Then
  249. strTemp = strTemp & "&nbsp;<Input type='text' name='MaxPerPage' size='3' maxlength='4' value='" & MaxPerPage & "' onKeyPress=""if (event.keyCode==13) window.location='" & JoinChar(sfilename) & "page=" & CurrentPage & "&MaxPerPage=" & "'+this.value;"">" & strUnit & "/页"
  250. Else
  251. strTemp = strTemp & "&nbsp;<b>" & MaxPerPage & "</b>" & strUnit & "/页"
  252. End If
  253. If ShowAllPages = True Then
  254. If TotalPage > 20 Then
  255. strTemp = strTemp & "&nbsp;&nbsp;转到第<Input type='text' name='page' size='3' maxlength='5' value='" & CurrentPage & "' onKeyPress=""if (event.keyCode==13) window.location='" & strUrl & "page=" & "'+this.value;"">页"
  256. Else
  257. strTemp = strTemp & "&nbsp;转到:<select name='page' size='1' onchange=""javascript:window.location='" & strUrl & "page=" & "'+this.options[this.selectedIndex].value;"">"
  258. For i = 1 To TotalPage
  259. strTemp = strTemp & "<option value='" & i & "'"
  260. If CLng(CurrentPage) = CLng(i) Then strTemp = strTemp & " selected "
  261. strTemp = strTemp & ">第" & i & "页</option>"
  262. Next
  263. strTemp = strTemp & "</select>"
  264. End If
  265. End If
  266. strTemp = strTemp & "</div>"
  267. ShowPage = strTemp
  268. End Function
  269. Function JoinChar(ByVal strUrl)
  270. If strUrl = "" Then
  271. JoinChar = ""
  272. Exit Function
  273. End If
  274. If InStr(strUrl, "?") < Len(strUrl) Then
  275. If InStr(strUrl, "?") > 1 Then
  276. If InStr(strUrl, "&") < Len(strUrl) Then
  277. JoinChar = strUrl & "&"
  278. Else
  279. JoinChar = strUrl
  280. End If
  281. Else
  282. JoinChar = strUrl & "?"
  283. End If
  284. Else
  285. JoinChar = strUrl
  286. End If
  287. End Function
  288. Function FilterArrNull(ByVal ArrString, ByVal CompartString)
  289. Dim arrContent, arrTemp, i
  290. If CompartString = "" Or ArrString = "" Then
  291. FilterArrNull = ArrString
  292. Exit Function
  293. End If
  294. If InStr(ArrString, CompartString) = 0 Then
  295. FilterArrNull = ArrString
  296. Exit Function
  297. Else
  298. arrContent = Split(ArrString, CompartString)
  299. For i = 0 To UBound(arrContent)
  300. If Trim(arrContent(i)) <> "" Then
  301. If arrTemp = "" Then
  302. arrTemp = Trim(arrContent(i))
  303. Else
  304. arrTemp = arrTemp & CompartString & Trim(arrContent(i))
  305. End If
  306. End If
  307. Next
  308. End If
  309. FilterArrNull = arrTemp
  310. End Function
  311. Sub ShowForm_MoveToClass()
  312. Dim tChannelID, BatchInfoID
  313. tChannelID = Trim(Request("tChannelID"))
  314. If tChannelID = "" Then
  315. tChannelID = ChannelID
  316. Else
  317. tChannelID = CLng(tChannelID)
  318. End If
  319. BatchInfoID = ReplaceBadChar(Request("Batch" & ModuleName & "ID"))
  320. If BatchInfoID = "" Then
  321. BatchInfoID = ReplaceBadChar(Request(ModuleName & "ID"))
  322. End If
  323. Response.Write "<form method='POST' name='myform' action='Admin_" & ModuleName & ".asp' target='_self'>"
  324. Response.Write " <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>"
  325. Response.Write " <tr class='title'>"
  326. Response.Write " <td height='22' colspan='4' align='center'><b>批量移动" & ChannelShortName & "</td>"
  327. Response.Write " </tr>"
  328. Response.Write " <tr align='left' class='tdbg'>"
  329. Response.Write " <td valign='top' width='300'>"
  330. Response.Write " <input type='radio' name='" & ModuleName & "Type' value='1' checked>指定" & ChannelShortName & "ID:<input type='text' name='Batch" & ModuleName & "ID' value='" & BatchInfoID & "' size='30'><br>"
  331. Response.Write " <input type='radio' name='" & ModuleName & "Type' value='2'>指定区域的" & ChannelShortName & ":<br><select name='BatchClassID' size='2' multiple style='height:360px;width:300px;'>" & GetClass_Option(channelid, 0) & "</select><br>"
  332. Response.Write " <input type='button' name='Submit' value=' 选定所有区域 ' onclick='SelectAll()'>"
  333. Response.Write " <input type='button' name='Submit' value='取消选定所有区域' onclick='UnSelectAll()'>"
  334. Response.Write " </td>"
  335. Response.Write " <td align='center' >移动到&gt;&gt;</td>"
  336. Response.Write " <td valign='top'>"
  337. Response.Write " 目标频道:<select name='tChannelID' onChange='document.myform.submit();'>" & GetChannel_Option(ModuleType, tChannelID) & "</select><br>"
  338. Response.Write " 目标区域:<font color=red>(不能指定为外部区域)</font><br><select name='tClassID' size='2' style='height:360px;width:300px;'>" & GetClass_Channel(tChannelID) & "</select>"
  339. Response.Write " </td>"
  340. Response.Write " </tr>"
  341. Response.Write " </table>"
  342. Response.Write " <p align='center'>"
  343. Response.Write " <input name='ChannelID' type='hidden' id='ChannelID' value='" & ChannelID & "'>"
  344. Response.Write " <input name='Action' type='hidden' id='Action' value='MoveToClass'>"
  345. Response.Write " <input name='add' type='submit' id='Add' value=' 执行批处理 ' style='cursor:hand;' onClick=""document.myform.Action.value='DoMoveToClass';"">&nbsp; "
  346. Response.Write " <input name='Cancel' type='button' id='Cancel' value=' 取 消 ' onClick=""window.location.href='Admin_" & ModuleName & ".asp?ChannelID=" & ChannelID & "&Action=Manage';"" style='cursor:hand;'>"
  347. Response.Write " </p>"
  348. Response.Write "</form>"
  349. Response.Write "<script language='javascript'>" & vbCrLf
  350. Response.Write "function SelectAll(){" & vbCrLf
  351. Response.Write " for(var i=0;i<document.myform.BatchClassID.length;i++){" & vbCrLf
  352. Response.Write " document.myform.BatchClassID.options[i].selected=true;}" & vbCrLf
  353. Response.Write "}" & vbCrLf
  354. Response.Write "function UnSelectAll(){" & vbCrLf
  355. Response.Write " for(var i=0;i<document.myform.BatchClassID.length;i++){" & vbCrLf
  356. Response.Write " document.myform.BatchClassID.options[i].selected=false;}" & vbCrLf
  357. Response.Write "}" & vbCrLf
  358. Response.Write "</script>" & vbCrLf
  359. End Sub
  360. '**************************************************
  361. '函数名:GetClass_Channel
  362. '作 用:区域下拉菜单(不检查权限)
  363. '参 数:iChannelID ---- 频道ID
  364. '返回值:区域下拉菜单
  365. '**************************************************
  366. Function GetClass_Channel(iChannelID)
  367. Dim rsClass, sqlClass, strClass_Option, tmpDepth, i
  368. Dim arrShowLine(20)
  369. For i = 0 To UBound(arrShowLine)
  370. arrShowLine(i) = False
  371. Next
  372. sqlClass = "Select * from Class where ChannelID=" & iChannelID & " order by RootID,OrderID"
  373. Set rsClass = Conn.Execute(sqlClass)
  374. If rsClass.BOF And rsClass.EOF Then
  375. strClass_Option = strClass_Option & "<option value=''>请先添加区域</option>"
  376. Else
  377. Do While Not rsClass.EOF
  378. tmpDepth = rsClass("Depth")
  379. If rsClass("NextID") > 0 Then
  380. arrShowLine(tmpDepth) = True
  381. Else
  382. arrShowLine(tmpDepth) = False
  383. End If
  384. If rsClass("ClassType") = 2 Then
  385. strClass_Option = strClass_Option & "<option value=''"
  386. Else
  387. If rsClass("Child") > 0 And rsClass("EnableAdd") = False Then
  388. strClass_Option = strClass_Option & "<option value='0'"
  389. Else
  390. strClass_Option = strClass_Option & "<option value='" & rsClass("ClassID") & "'"
  391. End If
  392. End If
  393. strClass_Option = strClass_Option & ">"
  394. If tmpDepth > 0 Then
  395. For i = 1 To tmpDepth
  396. strClass_Option = strClass_Option & "&nbsp;&nbsp;"
  397. If i = tmpDepth Then
  398. If rsClass("NextID") > 0 Then
  399. strClass_Option = strClass_Option & "├&nbsp;"
  400. Else
  401. strClass_Option = strClass_Option & "└&nbsp;"
  402. End If
  403. Else
  404. If arrShowLine(i) = True Then
  405. strClass_Option = strClass_Option & "│"
  406. Else
  407. strClass_Option = strClass_Option & "&nbsp;"
  408. End If
  409. End If
  410. Next
  411. End If
  412. strClass_Option = strClass_Option & rsClass("ClassName")
  413. If rsClass("ClassType") = 2 Then
  414. strClass_Option = strClass_Option & "(外)"
  415. End If
  416. strClass_Option = strClass_Option & "</option>"
  417. rsClass.MoveNext
  418. Loop
  419. End If
  420. rsClass.Close
  421. Set rsClass = Nothing
  422. strClass_Option = strClass_Option & "<option value='-1'>未指定任何区域</option>"
  423. GetClass_Channel = strClass_Option
  424. End Function
  425. '**************************************************
  426. '函数名:GetChannel_Option
  427. '作 用:频道下拉菜单
  428. '参 数:iModuleType ---- 频道类型
  429. ' iChannelID ---- 频道ID
  430. '返回值:频道下拉菜单目
  431. '**************************************************
  432. Function GetChannel_Option(iModuleType, iChannelID)
  433. Dim rsGetAdmin, rsChannel
  434. Dim strChannel
  435. Set rsChannel = Conn.Execute("select * from Channel where ChannelID=" & iChannelID & " order by OrderID")
  436. Do While Not rsChannel.EOF
  437. If rsChannel(0) = iChannelID Then
  438. strChannel = strChannel & "<option value='" & rsChannel(0) & "' selected>" & rsChannel(1) & "</option>"
  439. Else
  440. strChannel = strChannel & "<option value='" & rsChannel(0) & "'>" & rsChannel(1) & "</option>"
  441. End If
  442. rsChannel.MoveNext
  443. Loop
  444. rsChannel.Close
  445. Set rsChannel = Nothing
  446. GetChannel_Option = strChannel
  447. End Function
  448. '**************************************************
  449. '函数名:ShowJS_Main
  450. '作 用:页面管理js(多项诓全选,删除提示)
  451. '参 数:ItemName ---- 项目名称
  452. '返回值:javascript 验证
  453. '**************************************************
  454. Public Sub ShowJS_Main(ItemName)
  455. Response.Write "<SCRIPT language=javascript>" & vbCrLf
  456. Response.Write "function unselectall(){" & vbCrLf
  457. Response.Write " if(document.myform.chkAll.checked){" & vbCrLf
  458. Response.Write " document.myform.chkAll.checked = document.myform.chkAll.checked&0;" & vbCrLf
  459. Response.Write " }" & vbCrLf
  460. Response.Write "}" & vbCrLf
  461. Response.Write "function CheckAll(form){" & vbCrLf
  462. Response.Write " for (var i=0;i<form.elements.length;i++){" & vbCrLf
  463. Response.Write " var e = form.elements[i];" & vbCrLf
  464. Response.Write " if (e.Name != 'chkAll'&&e.disabled==false)" & vbCrLf
  465. Response.Write " e.checked = form.chkAll.checked;" & vbCrLf
  466. Response.Write " }" & vbCrLf
  467. Response.Write " }" & vbCrLf
  468. Response.Write "function ConfirmDel(){" & vbCrLf
  469. Response.Write " if(document.myform.Action.value=='Del'){" & vbCrLf
  470. Response.Write " if(confirm('确定要删除选中的" & ItemName & "吗?'))" & vbCrLf
  471. Response.Write " return true;" & vbCrLf
  472. Response.Write " else" & vbCrLf
  473. Response.Write " return false;" & vbCrLf
  474. Response.Write " }" & vbCrLf
  475. Response.Write "}" & vbCrLf
  476. Response.Write "</SCRIPT>" & vbCrLf
  477. End Sub
  478. '**************************************************
  479. '函数名:FoundInArr
  480. '作 用:检测数组中是否有指定的数值
  481. '参 数:strArr ----- 调入的数组
  482. ' strItem ----- 检测的字符
  483. ' strSplit ----- 分割字符
  484. '返回值:True ----有
  485. ' False ----没有
  486. '**************************************************
  487. Function FoundInArr(strArr, strItem, strSplit)
  488. Dim arrTemp, arrTemp2, i, j
  489. FoundInArr = False
  490. If IsNull(strArr) Or IsNull(strItem) Or Trim(strArr) = "" Or Trim(strItem) = "" Then
  491. Exit Function
  492. End If
  493. If IsNull(strSplit) Or strSplit = "" Then
  494. strSplit = ","
  495. End If
  496. If InStr(Trim(strArr), strSplit) > 0 Then
  497. If InStr(Trim(strItem), strSplit) > 0 Then
  498. arrTemp = Split(strArr, strSplit)
  499. arrTemp2 = Split(strItem, strSplit)
  500. For i = 0 To UBound(arrTemp)
  501. For j = 0 To UBound(arrTemp2)
  502. If LCase(Trim(arrTemp2(j))) <> "" And LCase(Trim(arrTemp(i))) <> "" And LCase(Trim(arrTemp2(j))) = LCase(Trim(arrTemp(i))) Then
  503. FoundInArr = True
  504. Exit Function
  505. End If
  506. Next
  507. Next
  508. Else
  509. arrTemp = Split(strArr, strSplit)
  510. For i = 0 To UBound(arrTemp)
  511. If LCase(Trim(arrTemp(i))) = LCase(Trim(strItem)) Then
  512. FoundInArr = True
  513. Exit Function
  514. End If
  515. Next
  516. End If
  517. Else
  518. If LCase(Trim(strArr)) = LCase(Trim(strItem)) Then
  519. FoundInArr = True
  520. End If
  521. End If
  522. End Function
  523. %>