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

📄 bjadminvote.asp

📁 进入后台
💻 ASP
字号:
<!--#include file="config.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!--#include file="head.asp"-->
<%bid=clng(request("bid"))
if bid="" or bid<1 then ShowError("访问的班级不存在")
rs.open "select * from bj where id="&bid&"",conn,1,1
	If Rs.eof Then ShowError("访问的班级不存在")
	if rs("isopen")=1 and session("xyluserid")="" then ShowError("你访问的班级禁止游客访问")
	if rs("isopen")=2 then
	if session("xyluserid")="" then ShowError("你访问的班级禁止非班级成员访问")
	if obj.inbj(session("xyluserid"),bid,SiteDatabase)<>1 then ShowError("你访问的班级禁止非班级成员访问")
	end if
	if rs("adminid")=session("xyluserid") or rs("adminid2")=session("xyluserid") then
	else
	ShowError("你无权访问此页面")
	end if
	bjname=rs("bjname")
	rs.close%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=Sitename%>-<%=bjname%>-班级管理</title>
<LINK href="css.css" type=text/css rel=stylesheet>
</head>
<body>
<%call bjhead(bid,bjname)%>
<table width="760"  border="0" align="center" cellpadding="0" cellspacing="0" class="border">
        <tr>
          <td height="291" valign="top">
            <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0" class="border">
        <tr>
          <td height="25">  <img src="skins/1/xb3.gif">&nbsp;当前位置:<a href="bjindex.asp?bid=<%=bid%>">班级首页</a> &gt;&gt; <a href="bjadmin.asp?bid=<%=bid%>">班级管理</a> &gt;&gt; 班级投票</td>
          </tr>
      </table>
	      <%bjadmin(bid)
Select Case request("type2")
	Case "add":
		Call add
	Case "edit":
		Call edit
	Case "del":
		Call del
	Case Else:
		 call show
End Select
sub show%>
            <br><%rs.open "select * from [vote] where bjid="&bid&"",conn,1,1
	If not Rs.eof Then%>
<table width="95%" border="0" align="center" cellpadding="1" cellspacing="2" class="border">
<form name="form1" method="post" action="?type2=edit&bid=<%=bid%>">
								<tr>
                                  <td bgcolor="#FFCFCE">投票主题:</td>
                                  <td><input name="title" type="text" class="formtext2" id="title" value="<%=rs("title")%>"></td>
                                </tr>
								<%for i=1 to 6%>
								<tr>
                                  <td width="14%" bgcolor="#FFCFCE">选项<%=i%>:</td>
                                  <td width="86%"><input name="select<%=i%>" type="text" class="formtext2" value="<%=rs("select"&i)%>"></td>
                                </tr>
								<%next%>
	<tr>
<td width="20%" bgcolor="#FFCFCE"><div align="center"></div></td>
    <td width="80%" height="20"><input name="Submit" type="submit" class="bottom" value="提交"> 
      <a href="?type2=del&bid=<%=bid%>&id=<%=rs("id")%>">删除此投票</a></td>
</tr>  </form>
</table>
<%else%>
<table width="95%" border="0" align="center" cellpadding="1" cellspacing="2" class="border">
<form name="form1" method="post" action="?type2=add&bid=<%=bid%>">
								<tr>
                                  <td bgcolor="#FFCFCE">投票主题:</td>
                                  <td><input name="title" type="text" class="formtext2" id="title"></td>
                                </tr>
								<%for i=1 to 6%>
								<tr>
                                  <td width="14%" bgcolor="#FFCFCE">选项<%=i%>:</td>
                                  <td width="86%"><input name="select<%=i%>" type="text" class="formtext2"></td>
                                </tr>
								<%next%>
	<tr>
<td width="20%" bgcolor="#FFCFCE"><div align="center"></div></td>
    <td width="80%" height="20"><input name="Submit" type="submit" class="bottom" value="提交"></td>
</tr>  </form>
</table>
<%end if
rs.close
end sub
sub add
if request("title")="" then ShowError("标题不可以为空")
	rs.open "select * from vote where bjid="&bid&"",conn,1,3
	rs.addnew()
		rs("bjid")=bid
		rs("title")=obj.HtmlEncode(request("title"))
		for i=1 to 6
		rs("select"&i)=request("select"&i)
		next
		rs("date")=now()
	rs.update
	rs.close:set rs=nothing
	closeconn
	a=obj.gourl(" 页面三秒后将自动返回班级投票管理页,可以继续选择以下操作:<br><br> 返回<A href='bjindex.asp?bid="&bid&"'>[班级首页]</a><br><br> 到<A href='?bid="&bid&"'>[班级投票管理]</a>","?bid="&bid&"")
end sub
sub edit
if request("title")="" then ShowError("标题不可以为空")
	rs.open "select * from vote where bjid="&bid&"",conn,1,3
		rs("title")=obj.HtmlEncode(request("title"))
		for i=1 to 6
		rs("select"&i)=request("select"&i)
		next
	rs.update
	rs.close:set rs=nothing
	closeconn
	a=obj.gourl(" 页面三秒后将自动返回班级投票管理页,可以继续选择以下操作:<br><br> 返回<A href='bjindex.asp?bid="&bid&"'>[班级首页]</a><br><br> 到<A href='?bid="&bid&"'>[班级投票管理]</a>","?bid="&bid&"")
end sub
sub del
sql="delete from vote where id="&ad&" and bjid="&bid&""
rs.open sql,conn,1,3
a=obj.gourl(" 页面三秒后将自动返回班级投票管理页,可以继续选择以下操作:<br><br> 返回<A href='bjindex.asp?bid="&bid&"'>[班级首页]</a><br><br> 到<A href='?bid="&bid&"'>[班级投票管理]</a>","?bid="&bid&"")
end sub%>
<br>
</td></tr>
</table>
<%sitebottom%>
</body>
</html>

⌨️ 快捷键说明

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