28,391
社区成员
发帖
与我相关
我的任务
分享
dim i,j,sr1,aq1
i = 1
j = 1
sr1 = "select * from seats"
set aq1 = conn.execute(sr1)
response.write "<table width=99px height=99px align=center >"
if not (aq1.bof and aq1.eof) then
for i = 1 to 3
response.write "<tr>"
for j = 1 to 3
if aq1("seatstate") = 0 then
imageurl = "images/1.gif"
altmess = "未被预订!"
else
imageurl = "images/2.jpg"
altmess = "已被预订!"
end if
response.write "<td width=33px height=33px align=center><form name=form1 method=post action=display.asp><input src=" & imageurl & " type=image name=input1 value=" & aq1("seatno") & " alt=" & altmess & "/></form>座位</td><td width=33px align=center></td><td width=33px align=center></td>"
aq1.movenext
next
response.write "</tr>"
next
response.write "</table>"
end if
conn.close
set aq1 = nothing
<%
dim i,j,sr1,aq1
i = 1
j = 1
sr1 = "select * from seats"
set aq1 = conn.execute(sr1)
response.write "<table width=99px height=99px align=center >"
if not (aq1.bof and aq1.eof) then
for i = 1 to 3
response.write "<tr>"
for j = 1 to 3
if aq1("seatstate") = 0 then
imageurl = "images/1.gif"
altmess = "未被预订!"
codes="input type=image"'如果未被预订则以表单标签形式输出,能提交表单
else
imageurl = "images/2.jpg"
altmess = "已被预订!"
codes="img"'如果已被预订则以图片形式直接输出,不能提交表单
end if
response.write "<td width=33px height=33px align=center><form name=form1 method=post action=display.asp>"
Response.Write"<"&codes&" src=" & imageurl & " alt=" & altmess & "/>"'调用上面的判断,看起是否被预订
Response.Write"<input name=""seatno"" type=""hidden"" value="""&aq1("seatno")&""" />"'隐藏课桌编号值。
Response.Write"</form></td><td width=33px align=center></td><td width=33px align=center></td>"
aq1.movenext
next
response.write "</tr>"
next
response.write "</table>"
end if
conn.close
set aq1 = nothing
%>
<script language="JavaScript">
function submitform(v)
{
alert("占了"+v+"座位")
document.classroom.action="提交的页面"+"?classroom=4&desk="+v;//这里是提交的教室与所站座位
document.classroom.submit();
}
</script>
<form method=post name="classroom" action="">
<input type="button" value="1#" onclick="submitform(this.value)">
<input type="button" value="2#" onclick="submitform(this.value)">
<input type="button" value="3#" onclick="submitform(this.value)">
<input type="button" value="4#" onclick="submitform(this.value)">
<input type="button" value="5#" onclick="submitform(this.value)">
</form>