📄 pc_addx.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>Untitled Document</title>
<%
action=safeChar(Request.Form("action"))
dept_id=session("dept_id")
dept_name=session("dept_name")
if not action="add76" then
Response.Write("<li>非法操作</li>")
Response.End()
end if
if dept_id="" then
Response.Write("<li>登录超时</li>")
Response.End()
end if
%>
<%
dim mark,reason,u_d,dept_score
u_d=split(replace(safeChar(trim(Request.Form("u_d"))),"#",""),",")
mark=split(safeChar(trim(Request.Form("mark"))),",")
reason=split(replace(safeChar(trim(Request.Form("reason"))),"#",""),",")
dept_score="dept_score"&dept_allow_month
j=0
k=0
for i = 0 to UBound(u_d)
on error resume next
u_d1=trim(u_d(i))
mark1=trim(mark(i))
reason1=trim(reason(i))
if not isnumeric(mark1) then
mark1=0
elseif cdbl(mark1)>dept_score_max then
Response.Write("<li>学号为:"&u_d1&" 输入的申请分不规则</li>")
Response.end()
end if
if len(reason1)>dept_score_reasonlen then
response.Write("<li>输入的字符太多</li>")
Response.End()
end if
Set c = Server.CreateObject("ADODB.Recordset")
c.ActiveConnection = dbconn
c.Source = "SELECT user_no FROM pc_user where user_no='"&u_d1&"' "
c.CursorType = 0
c.CursorLocation = 2
c.LockType = 1
c.Open()
if c.eof then
Response.Write("<script language='javascript'>alert('学号为:"&u_d1&" 不存在,就重新输入!');history.go(-1);</script>")
else
if not mark1=0 then
set d=Server.CreateObject("ADODB.Command")
d.ActiveConnection=dbconn
d.CommandText="insert into "&dept_score&"(u_d,dept_name,score,bz) values ('"&u_d1&"#"&dept_id&"','"&dept_name&"','"&mark1&"','"&reason1&"') "
d.CommandType=1
d.CommandTimeout=0
d.Prepared=true
d.Execute()
if err.number="0" then
j=j+1
else
k=k+1
errmsg=errmsg & "<li> 学号为: <span class='red'>"& u_d1&" </span>已有添加数据</li>"
err.clear
end if
end if
end if
next
Response.Write("<li>成功添加<span class='red'> "&j&"</span> 条记录<br /></li>")
Response.Write("<li>失败<span class='red'> "&k&"</span> 条记录<br /></li><br />")
Response.Write(errmsg)
%>
</head>
<body>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -