📄 markset.asp
字号:
<%
'功能:评分标准维护
'作者:展亮
'日期:2003-12-2 12:00
'参数: request.form("subed")="true"#表单提交; request("id")#要编辑记录的ID;
%>
<!--#include file="../inc/NoCatch.asp"-->
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->
<%
'response.buffer=false
'------------------------------------------------设置参数
LoginID=trim(session("LoginID")) : if LoginID="" then LoginID=0 '当前用户ID
pid=request("id") '记录ID
'------------------------------------------------
'------------------------------------------------修改记录
table="tbioaMarkSet" '表名
if request.form("subed")="增加" then
'表单提交后
'接受录入参数
input_number=Request.Form("input_number")'编号
input_name=Request.Form("input_name")'评分标准
input_orderid=Request.Form("input_orderid")'顺序号
'添加时使用的字段
field1=array("number","name","orderid")
value1=array(input_number,input_name,input_orderid)
for i=0 to ubound(field1)
value1(i)=replace(value1(i),"'","''")
next
sql = "INSERT INTO " & table & " (" & Join(field1, ",") & ") VALUES ('" & Join(value1, "','") & "')"
oConn.Execute sql
response.write("<script>history.back()</script>")
oConn.close'释放对象变量
response.end
end if
if request.form("subed")="修改" then
'表单提交后
'接受录入参数
input_number=Request.Form("input_number")'编号
input_name=Request.Form("input_name")'评分标准
input_orderid=Request.Form("input_orderid")'顺序号
'添加时使用的字段
field1=array("number","name","orderid")
value1=array(input_number,input_name,input_orderid)
sql="UPDATE " & table & " SET "
for i=0 to ubound(field1)
sql = sql & field1(i) & "='" & replace(value1(i),"'","''") & "'"
if i <> ubound(field1) then sql=sql & "," else sql=sql & " where id='" & pid & "'"
next
oConn.Execute sql
response.write("<script>history.back()</script>")
oConn.close'释放对象变量
response.end
end if
if request.form("subed")="删除" then
'表单提交后
oConn.Execute "DELETE FROM " & table & " WHERE id='" & pid& "'"
response.write("<script>history.back()</script>")
oConn.close'释放对象变量
response.end
end if
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from " & table & " order by orderid"
rs.open sql,oConn,1,1
'------------------------------------------------
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/main.css" type=text/css>
<title>编辑评分标准</title>
<script src="../js/Popup.js"></script>
<script src="../js/front_chec.js"></script>
<script language="JavaScript">
<!--
function require(form){
return checnull(form.input_orderid,"请填写顺序号!")&&
checnumber(form.input_orderid,"顺序号必须为数字!")&&
checnull(form.input_name,"请填写评分项目!")&&
checnull(form.input_number,"请填写评分分数!")&&
checnumber(form.input_number,"评分分数必须为数字!")&&
1==1;
}
-->
</script>
</head>
<body topmargin="10" leftmargin="10">
<br>
<div align="center">
<table width="520" cellspacing="1" cellpadding="4" class="tab">
<tr>
<td width="100%" class="tdBottom" valign="top">
<table width="100%" cellspacing="1" cellpadding="2" class="tab">
<tr>
<td width="100%" class="tdTop">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="tdTop2">
<img border="0" src="../images/icon_title.gif" align="left">编辑评分标准
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="td1">
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="tab">
<tr class="td1">
<form name="eventfrm" method="POST" action="" onSubmit="return require(this)">
<td nowrap colspan="6">顺序号:<input type="text" size=3 maxLength=2 name="input_orderid" class=input>
评分项目:<INPUT type=text size=28 maxLength=100 name=input_name class=input>
分数:<input type="text" size=3 maxLength=3 name="input_number" class=input>
<input type="submit" value="增加" name="subed" class="button0" onmouseout=className="button0" onmouseover=className="button1">
</td>
</form>
</tr>
<tr>
<td class="tdtop" nowrap>顺序号</td>
<td class="tdtop" nowrap>评分项目</td>
<td class="tdtop" nowrap>分数</td>
<td class="tdtop" colspan="2" width=80 nowrap>操作</td>
</tr>
<%while not rs.eof%>
<tr>
<form name="eventfrm" method="POST" action="?id=<%=rs("id")%>" onSubmit="return require(this)">
<td nowrap class="td2">
<input type="text" size=3 maxLength=2 value="<%=htmlout(rs("orderid"))%>" name="input_orderid" class="button0" onmouseout=className="button0" onmouseover=className="button1">
</td>
<td nowrap class="td2">
<input type="text" size=47 maxLength=100 value="<%=htmlout(rs("name"))%>" name="input_name" class="button0" onmouseout=className="button0" onmouseover=className="button1">
</td>
<td nowrap class="td2">
<input type="text" size=3 maxLength=3 value="<%=htmlout(rs("number"))%>" name="input_number" class="button0" onmouseout=className="button0" onmouseover=className="button1">
</td>
<td nowrap class="td2">
<input type="submit" value="修改" name="subed" class="button0" onmouseout=className="button0" onmouseover=className="button1">
</td>
<td nowrap class="td2">
<input type="submit" value="删除" name="subed" class="button0" onmouseout=className="button0" onmouseover=className="button1" onClick="return confirm('确定要删除该评分标准吗?\n该操作不可恢复!')">
</td>
</form>
</tr>
<%
rs.movenext
wend
%>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>
<%'释放对象变量
rs.close
oConn.close
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -