📄 list.asp
字号:
<!--#include file="../config.asp"-->
<!--#include file="../inc/check_login.asp"-->
<!--#include file="../inc/functions.asp"-->
<%
Application_ID = 2000100 '本功能编号,含义请查看编码表
if not CheckAuth(Session("Employee_ID"),Application_ID) then '验证权限
Server.Transfer "../err/un_authorized.htm"
response.end
end if
%>
<!--**************身份验证部分****************-->
<%
'项目名称
Project_Name = request("Project_Name")
'项目经理
Employee_ID = request("Employee_ID")
'客户编号
Customer_ID = request("Customer_ID")
'开始日期
Begin_Date_Plan_Min = request("Begin_Date_Plan_Min")
Begin_Date_Plan_Max = request("Begin_Date_Plan_Max")
'实际结束日期
End_Date_Act_Min = request("End_Date_Act_Min")
End_Date_Act_Max = request("End_Date_Act_Max")
'执行周期
WorkDays_Min = request("WorkDays_Min")
WorkDays_Max = request("WorkDays_Max")
'项目状态
Project_Status = request("Project_Status")
%>
<!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">
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;
}
}
</script>
</head>
<body>
<form name="frm" action="list.asp" method="post">
<table border=0 cellpadding=0 cellspacing=0 width="100%">
<tr>
<td width="97%">◆<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="Project_Name" value="<%=Project_Name%>"></td>
<td width="1%"><input type="submit" name="Submit" value="快速查询"></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-->
<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 = "sp_Project_Amount"
set rs = conn.execute(sql)
Projects_Total = rs(0)
'未完成项目数量
sql = "sp_Project_On_Progress_Amount"
set rs = conn.execute(sql)
On_Progress_Projects_Total = rs(0)
rs.close
sql = "select Projects.*,Customers.Customer_Name,Employee.Employee_Name from Projects,Customers,Employee where "
sql = sql & " Projects.Project_Manager = Employee.Employee_ID and Projects.Customer_ID = Customers.Customer_ID "
'用户条件
if IsNot(Project_Name,"s") then sql = sql & " and Projects.Project_Name like '%" & Project_Name & "%'"
if IsNot(Employee_ID,"n") then sql = sql & " and Projects.Project_Manager = " & Employee_ID
if IsNot(Customer_ID,"n") then sql = sql & " and Projects.Customer_ID = " & Customer_ID
if IsNot(Begin_Date_Plan_Min,"d") then sql = sql & " and Projects.Begin_Date_Plan >= '" & Begin_Date_Plan_Min & "'"
if IsNot(Begin_Date_Plan_Max,"d") then sql = sql & " and Projects.Begin_Date_Plan <= '" & Begin_Date_Plan_Max & "'"
if IsNot(End_Date_Act_Min,"d") then sql = sql & " and Projects.End_Date_Act >= '" & End_Date_Act_Min & "'"
if IsNot(End_Date_Act_Max,"d") then sql = sql & " and Projects.End_Date_Act <= '" & End_Date_Act_Max & "'"
if IsNot(WorkDays_Min,"n") then sql = sql & " and datediff(day,Projects.Begin_Date_Plan,Projects.End_Date_Act) >= " & WorkDays_Min
if IsNot(WorkDays_Max,"n") then sql = sql & " and datediff(day,Projects.Begin_Date_Plan,Projects.End_Date_Act) <= " & WorkDays_Max
if IsNot(Project_Status,"n") then sql = sql & " and Projects.Project_Status = " & Project_Status
sql = sql & " and Projects.Available = 1 order by Projects.Project_ID DESC"
'response.write sql
'保存本次查询 SQL
LastResultSQL_Project = request.Cookies("LastResultSQL_Project")
UseResult = request("UseResult") '是否使用上次查询结果
if UseResult = "yes" then
sql = LastResultSQL_Project
end if
response.Cookies("LastResultSQL_Project") = 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_Project_ID = rs("Project_ID")
f_Project_Name = rs("Project_Name")
f_Customer_ID = rs("Customer_ID")
f_Customer_Name = rs("Customer_Name")
f_Project_Manager = rs("Project_Manager")
f_Employee_Name = rs("Employee_Name")
f_Begin_Date_Plan = rs("Begin_Date_Plan")
f_End_Date_Plan = rs("End_Date_Plan")
f_End_Date_Act = rs("End_Date_Act")
f_Project_Status = rs("Project_Status")
if i mod 2 = 0 then
response.write "<tr>"
else
response.write "<tr bgcolor=#EFEFEF>"
end if
%>
<td><a href="detail.asp?Project_ID=<%= f_Project_ID %>" title="查看项目信息"><%= f_Project_Name %></a> </td>
<td><a class="na" href="../employee/detail.asp?Employee_ID=<%= f_Project_Manager %>" title="查看员工资料" target="foot"><%= f_Employee_Name %></a> </td>
<td><a class="na" href="../customer/detail.asp?Customer_ID=<%= f_Customer_ID %>" title="查看客户资料"><%= f_Customer_Name %></a> </td>
<td><nobr><%=FormatDate(f_Begin_Date_Plan,1)%><nobr> </td>
<!--td><%=FormatDate(f_End_Date_Plan,1)%> </td-->
<!--td><%=FormatDate(f_End_Date_Act,1)%> </td-->
<td><%=workdays(f_Begin_Date_Plan,f_End_Date_Plan)%> </td>
<% If f_Project_Status then %>
<% If f_End_Date_Act = f_End_Date_Plan then %>
<td><%=workdays(f_Begin_Date_Plan,f_End_Date_Act)%></font> </td>
<% ElseIf f_End_Date_Act > f_End_Date_Plan then %>
<td><font color="#FF0000"><%=workdays(f_Begin_Date_Plan,f_End_Date_Act)%></font> </td>
<% Else %>
<td><font color="#008800"><%=workdays(f_Begin_Date_Plan,f_End_Date_Act)%></font> </td>
<% End If %>
<% Else %>
<td> </td>
<% End If %>
<td><nobr>
<% If f_Project_Status then%>
<font color="#008800"><strong>√</strong></font>
<% Else %>
<font color="#FF0000">进行中</font>
<% End If %></nobr>
</td>
<td><nobr><a href="detail.asp?Project_ID=<%= f_Project_ID %>&op=modi" onClick="return ConfirmOption(<%= f_Project_Manager %>,'<%= f_Employee_Name %>');">修改</a>/<a href="del.asp?Project_ID=<%= f_Project_ID %>" target="foot" onClick="return ConfirmOption(<%= f_Project_Manager %>,'<%= f_Employee_Name %>');">删除</a></nobr></td>
</tr>
<%
i = i + 1
rs.movenext
wend
rs.close
set rs = nothing
conn.close
set conn = nothing
%>
<tr bgcolor="#EFEFEF">
<td colspan="3">
<a href="list.asp?PageNo=1&Project_Name=<%= Project_Name %>&Employee_ID=<%= Employee_ID %>&Customer_ID=<%= Customer_ID %>&Begin_Date_Plan_Min=<%= Begin_Date_Plan_Min %>&Begin_Date_Plan_Max=<%= Begin_Date_Plan_Max %>&End_Date_Act_Min=<%= End_Date_Act_Min %>&End_Date_Act_Max=<%= End_Date_Act_Max %>&WorkDays_Min=<%= WorkDays_Min %>&WorkDays_Max=<%= WorkDays_Max %>&Project_Status=<%= Project_Status %>"><font face="Webdings">5</font>第一页</a>
<a href="list.asp?PageNo=<%= PageNo - 1 %>&Project_Name=<%= Project_Name %>&Employee_ID=<%= Employee_ID %>&Customer_ID=<%= Customer_ID %>&Begin_Date_Plan_Min=<%= Begin_Date_Plan_Min %>&Begin_Date_Plan_Max=<%= Begin_Date_Plan_Max %>&End_Date_Act_Min=<%= End_Date_Act_Min %>&End_Date_Act_Max=<%= End_Date_Act_Max %>&WorkDays_Min=<%= WorkDays_Min %>&WorkDays_Max=<%= WorkDays_Max %>&Project_Status=<%= Project_Status %>"><font face="Webdings">3</font>上一页</a>
<a href="list.asp?PageNo=<%= PageNo + 1 %>&Project_Name=<%= Project_Name %>&Employee_ID=<%= Employee_ID %>&Customer_ID=<%= Customer_ID %>&Begin_Date_Plan_Min=<%= Begin_Date_Plan_Min %>&Begin_Date_Plan_Max=<%= Begin_Date_Plan_Max %>&End_Date_Act_Min=<%= End_Date_Act_Min %>&End_Date_Act_Max=<%= End_Date_Act_Max %>&WorkDays_Min=<%= WorkDays_Min %>&WorkDays_Max=<%= WorkDays_Max %>&Project_Status=<%= Project_Status %>"><font face="Webdings">4</font>下一页</a>
<a href="list.asp?PageNo=<%= PageCount %>&Project_Name=<%= Project_Name %>&Employee_ID=<%= Employee_ID %>&Customer_ID=<%= Customer_ID %>&Begin_Date_Plan_Min=<%= Begin_Date_Plan_Min %>&Begin_Date_Plan_Max=<%= Begin_Date_Plan_Max %>&End_Date_Act_Min=<%= End_Date_Act_Min %>&End_Date_Act_Max=<%= End_Date_Act_Max %>&WorkDays_Min=<%= WorkDays_Min %>&WorkDays_Max=<%= WorkDays_Max %>&Project_Status=<%= Project_Status %>"><font face="Webdings">6</font>最后一页</a>
</td>
<td colspan=5 align="right">共:<%= Projects_Total %> 个项目(<%= PageCount %>页),<%= On_Progress_Projects_Total %> 个正在进行</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -