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

📄 salelist.asp

📁 本系统是基于B/S结构的客户关系管理系统. 测试管理员和密码是super 用户名super 密码super 前台和后台是一次性同时登陆的 系统工能介绍: 客户管理---------- 添
💻 ASP
字号:
<!--#include file="../function/connect.asp"-->
<%
	Client_ID=request("Client_ID")
	if Client_ID<>"" then
		session("Client_ID")=Client_ID
	end if
	if Client_ID="" and session("Client_ID")<>"" then
		Client_ID=session("Client_ID")
	end if
	if Client_ID="all" then
		Client_ID=""
	end if
	
	meth=request("meth")
	if meth="del" and request("Sales_OPP_ID")<>"" then
		strsql="delete from SalesOpportunities where Sales_OPP_ID in (" & request("Sales_OPP_ID") &")"
		objConn.execute strsql
		strsql="delete from OrderDetails where Sales_OPP_ID in (" & request("Sales_OPP_ID") & ")"
		objConn.execute strsql
	end if
	
	strsql="select p.*,cl.client_name,co.Contact_Name,di.Invoice,dc.Currency_Name from SalesOpportunities p,clients cl,Contacts co,Dict_Invoices di,Dict_Currency dc where p.client_ID=cl.client_ID and p.Contact_ID=co.Contact_ID and di.Invoice_ID=p.Invoice_ID and dc.Currency_ID=p.Currency_ID "
	if Client_ID<>"" then
		strsql=strsql & " and p.Client_ID=" & Client_ID
	end if
	strsql=strsql & " and (p.Creator='" & session("loginuser") & "' or p.IsPublic=1)"
	'response.write strsql
	Set objRs = Server.CreateObject("adodb.recordset")
	    objRs.Open strsql,objConn,1,1
%>
<html>
<head>
<title>销售</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../cssD.css" rel=stylesheet>
<script>
	function checkNum()
	{
		rNum=0;
		var actID=document.all.Sales_OPP_ID;
		for(i=1;i<actID.length;i++){
			if(actID[i].checked==true){
				rNum=rNum +1 ;
			}
		}
		return rNum;
	}
	function checkAll()
	{
		var actID=document.all.Sales_OPP_ID;
		if(document.form1.checkall.checked==false){
			for(i=0;i<actID.length;i++){
				actID[i].checked=false;
			}
		}else{
			for(i=0;i<actID.length;i++){
				actID[i].checked=true;
			}
		}
	}
	function modify()
	{
		if(checkNum()!=1)
		{
			alert('修改的项目只能是一个.');
		}else{
			Sales_OPP_ID=getValue();
			window.open('sale.asp?Sales_OPP_ID='+ Sales_OPP_ID,'修改','left=150,top=150,width=630,height=530');
			//document.form1.action="sale.asp";
			//document.form1.submit();
		}
	}
	
	function getValue(){
		var actID=document.all.Sales_OPP_ID;
		var getv="";
		for(i=0;i<actID.length;i++){
			if(actID[i].checked==true){
				getv=actID[i].value;
			}
		}
		return getv;
	}
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="103%" border="1" cellspacing="0" cellpadding="2" bordercolorlight='#000000' bordercolordark='#FFFFFF'>
 <form name="form1" method="post" action="Purchaselist.asp">
  <tr class="tablehead"> 
    <td width="4%"><input type="checkbox" name="checkall" value="1" onclick="checkAll();"><input type="checkbox" name="Sales_OPP_ID" value="0" disabled style="display:none;"></td>
    <td width="10%" nowrap> 
      <div align="center">主题</div>
    </td>
    <td width="10%" nowrap> 
      <div align="center">订单/合同号</div>
    </td>
    <td width="10%" nowrap> 
      <div align="center">购买日期</div>
    </td>
     <td width="10%" nowrap> 
      <div align="center">相关客户</div>
    </td>
    <td width="10%" nowrap> 
      <div align="center">相关联系人</div>
    </td>
    <td width="10%" nowrap> 
      <div align="center">发票类型</div>
    </td>
    <td width="10%" nowrap> 
      <div align="center">货币类型</div>
    </td>
    <td width="10%" nowrap> 
      <div align="center">总计金额</div>
    </td>
    <td width="10%" nowrap> 
      <div align="center">已付款金额</div>
    </td>
    <td width="10%" nowrap> 
      <div align="center">未付款金额</div>
    </td>
  </tr>
  <%if not objrs.eof then
  	do while not objrs.eof
  	Amount=objrs.fields("Amount")
  	if Amount & "" ="" then
  		Amount=0
  	end if
  	Paid_Amount=objrs.fields("Paid_Amount")
  	if Paid_Amount & "" ="" then
  		Paid_Amount=0
  	end if
  %>
  <tr align="center"> 
        <td width="4%" class="tablehead">
        <input type="checkbox" name="Sales_OPP_ID" value="<%=objrs.fields("Sales_OPP_ID")%>">
      </td>
    <td width="10%" nowrap>&nbsp;<a href="sale.asp?Sales_OPP_ID=<%=objrs.fields("Sales_OPP_ID")%>"><%=objrs.fields("Regarding")%></a></td>
    <td width="10%" nowrap>&nbsp;<%=objrs.fields("order_num")%></td>
    <td width="10%" nowrap>&nbsp;<%=objrs.fields("Create_Date")%></td>
    <td width="10%" nowrap>&nbsp;<%=objrs.fields("client_name")%></td>
    <td width="10%" nowrap>&nbsp;<%=objrs.fields("Contact_Name")%></td>
    <td width="10%" nowrap>&nbsp;<%=objrs.fields("Invoice")%></td>
    <td width="10%" nowrap>&nbsp;<%=objrs.fields("Currency_Name")%></td>
    <td width="10%" nowrap>&nbsp;<%=Amount%></td>
    <td width="10%" nowrap>&nbsp;<%=Paid_Amount%></td>
    <td width="10%" nowrap>&nbsp;<%=Amount-Paid_Amount%></td>
  </tr>
  <%
  	objrs.movenext
  	loop
  else%>
  <tr align="center"> 
	  <td colspan="11">
	  	没有销售
	  </td>
  </tr>
  <%end if%>
    <input type="hidden" name="meth" value="del">

  <tr align="center"> 
	  <td colspan="11">
	  	<input type="button" value=" 添加 " class="button" onclick="window.open('sale.asp','销售','left=150,top=150,width=630,height=530');">&nbsp;<input type="submit" value=" 删除 " class="button">&nbsp;<input type="button" value=" 修改 " class="button" onclick="modify();">
	  </td>
  </tr>
    </form>
</table>
</body>
</html>

⌨️ 快捷键说明

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