📄 pc_update.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>
<%
dim dept_score,dept_id,y
dept_score="dept_score"&dept_allow_month
dept_id=session("dept_id")
action=Request("action")
if action="update" then
on error resume next
u_d=safeChar(trim(Request.Form("u_d")))
response.Write(u_d)
mark=safeChar(trim(Request.Form("mark")))
reason=replace(safeChar(trim(Request.Form("reason"))),"#","")
on error resume next
set c = Server.CreateObject("ADODB.Command")
c.ActiveConnection = dbconn
if mark=0 then
c.commandText="delete * from "&dept_score&" where score="&mark&""
else
c.CommandText = "update "&dept_score&" set score='"&mark&"',bz='"&reason&"' where u_d='"&u_d&"#"&dept_id&"'"
end if
c.CommandType = 1
c.CommandTimeout = 0
c.Prepared = true
c.Execute()
if err.number="0" then
Response.Write("<script language='javascript'>alert('学号为:"&u_d&"的评分修改成功');location=('pc_score.asp');</script>")
else
Response.Write("<li>输入的数据有问题</li>")
end if
%>
<%
else
Dim rs1
u_d=request.QueryString("u_d")
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.ActiveConnection = dbconn
rs1.Source = "SELECT u_d,dept_name,score,bz FROM "&dept_score&" where u_d='"&u_d&"#"&dept_id&"'"
rs1.CursorType = 0
rs1.CursorLocation = 2
rs1.LockType = 1
rs1.Open()
y=split(rs1(0),"#")
if rs1.eof then response.Write("系统错误") end if
%>
<p> </p>
<p> </p>
<p> </p>
<form name="form" action="" method="post" onsubmit="return chk()">
<table width="94%" border="0" align="center" cellpadding="1" cellspacing="0" class="atable1">
<tr>
<td colspan="8" bgcolor="#333"><span class="STYLE1"> 部门评分修改</span></td>
</tr>
<tr>
<td height="30" colspan="8" class="tdmenu"> </td>
</tr>
<tr>
<td width="10%" class="tdmenu"><div align="center">学号:</div></td>
<td width="10%" class="tdmenu">
<div align="center"><%=y(0)%></div></td>
<td width="11%" class="tdmenu">
部门:</td>
<td width="8%" class="tdmenu"><div align="center"><%=rs1(1)%></div></td>
<td width="18%" class="tdmenu"><div align="center"> [<span ><%=dept_allow_month%></span>]月部门得分</div></td>
<td colspan="3" class="tdmenu">
<div align="left">
<input name="mark" type="text" class="atable1" id="mark" value="<%=rs1(2)%>" size="4" maxlength="4" />
可以为负数,负数代表扣分 </div>
<div align="left"></div></td>
</tr>
<tr>
<td height="50" colspan="7" class="tdmenu">
<div align="center">理由:
<input name="reason" type="text" class="atable1" id="reason" value="<%=rs1(3)%>" size="80" maxlength="150" />
</div></td>
<td width="17%" height="30" class="tdmenu"><input name="提交" type="submit" class="tdmenu" id="提交" value="提交" />
<input name="重填" type="reset" class="tdmenu" id="重填" value="重填" />
<input type="hidden" name="action" value="update" />
<input name="u_d" type="hidden" id="u_d" value="<%=y(0)%>" />
</td>
</tr>
</table>
</form>
<%
rs1.close
set rs1=nothing
end if%>
</body>
</html>
<%
rs1.Close()
Set rs1 = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -