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

📄 editpersoninfindb.asp

📁 一套简单的OA系统
💻 ASP
字号:
<%response.expires=0%>
<!--#INCLUDE FILE="asp/fupload.inc"-->
<!--#include file="asp/sqlstr.asp"-->
<!--#include file="asp/bgsub.asp"-->
<!--#include file="asp/opendb.asp"-->
<%
'-----------------------------------------
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>企业办公自动化IE37-OA系统</title>
</head>
<body bgcolor="#ffffff" topmargin="5" leftmargin="5">
 
<center>
<table align="center">
<tr>
<td>
<b>编辑<%=oabusyname%>的个人基本档案</b>&nbsp;&nbsp;
</td><form method="post" action="personinfo.asp"><td>
<input type="submit" value="返回">
</td>
</tr>
</table>
</center>
<%
 
dim a(33)
if Request.ServerVariables("REQUEST_METHOD") = "POST" Then
'---------------------------
'取得发送的数据
'---------------------------
	Dim Fields
	UploadSizeLimit=100000
	Set Fields = GetUpload()
	if Fields is nothing then
		response.write("<script language=""javascript"">")
		response.write("alert(""对不起,您上传的相片太大,不能超过50KB,请返回重传!"");")
		response.write("history.go(-1);")
		response.write("</script>")
		response.end
	end if
	dim Field
	For Each Field In Fields.Items
		select case Field.name
			case "a1" a(1)=BinaryToString(Field.value)
			case "a2" a(2)=BinaryToString(Field.value)
			case "a3" a(3)=BinaryToString(Field.value)
			case "a4" a(4)=BinaryToString(Field.value)
			case "a5" a(5)=BinaryToString(Field.value)
			case "a6" a(6)=BinaryToString(Field.value)
			case "a7" a(7)=BinaryToString(Field.value)
			case "a8" a(8)=BinaryToString(Field.value)
			case "a9" a(9)=BinaryToString(Field.value)
			case "a10" a(10)=BinaryToString(Field.value)
			case "a11" a(11)=BinaryToString(Field.value)
			case "a12" a(12)=BinaryToString(Field.value)
			case "a13" a(13)=BinaryToString(Field.value)
			case "a14" a(14)=BinaryToString(Field.value)
			case "a15" a(15)=BinaryToString(Field.value)
			case "a16" a(16)=BinaryToString(Field.value)
			case "a17" a(17)=BinaryToString(Field.value)
			case "a18" a(18)=BinaryToString(Field.value)
			case "a19" a(19)=BinaryToString(Field.value)
			case "a20" a(20)=BinaryToString(Field.value)
			case "a21" a(21)=BinaryToString(Field.value)
			case "a22" a(22)=BinaryToString(Field.value)
			case "a23" a(23)=BinaryToString(Field.value)
			case "a24" a(24)=BinaryToString(Field.value)
			case "a25" a(25)=BinaryToString(Field.value)
			case "a26" a(26)=BinaryToString(Field.value)
			case "a27" a(27)=BinaryToString(Field.value)
			case "a28" a(28)=BinaryToString(Field.value)
			case "a29" a(29)=BinaryToString(Field.value)
			case "a30" a(30)=BinaryToString(Field.value)
			case "a31" a(31)=BinaryToString(Field.value)
			case "a32" a(32)=BinaryToString(Field.value)
			case "a33" a(33)=BinaryToString(Field.value)
			case "submit" submit=BinaryToString(Field.value)
			case "file1"
				filename=field.FileName
				fileContentType=field.ContentType
				filevalue=field.value
		end select
	next
	'-------------------
	'判断是输入还是修改
	'------------------
	if submit="输入" then
		'---------------
		'判断是否是照片
		'---------------
		if filename<>"" and fileContentType<>"image/gif" and fileContentType<>"image/pjpeg" then
%>
<center>
<br><br>
<font color=red size=3>上传的照片应该为GIF或JPG文件!</font><br><br>
<input type="button" value="重填" onclick="history.go( -1 );return true;">
</center> 
<%
		else
			'------------
			'开始输入
			'-----------
			set conn=opendb("oabusy","conn","accessdsn")
			set rs=server.createobject("ADODB.recordset") 
			sql = "select * from personinf"
			rs.Open sql,conn,1,3
			rs.addnew
			rs("username")=oabusyusername
			for i=1 to 33
				rs("a" & i)=a(i)
			next
			if filename<>"" then
				rs("havephoto")="yes"
				rs("photo").appendchunk filevalue
			end if
			rs.update 
			rs.close 
			conn.close
			set rs=nothing 
			set conn=nothing 
%>
<br><br>
<center><font color=red size=3>成功输入个人基本档案!</font><br><br><form method="post" action="personinfo.asp"><input type="submit" value="返回"></form>
</center>
<%
		end if
	else
	'---------------
	'判断是否是照片
	'---------------
		if filename<>"" and fileContentType<>"image/gif" and fileContentType<>"image/pjpeg" then
%>
<center>
<br><br>
<font color=red size=3>上传的照片应该为GIF或JPG文件!</font><br><br>
<input type="button" value="重填" onclick="history.go( -1 );return true;">
</center> 
<%
		else
			'------------
			'开始修改
			'-----------
			set conn=opendb("oabusy","conn","accessdsn")
			set rs=server.createobject("ADODB.recordset") 
			sql = "select * from personinf where username=" & sqlstr(oabusyusername)
			rs.Open sql,conn,1,3
			on error resume next
			for i=1 to 33
				rs("a" & i)=a(i)
			response.write(err.description)
			next
			if filename<>"" then
				rs("havephoto")="yes"
				rs("photo").appendchunk filevalue
			end if
			rs("updatedate")=now()
			rs.update 
			rs.close 
			conn.close
			set rs=nothing 
			set conn=nothing 
%>
<br><br>
<center><font color=red size=3>成功修改个人基本档案!</font><br><form method="post" action="personinfo.asp"><input type="submit" value="返回"></form>
</center>
<%
		end if
	end if
end if
%>
<div align="center">
  <center>
  <table>
    <tr>
      <td height=19>
        <table border="0" cellpadding="0" cellspacing="0" width="610" height="19">
		  <tr>
          <td width="100%" height=20><p align="center"><font color="#808080">IE37 &copy; <a href="http://www.ie37.com" target="_blank">IE37.com</a></font></td> 
		  </tr>
        </table>
      </td>
    </tr>
<%
%>
  </table>
  </center>
</div>
</body>

⌨️ 快捷键说明

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