📄 list.asp
字号:
<!--#include file="../config.asp"-->
<!--#include file="../inc/check_login.asp"-->
<!--#include file="../inc/functions.asp"-->
<%
Application_ID = 3000100 '本功能编号,含义请查看编码表
if not CheckAuth(Session("Employee_ID"),Application_ID) then '验证权限
Server.Transfer "../err/un_authorized.htm"
response.end
end if
%>
<!--**************身份验证部分****************-->
<%
'合同编号
Contract_No = request("Contract_No")
'客户编号
Customer_ID = request("Customer_ID")
'项目编号
Project_ID = request("Project_ID")
'签约人(员工)编号
Employee_ID = request("Employee_ID")
'金额
Account_Min = request("Account_Min")
Account_Max = request("Account_Max")
'签约日期
Sign_Date_Min = request("Sign_Date_Min")
Sign_Date_Max = request("Sign_Date_Max")
'结束日期
End_Date_Min = request("End_Date_Min")
End_Date_Max = request("End_Date_Max")
'外包费
Other_Cost_Min = request("Other_Cost_Min")
Other_Cost_Max = request("Other_Cost_Max")
'基础业务费
Base_Cost_Min = request("Base_Cost_Min")
Base_Cost_Max = request("Base_Cost_Max")
'已收金额
Received_Min = request("Received_Min")
Received_Max = request("Received_Max")
'应收金额
Account_Received_Min = request("Account_Received_Min")
Account_Received_Max = request("Account_Received_Max")
'业绩金额
Received_Base_Cost_Other_Cost_Min = request("Received_Base_Cost_Other_Cost_Min")
Received_Base_Cost_Other_Cost_Max = request("Received_Base_Cost_Other_Cost_Max")
'合同状态
Contract_Status = request("Contract_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> ◆<a href="stat.asp" target="foot">财务统计</a></td>
<td width="1%"><nobr>合同编号:</nobr></td>
<td width="1%"><input type="text" name="Contract_No" value="<%= Contract_No %>" size="20" maxlength="20"></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>
<td>操作</td>
</tr>
<%
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
conn.open connstr
'合同总数量
sql = "sp_Contracts_Amount"
set rs = conn.execute(sql)
Contracts_Total = rs(0)
'尚未完成的合同数量
sql = "sp_Contracts_On_Progress_Amount"
set rs = conn.execute(sql)
On_Progress_Contracts_Total = rs(0)
rs.close
sql = "select Contracts.*,Customers.Customer_Name,Employee.Employee_Name from Contracts,Customers,Employee where "
sql = sql & " Contracts.Employee_ID = Employee.Employee_ID and Contracts.Customer_ID = Customers.Customer_ID "
'用户条件
if IsNot(Contract_No,"s") <> "" then sql = sql & " and Contracts.Contract_No like '%" & Contract_No & "%'"
if IsNot(Customer_ID,"n") then sql = sql & " and Customers.Customer_ID = " & Customer_ID
if IsNot(Project_ID,"n") then sql = sql & " and Contracts.Project_ID = " & Project_ID
if IsNot(Employee_ID,"n") then sql = sql & " and Contracts.Employee_ID = " & Employee_ID
if IsNot(Account_Min,"n") then sql = sql & " and Contracts.Account >= " & Account_Min
if IsNot(Account_Max,"n") then sql = sql & " and Contracts.Account <= " & Account_Max
if IsNot(Sign_Date_Min,"d") then sql = sql & " and Contracts.Sign_Date >= '" & Sign_Date_Min & "'"
if IsNot(Sign_Date_Max,"d") then sql = sql & " and Contracts.Sign_Date <= '" & Sign_Date_Max & "'"
if IsNot(End_Date_Min,"d") then sql = sql & " and Contracts.End_Date >= '" & End_Date_Min & "'"
if IsNot(End_Date_Max,"d") then sql = sql & " and Contracts.End_Date <= '" & End_Date_Max & "'"
if IsNot(Other_Cost_Min,"n") then sql = sql & " and Contracts.Other_Cost >= " & Other_Cost_Min
if IsNot(Other_Cost_Max,"n") then sql = sql & " and Contracts.Other_Cost <= " & Other_Cost_Max
if IsNot(Base_Cost_Min,"n") then sql = sql & " and Contracts.Base_Cost >= " & Base_Cost_Min
if IsNot(Base_Cost_Max,"n") then sql = sql & " and Contracts.Base_Cost <= " & Base_Cost_Max
if IsNot(Received_Min,"n") then sql = sql & " and Contracts.Received >= " & Received_Min
if IsNot(Received_Max,"n") then sql = sql & " and Contracts.Received <= " & Received_Max
if IsNot(Account_Received_Min,"n") then sql = sql & " and Contracts.Account + Contracts.Chg_Account - Contracts.Received >= " & Account_Received_Min
if IsNot(Account_Received_Max,"n") then sql = sql & " and Contracts.Account + Contracts.Chg_Account - Contracts.Received <= " & Account_Received_Max
if IsNot(Received_Base_Cost_Other_Cost_Min,"n") then sql = sql & " and Contracts.Received - Contracts.Base_Cost - Contracts.Other_Cost >= " & Received_Base_Cost_Other_Cost_Min
if IsNot(Received_Base_Cost_Other_Cost_Max,"n") then sql = sql & " and Contracts.Received - Contracts.Base_Cost - Contracts.Other_Cost <= " & Received_Base_Cost_Other_Cost_Max
if IsNot(Contract_Status,"n") then sql = sql & " and Contracts.Contract_Status = " & Contract_Status
sql = sql & " and Contracts.Available = 1 order by Contracts.Contract_ID DESC"
'response.write sql
'保存本次查询 SQL
LastResultSQL_Contract = request.Cookies("LastResultSQL_Contract")
UseResult = request("UseResult") '是否使用上次查询结果
if UseResult = "yes" then
sql = LastResultSQL_Contract
end if
response.Cookies("LastResultSQL_Contract") = 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_Contract_ID = rs("Contract_ID")
f_Ext_Name = rs("Ext_Name")
f_Contract_No = rs("Contract_No")
f_Customer_ID = rs("Customer_ID")
f_Customer_Name = rs("Customer_Name")
f_Employee_ID = rs("Employee_ID")
f_Employee_Name = rs("Employee_Name")
f_Account = rs("Account")
f_Sign_Date = rs("Sign_Date")
f_Other_Cost = rs("Other_Cost")
f_Base_Cost = rs("Base_Cost")
f_Chg_Account = rs("Chg_Account")
f_Received = rs("Received")
f_Contract_Status = rs("Contract_Status")
f_End_Date = rs("End_Date")
if i mod 2 = 0 then
response.write "<tr>"
else
response.write "<tr bgcolor=#EFEFEF>"
end if
%>
<td><nobr>
<% If trim(f_Ext_Name) <> "" then %>
<a href="../upload_documents/contract_<%= f_Contract_ID %>.<%=f_Ext_Name%>" target="_blank"><img src="../images/doc_type/<%= f_Ext_Name %>.gif" border=0 width=16 height=16></a>
<% Else %>
<a href="upload.asp?Contract_ID=<%= f_Contract_ID %>&Contract_No=<%= f_Contract_No %>" target="foot" onClick="return ConfirmOption(<%= f_Employee_ID %>,'<%= f_Employee_Name %>');">上传</a>
<% End If %></nobr>
</td>
<td><a href="detail.asp?Contract_ID=<%= f_Contract_ID %>"><%= f_Contract_No %></a></td>
<td><a class="na" href="../customer/detail.asp?Customer_ID=<%= f_Customer_ID %>"><%= f_Customer_Name %></a></td>
<td>¥<%= f_Account %></td>
<td>¥<%= f_Chg_Account %></td>
<td><nobr><%= FormatDate(f_Sign_Date,1) %></nobr></td>
<td>¥<%= f_Received %></td>
<td>
<% If f_Account + f_Chg_Account - f_Received > 0 then %>
¥<%= (f_Account + f_Chg_Account - f_Received) %>
<% Else %>
<font color="#008800"><strong>√</strong></font>
<% End If %>
</td>
<td><nobr><a href="../employee/detail.asp?Employee_ID=<%= f_Employee_ID %>" target="foot"><%= f_Employee_Name %></a></nobr></td>
<% If f_Contract_Status then %>
<td><font color="#008800"><strong>√</strong></font></td>
<% Else %>
<td><font color="#FF0000"><strong>×</strong></font></td>
<% End If %>
<td><nobr><a href="del.asp?Contract_ID=<%= f_Contract_ID %>" target="foot" onClick="return ConfirmOption(<%= f_Employee_ID %>,'<%= f_Employee_Name %>');">删除</a></nobr></td>
</tr>
<%
i = i + 1
rs.movenext
wend
rs.close
set rs = nothing
set conn = nothing
%>
<tr bgcolor="#EFEFEF">
<td colspan="3">
<a href="list.asp?PageNo=1&Contract_No=<%= Contract_No %>&Customer_ID=<%= Customer_ID %>&Project_ID=<%= Project_ID %>&Employee_ID=<%= Employee_ID %>&Account_Min=<%= Account_Min %>&Account_Max=<%= Account_Max %>&Sign_Date_Min=<%= Sign_Date_Min %>&Sign_Date_Max=<%= Sign_Date_Max %>&Other_Cost_Min=<%= Other_Cost_Min %>&Other_Cost_Max<%= Other_Cost_Max %>&Base_Cost_Min=<%= Base_Cost_Min %>&Base_Cost_Max=<%= Base_Cost_Max %>&Received_Min=<%= Received_Min %>&Received_Max=<%= Received_Max %>&Account_Received_Min=<%= Account_Received_Min %>&Account_Received_Max=<%= Account_Received_Max %>&Received_Base_Cost_Other_Cost_Min=<%= Received_Base_Cost_Other_Cost_Min %>&Received_Base_Cost_Other_Cost_Max=<%= Received_Base_Cost_Other_Cost_Max %>&Contract_Status=<%= Contract_Status %>"><font face="Webdings">5</font>第一页</a>
<a href="list.asp?PageNo=<%= PageNo - 1 %>&Contract_No=<%= Contract_No %>&Customer_ID=<%= Customer_ID %>&Project_ID=<%= Project_ID %>&Employee_ID=<%= Employee_ID %>&Account_Min=<%= Account_Min %>&Account_Max=<%= Account_Max %>&Sign_Date_Min=<%= Sign_Date_Min %>&Sign_Date_Max=<%= Sign_Date_Max %>&Other_Cost_Min=<%= Other_Cost_Min %>&Other_Cost_Max<%= Other_Cost_Max %>&Base_Cost_Min=<%= Base_Cost_Min %>&Base_Cost_Max=<%= Base_Cost_Max %>&Received_Min=<%= Received_Min %>&Received_Max=<%= Received_Max %>&Account_Received_Min=<%= Account_Received_Min %>&Account_Received_Max=<%= Account_Received_Max %>&Received_Base_Cost_Other_Cost_Min=<%= Received_Base_Cost_Other_Cost_Min %>&Received_Base_Cost_Other_Cost_Max=<%= Received_Base_Cost_Other_Cost_Max %>&Contract_Status=<%= Contract_Status %>"><font face="Webdings">3</font>上一页</a>
<a href="list.asp?PageNo=<%= PageNo + 1 %>&Contract_No=<%= Contract_No %>&Customer_ID=<%= Customer_ID %>&Project_ID=<%= Project_ID %>&Employee_ID=<%= Employee_ID %>&Account_Min=<%= Account_Min %>&Account_Max=<%= Account_Max %>&Sign_Date_Min=<%= Sign_Date_Min %>&Sign_Date_Max=<%= Sign_Date_Max %>&Other_Cost_Min=<%= Other_Cost_Min %>&Other_Cost_Max<%= Other_Cost_Max %>&Base_Cost_Min=<%= Base_Cost_Min %>&Base_Cost_Max=<%= Base_Cost_Max %>&Received_Min=<%= Received_Min %>&Received_Max=<%= Received_Max %>&Account_Received_Min=<%= Account_Received_Min %>&Account_Received_Max=<%= Account_Received_Max %>&Received_Base_Cost_Other_Cost_Min=<%= Received_Base_Cost_Other_Cost_Min %>&Received_Base_Cost_Other_Cost_Max=<%= Received_Base_Cost_Other_Cost_Max %>&Contract_Status=<%= Contract_Status %>"><font face="Webdings">4</font>下一页</a>
<a href="list.asp?PageNo=<%= PageCount %>&Contract_No=<%= Contract_No %>&Customer_ID=<%= Customer_ID %>&Project_ID=<%= Project_ID %>&Employee_ID=<%= Employee_ID %>&Account_Min=<%= Account_Min %>&Account_Max=<%= Account_Max %>&Sign_Date_Min=<%= Sign_Date_Min %>&Sign_Date_Max=<%= Sign_Date_Max %>&Other_Cost_Min=<%= Other_Cost_Min %>&Other_Cost_Max<%= Other_Cost_Max %>&Base_Cost_Min=<%= Base_Cost_Min %>&Base_Cost_Max=<%= Base_Cost_Max %>&Received_Min=<%= Received_Min %>&Received_Max=<%= Received_Max %>&Account_Received_Min=<%= Account_Received_Min %>&Account_Received_Max=<%= Account_Received_Max %>&Received_Base_Cost_Other_Cost_Min=<%= Received_Base_Cost_Other_Cost_Min %>&Received_Base_Cost_Other_Cost_Max=<%= Received_Base_Cost_Other_Cost_Max %>&Contract_Status=<%= Contract_Status %>"><font face="Webdings">6</font>最后一页</a>
</td>
<td colspan=8 align="right">共:<%= Contracts_Total %> 份合同,<%= On_Progress_Contracts_Total %> 份尚未完毕</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -