📄 classxuanketime.asp
字号:
<!--#include file="connectionstring.asp"-->
<%
IdClass=request.cookies("IdClass")
if IdClass="" then
response.write "非法操作!"
response.end
end if
response.cookies("IdClass")=IdClass
IdCourse=request("IdCourse")
response.cookies("IdCourse")=IdCourse
Group=request("Group")
tnum=request.cookies("tnumber")
timea=request.cookies("timea")
for ni=1 to Request.Form("hid").Count
if request("hid")(ni) = IdCourse then
SelectTime = request("SelectTime")(ni)
exit for
end if
next
response.cookies("SelectTime")=SelectTime
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open strConn
sql="select * from classid where id='"&IdClass&"'"
rs=conn.execute(sql)
ClassName=rs("name")
conn.close
ClassGroupName=left(ClassName,6)&Group
response.cookies("ClassGroupName")=ClassGroupName
all=0
all1=0
for i=left(timea,2) to right(timea,2)
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open strConn
if i<10 then
ib="0"&i
else
ib=i
end if
if IdCourse=33 or IdCourse=20 or IdCourse=27 then
classgroupName1=left(ClassGroupName,6)&"A"
classgroupName2=left(ClassGroupName,6)&"B"
Group1="A"
Group2="B"
sql = "select * from groupxuan where classgp='"&ClassGroupName2&"' and time like '"&ib&"%'"
set relist = conn.execute(sql)
while not relist.eof
all=all+1
relist.Movenext
wend
relist.close
sql = "select * from groupxuan where classgp='"&ClassGroupName1&"' and time like '"&ib&"%'"
set relist = conn.execute(sql)
while not relist.eof
all1=all1+1
relist.Movenext
wend
relist.close
else
sql = "select * from groupxuan where classgp='"&ClassGroupName&"' and time like '"&ib&"%'"
set relist = conn.execute(sql)
while not relist.eof
all=all+1
relist.Movenext
wend
relist.close
end if
next
if int(all)>=int(tnum) then
response.write "<html><body background=Back1.jpg>你已经达到本段时间内允许选的个数!</body></html>"
response.end
end if
if int(all1)>=int(tnum) then
response.write "<html><body background=Back1.jpg>你已经达到本段时间内允许选的个数!</body></html>"
response.end
end if
'ClassNumShould为该组允许(应该)做实验的全部个数。
sql="select * from classid where id='" &idClass& "'"
set rs=conn.execute(sql)
ClassNumShould=rs("num")
'ClassNum为该组已经预约的实验个数。
sql="select * from groupxuan where classgp='" &classgroupName& "'"
set rsNum=conn.execute(sql)
ClassNun=0
while not rsNum.eof
ClassNum=ClassNum+1
rsNum.movenext
wend
if ClassNum>=ClassNumShould then
response.write "该组已经预约" &ClassNum& "个实验,足够啦。"
response.end
end if
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open strConn
sql="select * from groupxuan where classgp='" &ClassGroupName& "' and kemu='" &IdCourse& "'"
set relist=conn.Execute(sql)
if not relist.eof then
response.write "<html><body background=Back1.jpg>你已经预约了这个实验,请重新预约 !</body></html>"
response.end
end if
sql="select * from groupxuan where time='" &SelectTime& "' and kemu='" &IdCourse& "'"
set relist=conn.Execute(sql)
if not relist.eof then
response.write "<html><body background=Back1.jpg>已经有一个班在你之前预约了这个实验,你动作太慢啦!哈哈!</body></html>"
response.end
end if
relist.close
set relist = nothing
Response.Redirect "ClassXuankeTimeOk.asp"
'传入下一页的内容有:实验号IdCourse、班级号ClassId、班组名ClassGroupName、选择时间SelectTime
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -