⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setclass.asp

📁 程序介绍: 1、内嵌式投票系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
end if
End Sub

Sub saveadds
if request("stype")="" then
OutMsg=OutMsg+"<br>"+"<li>请输入子栏目名称。"
founderr=true
end if
if founderr=true then Call PrintMsg(OutMsg)
rSub.open "select * from type where m="&request("m")&" and stype like '"&request("stype")&"'",conn,1,3
if rSub.bof and rSub.eof then
  rsclass.open "select * from type where m="&request("m"),conn,1,1
  rSub.close
  rSub.open "select s from type order by s desc",conn,1,1
  rSub.movefirst
  dim temps
  temps=rSub("s")
  rSub.close
  rSub.open "select * from type where id is null",conn,1,3
  rSub.addnew
  rSub("r")=rsclass("r")
  rSub("rtype")=rsclass("rtype")
  rSub("m")=rsclass("m")
  rSub("mtype")=rsclass("mtype")
  rSub("stype")=request("stype")
  rSub("s")=temps+1
  rSub.update
  rSub.close
  rsclass.close
Call updatemenu
  Call PrintMsg("子栏目添加成功!")
else
  rSub.close
  Call PrintMsg("一个主栏目中不能有两个相同的子栏目,请输入其他子栏目!")
end if
End Sub

Sub savemodr
if request("rtype")="" then
OutMsg=OutMsg+"<br>"+"<li>请输入新的根栏目名称。"
founderr=true
end if
if founderr=true then Call PrintMsg(OutMsg)
rSub.open "select rtype from type where rtype like '"&request("rtype")&"'",conn,1,1
if rSub.bof and rSub.eof then
  rSub.close
  rSub.open "select rtype from type where r="&request("r"),conn,1,3
  do while not rSub.eof
    rSub("rtype")=request("rtype")
    rSub.update
    rSub.movenext
  loop
  rSub.close
Call updatemenu
  Call PrintMsg("根栏目修改成功!")
else
  rSub.close
  Call PrintMsg("不能有两个相同的根栏目,请输入其他根栏目!")
end if
End Sub

Sub savemodm
if request("mtype")="" then
OutMsg=OutMsg+"<br>"+"<li>请输入新的主栏目名称。"
founderr=true
end if
if founderr=true then Call PrintMsg(OutMsg)
dim tempr
rSub.open "select r from type where m="&request("m"),conn,1,1
rSub.movefirst
tempr=rSub("r")
rSub.close
rSub.open "select * from type where r="&tempr&" and mtype like '"&request("mtype")&"'",conn,1,1
if rSub.bof and rSub.eof then
  rSub.close
  rSub.open "select mtype from type where m="&request("m"),conn,1,3
  do while not rSub.eof
    rSub("mtype")=request("mtype")
    rSub.update
    rSub.movenext
  loop
  rSub.close
Call updatemenu
  Call PrintMsg("主栏目修改成功!")
else
  rSub.close
  Call PrintMsg("一个根栏目中不能有两个相同的主栏目,请输入其他主栏目!")
end if
End Sub

Sub savemods
if request("stype")="" then
OutMsg=OutMsg+"<br>"+"<li>请输入新的子栏目名称。"
founderr=true
end if
if founderr=true then Call PrintMsg(OutMsg)
dim tempm
rSub.open "select m from type where s="&request("s"),conn,1,1
tempm=rSub("m")
rSub.close
rSub.open "select * from type where m="&tempm&" and stype like '"&request("stype")&"'",conn,1,1
if rSub.bof and rSub.eof then
  rSub.close
  rSub.open "select stype from type where s="&request("s"),conn,1,3
  rSub("stype")=request("stype")
  rSub.update
  rSub.close
Call updatemenu
  Call PrintMsg("子栏目修改成功!")
else
  rSub.close
  Call PrintMsg("一个主栏目中不能有两个相同的子栏目,请输入其他子栏目!")
end if
End Sub

Sub deleter()
if request("r")="" then
OutMsg=OutMsg+"<br>"+"<li>没有栏目,不能删除。"
founderr=true
end if
if founderr=true then Call PrintMsg(OutMsg)
conn.execute "delete from type where r="&request("r")
conn.execute "delete from main where r="&request("r")
Call updatemenu
response.redirect ""&thisprog&""
End sub

Sub deletem()
if request("m")="" then
OutMsg=OutMsg+"<br>"+"<li>没有栏目,不能删除。"
founderr=true
end if
if founderr=true then Call PrintMsg(OutMsg)
conn.execute "delete from type where m="&request("m")
conn.execute "delete from main where m="&request("m")
Call updatemenu
response.redirect ""&thisprog&""
End sub

Sub deletes()
if request("s")="" then
OutMsg=OutMsg+"<br>"+"<li>没有栏目,不能删除。"
founderr=true
end if
if founderr=true then Call PrintMsg(OutMsg)
conn.execute "delete from type where s="&request("s")
conn.execute "delete from main where s="&request("s")
Call updatemenu
response.redirect ""&thisprog&""
End sub

Sub menuwelcome%>
<table width="100%" border="0" cellspacing="3" cellpadding="0">
  <tr> 
    <td bgcolor=#EEEEEE> 
      <p><b>更新所有菜单</b>:<br>
        注意:这里将更新所有的导航菜单,包括首页的主菜单,首页的栏目导航,各根栏目下拉菜单,如果你手动改过数据库中的栏目信息,你需要在此更新一次。在你每次增加,修改,删除栏目时程序会自动更新
        (这样可以加快页面的显示速度。)</p>
    </td>
  </tr>
  <tr> 
    <td> 
<form action="<%=thisprog%>?action=updatemenu" method=post>
<input type="submit" name="Submit" value="更新">
</form>
    </td>
  </tr>
</table>
<%End Sub

Sub updatemenu()
dim rsmenu,mmenu,rsmmenu,smenu,tempmmenu,startwidth,addwidth,i,x,y
set rsmenu=server.createobject("adodb.recordset")
set rsmmenu=server.createobject("adodb.recordset")
rSub.open "select distinct r from type order by r asc",conn,1,1
for y=1 to rSub.recordcount
startwidth=10
addwidth=75
smenu=""
mmenu="<table width=754 cellpadding=0 cellspacing=0 border=0 bgcolor=#3584D5><tr height=26 align=left>"
rsmmenu.open "select distinct m,mtype from type where r="&rSub("r")&" order by m asc",conn,1,1
x=1
do while not rsmmenu.eof
'菜单
tempmmenu=""
for i=1 to rsmmenu.recordcount
 if i=x then
  tempmmenu=tempmmenu&"'Layer"&i&"','','show',"
 else
  tempmmenu=tempmmenu&"'Layer"&i&"','','hide',"
 end if
next
tempmmenu=tempmmenu&")"
tempmmenu=replace(tempmmenu,",)",")")
mmenu=mmenu&"<td width=76 align=center><a class=pf href=m.asp?o="&rsmmenu("m")+100&" onmouseover=""MM_showHideLayers("&tempmmenu&""">"&rsmmenu("mtype")&"</a></td>"
'DIV
smenu=smenu&"<DIV id=Layer"&x&" style=""LEFT: "&startwidth&"px; POSITION: absolute; TOP: 148px; VISIBILITY: hidden; WIDTH: 70px; Z-INDEX: 12""><TABLE bgColor=#3584D5 border=0 cellPadding=1 cellSpacing=0 width=80><TBODY><TR><TD width=8></TD><TD width=74>"
rsmenu.open "select s,stype from type where m="&rsmmenu("m"),conn,1,1
do while not rsmenu.eof
smenu=smenu&"<A class=pf href=f.asp?o="&rsmenu("s")+1000&">"&rsmenu("stype")&">></a><BR>"
rsmenu.movenext
loop
rsmenu.close
smenu=smenu&"</TD></TR></TBODY></TABLE></DIV>"

startwidth=startwidth+addwidth
x=x+1
rsmmenu.movenext
loop
mmenu=mmenu&"<td width="&rsmmenu.recordcount*(-76)+760&"></td></tr></table>"+chr(10)
rsmmenu.close
rsmenu.open "select * from sitefiles where name='menu"&rSub("r")&"'",conn,1,3
if rsmenu.bof and rsmenu.eof then
rsmenu.close
rsmenu.open "select * from sitefiles",conn,1,3
rsmenu.addnew
rsmenu("name")="menu"&rSub("r")&""
else
rsmenu("content")=mmenu&smenu
end if
'response.write smenu
'response.write mmenu
rsmenu.update
rsmenu.close
rSub.movenext
next
rSub.close
set rsmenu=nothing
set rsmmenu=nothing
Call outmainmenu
Call menufiles
if action="updatemenu" then PrintMsg("所有菜单更新成功!")
End Sub

Sub outmainmenu
dim rsmainmenu,rsrmainmenu,outmainmenu,i,x,toutmainmenu
i=3
set rsmainmenu=server.createobject("adodb.recordset")
set rsrmainmenu=server.createobject("adodb.recordset")
rsrmainmenu.open "select distinct r from type order by r asc",conn,1,1
do while not rsrmainmenu.eof
rSub.open "select distinct m,mtype,rtype from type where r="&rsrmainmenu("r")&" order by m asc",conn,1,1
outmainmenu="<br><TABLE bgColor=#99ccff border=0 cellPadding=0 cellSpacing=0 width=""98%""><TBODY><TR vAlign=bottom><TD height=18 vAlign=top width=12><IMG height=7 width=7 src=images/jiao.gif></TD><TD>"&rSub("rtype")&"</TD></TR></TBODY></TABLE><TABLE bgColor=#99ccff border=0 cellPadding=1 cellSpacing=0 width=""98%""><TBODY><TR><TD><TABLE bgColor=#ffffff border=0 cellPadding=0 cellSpacing=0 width=""100%""><TBODY>"
do while not rSub.eof
rsmainmenu.open "select s,stype,m,mtype from type where m="&rSub("m"),conn,1,1
'if i mod 2=1 then outmainmenu=outmainmenu&"<TR><TD width=""2%""></TD>"
outmainmenu=outmainmenu&"<TR><TD width=""2%""></TD>"
outmainmenu=outmainmenu&"<TD valign=top width=""100%""><BR><B><a href=m.asp?o="&rsmainmenu("m")+100&">"&rsmainmenu("mtype")&"</a></B> - "
x=4
bbb=0
do while (not rsmainmenu.eof) and bbb<4
bbb=bbb+1
outmainmenu=outmainmenu&"<a href=f.asp?o="&rsmainmenu("s")+1000&">"&rsmainmenu("stype")&"</a>、"
'if x mod 3=0 then outmainmenu=outmainmenu&"<br>"
x=x+1
i=i+1
rsmainmenu.movenext
loop
outmainmenu=outmainmenu&")"
outmainmenu=replace(outmainmenu,"、)","")
if bbb>3 then outmainmenu=outmainmenu&" ..."
outmainmenu=outmainmenu&"</TD>"
outmainmenu=outmainmenu&"</TR>"
'if i mod 2=1 then outmainmenu=outmainmenu&"</TR>"
rsmainmenu.close
rSub.movenext
loop
rSub.close
toutmainmenu=toutmainmenu&outmainmenu&"</TBODY></TABLE></TD></TR></TBODY></TABLE>"
'response.write outmainmenu&"</TBODY></TABLE></TD></TR></TBODY></TABLE>"
rsrmainmenu.movenext
loop
rsrmainmenu.close

rSub.open "select * from sitefiles where name='mainmenu'",conn,1,3
if rSub.bof and rSub.eof then
rSub.close
rSub.open "select * from sitefiles",conn,1,3
rSub.addnew
rSub("name")="mainmenu"
end if
rSub("content")=toutmainmenu
rSub.update
rSub.close
End Sub

Sub updatemenu1
const menuwidth=80
dim rsr,rsm,rss,i,x,y,menus,menum,menuout,smwidth
smwidth=158
set rsr=server.createobject("adodb.recordset")
set rsm=server.createobject("adodb.recordset")
set rss=server.createobject("adodb.recordset")
rsr.open "select distinct r from type order by r asc",conn,1,1
for i=1 to rsr.recordcount
menum="arMenu"&i&" = new Array(120,"&smwidth&",133,""#000000"",""#FFFFFF"",""#EFF7FF"",""#003F5C"",""black"",""black"","
  rsm.open "select distinct m,mtype from type where r="&rsr("r")&" order by m asc",conn,1,1
  for x=1 to rsm.recordcount
  rss.open "select * from type where m="&rsm("m")&" order by s asc",conn,1,1
  menum=menum&""""&rsm("mtype")&""",""m.asp?o="&rsm("m")+100&""","&rss.recordcount&","
    menus="arMenu"&i&"_"&x&"  = new Array("
    for y=1 to rss.recordcount-1
      menus=menus& """"&rss("stype")&""",""f.asp?o="&rss("s")+1000&""",0,"
    rss.movenext
    next
    menus=menus& """"&rss("stype")&""",""f.asp?o="&rss("s")+1000&""",0)"+chr(10)
'    response.write menus
  menuout=menuout&menus
    menus=""
  rss.close
  rsm.movenext
  next
  rsm.close
menum=menum&")"
menum=replace(menum,",)",")")
menum=menum+chr(10)
'response.write menum
menuout=menuout&menum
menum=""
rsr.movenext
smwidth=smwidth+menuwidth
next
rsr.close
'response.write menuout
rSub.open "select content from sitefiles where id=1",conn,1,3
if rSub.bof and rSub.eof then
  rSub.close
  rSub.open "select * from sitefiles",conn,1,3
  rSub.addnew
end if
rSub("content")=menuout
rSub.update
rSub.close
set rsr=nothing
set rsm=nothing
set rss=nothing
if action="updatemenu" then PrintMsg("导航菜单更新成功!")
End Sub%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -