📄 month_score.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="const.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="img/Style.css" rel="stylesheet" type="text/css" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE1 {color: #FFFFFF}
-->
</style>
</head>
<body>
<%
action=Request("action")
if action="update" then
Response.Write("================开始处理=====================")
dim t_month,m_finmark,m_deptreason,m_deptmark,m_apamrk
t_month=trim(Request.Form("t_month")) '获取操作的月份
m_finmark="m"&t_month&"_finmark" '定义数据表中的列名 月最终得分列
m_deptreason="m"&t_month&"_deptreason"'部门加分理由
m_deptmark="m"&t_month&"_deptmark" '部门加分值
m_apmark="m"&t_month&"_apmark" '个人申请分
Dim rs,rs2,c1,c '顺序帅选学号
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = dbconn
rs.Source = "SELECT user_no FROM pc_user"
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()
if rs.eof or rs.bof then
response.Write("系统错误:pc_user")
response.End()
end if
Response.Write("<br /><li>学号帅选成功,开始搜集数据!!!!<br /></li>")
do while not rs.eof
xscore=0
xreason="" '计算出部门加分和理由
xuser_no=rs(0)
'筛选特定学生特定月加分级理由 ,再整理出总分和总加分理由
Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.ActiveConnection = dbconn
rs2.Source = "SELECT u_d,dept_name,score, bz FROM dept_score"&t_month&" where u_d like '"&xuser_no&"#%'"
rs2.CursorType = 0
rs2.CursorLocation = 2
rs2.LockType = 1
rs2.Open()
do while not rs2.eof
xscore=xscore+Cdbl(rs2(2))
xreason=xreason&"部门: "&rs2(1)&" 提出加分额: "&rs2(2)& "分, 理由:"&rs2(3)&"#"
rs2.movenext
loop
if xscore>all_dept_score_max then
xscore=all_dept_score_max
end if
if xreason="" then
xreason="没有部门评分情况的记录!"
else
xreason=xreason&"因为所有部门总加分额度不能超过:"&all_dept_score_max&" 所以最后部门给与的加分为: <span class=red> "&xscore&"</span>"
end if
'更新用户表中指定用户的部门相关的项 特定月加分及理由
'response.Write(xreason)
set c = Server.CreateObject("ADODB.Command")
c.ActiveConnection =dbconn
c.CommandText = "update pc_user set "&m_deptmark&"="&xscore&","&m_deptreason&"='"&xreason&"' where user_no='"&xuser_no&"' "
c.CommandType = 1
c.CommandTimeout = 0
c.Prepared = true
c.execute
rs.movenext
loop
Response.Write("<br /><br />========================<li>数据帅选完成<br /></li><br /><li>写入数据完成</li>")
Response.Write("<br /><br /><li>开始计算最后得分<br /></li>")
set c1 = Server.CreateObject("ADODB.Command") '计算最后得分
c1.ActiveConnection =dbconn
c1.CommandText = "update pc_user set "&m_finmark&"="&m_deptmark&"+"&m_apmark&"+"&init_score&""
c1.CommandType = 1
c1.CommandTimeout = 0
c1.Prepared = true
c1.execute
if err.number="0" then
Response.Write("<br /><li>处理完成!!!!<br /></li>")
else
response.Write("出现异常错误")
end if
rs2.close
set rs2=nothing
rs.close
set rs=nothing
%>
<%else
if pc_term="fir" then
term=0
elseif pc_term="sed" then
term=1
end if
Dim rs1
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.ActiveConnection = dbconn
rs1.Source = "SELECT month,month_name FROM set_month where isok=1 and isterm="&term&""
rs1.CursorType = 0
rs1.CursorLocation = 2
rs1.LockType = 1
rs1.Open()
if rs1.eof or rs1.bof then
response.Write("系统错误:set_month")
response.End()
end if
dim ismonth
ismonth=month(date)
%>
<p> </p>
<p> </p>
<p> </p>
<form name="form" action="" method="post">
<table width="80%" border="0" align="center" cellpadding="1" cellspacing="0" class="atable1">
<tr>
<td colspan="3" bgcolor="#333"><span class="STYLE1"> 月综合分生成</span></td>
</tr>
<tr>
<td width="81%" height="30" class="tdmenu">
<div align="center"><br />
您的操作被锁定在: <span class="red">
<%if pc_term="fir" then
Response.Write("上学期")
elseif pc_term="sed" then
Response.Write("下学期")
end if%>
</span></span> 详情请查看<a href="set_zt.asp">系统参数设置</a>
或者请在 <a href="set_month.asp">学期月份设定里修改
</a> <br />
<br />
请选择要计算得分的月份:
<select name="t_month" class="red" id="t_month" onchange="javascript:t_month1.value=t_month.value;tj.value='确认生成[ '+t_month.value+' ]月份综合分'">
<%do while not rs1.eof%>
<option value="<%=rs1(0)%>" <%if ismonth=rs1(0) then response.Write("selected='selected'") end if%>><%=rs1(1)%></option>
<%rs1.movenext()
loop%>
</select>
<=>
<input name="t_month1" type="text" value="<%=ismonth%>" class="atable1" id="t_month1" size="1" maxlength="1" disabled="disabled" />
基本分为 :<%=init_score%></div>
<p align="center"><span class="jushe">此操作用于计算当月的综合测评分,操作应该在当月的个人申<br />
<br />
请分、部门评测分提交完成后执行, 操作会比较耗系统资源.</span><br />
<br />
</p></td>
</tr>
<tr>
<td height="30" class="tdmenu"><div align="center">
<input name="提交" type="submit" class="tdmenu" id="tj" value="确认生成[ <%=ismonth%> ]月份综合分" />
<input name="重填" type="button" class="tdmenu" id="重填" value="放弃操作并返回上一页" onclick="javascript:history.go(-1)" />
<input type="hidden" name="action" value="update" />
<br />
<br />
</div></td>
</tr>
</table>
</form>
<%
rs1.close
set rs1=nothing
end if%>
</body>
</html>
<%dbconn.close%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -