📄 salelist.asp
字号:
<!--#include file="../../Conndb.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>销售机会管理</title>
<link rel="stylesheet" type="text/css" href="../../style.CSS">
<script language="javascript">
function newView(url) {
var oth="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=200,top=200";
oth = oth+",width=600,height=300";
var newView=window.open(url,"newView",oth);
newView.focus();
return false;
}
</script>
</head>
<body link="#000080" vlink="#080080">
<form id="form1" name="form1" method="POST" action="SaleList.asp">
<%
Dim ptype '项目类型
ptype = Request("ptype")
sch = ""
If ptype<>"" Then
sch = " AND s.PTypeId=" & ptype
End If
Dim pstatus '项目状态
pstatus = Request("pstatus")
If IsEmpty(pstatus) Then
pstatus = "全部"
End If
%>
<p align="center"><font size="3" color="#000080"><b>销 售 机 会 管 理</font></b></font></p>
<p align="left"><font color="#000080"><b>项目类型</b> <select size="1" name="ptype">
<%
'读取所有项目类型信息
Dim rs, rs1
Set rs = Server.CreateObject("ADODB.RecordSet")
Set rs1 = Server.CreateObject("ADODB.RecordSet")
sql = "SELECT * FROM Types WHERE flag = 7" ' flag=7表示保存的数据为项目类型
rs.Open sql,conn,1,1 '执行SELECT语句
Do While Not rs.Eof
%>
<option
<% If ptype = CStr(rs("TypeId")) Then %>
selected
<% End If %>
value="<%=rs("TypeId")%>"><%=rs("TypeName")%></option>
<%
' 移动记录集的指针
rs.MoveNext
Loop
rs.Close
%>
</select> <b>项目状态</b> <select size="1" name="pstatus">
<option <%If pstatus = "全部" Then %> selected <% End If %> value="全部">全部 </option>
<option <%If pstatus = "启动" Then %> selected <% End If %> value="启动">启动</option>
<option <%If pstatus = "中止" Then %> selected <% End If %> value="中止">中止</option>
<option <%If pstatus = "结束" Then %> selected <% End If %> value="结束">结束</option>
</select> <input type="submit" value="查询" name="B1"></font></p>
<table align=center border="1" cellspacing="0" width="100%" bordercolorlight="#000080" bordercolordark="#FFFFFF">
<tr>
<td width="8%" align="center" bgcolor="#C1E0FF"><strong>销售编号</strong></td>
<td width="11%" align="center" bgcolor="#C1E0FF"><strong>项目名称</strong></td>
<td width="10%" align="center" bgcolor="#C1E0FF"><strong>客户名称</strong></td>
<td width="6%" align="center" bgcolor="#C1E0FF"><strong>联系人</strong></td>
<td width="7%" align="center" bgcolor="#C1E0FF"><strong>项目类型</strong></td>
<td width="7%" align="center" bgcolor="#C1E0FF"><strong>销售人员</strong></td>
<td width="4%" align="center" bgcolor="#C1E0FF"><strong>状态</strong></td>
<td width="7%" align="center" bgcolor="#C1E0FF"><b>目前进度</b></td>
<td width="7%" align="center" bgcolor="#C1E0FF"><b>签约日期</b></td>
<td width="7%" align="center" bgcolor="#C1E0FF"><b>签约金额</b></td>
<td width="7%" align="center" bgcolor="#C1E0FF"><strong>操作</strong></td>
</tr>
<%
'读取数据到记录集rs中
sql = "SELECT s.Id AS 销售编号, s.ProName AS 项目名称,c.CustName AS 客户名称,a.CName AS 联系人," _
& "t.TypeName AS 项目类型,e.EmpName AS 销售人员,s.Status AS 状态,s.PPercent AS 目前进度," _
& "s.SignDate AS 签约日期,s.SignSum AS 签约金额" _
& " FROM SaleChance s,Contact a,Customer c,Types t,Employees e" _
& " WHERE s.CustId=c.CustId AND s.EmpId=e.EmpId AND s.CtId=a.Id" _
& " AND s.PTypeId=t.TypeId " & sch
'增加项目状态的判断
If pstatus <> "全部" Then
sql = sql + " AND s.Status='" & pstatus & "'"
End If
'执行SELECT语句
rs.Open sql,conn,1,1
'在表格中显示销售信息
If rs.Eof Then
Response.Write "<tr><td colspan=11 align=center>目前还没有销售机会信息。</td></tr></table>"
Else
Do While Not rs.EOF
%>
<tr>
<td><%=rs("销售编号")%></a></td>
<td align="center"><%=rs("项目名称")%> </td>
<td align="center"><%=rs("客户名称")%> </td>
<td align="center"><%=rs("联系人")%> </td>
<td align="center"><%=rs("项目类型")%></td>
<td align="center"><%=rs("销售人员")%> </td>
<td align="center"><%=rs("状态")%> </td>
<td align="center"><%=rs("目前进度")%> </td>
<td align="center"><%=rs("签约日期")%> </td>
<td align="center"><%=rs("签约金额")%> </td>
<td align="center"><a href="SaleEdit.asp?action=edit&sid=<%=rs("销售编号")%>"
onClick="return newView(this.href)">修改</a>
<a href="SaleDelt.asp?sid=<%=rs("销售编号")%>" onClick="return newView(this.href)">删除</a></td>
</tr>
<%
rs.MoveNext()
Loop
%>
</table>
<%End If%>
<p align="center">
<input type="button" value="添加销售机会" onclick="newView('SaleEdit.asp?action=add')" name=add></p>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -