📄 cls_modify.asp
字号:
act = "update"
temp = Split(rowlst,",")
End If
rs.Close
Set rs = Nothing
sql = ""
For i=0 To Ubound(Split(rowlst,","))
values = Trim(Request.Form("CurWork_"&i))
If act = "insert" Then
If i = 3 Then
sql = sql & values & ","
Else
sql = sql & sys.SqlVar(values) & ","
End If
ElseIf act = "update" Then
If i = 3 Then
sql = sql & temp(i)&"="& values & ","
Else
sql = sql & temp(i)&"="& sys.SqlVar(values) & ","
End If
End If
Next
If Right(sql,1) = "," Then sql = Left(sql,Len(sql)-1)
If act = "insert" Then
sql = "INSERT INTO [CurrentWork]([UserID],"&rowlst&") VALUES("&UserID&","&sql&")"
ElseIf act = "update" Then
Erase temp
sql = "UPDATE [CurrentWork] SET "&sql&" WHERE [UserID]=" & UserID
End If
Conn.Execute(sql)
End Function
Public Function Save_WorkLive()
sys.CheckSubmit(True)
rowlst = "[UnitsName],[From],[To],[DeptJob],[Responsibility]"
Dim j,IDLst,section,nullcount
ReDim temp(5)
For i=0 To Ubound(temp)
temp(i) = Trim(Request.Form("WorLive_"&i))
Next
IDLst = Split(temp(Ubound(temp)),",")
section = Split(rowlst,",")
For i=0 To Ubound(IDLst)
sql = ""
nullcount = 0
IDLst(i) = Trim(IDLst(i))
If sys.IsNum(IDLst(i)) Then
For j=0 To Ubound(section)
values = Trim(Split(temp(j),",")(i))
sql = sql & section(j)&"="& sys.SqlVar(values) & ","
If sys.ChkEmpty(values) Then
nullcount = nullcount + 1
End If
Next
If Right(sql,1) = "," Then sql = Left(sql,Len(sql)-1)
sql = "UPDATE [WorkLive] SET "&sql&" WHERE [ID]=" & IDLst(i)
If nullcount = Ubound(temp) Then
sql = "DELETE FROM [WorkLive] WHERE [ID]=" & IDLst(i)
End If
Conn.Execute(sql)
ElseIf IDLst(i) = "new" Then
For j=0 To Ubound(section)
values = Trim(Split(temp(j),",")(i))
sql = sql & sys.SqlVar(values) & ","
If sys.ChkEmpty(values) Then
nullcount = nullcount + 1
End If
Next
If Right(sql,1) = "," Then sql = Left(sql,Len(sql)-1)
sql = "INSERT INTO [WorkLive]([UserID],"&rowlst&") VALUES("&UserID&","&sql&")"
If nullcount <> Ubound(temp) Then
Conn.Execute(sql)
End If
End If
Next
Erase section
Erase IDLst
Erase temp
End Function
Public Function Save_BringUpLive()
sys.CheckSubmit(True)
rowlst = "[CoursesName],[From],[To],[Certificate],[Organization]"
Dim j,IDLst,section,nullcount
ReDim temp(5)
For i=0 To Ubound(temp)
temp(i) = Trim(Request.Form("BriLive_"&i))
Next
IDLst = Split(temp(Ubound(temp)),",")
section = Split(rowlst,",")
For i=0 To Ubound(IDLst)
sql = ""
nullcount = 0
IDLst(i) = Trim(IDLst(i))
If sys.IsNum(IDLst(i)) Then
For j=0 To Ubound(section)
values = Trim(Split(temp(j),",")(i))
sql = sql & section(j)&"="& sys.SqlVar(values) & ","
If sys.ChkEmpty(values) Then
nullcount = nullcount + 1
End If
Next
If Right(sql,1) = "," Then sql = Left(sql,Len(sql)-1)
sql = "UPDATE [BringUpLive] SET "&sql&" WHERE [ID]=" & IDLst(i)
If nullcount = Ubound(temp) Then
sql = "DELETE FROM [BringUpLive] WHERE [ID]=" & IDLst(i)
End If
Conn.Execute(sql)
ElseIf IDLst(i) = "new" Then
For j=0 To Ubound(section)
values = Trim(Split(temp(j),",")(i))
sql = sql & sys.SqlVar(values) & ","
If sys.ChkEmpty(values) Then
nullcount = nullcount + 1
End If
Next
If Right(sql,1) = "," Then sql = Left(sql,Len(sql)-1)
sql = "INSERT INTO [BringUpLive]([UserID],"&rowlst&") VALUES("&UserID&","&sql&")"
If nullcount <> Ubound(temp) Then
Conn.Execute(sql)
End If
End If
Next
Erase section
Erase IDLst
Erase temp
End Function
Public Function Save_JobPurpose()
sys.CheckSubmit(True)
rowlst = "[Job],[ExpectPay],[JobProperty],[OnDutyTime]"
Dim j,IDLst,section,nullcount
ReDim temp(4)
For i=0 To Ubound(temp)
temp(i) = Trim(Request.Form("JobPur_"&i))
Next
IDLst = Split(temp(Ubound(temp)),",")
section = Split(rowlst,",")
For i=0 To Ubound(IDLst)
sql = ""
nullcount = 0
IDLst(i) = Trim(IDLst(i))
If sys.IsNum(IDLst(i)) Then
For j=0 To Ubound(section)
values = Trim(Split(temp(j),",")(i))
sql = sql & section(j)&"="& sys.SqlVar(values) & ","
If sys.ChkEmpty(values) Then
nullcount = nullcount + 1
End If
Next
If Right(sql,1) = "," Then sql = Left(sql,Len(sql)-1)
sql = "UPDATE [JobPurpose] SET "&sql&" WHERE [ID]=" & IDLst(i)
If nullcount = Ubound(temp) Then
sql = "DELETE FROM [JobPurpose] WHERE [ID]=" & IDLst(i)
End If
Conn.Execute(sql)
ElseIf IDLst(i) = "new" Then
For j=0 To Ubound(section)
values = Trim(Split(temp(j),",")(i))
sql = sql & sys.SqlVar(values) & ","
If sys.ChkEmpty(values) Then
nullcount = nullcount + 1
End If
Next
If Right(sql,1) = "," Then sql = Left(sql,Len(sql)-1)
sql = "INSERT INTO [JobPurpose]([UserID],"&rowlst&") VALUES("&UserID&","&sql&")"
If nullcount <> Ubound(temp) Then
Conn.Execute(sql)
End If
End If
Next
Erase section
Erase IDLst
Erase temp
End Function
Public Function Save_OtherCert()
sys.CheckSubmit(True)
rowlst = "[OtherCertificate],[GetTime]"
Dim j,IDLst,section,nullcount
ReDim temp(2)
For i=0 To Ubound(temp)
temp(i) = Trim(Request.Form("Cert_"&i))
Next
IDLst = Split(temp(Ubound(temp)),",")
section = Split(rowlst,",")
For i=0 To Ubound(IDLst)
sql = ""
nullcount = 0
IDLst(i) = Trim(IDLst(i))
If sys.IsNum(IDLst(i)) Then
For j=0 To Ubound(section)
values = Trim(Split(temp(j),",")(i))
sql = sql & section(j)&"="& sys.SqlVar(values) & ","
If sys.ChkEmpty(values) Then
nullcount = nullcount + 1
End If
Next
If Right(sql,1) = "," Then sql = Left(sql,Len(sql)-1)
sql = "UPDATE [OtherCert] SET "&sql&" WHERE [ID]=" & IDLst(i)
If nullcount = Ubound(temp) Then
sql = "DELETE FROM [OtherCert] WHERE [ID]=" & IDLst(i)
End If
Conn.Execute(sql)
ElseIf IDLst(i) = "new" Then
For j=0 To Ubound(section)
values = Trim(Split(temp(j),",")(i))
sql = sql & sys.SqlVar(values) & ","
If sys.ChkEmpty(values) Then
nullcount = nullcount + 1
End If
Next
If Right(sql,1) = "," Then sql = Left(sql,Len(sql)-1)
sql = "INSERT INTO [OtherCert]([UserID],"&rowlst&") VALUES("&UserID&","&sql&")"
If nullcount <> Ubound(temp) Then
Conn.Execute(sql)
End If
End If
Next
Erase section
Erase IDLst
Erase temp
End Function
Public Function Save_SkillInfo()
sys.CheckSubmit(True)
rowlst = "[OnesStrongSuit],[Language],[ITSkill],[SelfEvaluate],[StateAtSchool],[Remark]"
sql = "SELECT [UserID] FROM [SkillInfo] WHERE [UserID]=" & UserID
Set rs = Conn.Execute(sql)
If rs.Eof And rs.Bof Then
act = "insert"
Else
act = "update"
temp = Split(rowlst,",")
End If
rs.Close
Set rs = Nothing
sql = ""
For i=0 To Ubound(Split(rowlst,","))
values = Trim(Request.Form("Ski_"&i))
If act = "insert" Then
sql = sql & sys.SqlVar(values) & ","
ElseIf act = "update" Then
sql = sql & temp(i)&"="& sys.SqlVar(values) & ","
End If
Next
If Right(sql,1) = "," Then sql = Left(sql,Len(sql)-1)
If act = "insert" Then
sql = "INSERT INTO [SkillInfo]([UserID],"&rowlst&") VALUES("&UserID&","&sql&")"
ElseIf act = "update" Then
Erase temp
sql = "UPDATE [SkillInfo] SET "&sql&" WHERE [UserID]=" & UserID
End If
Conn.Execute(sql)
End Function
Public Function Release()
act = LCase(Trim(Request.QueryString("type")))
If act = "0" Then
sql = "UPDATE [User] SET [ReleaseTime]=NULL WHERE [ID]=" & UserID
Conn.Execute(sql)
sys.ShowMsg "你的简历已经取消发布。","modify.asp?action=modify",""
sys.Abort()
ElseIf act = "1" Then
sql = "UPDATE [User] SET [ReleaseTime]='"&Now()&"' WHERE [ID]=" & UserID
Conn.Execute(sql)
sys.ShowMsg "你的简历发布成功。","modify.asp?action=modify",""
sys.Abort()
End If
sys.Go "modify.asp?action=modify",301
End Function
Public Function uploadPhoto()
Response.Expires = -9999
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "cache-ctrol","no-cache"
Dim upload,fileContent,f,allowable,AddJS
act = LCase(Trim(Request.QueryString("type")))
If act = "save" Then
allowable = "|image/pjpeg|image/gif|image/bmp|image/x-png|"
AddJS = "try{parent.document.getElementById('submitbut').disabled=false;}catch(e){}"
Set upload = New DoteyUpload
upload.MaxTotalBytes = 60 * 1024
upload.Upload()
If Request.TotalBytes > 60 * 1024 Then
sys.ShowMsg "不能上传超过 60K 的文件。","back:off",AddJS
Set upload = Nothing
Exit Function
End If
If upload.Files.Count < 1 Then
sys.ShowMsg "请选择上传的相片。","back:off",AddJS
Set upload = Nothing
Exit Function
End If
If sys.ChkEmpty(upload.ErrMsg) Then
Set f = upload.Files("photo")
If InStr(allowable,"|"&LCase(Trim(f.FileType))&"|") <= 0 Then
sys.ShowMsg "错误:只能上传jpg、gif、bmp、png格式图片。","back:off",AddJS
ElseIf f.FileSize <= 0 Then
sys.ShowMsg "错误:图片大小无效。","back:off",AddJS
Else
fileContent = f.GetBinary()
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT [UserID],[Photo] FROM [BasicInfo] WHERE [UserID]=" & UserID
rs.Open sql,Conn,1,2
If rs.Eof And rs.Bof Then
rs.AddNew
rs("UserID") = UserID
End If
rs("Photo") = fileContent
rs.Update
rs.Close
Set rs = Nothing
sys.ShowMsg "上传相片成功。","back:off","try{parent.window.close();}catch(e){}"
End If
Set f = Nothing
Else
sys.ShowMsg "上传过程中出现错误:\n\n"&Upload.ErrMsg,"back:off",AddJS
End If
Set upload = Nothing
Exit Function
End If
rp.HeadMode = 1
rp.Head("上传相片")
%>
<div id="upload_photo">
<div class="title">上传相片</div>
<div class="main">
<iframe src="about:blank" name="submitfrm" id="submitfrm" style="display:none"></iframe>
<div class="tip">提示:只能上传jpg、gif、bmp、png格式图片,尺寸134*160以上,大小不能超过60K。</div>
<form action="modify.asp?action=uploadPhoto&type=save" method="post" enctype="multipart/form-data" target="submitfrm" onsubmit="document.getElementById('submitbut').disabled=true;">
选择相片:<input type="file" name="photo" id="photo" size="35" />
<div class="submit"><input type="submit" id="submitbut" value="上 传" /> <input type="button" value="取 消" onClick="window.close();" /></div>
</form>
</div>
</div>
<%
rp.Foot()
rp.HeadMode = 0
End Function
End Class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -