📄 index.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="xuanke.asp" -->
<html>
<head>
<style>
.time { font-size: 12pt; line-height: 14pt; color:red;}
</style>
<SCRIPT language=JavaScript>
<!-- Hiding
var ctimer;
function init(){
if (document.all){
tim2.style.left=tim1.style.posLeft;
tim2.style.top=tim1.style.posTop+tim1.offsetHeight-6;
settimes();
}
}
function settimes(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
if (hours<10)
hours="0"+hours;
if(mins<10)
mins="0"+mins;
if (secs<10)
secs="0"+secs;
tim1.innerHTML=hours+":"+mins+":"+secs
tim2.innerHTML=hours+":"+mins+":"+secs
ctimer=setTimeout('settimes()',960);
}
// Done hiding -->
</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网上选课系统</title>
<style type="text/css">
<!--
@import url("style.css");
body {
background-image: url(image/back.jpg);
}
.STYLE1 {color: #FF0000}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
</head>
<%
dim rs_user,course
dim rs_user_total,course_total
'打开用户资料数据库---------------
Set rs_user = Server.CreateObject("ADODB.Recordset")
sql = "SELECT name FROM student"
rs_user.Open sql,xuanke_conn,3,2
'打开课程资料数据库---------------
Set course = Server.CreateObject("ADODB.Recordset")
sql = "SELECT cno FROM course"
course.Open sql,xuanke_conn,3,2
'生成注册用户总数和课程记录总数------------------
If (rs_user.RecordCount = -1) Then
rs_user_total=0
rs_user.movefirst
While (Not rs_user.EOF)
rs_user_total = rs_user_total + 1
rs_user.MoveNext
Wend
else
rs_user_total = rs_user.RecordCount
End If
If (course.RecordCount = -1) Then
course_total=0
course.movefirst
While (Not course.EOF)
course_total = course_total + 1
course.MoveNext
Wend
else
course_total = course.RecordCount
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (course_total = -1) Then
' count the total records by iterating through the recordset
course_total=0
While (Not course.EOF)
course_total = course_total + 1
course.MoveNext
Wend
' reset the cursor to the beginning
If (course.CursorType > 0) Then
course.MoveFirst
Else
course.Requery
End If
' set the number of rows displayed on this page
If (course_numRows < 0 Or course_numRows > course_total) Then
course_numRows = course_total
End If
' set the first and last displayed record
course_first = 1
course_last = course_first + course_numRows - 1
If (course_first > course_total) Then
course_first = course_total
End If
If (course_last > course_total) Then
course_last = course_total
End If
End If
%>
<body bgcolor="#FFFFCC" onLoad="init()">
<DIV class=time id=tim1
style="HEIGHT: 20px; LEFT: 50px; POSITION: absolute; TOP: 10px; WIDTH: 10px"></DIV>
<DIV class=time id=tim2
style="FILTER: flipv() alpha(opacity=20); FONT-STYLE: italic; POSITION: absolute"></DIV>
<div align="center">
<table width="760" border="0" class="table_big">
<tr>
<td height="345" valign="top"><div align="center">
<!--#include file="include/head.asp" -->
<br>
<table width="703" border="0" cellspacing="0">
<tr>
<td height="19">
<marquee direction="left" loop="5" behavior="scroll" ><table width="559" border="0">
<tr>
<td width="509"><span class="STYLE1">注意:本系统的默认密码是123456,进入系统后,请马上更改密码!</span></td>
</tr>
</table></marquee></td>
</tr>
<tr>
<td height="23" class="text"><table width="703" border="0" cellpadding="1" cellspacing="1" bgcolor="#0000FF" class="text_blue">
<tr>
<td height="36" bgcolor="#87CEFA" class="text"><div align="left">
<table width="161" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="151" class="text_blue"><%
'用户登陆后显示欢迎用户--------------------------
if not isempty(session("id_no")) then
set rs_user_name=server.CreateObject("adodb.recordset")
sql="select * from student where id_no ='"&session("id_no") &"'"
rs_user_name.open sql,xuanke_conn,3,2
'下面的response.Write中可以输出Html代码-------------
response.Write("欢迎您," & rs_user_name("name") & " !<br><br>")
end if
%></td>
</tr>
</table>
</div>
<div align="justify">本系统共有课程<a href="course.asp"><%=(course_total)%></a> 个当前有<%=(rs_user_total)%>位注册用户 </div></td>
</tr>
</table></td>
</tr>
<tr>
<td><form name="form1" method="post" action="login.asp">
<br>
<br>
<br>
<table width="261" height="67" border="0" align="center" cellspacing="1" bgcolor="#000000">
<tr>
<td colspan="2" background="image/type_bg.gif"> </td>
</tr>
<tr>
<td width="64" height="24" align="right" bgcolor="#87CEFA" class="text">身份证:</td>
<td align="left" bgcolor="#87CEFA"><input name="id_no" type="text" class="textfield" id="id_no" size="20"></td>
</tr>
<tr>
<td align="right" bgcolor="#87CEFA" class="text">密 码:</td>
<td align="left" bgcolor="#87CEFA"><input name="s_pw" type="password" class="textfield" id="s_pw" size="20"> <span class="text_blue">
<label></label><label></label>
</span><span class="text_blue">
<label></label>
</span></td>
</tr>
<tr>
<td rowspan="2" bgcolor="#87CEFA" class="text"><div align="right">你的年级:</div></td>
<td bgcolor="#87CEFA" class="text"><span class="text_blue">
<label>
<input type="radio" name="studentgrade" value="1">
</label>
大一
<label>
<input type="radio" name="studentgrade" value="2">
大二</label>
</span></td>
</tr>
<tr>
<td bgcolor="#87CEFA" class="text"><span class="text_blue">
<label>
<input type="radio" name="studentgrade" value="3">
大三
<input type="radio" name="studentgrade" value="4">
大四 </label>
</span></td>
</tr>
<tr>
<td colspan="2" bgcolor="#87CEFA">
<div align="center">
<%if isempty(session("id_no")) then login="登录" else login="重新登录" end if %>
<input name="login" type="submit" class="button" id="login" value="<%=login %>">
</div></td>
</tr>
</table>
</form>
<p align="center"><br>
</p></td>
</tr>
</table>
<br>
<!--#include file="include/foot.asp" -->
<br>
</div></td>
</tr>
</table>
</div>
</body>
</html>
<%
set rs_user_name = Nothing
rs_user.Close()
Set rs_user = Nothing
course.Close()
Set course = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -