⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 editrewpuninf.asp

📁 红金羚v1.5办公自动化软件是基于大型数据库系统开发的应用系统
💻 ASP
字号:
<%response.expires=0%>
<!--#include file="asp/sqlstr.asp"-->
<!--#include file="asp/bgsub.asp"-->
<!--#include file="asp/opendb.asp"-->
<%
function strlength(inputstr)
	dim length,i
	length=0
	for i=1 to len(inputstr)
		if asc(mid(inputstr,i,1))<0 then
			length=length+2
		else
			length=length+1
		end if
	next
	strlength=length
end function
'-----------------------------------------
oabusyname=request.cookies("oabusyname")
oabusyusername=request.cookies("oabusyusername")
oabusyuserdept=request.cookies("oabusyuserdept")
oabusyuserlevel=request.cookies("oabusyuserlevel")
if oabusyusername="" then 
	response.write("<script language=""javascript"">")
	response.write("window.top.location.href='default.asp';")
	response.write("</script>")
	response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css/css.css">
<meta http-equiv="expires" content="no-cache">
<title>红孩儿Office办公系统</title>
</head>
<body bgcolor="#ffffff" topmargin="5" leftmargin="5">
<%
call bghead()
'打开数据库读出用户名
set conn=opendb("oabusy","conn","accessdsn")
set rs=server.createobject("adodb.recordset")
sql="select name from userinf where username=" & sqlstr(request.form("username"))
rs.open sql,conn,1
name=rs("name")
%>
<center>
<table>
<tr>
<td>
<b>编辑<%=name%>的奖惩信息</b>&nbsp;&nbsp;
</td>
<form method="post" action="punish.asp" name="form2"><td>
<input type="hidden" name="userdept" value="<%=request.form("userdept")%>">
<input type="hidden" name="username" value="<%=request.form("username")%>">
<input type="submit" value="返回">
</td>
</form>
</tr>
</table>
</center>
<%
call bgmid()
if request.form("submit")="修改" then
	errorinfo=""
	username=request.form("username")
	rewpunname=request.form("rewpunname")
	if strlength(rewpunname)>30 then
		errorinfo=errorinfo&"奖惩名称太长,不能超过25个汉字!<br>"
	end if
	rewpundate=request.form("rewpundate")
	if strlength(rewpundate)>15 then
		errorinfo=errorinfo&"奖惩日期太长,不能超过15个英文字符!<br>"
	end if
	rewpunfile=request.form("rewpunfile")
	if strlength(rewpunfile)>30 then
		errorinfo=errorinfo&"奖惩文号太长,不能超过25个汉字!<br>"
	end if
	rewpunsort=request.form("rewpunsort")
	if strlength(rewpunsort)>30 then
		errorinfo=errorinfo&"奖惩类型太长,不能超过25个汉字!<br>"
	end if
	rewpuntype=request.form("rewpuntype")
	if strlength(rewpuntype)>30 then
		errorinfo=errorinfo&"奖惩方式太长,不能超过25个汉字!<br>"
	end if
	remark=request.form("remark")
	updatename=oabusyname
	updatedate=now()
	id=request.form("id")
	if errorinfo="" then
		sql = "Update rewpuninf set "
		sql = sql & "rewpunname=" & SqlStr(rewpunname) & ", "
		sql = sql & "rewpundate=" & SqlStr(rewpundate) & ", "
		sql = sql & "rewpunfile=" & SqlStr(rewpunfile) & ", "
		sql = sql & "rewpunsort=" & SqlStr(rewpunsort) & ", "
		sql = sql & "rewpuntype=" & SqlStr(rewpuntype) & ", "
		sql = sql & "remark=" & SqlStr(remark) & ", "
		sql = sql & "updatename=" & SqlStr(updatename) & ", "
		sql = sql & "updatedate=#" & updatedate & "# where id=" & id
		conn.Execute sql
%>
<br><br>
<center><font color="red" size="+1">成功修改员工奖惩信息!</font></center>
<br><br>
<%  
	else
%>
<div align="center">
<table widht="80%" border="0">
<tr><td>
<center><b><font color="red" size="+1">出错了</font></b></center><br><br>
<font color="#ee0000" size="+1"><%=errorinfo%></font>
<center><input type="button" value="返回" onclick="history.go( -1 );return true;"></center>
</td></tr></table>
</div>
<%
	end if
else  
	if request.form("submit")="删除" then  
		set conn=opendb("oabusy","conn","accessdsn")  
		sql="delete from rewpuninf where id=" & request.form("id")  
		conn.Execute sql  
%>  
<br><br>  
<center><font color=red size=3>成功删除员工奖惩信息!</font></center>  
<%  
	else  
%>  
<script Language="JavaScript">  
function form_check()  
{  
	var l1=document.form1.rewpunname.value;  
	if(l1=="")  
	{  
		window.alert("奖惩名称必须填写!");  
		document.form1.rewpunname.focus();  
		return (false);  
	}  
  
	var l2=document.form1.rewpundate.value;  
	if(l2=="")  
	{  
		window.alert("奖惩日期必须填写!");  
		document.form1.rewpundate.focus();  
		return (false);  
	}  
}  
</script>  
<%  
		'打开数据库,读出职务变动信息  
		set rs=server.createobject("adodb.recordset")  
		sql="select * from rewpuninf where id=" & request.form("id")  
		rs.open sql,conn,1
		if not rs.eof and not rs.bof then
%>  
<br>  
<center>  
<form method="post" action="editrewpuninf.asp" name="form1" onsubmit="return form_check();">  
  <table border="1" cellpadding="0" cellspacing="0" width="526" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF">  
    <tr>  
      <td height="25" width="82" align="center"><b>员工姓名</b></td>  
      <td colspan="3" width="438" bgcolor="#FFFFFF"><%=name%>  
      </td>  
    </tr>  
    <tr>  
      <td width="82" align="center"><b>奖惩名称</b></td>  
      <td colspan="3" width="438" bgcolor="#FFFFFF"><input type="text" name="rewpunname" size=61 value="<%=server.htmlencode(rs("rewpunname"))%>" maxlength="50">   
      </td>  
    </tr>  
    <tr>  
      <td width="82" align="center"><b>奖惩日期</b></td>  
      <td bgcolor="#FFFFFF" width="177"><input type="text" name="rewpundate" size=22 value="<%=server.htmlencode(rs("rewpundate"))%>" maxlength="15">   
      </td>  
      <td width="94" align="center"><b>奖惩文号</b></td>  
      <td bgcolor="#FFFFFF" width="163"><input type="text" name="rewpunfile" size=20 value="<%=server.htmlencode(rs("rewpunfile"))%>" maxlength="50">   
      </td>  
    </tr>  
    <tr>  
      <td width="82" align="center"><b>奖惩类型</b></td>  
      <td bgcolor="#FFFFFF" width="177"><input type="text" name="rewpunsort" size=22 value="<%=server.htmlencode(rs("rewpunsort"))%>" maxlength="50">  
      </td>  
      <td width="94" align="center"><b>奖惩方式</b></td>  
      <td bgcolor="#FFFFFF" width="163"><input type="text" name="rewpuntype" size=20 value="<%=server.htmlencode(rs("rewpuntype"))%>" maxlength="50">   
      </td>  
    </tr>  
    <tr>  
      <td width="82" align="center"><b>奖惩原因<br>  
        备注说明</b></td>  
      <td colspan="3" width="438" bgcolor="#FFFFFF"><textarea rows="6" name="remark" cols="59"><%=server.htmlencode(rs("remark"))%></textarea>  
      </td>  
    </tr>  
  </table>  
<br>  
<input type="hidden" name="userdept" value="<%=request.form("userdept")%>">  
<input type="hidden" name="username" value="<%=request.form("username")%>">  
<input type="hidden" name="id" value=<%=request.form("id")%>>  
<input type="submit" name="submit" value="修改">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="submit" value="删除" onclick="return window.confirm('你确定要删除这条变动记录吗?')">  
</form>  
</center>  
<%  
		else
			response.write("<center><br><br><font color=""#ee0000"" size=""+1"">对不起,该条奖惩档案信息已经被删除!</font><br><br></center>")
		end if
	end if  
end if  
%>
         </td>
            
          <td background="<%=imgpath%>images/j5.gif" width=19 height=280></td>
          </tr>
        </table>
    </tr>
    <tr>
      <td height=19>
        <table border="0" cellpadding="0" cellspacing="0" width="610" height="19">
          <tr>
            
          <td width=18 height=20><img border="0" src="<%=imgpath%>images/j6.gif" width="18" height="19"></td>
            
          <td background="<%=imgpath%>images/j7.gif" width=100% height=20></td>
            
          <td width="19" height="20"><img border="0" src="<%=imgpath%>images/j8.gif"></td>
          </tr>
		  <tr>
          <td width="100%" height=20 colspan="3"><center>-----<a href="http://office.11k.net/" target=_blank><font color="red">Red office v1.5</font></a>-----</center></td>
		  </tr>
        </table>
      </td>
    </tr>
  </table>
<%  
conn.close  
set conn=nothing  
%>  
</body>  
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -