📄 list.asp
字号:
<!--#include file="../config.asp"-->
<!--#include file="../inc/check_login.asp"-->
<!--#include file="../inc/functions.asp"-->
<%
Application_ID = 4000100 '本功能编号,含义请查看编码表
if not CheckAuth(Session("Employee_ID"),Application_ID) then '验证权限
Server.Transfer "../err/un_authorized.htm"
response.end
end if
%>
<!--**************身份验证部分****************-->
<%
'用户条件
Document_Title = request("Document_Title")
Customer_ID = request("Customer_ID")
Project_ID = request("Project_ID")
Group_ID = request("Group_ID")
Add_Date_Min = request("Add_Date_Min")
Add_Date_Max = request("Add_Date_Max")
Employee_ID = request("Employee_ID")
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK rel="stylesheet" type="text/css" href="../style.css">
<script language="JavaScript" type="text/javascript" src="../js/functions.js"></script>
<script language="JavaScript" type="text/javascript">
//操作确认
function ConfirmOption(Employee_ID,Employee_Name){
if(<%= Session("Employee_ID") %> == 1 || Employee_ID == <%= Session("Employee_ID") %>){
if(confirm('您确定要修改/删除文档吗?')){
return true;
}else{
return false;
}
}else{
alert('警告!您不是该文档的录入者,请联系 ' + Employee_Name + ' 进行修改/删除。');
return false;
}
}
//改变文档组
function chg_grp(Group_ID){
location.href = 'list.asp?Group_ID='+Group_ID+'&Document_Title=<%= Document_Title %>&Customer_ID=<%= Customer_ID %>&Project_ID=<%= Project_ID %>&Add_Date_Min=<%= Add_Date_Min %>&Add_Date_Max=<%= Add_Date_Max %>&Employee_ID=<%= Employee_ID %>';
}
</script>
</head>
<body>
<form action="list.asp" method="post" name="frm">
<table width="100%" border=0 cellpadding=0 cellspacing=0>
<tr>
<td width="96%">◆<a href="search.asp" target="foot">文档查询</a> ◆<a href="new.asp" target="foot">录入新文档</a></td>
<td width="1%"><nobr>文档名称:</nobr></td>
<td width="1%"><input type="text" name="Document_Title" value="<%= Document_Title %>" size="20" maxlength="255"></td>
<td width="1%"><input type="submit" name="Submit" value="快速查询"></td>
<td width="1%">
<select name="Group_ID" size="1" onChange="return chg_grp(this.value);">
<option value="">全部文档</option>
<%
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
conn.open connstr
sql = "sp_Document_Group"
'response.write sql
set rs = conn.execute(sql)
while not rs.eof
if CStr(Group_ID) = CStr(rs("Group_ID")) then
tag = "selected"
else
tag = ""
end if
response.write "<option value=" & rs("Group_ID") & " " & tag & ">" & rs("Group_Name") & "</option>"
rs.movenext
wend
rs.close
set rs = nothing
conn.close
set conn = nothing
%>
</select>
</td>
</tr>
</table>
<hr size=1>
<table bgcolor="#FFFFFF" border=0 cellpadding=1 cellspacing=1 width="100%">
<tr bgcolor="#EFEFEF">
<td>附件</td>
<td>文档名称</td>
<td>文档分组</td>
<td>录入日期</td>
<td>录入人</td>
<td>操作</td>
</tr>
<%
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
conn.open connstr
'文档总数量
sql = "select count(Document_ID) from Documents where Group_ID > 0"
set rs = conn.execute(sql)
Documents_Total = rs(0)
'本人录入文档总数量
sql = "select count(Document_ID) from Documents where Group_ID > 0 and Employee_ID = " & Session("Employee_ID")
set rs = conn.execute(sql)
My_Documents_Total = rs(0)
rs.close
sql = "select Documents.*,Documents_Group.Group_Name,Employee.Employee_Name from Documents,Documents_Group,Employee where Documents.Group_ID = Documents_Group.Group_ID and Documents.Employee_ID = Employee.Employee_ID "
'用户条件
if IsNot(Document_Title,"s") then sql = sql & " and Documents.Document_Title like '%" & Document_Title & "%'"
if IsNot(Customer_ID,"n") then sql = sql & " and Documents.Customer_ID =" & Customer_ID
if IsNot(Project_ID,"n") then sql = sql & " and Documents.Project_ID =" & Project_ID
if IsNot(Group_ID,"n") then sql = sql & " and Documents.Group_ID = " & Group_ID
if IsNot(Add_Date_Min,"d") then sql = sql & " and Documents.Add_Date >= '" & Add_Date_Min & "'"
if IsNot(Add_Date_Max,"d") then sql = sql & " and Documents.Add_Date <= '" & Add_Date_Max & "'"
if IsNot(Employee_ID,"n") then sql = sql & " and Documents.Employee_ID =" & Employee_ID
sql = sql & " order by Documents.Document_ID DESC"
'response.write sql
rs.open sql,conn,1
if rs.eof then
response.write "<tr><td colspan=18>暂时没有记录</td></tr></table>"
response.end
end if
PageSize = request.Cookies("PageSize")
if not IsNot(PageSize,"n") then PageSize = DefaultPageSize
rs.pagesize = PageSize
PageCount = rs.PageCount
PageNo = request("PageNo")
if PageNo = "" or CInt(PageNo) < 1 then PageNo = 1
if CInt(PageNo) > PageCount then PageNo = PageCount
rs.absolutepage = PageNo
i = 0
while not rs.eof and i < rs.pagesize
f_Document_ID = rs("Document_ID")
f_Document_Title = rs("Document_Title")
f_Document_Type = rs("Document_Type")
f_Group_Name = rs("Group_Name")
f_Document_Content = rs("Document_Content")
f_Add_Date = rs("Add_Date")
f_Employee_ID = rs("Employee_ID")
f_Employee_Name = rs("Employee_Name")
if i mod 2 = 0 then
response.write "<tr>"
else
response.write "<tr bgcolor=#EFEFEF>"
end if
%>
<td>
<% If trim(f_Document_Type) <> "" then %>
<a href="../upload_documents/attch_<%= f_Document_ID %>.<%=f_Document_Type%>" target="_blank"><img src="../images/doc_type/<%= f_Document_Type %>.gif" border=0 width=16 height=16 alt="下载<%= f_Document_Type %>文件"></a>
<% Else %>
无
<% End If %>
</td>
<td><a href="detail.asp?Document_ID=<%=f_Document_ID%>" title="查看文档信息" target="foot"><%= f_Document_Title %></a> </td>
<td><%= f_Group_Name %> </td>
<td><%= FormatDate(f_Add_Date,1) %> </td>
<td><a href="../employee/detail.asp?Employee_ID=<%= f_Employee_ID %>" title="查看员工资料" target="foot"><%= f_Employee_Name %></a> </td>
<td>
<a href="upload.asp?Document_ID=<%= f_Document_ID %>" target="foot" onClick="return ConfirmOption(<%= f_Employee_ID %>,'<%= f_Employee_Name %>');">上传附件</a>/<a href="modi.asp?Document_ID=<%= f_Document_ID %>" target="foot" onClick="return ConfirmOption(<%= f_Employee_ID %>,'<%= f_Employee_Name %>');">修改</a>/<a href="del.asp?Document_ID=<%= f_Document_ID %>" target="foot" onClick="return ConfirmOption(<%= f_Employee_ID %>,'<%= f_Employee_Name %>');">删除</a>
</td>
</tr>
<%
i = i + 1
rs.movenext
wend
rs.close
set rs = nothing
set conn = nothing
%>
<tr bgcolor="#EFEFEF">
<td colspan=4">
<a href="list.asp?PageNo=1&Document_Title=<%= Document_Title %>&Customer_ID=<%= Customer_ID %>&Project_ID=<%= Project_ID %>&Group_ID=<%= Group_ID%>&Add_Date_Min=<%= Add_Date_Min %>&Add_Date_Max=<%= Add_Date_Max %>&Employee_ID=<%= Employee_ID %>"><font face="Webdings">5</font>第一页</a>
<a href="list.asp?PageNo=<%= PageNo - 1 %>&Document_Title=<%= Document_Title %>&Customer_ID=<%= Customer_ID %>&Project_ID=<%= Project_ID %>&Group_ID=<%= Group_ID%>&Add_Date_Min=<%= Add_Date_Min %>&Add_Date_Max=<%= Add_Date_Max %>&Employee_ID=<%= Employee_ID %>"><font face="Webdings">3</font>上一页</a>
<a href="list.asp?PageNo=<%= PageNo + 1 %>&Document_Title=<%= Document_Title %>&Customer_ID=<%= Customer_ID %>&Project_ID=<%= Project_ID %>&Group_ID=<%= Group_ID%>&Add_Date_Min=<%= Add_Date_Min %>&Add_Date_Max=<%= Add_Date_Max %>&Employee_ID=<%= Employee_ID %>"><font face="Webdings">4</font>下一页</a>
<a href="list.asp?PageNo=<%= PageCount %>&Document_Title=<%= Document_Title %>&Customer_ID=<%= Customer_ID %>&Project_ID=<%= Project_ID %>&Group_ID=<%= Group_ID%>&Add_Date_Min=<%= Add_Date_Min %>&Add_Date_Max=<%= Add_Date_Max %>&Employee_ID=<%= Employee_ID %>"><font face="Webdings">6</font>最后一页</a>
</td>
<td colspan=2 align="right">共:<%= Documents_Total %> 份,<%= Session("Employee_Name") %>录入:<%= My_Documents_Total %> 份</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -