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

📄 onequeryhr.asp

📁 绿叶办公自动化系统
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT"%>
<%  
Response.ExpiresAbsolute=now()-1
Response.CacheControl="no-cache"
%>
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers=""
MM_authFailedURL="../../../index.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
  If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
         (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
    MM_grantAccess = true
  End If
End If
If Not MM_grantAccess Then
  MM_qsChar = "?"
  If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
  MM_referrer = Request.ServerVariables("URL")
  if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
  MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
  Response.Redirect(MM_authFailedURL)
End If
%>
<!--#include file="lib.asp" -->
<!--#include file="../../../Connections/oavbsconn.asp" -->
<%
Dim levels__MMColParam
levels__MMColParam = "1"
If (Session("names")  <> "") Then 
  levels__MMColParam = Session("names") 
End If
%>
<%
Dim levels
Dim levels_numRows
Set levels = Server.CreateObject("ADODB.Recordset")
levels.ActiveConnection = MM_oavbsconn_STRING
levels.Source = "SELECT 姓名,操作名称  FROM levelssdfgsfgtrgrthe5fgbdnjyu76  WHERE 姓名 = '" + Replace(levels__MMColParam, "'", "''") + "' and 操作名称='导出人事档案数据'"
levels.CursorType = 0
levels.CursorLocation = 2
levels.LockType = 1
levels.Open()
levels_numRows = 0
%>
<%if not levels.eof or not levels.bof then%>


<%
Dim rs__c
rs__c = "1"
If (request("c") <> "") Then 
  rs__c = request("c")
End If
%>
<%
Dim rs
Dim rs_numRows

Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_oavbsconn_STRING
rs.Source = "SELECT *  FROM 用户基本自资料vfsrgftvrtrefverfcadfc  WHERE 编号 like'%" + Replace(rs__c, "'", "''") + "%' or 姓名 like'%" + Replace(rs__c, "'", "''") + "%'or 曾用名 like'%" + Replace(rs__c, "'", "''") + "%'or 性别 like'%" + Replace(rs__c, "'", "''") + "%'or 出生日期 like'%" + Replace(rs__c, "'", "''") + "%'or 婚姻状况 like'%" + Replace(rs__c, "'", "''") + "%'or 身高 like'%" + Replace(rs__c, "'", "''") + "%'or 户口所在地 like'%" + Replace(rs__c, "'", "''") + "%'or 民族 like'%" + Replace(rs__c, "'", "''") + "%'or 体重 like'%" + Replace(rs__c, "'", "''") + "%'or 政治面貌 like'%" + Replace(rs__c, "'", "''") + "%'or 身份证号 like'%" + Replace(rs__c, "'", "''") + "%'or 健康状况 like'%" + Replace(rs__c, "'", "''") + "%'or 血型 like'%" + Replace(rs__c, "'", "''") + "%' or 手机 like'%" + Replace(rs__c, "'", "''") + "%' or 电子邮件 like'%" + Replace(rs__c, "'", "''") + "%'or 毕业学校 like'%" + Replace(rs__c, "'", "''") + "%'or 专业 like'%" + Replace(rs__c, "'", "''") + "%'or 学历 like'%" + Replace(rs__c, "'", "''") + "%'or 毕业日期 like'%" + Replace(rs__c, "'", "''") + "%'or 外语语种 like'%" + Replace(rs__c, "'", "''") + "%'or 外语水平 like'%" + Replace(rs__c, "'", "''") + "%'or 获得证书外语 like'%" + Replace(rs__c, "'", "''") + "%'or 学位 like'%" + Replace(rs__c, "'", "''") + "%'or 计算机水平 like'%" + Replace(rs__c, "'", "''") + "%'or 获得证书计算机 like'%" + Replace(rs__c, "'", "''") + "%'or 计算机擅长 like'%" + Replace(rs__c, "'", "''") + "%'or 家庭地址 like'%" + Replace(rs__c, "'", "''") + "%'or 邮编家庭 like'%" + Replace(rs__c, "'", "''") + "%'or 家庭电话 like'%" + Replace(rs__c, "'", "''") + "%'or 普通话水平 like'%" + Replace(rs__c, "'", "''") + "%'or 现住址 like'%" + Replace(rs__c, "'", "''") + "%'or 邮编现住址 like'%" + Replace(rs__c, "'", "''") + "%'or 目前电话 like'%" + Replace(rs__c, "'", "''") + "%' or 家庭情况 like'%" + Replace(rs__c, "'", "''") + "%'or 档案存放地 like'%" + Replace(rs__c, "'", "''") + "%'or 职称 like'%" + Replace(rs__c, "'", "''") + "%'or 本单位工龄 like'%" + Replace(rs__c, "'", "''") + "%'or 累计工龄 like'%" + Replace(rs__c, "'", "''") + "%'or 部门 like'%" + Replace(rs__c, "'", "''") + "%'or 职务 like'%" + Replace(rs__c, "'", "''") + "%'or 何时开始参加工作 like'%" + Replace(rs__c, "'", "''") + "%'or 录入人 like'%" + Replace(rs__c, "'", "''") + "%'or 添加该记录所使用的帐号 like'%" + Replace(rs__c, "'", "''") + "%' or 添加该记录所使用的帐号人部门 like'%" + Replace(rs__c, "'", "''") + "%' or 添加该记录所使用的帐号人姓名 like'%" + Replace(rs__c, "'", "''") + "%' or 添加时间 like'%" + Replace(rs__c, "'", "''") + "%' or 添加IP like'%" + Replace(rs__c, "'", "''") + "%' or 添加日期 like'%" + Replace(rs__c, "'", "''") + "%'or 何时到本单位工作 like'%" + Replace(rs__c, "'", "''") + "%'or 备注 like'%" + Replace(rs__c, "'", "''") + "%' or 照片名 like'%" + Replace(rs__c, "'", "''") + "%' or 照片大小 like'%" + Replace(rs__c, "'", "''") + "%'  ORDER BY 更新时间 desc,添加时间 desc"
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()

rs_numRows = 0
%>
<%
Dim userpath__MMColParam
userpath__MMColParam = "1"
If (Session("userssdfgfhtrh") <> "") Then 
  userpath__MMColParam = Session("userssdfgfhtrh")
End If
%>
<%
Dim userpath
Dim userpath_numRows

Set userpath = Server.CreateObject("ADODB.Recordset")
userpath.ActiveConnection = MM_oavbsconn_STRING
userpath.Source = "SELECT oneselffolder356u47646u4ty,pathaccess  FROM usertertggbng  WHERE usersdsfg56 = '" + Replace(userpath__MMColParam, "'", "''") + "'"
userpath.CursorType = 0
userpath.CursorLocation = 2
userpath.LockType = 1
userpath.Open()

userpath_numRows = 0
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

Dim rs_total
Dim rs_first
Dim rs_last

' set the record count
rs_total = rs.RecordCount

' set the number of rows displayed on this page
If (rs_numRows < 0) Then
  rs_numRows = rs_total
Elseif (rs_numRows = 0) Then
  rs_numRows = 1
End If

' set the first and last displayed record
rs_first = 1
rs_last  = rs_first + rs_numRows - 1

' if we have the correct record count, check the other stats
If (rs_total <> -1) Then
  If (rs_first > rs_total) Then
    rs_first = rs_total
  End If
  If (rs_last > rs_total) Then
    rs_last = rs_total
  End If
  If (rs_numRows > rs_total) Then
    rs_numRows = rs_total
  End If
End If
%>

<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (rs_total = -1) Then

  ' count the total records by iterating through the recordset
  rs_total=0
  While (Not rs.EOF)
    rs_total = rs_total + 1
    rs.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (rs.CursorType > 0) Then
    rs.MoveFirst
  Else
    rs.Requery
  End If

  ' set the number of rows displayed on this page
  If (rs_numRows < 0 Or rs_numRows > rs_total) Then
    rs_numRows = rs_total
  End If

  ' set the first and last displayed record
  rs_first = 1
  rs_last = rs_first + rs_numRows - 1
  
  If (rs_first > rs_total) Then
    rs_first = rs_total
  End If
  If (rs_last > rs_total) Then
    rs_last = rs_total
  End If

End If
%>

<%fname1 = makefilename(now())

fname =request("name")&"查询导出用户档案"&fname1&".xls"
 q=userpath("oneselffolder356u47646u4ty")
p="/dataandfiles/files/u/"&q&"/"&fname
p1="/dataandfiles/files/u/"&q
%>
<%
 Dim objFSO1q
  Set objFSO1q= Server.CreateObject("Scripting.FileSystemObject")
  If  objFSO1q.FolderExists(Server.MapPath(p1))   Then   
Else   
objFSO1q.CreateFolder(Server.MapPath(p1))
Set objFSO1q = Nothing   
end if   '释放 FileSystemObject 对象实例内存空间
%>

<%  on error resume next
dim  rstCount,rstField    
rstCount=rs.recordcount'记录行数  
rstField=rs.fields.count'记录列数  
rstCount=rs_total
 'response.write rstCount 
 
dim  oExcel,sCellValue,Path    
Set  oExcel  =  Server.CreateObject("OWC.Spreadsheet")    
 
dim  Line,Column  
Line=1  
 
'写入列名  
For  Column=0  to  rstField-1    
       sCellValue=rs.fields(Column).name'列名  
       sCellValue=sCellValue&""  
       oExcel.Cells(Line,Column+1)=  sCellValue  '第一行的第几列,列是循环的,行不变。  
Next    
 
'写入记录,从第二行开始先行后列的写入表中  
For  Line=2  to  rstcount+1  
       For  Column=0  to  rstField-1    
               sCellValue=rs.fields(Column)  
               sCellValue=sCellValue&""  
               oExcel.Cells(Line,Column+1)=  sCellValue  
       Next    
rs.movenext  
Next    
'这行不知道干什么  
For  Column  =  1  to  rstField  
       oExcel.Columns(Column).AutoFitColumns    
Next  
 
'设置Excel表里的字体  
Column  =  1    
Do  While  Column  <=  rstField    
       oExcel.Cells(1,  Column).Font.Bold  =  True    
       oExcel.Cells(1,  Column).Font.Italic  =  False  
       oExcel.Cells(1,  Column).Font.Size  =  16    
       Column  =  Column  +  1    
Loop    
 
'输出该表  
Path=Server.MapPath(fname)  
'Path=Server.MapPath("Caseinfo.xls")    
  
oExcel.ActiveSheet.Export  Path,  0    
%>
<%
if err.number<>0 then%>
<script language="javascript">
{
alert("服务器未安装office 2000软件,无法生成excel文件。office 2003 将无法在本系统导出数据。");history.go(-1)
}

</script>
<%response.end 
end if%>

<link href="../../../css/link1.css" rel="stylesheet" type="text/css">

<style type="text/css">
<!--
.style1 {font-size: 12px}
-->
</style>
<br/>   






 
<img src="../../../img/xls.gif" width="18" height="18">
<!--#include file="copy.asp" -->
<a  href=re.asp?u=<%=p%> target=_blank><%=fname%></a> <span class="style1">&nbsp;<%=s1%>  导出成功,该excel表格已经保存到您的文件夹里,</span><a href="../../../f/asp/filesupadmin/jieshouselffilessdfghfg.asp">点击访问</a>   <a href="javascript:history.go(-1)">返回</a><br/> 


<%
rs.Close()
Set rs = Nothing
%>
<%
userpath.Close()
Set userpath = Nothing
%><%
levels.Close()
Set levels = Nothing
%>
<%else%>
<%
levels.Close()
Set levels = Nothing
%>
<%
response.write"<script>alert('"&Session("names")&"很抱歉,您没有导出人事档案的权限。');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>"
%>
<%response.end()
end if%>

⌨️ 快捷键说明

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