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

📄 jgsetup_delupd.asp

📁 用C++编写的人事管理系统
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<%  
seljgid=trim(Request.Form("seljgid"))'flName是多选框的名称
deleteorupdate=Request.Form("deleteorupdate")
if deleteorupdate="deletetozhan" then
  if seljgid<>"" then
       seljgid=split(seljgid,",")
	set rs=server.createobject("adodb.recordset")
       for i=0 to ubound(seljgid)
		        sql="select * from jg where id=" & seljgid(i)
				 rs.open sql,conn,1,2
				 if rs.eof then
 	response.write "<script language=JavaScript>{window.alert('所选记录中有不存在或已被删除的记录,请按“确定”返回后“刷新”页面!');window.history.go(-1);}</script>"
  response.end
   end if
				 rs("isdeletetozhan")="是"
				 rs.update
				 rs.close
				next
				 response.write "<script language=JavaScript>{window.alert('成功地把所选记录删除到回收站,请按“确定”返回!');window.history.go(-1);}</script>"
  end if 
   response.end
 end if
 
 if deleteorupdate="deleteoutzhan" then
  if seljgid<>"" then
       seljgid=split(seljgid,",")
	set rs=server.createobject("adodb.recordset")
       for i=0 to ubound(seljgid)
		        sql="select * from jg where id=" & seljgid(i)
				 rs.open sql,conn,1,2
				  if rs.eof then
 	response.write "<script language=JavaScript>{window.alert('所选记录中有不存在或已被删除的记录,请按“确定”返回后“刷新”页面!');window.history.go(-1);}</script>"
  response.end
   end if
				 rs("isdeletetozhan")="否"
				 rs.update
				 rs.close
				next
				  response.write "<script language=JavaScript>{window.alert('成功地把所选记录从回收站中恢复成正式教工,请按“确定”返回!');window.history.go(-1);}</script>"
  end if 
   response.end
 end if

if deleteorupdate="deletforever" then
    if seljgid<>"" then
        seljgid=split(seljgid,",")
		 for i=0 to ubound(seljgid) 
	   set rsimg=server.createobject("adodb.recordset")
	    sqldelimg="select * from jg where id=" & seljgid(i)
		rsimg.open sqldelimg,conn,1,3
		 if rsimg.eof then
 	response.write "<script language=JavaScript>{window.alert('所选记录中有不存在或已被删除的记录,请按“确定”返回后“刷新”页面!');window.history.go(-1);}</script>"
  response.end
   end if
		img=rsimg("img")
		if img<>"" then
		set DelObj=Server.CreateObject("Scripting.FileSystemObject")
 filepath="upload/"&img
  Delpath=server.mappath(filepath)
 if DelObj.FileExists(Delpath) then
 set DelFi=DelObj.getfile(Delpath)
 DelFi.Delete
 set Delobj=nothing
 end if
 end if
 set rsde=server.createobject("adodb.recordset")
    s="select * from jg where id=" & seljgid(i)
				rsde.open s,conn,1,2
				session("jg_name")=rsde("name")
				session("jg_login")=rsde("login")
				rsde.delete
				 '-----------------------***************
	  ip111 = Request.ServerVariables("HTTP_X_FORWARDED_FOR") ' 代理IP
ip222 =Request.ServerVariables("REMOTE_ADDR") 
if ip111 = "" then
ipupdate = ip222
else
ipupdate = ip111
end if
jgpcname=Request.ServerVariables("HTTP_USER_AGENT")
sql_jgupddiary="select * from deljgdiary"
set rs_jgupddiary=server.CreateObject("adodb.recordset")
rs_jgupddiary.open sql_jgupddiary,conn,1,2
rs_jgupddiary.addnew     
      rs_jgupddiary("jg_login")=session("jg_login")
	  rs_jgupddiary("jg_name")=session("jg_name") '教工姓名
      rs_jgupddiary("lastupduser")=session("adminlogin")
      rs_jgupddiary("lastupdname")=session("adminname")
      rs_jgupddiary("lastupddate")=now
      rs_jgupddiary("lastupdip")=ipupdate
	  rs_jgupddiary("os")=jgpcname
      rs_jgupddiary.update
	  rs_jgupddiary.close
	  set rs_jgupddiary=nothing
	  '------------------------------********************
						next	
			response.Write "<script language=javascript>{window.alert('恭喜您,该教工的资料和相片全部成功删除');window.history.go(-1);}</script>"
  end if   
   response.end
  end if

if deleteorupdate="update" then
  if seljgid<>"" then
       seljgid=split(seljgid,",")
	set rs=server.createobject("adodb.recordset")
       for i=0 to ubound(seljgid)
		        sql="select * from jg where id=" & seljgid(i)
				 rs.open sql,conn,1,2
				  if rs.eof then
 	response.write "<script language=JavaScript>{window.alert('所选记录中有不存在或已被删除的记录,请按“确定”返回后“刷新”页面!');window.history.go(-1);}</script>"
  response.end
   end if
				 rs("isupdate")="是"
				 rs.update
				 rs.close
				next
				response.write "<script language=JavaScript>{window.alert('成功地为所选教工设定了“修改权”,请按“确定”返回!');window.history.go(-1);}</script>"
  end if 
   response.end
 end if
 
 if deleteorupdate="updateno" then
  if seljgid<>"" then
       seljgid=split(seljgid,",")
	set rs=server.createobject("adodb.recordset")
       for i=0 to ubound(seljgid)
		        sql="select * from jg where id=" & seljgid(i)
				 rs.open sql,conn,1,2
				  if rs.eof then
 	response.write "<script language=JavaScript>{window.alert('所选记录中有不存在或已被删除的记录,请按“确定”返回后“刷新”页面!');window.history.go(-1);}</script>"
  response.end
   end if
				 rs("isupdate")="否"
				 rs.update
				 rs.close
				next
				response.write "<script language=JavaScript>{window.alert('成功地取消了所选教工的“修改改权”,请按“确定”返回!');window.history.go(-1);}</script>"
  end if 
  response.end
 end if
 '---------------------
 uid=request("uid")
 if uid<>"" then
  %>
  <!--#include file="qyschar.asp" -->
  <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<form name="form1" method="post" action="#">
  <table width="98%" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#DBEEC4" bgcolor="#CDE7AD">

  <tr align="center" bgcolor="#CDE7AD">
    <td width="143" height="33" > <div align="center">姓名</div></td>
	<td width="204"><div align="center">登录名</div></td>
    <td width="215" class="style6"><div align="center">登录密码</div></td>
    <td width="177"><div align="center">被允许修改</div></td>
    </tr>
 <%
 set rslogin=server.createobject("adodb.recordset")
            sqllogin="select * from jg where id="&uid
				 rslogin.open sqllogin,conn,1,2
if rslogin.eof then
response.write "<script language=JavaScript>{window.alert('该记录不存在,可能已被删除,请按“确定”返回!');window.history.go(-1);}</script>"
response.end
end if 
%>
    <tr bgcolor="#CDE7AD">
      <td height="39" bgcolor="#CDE7AD">
          <div align="center">
        <input name="uuname" type="text" id="uuname" value="<%=rslogin("name")%>" size="10">
        </div>
      </div></td>
    <td >
      <div align="center">
        <input name="uulogin" type="text" id="uulogin" value="<%=rslogin("login")%>" size="15">
      </div></td>
    <td><div align="center">
      <input name="uupwd" type="text" id="uupwd" value="<%=oyfqj(rslogin("pwd"))%>" size="15">      
    </div></td>
    <td  ><div align="center">
      <select name="uuisupdate" id="uuisupdate">
        <option value="<%=rslogin("isupdate")%>"><%=rslogin("isupdate")%></option>
          <option value="是">是</option>
          <option value="否">否</option>
      </select>
    </div></td>
    </tr>
</table>
  <div align="center">
    <p>
      <input type="submit" name="Submit" value="修改资料">
    </p>
  </div>
</form>
<p>&nbsp;</p>
<p>&nbsp; </p>
</body>
</html>
<% 
rslogin.close
set rslogin=nothing
end if%>
<% 
 uuname=trim(request("uuname"))
 if uuname<>"" then
  uulogin=trim(request("uulogin"))
   uupwd=oyfqm(trim(request("uupwd")))
    uuisupdate=trim(request("uuisupdate"))
 set rslogin=server.createobject("adodb.recordset")
            sqllogin="select * from jg where id="&uid
				 rslogin.open sqllogin,conn,1,2
				 rslogin("name")=uuname
				 rslogin("login")=uulogin
				 rslogin("pwd")=uupwd
				 rslogin("isupdate")=uuisupdate
				 rslogin.update
rslogin.close
set rslogin=nothing
response.write "<script language=JavaScript>{window.alert('修改成功!请按“确定”返回!');window.history.go(-2);}</script>"
end if  
%>

⌨️ 快捷键说明

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