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

📄

📁 我做的第一个学生管理系统
💻
字号:
<%
dim Pri
Pri=CheckUrl("毕业资料查询")
%>

<!--#include virtual="/school/public/CheckUrl.asp"-->
<%
vServer="http://" & Request.ServerVariables("Server_name")

%>
<%
CategoryID=Request("CategoryID")
%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>毕业生基本资料查询 by longzhiping</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">


<meta name="Microsoft Theme" content="sumipntg 011"><meta name="Microsoft Border" content="tlb, default"></head>

<body background="../../images/di2001.jpg"  topmargin="0">
<p><font color="#ff0000" size ="5"><strong>&nbsp;&nbsp;毕业学生基本资料查询</strong>
<OBJECT classid=clsid:BD96C556-65A3-11D0-983A-00C04FC29E33 height=1 id=RDS1 width=1>
	<PARAM NAME="ExecuteOptions" VALUE="2">
	<PARAM NAME="FetchOptions" VALUE="3">
	<PARAM NAME="SortDirection" VALUE="-1">
	<PARAM NAME="InternetTimeout" VALUE="300000"></OBJECT>
<OBJECT classid=clsid:BD96C556-65A3-11D0-983A-00C04FC29E33 height=1 id=RDS2 width=1>
	<PARAM NAME="ExecuteOptions" VALUE="2">
	<PARAM NAME="FetchOptions" VALUE="3">
	<PARAM NAME="SortDirection" VALUE="-1">
	<PARAM NAME="InternetTimeout" VALUE="300000"></OBJECT></font><br>
<div align="center"><center>
<table border="1" width="736" height="1" bordercolordark="#003366" bordercolorlight="#c0c0c0" id=TABLE1>
   <tr> 
    <td width="591" height="1" rowspan="2" valign="top">
                        <OBJECT classid="clsid:00028CD1-0000-0000-0000-000000000046" codeBase=http://xk_server/test/tdbg6.ocx 
	 CODEBASE="http://<%=Request.ServerVariables("SERVER_NAME")%>/school/public/tdbg6.ocx"
	dataSrc=#rds1 height=350 id=grid1 style="HEIGHT: 350px; LEFT: 0px; TOP: 0px; WIDTH: 592px" 
	width=592 VIEWASTEXT></OBJECT>
<font color="#003366">
    查询条件:<input id="condition_ID" size="40" ><br> 
                        查询栏目: <select id="field_id" size="1" onfocus="field_gotfocus()" onblur="field_getSelect()">
				<option value="1" selected>学号    </select>
                         &nbsp; 比 较:<select name="compare_id" size="1" onblur="compare_getSelect()">
			  <option value="1" 
              selected>等于 =
			  <option value="2">大于 &gt;
			  <option value="3">小于 &lt; <option value="4">小于等于&lt;= <option value="5">大于等于&gt;=
			  <option value="5">不等于&lt;&gt;
			  <option value="6">包含
			  </select>
                         条 件:<input name="express_id" size="10" onblur="express_input()" > 逻 辑:<select id="logic_id" size="1" onfocus="logic_getfocus()" onblur="logic_getSelect()">
	  <option value="1" selected>并且
	  <option value="2">或者
	  </select>
 
            </font></td>
        

<td width="113" height="24" valign="top">
	<form method="post" action="../_vti_bin/shtml.dll/student/基本资料.asp" webbot-action = 
                        --WEBBOT-SELF-->
     <p><img id="photoid" datasrc="#rds1" Datafld="图片" width="110" height="142" alt="学生相片">
    </form></p>
    
    </td>
  </tr>
  <tr>
    <td width="113" height="1" valign="top"><form method="post" action="../_vti_bin/shtml.dll/student/基本资料.asp" webbot-action = 
                        --WEBBOT-SELF-->
     <p align="center"> 
      <font color="#003366">
	  <input type="button" value="查    询" name="B5" onclick="freeSearch()" style="BACKGROUND-COLOR: rgb(192,192,192); COLOR: rgb(0,0,255); FONT-FAMILY: 宋体; FONT-SIZE: 12px; HEIGHT: 25px" height = 25></p>
	  <p align="center"> <input type="button" value="资料刷新" name="allinfo" id="allinfo"  onclick="backing()" style="BACKGROUND-COLOR: rgb(192,192,192); COLOR: rgb(0,0,255); FONT-FAMILY: 宋体; FONT-SIZE: 12px; HEIGHT: 25px" height = 25> 
      
      <p align="center"> <input type="button" value="退    出" name="allinfo"   onclick="returning()" style="BACKGROUND-COLOR: rgb(192,192,192); COLOR: rgb(0,0,255); FONT-FAMILY: 宋体; FONT-SIZE: 12px; HEIGHT: 25px" height = 25>
                        </FONT><!--mstheme--></FONT>
     
<script language="VBScript">
	
    dim fieldname(40)
	colcount = 0
	compare_select = false
	field_select = false
	express_input = false
	logic_select = false
	search_flag = false

	RDS1.Server="http://<%=REQUEST.SERVERVARIABLES("SERVER_NAME")%>" 
    RDS1.Connect="database=school;uid=sa;pwd=;dsn=school"
    RDS1.SQL = "select * from baseinfo<%=CategoryID%> order by 学号"            
	saveSQL = RDS1.SQL
    RDS1.Refresh

    grid1.AllowAddnew = false
    grid1.AllowDelete = false
    grid1.AllowUpdate = true

</script>


<script language="VBScript">



sub grid1_BeforeColEdit(colindex,keyascii,cancel)

		msgbox selcolname+"毕业生资料不能修改!"
		cancel = true
end sub



sub field_getSelect()
	if field_select then
		exit sub
	end if
	condvalue = condition_id.value
	condition_id.value = condvalue + fieldname(field_id.selectedindex)	
	field_select = true
	compare_select = false
	express_select = false
	logic_select = false
end sub

sub compare_getSelect()
	if compare_select then
		msgbox "已经输入比较操作符!"
		exit sub 
	end if 

	condvalue = condition_id.value
	if len(trim(condvalue)) = 0 then
		condvalue = "学号"
	end if
	select case compare_id.selectedindex
		case 0
			condvalue = condvalue + "="
		case 1
			condvalue = condvalue + ">"
		case 2
			condvalue = condvalue + "<"

		case 3
			condvalue = condvalue + "<="
		case 4
			condvalue = condvalue + ">="
		case 5
			condvalue = condvalue + "<>"
		case 6
			condvalue = condvalue + " like "
	end select 
	condition_id.value = condvalue
	compare_select = true
end sub

sub logic_getfocus()
    if len(trim(express_id.value))=0 then		
		msgbox "条件不能为空,请先输入条件表达式!"

	end if
end sub 

sub logic_getSelect()
	if logic_select then
		exit sub
	end if 
	condvalue = condition_id.value
	select case logic_id.selectedIndex
		case 0
			condvalue = condvalue + " and "
		case 1
			condvalue = condvalue + " or "
	end select
	condition_id.value=condvalue
	logic_select = true
	field_select = false
end sub

sub field_Gotfocus()
	if len(trim(condition_id.value)) = 0 then
		field_select = false
		compare_select = false
		express_select = false
		logic_select = false
	end if

	if colcount > 0 then
		exit sub
	end if 
	colcount = grid1.columns.count
	fieldname(0)="学号"
	for i=1 to colcount-1 
		  colcaption = grid1.columns.item(i).caption
		  fieldname(i) = colcaption
		  set oOption = document.createElement("OPTION")
		  oOption.text  = colcaption
	      oOption.value = cstr(i+1)
	      document.all.field_id.add(oOption)		
	next

end sub 


sub express_input()
	condvalue = condition_id.value
	if not compare_select then
		msgbox "请先输入比较操作符!"
		exit sub
	end if
	if len(trim(condvalue))=0 then
		condvalue = "学号="
	end if
	if len(trim(express_id.value))>0 and compare_id.selectedindex <> 6 then
		condvalue = condvalue + "'" + express_id.value + "'"
		condition_id.value = condvalue
    elseif len(trim(express_id.value))>0 and compare_id.selectedindex = 6 then
		condvalue = condvalue + "'%" + express_id.value + "%'"
		condition_id.value = condvalue
	else
		msgbox "条件不能为空,请重新输入条件表达式!"
	end if
end sub




sub freeSearch()
	if len(trim(condition_id.value))=0 then
		msgbox "请先输入查询条件!"
		exit sub
	end if
	rds1.sql =" select * from baseinfo<%=CategoryID%>  where  " + condition_id.value

	on error resume next
	rds1.ExecuteOptions = 1	
	rds1.refresh
	if rds1.recordset.recordcount = 0 then
		msgbox "对不起!没有找到符合条件的记录!"
		rds1.sql = saveSQL
		rds1.refresh
	else
		msgbox "总共找到 " + cstr(rds1.recordset.recordcount) +" 条符合条件的记录!"
		search_flag = true
	end if
end sub


sub backing()

	if search_flag then
		rds1.sql = saveSQL
		rds1.refresh
		condition_ID.value =""
	end if
	
end sub
sub returning()
   history.go(-1)
end sub   

</script>
<SCRIPT language=javascript>
function click() {
if (event.button==2) {
alert('对不起,禁止使用此功能^_^.')
}
}
document.onmousedown=click
</SCRIPT>
 

    </form></td>
                    <P></P></tr>

</table></CENTER></P></DIV>

<!--msnavigation--></TD></TR><!--msnavigation--></TBODY></TABLE><!--msnavigation--><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td>

<p align="center"> </p>
</td></tr><!--msnavigation--></table></body>
</html>

⌨️ 快捷键说明

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