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

📄 lscxdj_update.asp

📁 学生日常管理系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
coursetype(2) = "期末成绩"
coursetype(3) = "总评成绩"
coursetype(4) = "补考成绩"	

rds1.SQL = " Execute serach_alltypescore "+ classno.value
rds1.ExecuteOptions =1 
rds1.Refresh 


for typecount = 0 to 4
		rds2.SQL = " select "+coursename+" from score where 成绩类型='"+coursetype(typecount)+"' and 学年='"+yearno.value+"' "&_
				   " and 学期='" +termno.value+"' and 学号 in (select 学号 from student where 班号='"+classno.value+"') "&_
				   " order by 学号"
		rds2.ExecuteOptions = 1
		rds2.Refresh

		if rds2.Recordset.recordcount >0 then 
			rds1.Recordset.Movefirst
			'grid1.row = 0
			rds2.Recordset.Movefirst
			while not rds2.Recordset.eof and not rds1.Recordset.eof
			'for i =0 to rds2.Recordset.recordcount-1
				if isnull(rds2.Recordset.fields(0))=false then
					'msgbox rds2.Recordset.fields(0)
					'msgbox rtrim(cstr(rds2.Recordset.fields(0)))
					'rds1.Recordset.fields(2+typecount).value = rtrim(cstr(rds2.Recordset.fields(0)))
					rds1.Recordset.fields(2+typecount).value = cint(rds2.Recordset.fields(0))
					'grid1.columns.item(2+typecount).value = rtrim(cstr(rds2.Recordset.fields(0)))
				end if
				
				
				rds1.Recordset.Movenext
				'grid1.row = grid1.row + 1
				rds2.Recordset.Movenext
			Wend 
		end if
next
  
search_all = true

end sub


			
'====================根据班号,学号,年级查询成绩====================================
sub score_search(search_type)    
'========================================================================	
	'根据课程名,取得课程代码
	 get_course(search_type)
	 if CourseSelectCount<=0 then
		msgbox("没有输入此学期成绩!请输入成绩或到班级课程设置模块中运行刷新功能")
		exit sub
	 end if
	
	course_sql = "select 学号,姓名,名次,"
	total_score ="("
	select_course = CourseSelectCount
	if rtrim(courseno.value)="所有课程" then
		for i = 0 to courseSelectCount - 1
 			course_sql = course_sql +"'"+rtrim(GetCourseName(i))+"'=str("+courseSelectArray(0,i)+",7,1),"
 	
			total_score = total_score + courseSelectArray(0,i)+"+"
		next
		
    else
			
		for i = 0 to CourseCount -1
			if rtrim(courseArray(0,i)) = rtrim(courseno.value) then
				course_sql = course_sql +"'"+rtrim(courseArray(0,i))+"'=str("+courseNoArray(0,i)+",7,1),"
				total_score = total_score + courseNoArray(0,i)+"+"
				
				exit for
			end if
		next  
		'找出本学期是否开设了此课程,通过计算是否在开设数组中CourseSelectArrary中进行判断
		findOpned = false
		for j = 0 to CourseSelectCount-1
			if courseNoArray(0,i)=CourseSelectArray(0,j) then
	
				findOpend = true
				exit for
			end if
		next
		if findOpend then		
			select_course = 1	
		else
			 '表明此课程没有成绩
				msgbox "没有输入成绩,请选择其它课程!"
				exit sub
		end if 
		
	end if 
	if select_course=0 then
		msgbox "没有输入成绩,请选择其它课程或成绩类型!"
		exit sub
	end if
	
	
	total_score = total_score + "0)"
	avg_score = total_score+"/"+cstr(select_course) 
	course_sql = course_sql + "'总成绩'=str("+total_score+",6,1),'平均成绩'=str("+avg_score+",6,2)   from score "
		if search_type="CLASS" then
				course_sql = course_sql +" where 学号 in (select 学号 from student where rtrim(班号)='"+rtrim(classno.value)+"') and "
			end if 
		if search_type="GRADE" then
				course_sql = course_sql +" where 学号 in (select 学号 from student where 班号 in (select 班号 from class where year(入学年度)='"+rtrim(gradeno.value)+"')) and "
			end if
		if search_type="XH" then
				course_sql = course_sql +" where rtrim(学号) >= rtrim("+startno.value+") and rtrim(学号) <= rtrim("+endno.value+") and "
			end if
		
			     
		course_sql = course_sql + " 学年='"+yearno.value+"' and 学期='"+termno.value+"' and 成绩类型='"+scoreno.value+"'"
	
	rds1.SQL = course_sql
	rds1.ExecuteOptions = 1
	rds1.refresh
	
		
	if rds1.Recordset.recordcount = 0 then
		msgbox "对不起,成绩还没有输入无法查询!"
    	exit sub
	end if
	scoreSort()
	rds1.Recordset.movefirst
	for i=0 to rds1.recordset.recordcount-1 
	      xhOrderArray(0,i)=rds1.Recordset.fields(0)
	      rds1.Recordset.movenext	
	next
	'xhOrderArray = rds1.recordset.Getrows(rds1.recordset.recordcount,0,0) 
	xhsort()
	
end sub

'========按班、年级及学号取某学年某学期所开所的课程======
sub get_course(get_type)
	courseSelectCount = 0
	
	select case get_type 
		case "CLASS"
			rds2.SQL = " select 课程号 from class_course where 班号='"+classno.value+"' and "&_
						" 学年='"+yearno.value+"' and 学期='"+termno.value+"'"	
		case "XH"
			rds2.SQL = "select a.课程号 from class_course as a,student as b where b.学号>='"+rtrim(startno.value)+"' and "&_
					   " b.学号<='"+rtrim(endno.value)+"' and b.班号=a.班号 and "&_
					   " 学年='"+yearno.value+"' and 学期='"+termno.value+"' group by a.课程号"
			
		case "GRADE" 
			rds2.SQL = " select 课程号 from class_course  where 班号 in (select 班号 from class where year(入学年度)='"+rtrim(gradeno.value)+"') and "&_ 
						" 学年='"+yearno.value+"' and 学期='"+termno.value+"' group by 课程号"
		
	end select
	'msgbox rds2.sql
	rds2.ExecuteOptions = 1
	rds2.Refresh
	courseSelectCount = rds2.Recordset.recordcount
	if courseSelectCount <=0 then
		exit sub 
	end if 
	
	rds2.Recordset.movefirst
	for i=0 to rds2.recordset.recordcount-1 
	      courseSelectArray(0,i)=rds2.Recordset.fields(0)
	      rds2.Recordset.movenext	
	next

	'courseSelectArray= rds2.recordset.Getrows(rds2.recordset.recordcount,0,0) 
	
end sub
				
'==============根据序列号从开设课程数组中取课程名称=================
function  GetCourseName(cno)
	
	GetCourseName = "No Find"
	for loopcount = 0 to courseCount-1
	
		if courseNoArray(0,loopcount) = courseSelectArray(0,cno) then
			GetCourseName = courseArray(0,loopcount)
			exit for
		end if
	next
	
end function
	

'===============================================
sub xhSort()
	if len(trim(rds1.SQL)) <=0 then
		msgbox "没有查询结果,无法进行排序!"
		exit sub
	end if
	
	rds1.SQL = course_sql + " order by 学号"
	'msgbox rds1.sql
	rds1.ExecuteOptions=1
	rds1.refresh
	
	 xhFillOrder()
	
end sub
'==============================================================

'===============================================
sub scoreSort()
   if len(trim(rds1.SQL)) <=0 then
	msgbox "没有查询结果,无法进行排序!"
		exit sub
	end if
	
	rds1.SQL = course_sql + " order by "+total_score + " DESC"
	rds1.ExecuteOptions=1
	rds1.refresh
	
	scoreFillOrder()
	
	
end sub
'==============================================================
sub scoreFillOrder() '成绩排序,填写名次
	loopcount = rds1.Recordset.recordcount
	
	rds1.recordset.Movefirst
	
	for i = 0 to loopcount-1 
		rds1.recordset.fields(2).value = cstr(i+1)
		rds1.Recordset.movenext
	next
	rds1.recordset.Movefirst 	

end sub

sub xhFillOrder() '学号排序,填写名次
	
	loopcount = rds1.Recordset.recordcount
	rds1.recordset.Movefirst	
	for i = 0 to loopcount-1
		for j = 0 to loopcount - 1
			if rds1.Recordset.fields(0).value = xhOrderArray(0,j) then
					rds1.recordset.fields(2).value = cstr(j+1)
					exit for
			end if
		next 
		rds1.Recordset.movenext
	next

end sub

sub printing()

'	RDS1.recordset.movefirst 	
'	if search_all then
'		call free_printer(rds1.Recordset.recordcount,trim(classno.value)+"班"+trim(yearno.value)+trim(termno.value)+"学期"+trim(CourseArray(0,courseno.selectedIndex-1))+"成绩信息一览表")
'	else

'		call free_printer(rds1.Recordset.recordcount,"学生成绩信息一览表")
'	end if 
 
' rds1.SQL="execute kaoqin_total 1,2,'991'"
' rds1.ExecuteOptions = 1
' rds1.Refresh 

 

	'vp.CurrentX=1
    'vp.CurrentY=1
    
    vp.MarginLeft=800


    vp.AbortWindowPos=1
    
    
    
	
	vp.Preview = true
	
	vp.StartDoc 
	
	rds1.recordset.movefirst
	

   print_lineno = 0  
   
  
   vp.Header = "|商业学校"+"毕业学生操行分表"+"|"
'   vp.Footer = " ||第%d页"
   formatstr = "<+950|<+900"
   headstr = "" 

   scoreCount = rds1.Recordset.fields.count-2
   
   for k=0 to rds1.Recordset.fields.count-1 
	   
    
     
     if k >1 and k<scoreCount then
		formatstr = formatstr+ "|<+900"
	 end if
	 
	 
	 if K>=scoreCount then
		formatstr = formatstr+ "|<+900"
	 end if
	  
	 headstr = headstr + trim(rds1.Recordset.fields(k).name)+"|"
	 
    ' msgbox headstr
    next 
   
	'print_lineno = print_lineno + 1
    rds1.Recordset.movefirst
    
    
    while not rds1.Recordset.eof
	onelinestr =""
	
     For j = 0 To  rds1.Recordset.fields.count-1 

      If isnull(rds1.Recordset.fields(j))=false  then   ' or trim(rds1.Recordset.fields(j))<>"" then
    
      
         if IsNumeric(rds1.Recordset.fields(j)) = true  Then
    
                   'xlSheet.Cells(print_lineno, j + 1) = trim(cstr(rds2.Recordset.fields(j)))
                   if j <>0 and j <>scoreCount +1 then
					onelinestr = onelinestr + trim(cstr(rds1.Recordset.fields(j))) +"|"
				  ' msgbox trim(cstr(formatnumber(rds1.Recordset.fields(j),0)))
				 '   msgbox onelinestr
				    else
					onelinestr = onelinestr + trim(cstr(rds1.Recordset.fields(j))) +"|"
				'	msgbox onelinestr
				   end if
				   
               
         else        

          'xlSheet.Cells(print_lineno, j + 1) = trim(cstr(rds2.Recordset.fields(j)))
                   onelinestr = onelinestr + trim(cstr(rds1.Recordset.fields(j))) +"|"
               '    msgbox onelinestr

         End If
     else  ' It is Null
		  onelinestr = onelinestr + "|"  
         ' msgbox onelinestr
    
    end if   

    Next
   
    print_lineno=print_lineno+1
    if print_lineno = 1 then
		vp.AddTable formatstr,headstr,onelinestr,,,false
    
    else
		vp.AddTable formatstr,headstr,onelinestr,,,true
	end if 
    rds1.Recordset.movenext
    
 wend 
 
    vp.EndDoc 
	vp.SaveDoc  "c:\xkprint.prn"
	
		
	window.open "http://<%=REQUEST.SERVERVARIABLES("SERVER_NAME")%>/shangye/public/print.asp"
 
end sub 





sub returning()
    history.go(-1)

end sub
'==============================================================
sub grid1_BeforeColEdit(colindex,keyascii,cancel)
	'	msgbox "不能输入和修改成绩!"			
		'cancel = true	
end sub

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


<p>
<object classid="clsid:6E84D662-9599-11D2-9367-20CC03C10627" height="3" id="vp" width="3"
VIEWASTEXT>
</object>
</p>
</body>
</html>

⌨️ 快捷键说明

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