?? kaoqin.asp
字號:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>
<body background="../images/di2001.jpg">
<p>
<object id="rds1" classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33" width="9"
height="6">
</object>
<object id="rds2" classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33" width="6"
height="8">
</object>
</p>
<div align="center"><center>
<table border="0" width="747" height="282" style="HEIGHT: 282px; WIDTH: 747px"
cellspacing="0" cellpadding="0">
<caption align="left"><font color="#ff0000" size="5"><b>學生考勤資料錄入</b></font></caption>
<tr>
<td width="569" height="188" valign="top" bgcolor="#AFC6DC">
<object classid="clsid:00028CD1-0000-0000-0000-000000000046" codebase="http:/"
<%=Request.ServerVariables("SERVER_NAME")%>/school/public/tdbg6.ocx" dataSrc="#rds1"
height="357" id="grid1" style="LEFT: 0px; TOP: 0px" width="562" VIEWASTEXT id="tdbgrid1">
</object>
</td>
<td width="161" height="188" valign="top" bgcolor="#AFC6DC"><font color="#ff0000">請選擇錄入的條件:</font>
周別<input type="text" name="weekno" size="10" style="HEIGHT: 21px; WIDTH: 72px">
日期<input type="text" name="dateno" size="10"> 班號<select
name="classno" size="1">
</select> 學號<input type="text" name="start_no" size="10">
姓名<input type="text" name="xm" size="10"> <!-- 課別<select
name="kno" size="1">
<option selected value="早操">早操</option>
<option value="正課">正課</option>
<option value="晚修">晚修</option>
</select>--><p align="center"><input type="button" value="開始錄入"
onclick="begininput()" name="start_input"
style="COLOR: rgb(0,0,255); FONT-FAMILY: 宋體; FONT-SIZE: 14px"> <input type="button"
value="開始修改" onclick="modi_click()" name="start_modi"
style="COLOR: rgb(0,0,255); FONT-FAMILY: 宋體; FONT-SIZE: 14px"> <input type="button"
value="保存錄入" onclick="update_click()" name="start_update"
style="COLOR: rgb(0,0,255); FONT-FAMILY: 宋體; FONT-SIZE: 14px"> <input type="button"
value="保存修改" onclick="save_click()" name="start_update"
style="COLOR: rgb(0,0,255); FONT-FAMILY: 宋體; FONT-SIZE: 14px"> <input type="button"
value="打印數據" onclick="printing()" name="start_print"
style="COLOR: rgb(0,0,255); FONT-FAMILY: 宋體; FONT-SIZE: 14px"> <input type="button"
value="退出返回" onclick="returning()" name="exiting"
style="COLOR: rgb(0,0,255); FONT-FAMILY: 宋體; FONT-SIZE: 14px"></td>
</tr>
</table>
</center></div><script language="Vbscript">
dim courseNoArray(0,100),courseArray(0,100),courseSelectArray(0,100),xhOrderArray(0,100)
dim courseCount,courseSelectCount,search_all
dim course_sql
dim total_score
search_all = false
rds1.server = "http://<%=Request.ServerVariables("SERVER_NAME")%>"
rds1.connect ="database=school;uid=sa;pwd=;dsn=school"
rds2.server ="http://<%=Request.ServerVariables("SERVER_NAME")%>"
rds2.connect ="database=school;uid=sa;pwd=;dsn=school"
'Get all class Number
rds2.sql = "select * from class"
rds2.ExecuteOptions = 1
rds2.refresh
colcount=rds2.Recordset.recordcount
while not rds2.Recordset.eof
for circle=0 to colcount-1
colitem=rds2.Recordset.fields(0)
set item_option = document.createElement("OPTION")
item_option.text = colitem
item_option.value = colitem
document.all.classno.add(item_option)
rds2.Recordset.movenext
next
wend
dateno.value = "20"+formatdatetime(date(),2)
grid1.AllowAddnew = true
</script>
<script language="VBScript">
'==============================================================
sub begininput()
if len(weekno.value)=0 then
msgbox "請輸入周別......",,"提示窗口"
exit sub
end if
if len(classno.value)=0 and len(xm.value)=0 and len(start_no.value)=0 then
msgbox "請選擇班級或者輸入學號,姓名......",,"提示窗口"
exit sub
end if
'msgbox formatdatetime(date(),1)
l_date=trim(dateno.value)
if len(classno.value)<>0 then
rds1.SQL="execute kaoqin_class"+"'"+weekno.value+"',"+"'"+l_date+"',"+"'"+classno.value+"'" '+kno.value+"'"
rds1.ExecuteOptions = 1
rds1.Refresh
elseif len(start_no.value)<>0 then
rds1.SQL="execute kaoqin_xh"+"'"+weekno.value+"',"+"'"+l_date+"',"+"'"+start_no.value+"'" '+kno.value+"'"
rds1.ExecuteOptions = 1
rds1.Refresh
else
rds1.SQL="execute kaoqin_xm"+"'"+weekno.value+"',"+"'"+l_date+"',"+"'"+xm.value+"'" '+kno.value+"'"
rds1.ExecuteOptions = 1
rds1.Refresh
end if
end sub
'==================================
sub modi_click()
if len(weekno.value)=0 then
msgbox "請輸入周別......",,"提示窗口"
exit sub
end if
if len(classno.value)=0 and len(xm.value)=0 and len(start_no.value)=0 then
msgbox "請選擇班級或者輸入學號,姓名......",,"提示窗口"
exit sub
end if
'msgbox formatdatetime(date(),1)
l_date=trim(dateno.value)
'msgbox weekno.value
if len(classno.value)<>0 then
rds1.SQL="select * from kaoqin where 周別='"&weekno.value&"' and 日期='"&l_date&"' and 班號='"&classno.value&"'" ' and 課別='"&kno.value&"'"
rds1.ExecuteOptions = 1
rds1.Refresh
elseif len(start_no.value)<>0 then
rds1.SQL="select * from kaoqin where 周別='"&weekno.value&"' and 日期='"&l_date&"' and 學號='"&start_no.value&"'" ' and 課別='"&kno.value&"'"
rds1.ExecuteOptions = 1
rds1.Refresh
else
rds1.SQL="select * from kaoqin where 周別='"&weekno.value&"' and 日期='"&l_date&"' and 姓名='"&xm.value&"'" ' and 課別='"&kno.value&"'"
rds1.ExecuteOptions = 1
rds1.Refresh
end if
end sub
'=================================
'保存數據修改
'================================
sub save_click()
if rds1.Recordset.recordcount<0 then
msgbox "沒有數據保存......",,"提示窗口"
exit sub
end if
if grid1.row=0 then
' msgbox grid1.row
rds1.Recordset.movenext
else
rds1.Recordset.movenext
end if
grid1.Editactive = False
On Error resume next
RDS1.SubmitChanges
If Err.Number <> 0 Then
MsgBox "無法更新數據!"
exit sub
End If
rds1.Recordset.movefirst
for i=0 to rds1.Recordset.recordcount-1
l_week=trim(rds1.Recordset.fields(0))
l_date1=trim(rds1.Recordset.fields(1))
l_bh=trim(rds1.Recordset.fields(2))
l_xh=trim(rds1.Recordset.fields(3))
l_xm=trim(rds1.Recordset.fields(4))
l_kb=trim(rds1.Recordset.fields(5))
l_kk=rds1.Recordset.fields(6)
l_cd=rds1.Recordset.fields(7)
l_zt=rds1.Recordset.fields(8)
l_sj=rds1.Recordset.fields(9)
l_bj=rds1.Recordset.fields(10)
l_bz=rds1.Recordset.fields(11)
l_date=trim(dateno.value)
select case rds1.Recordset.fields(5)
case "早操"
if isnull(l_cd) then
l_cd_kf=0
else
l_cd_kf=l_cd*0.5
end if
if isnull(l_zt) then
else
l_zt_kf=l_zt*0.5
end if
if isnull(l_kk) then
else
l_kk_kf=l_kk*1
end if
if len(classno.value)<>0 then
' msgbox "ok1"
rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周別='"&weekno.value&"' and 日期='"&l_date&"' and 班號='"&trim(classno.value)&"' and 扣分項目='扣早操'"
' msgbox rds2.sql
rds2.ExecuteOptions =1
rds2.Refresh
elseif len(start_no.value)<>0 then
' msgbox "ok"
rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周別='"&weekno.value&"' and 日期='"&l_date&"' and 學號='"&start_no.value&"' and 扣分項目='扣早操'"
' msgbox rds2.sql
rds2.ExecuteOptions =1
rds2.Refresh
else
rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周別='"&weekno.value&"' and 日期='"&l_date&"' and 姓名='"&xm.value&"' and 扣分項目='扣早操'"
' msgbox rds2.sql
rds2.ExecuteOptions =1
rds2.Refresh
end if
case "正課"
if isnull(l_cd) then
l_cd_kf=0
else
l_cd_kf=l_cd*1
end if
if isnull(l_zt) then
else
l_zt_kf=l_zt*1
end if
if isnull(l_kk) then
else
l_kk_kf=l_kk*3
end if
if len(classno.value)<>0 then
rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周別='"&weekno.value&"' and 日期='"&l_date&"' and 班號='"&classno.value&"' and 扣分項目='扣正課'"
rds2.ExecuteOptions =1
rds2.Refresh
elseif len(start_no.value)=0 then
rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周別='"&weekno.value&"' and 日期='"&l_date&"' and 學號='"&start_no.value&"' and 扣分項目='扣正課'"
rds2.ExecuteOptions =1
rds2.Refresh
else
rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周別='"&weekno.value&"' and 日期='"&l_date&"' and 姓名='"&start_no.value&"' and 扣分項目='扣正課'"
rds2.ExecuteOptions =1
rds2.Refresh
end if
case "晚修"
if isnull(l_cd) then
l_cd_kf=0
else
l_cd_kf=l_cd*1
end if
if isnull(l_zt) then
else
l_zt_kf=l_zt*1
end if
if isnull(l_kk) then
else
l_kk_kf=l_kk*3
end if
if len(classno.value)<>0 then
rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周別='"&weekno.value&"' and 日期='"&l_date&"' and 班號='"&classno.value&"' and 扣分項目='扣晚修'"
rds2.ExecuteOptions =1
rds2.Refresh
elseif len(start_no.value)=0 then
rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周別='"&weekno.value&"' and 日期='"&l_date&"' and 學號='"&start_no.value&"' and 扣分項目='扣晚修'"
rds2.ExecuteOptions =1
rds2.Refresh
else
rds2.SQL="update xscxdjk set 扣分='"&cdbl(l_cd_kf+l_zt_kf+l_kk_kf)&"' where 周別='"&weekno.value&"' and 日期='"&l_date&"' and 姓名='"&start_no.value&"' and 扣分項目='扣晚修'"
rds2.ExecuteOptions =1
rds2.Refresh
end if
end select
'msgbox rds1.Recordset.fields(4)
rds1.Recordset.movenext
next
end sub
'=================================
'保存考勤數據錄入
'=================================
sub update_click()
if rds1.Recordset.recordcount<0 then
msgbox "沒有數據保存......",,"提示窗口"
exit sub
end if
rds1.Recordset.movefirst
for i=0 to rds1.Recordset.recordcount-1
if isnull(rds1.Recordset.fields(6)) and isnull(rds1.Recordset.fields(7)) and isnull(rds1.Recordset.fields(8)) and isnull(rds1.Recordset.fields(9)) and isnull(rds1.Recordset.fields(10)) then
else
l_week=trim(rds1.Recordset.fields(0))
l_date1=trim(rds1.Recordset.fields(1))
l_bh=trim(rds1.Recordset.fields(2))
l_xh=trim(rds1.Recordset.fields(3))
l_xm=trim(rds1.Recordset.fields(4))
l_kb=trim(rds1.Recordset.fields(5))
l_kk=rds1.Recordset.fields(6)
l_cd=rds1.Recordset.fields(7)
l_zt=rds1.Recordset.fields(8)
l_sj=rds1.Recordset.fields(9)
l_bj=rds1.Recordset.fields(10)
l_bz=rds1.Recordset.fields(11)
if isnull(l_kk) then
else
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -