?? 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 + -