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

📄 contactlist.asp

📁 本系统是基于B/S结构的客户关系管理系统. 测试管理员和密码是super 用户名super 密码super 前台和后台是一次性同时登陆的 系统工能介绍: 客户管理---------- 添
💻 ASP
字号:
<!--#include file="../function/connect.asp"-->
<%
	meth=request("meth")
	client_ID=request("client_ID")
	if meth="del" and request("Contact_ID")<>"" then
		strsql="delete from Contacts where Contact_ID in (" & request("Contact_ID") &")"
		objConn.execute strsql
		response.redirect "contactlist.asp?client_ID=" & client_ID & "&Contact_Name=" & Contact_Name & "&Page=" & Page
	end if
	
	if client_ID="all" then
		client_ID=""
	'else
		'ID=session("client_ID")
	end if
	
	Contact_Name=request("Contact_Name")
	strsql="select c.*,d.Department from contacts c,Dict_Department d where d.Department_ID=c.Department_ID and (c.contact_owner='" & session("loginuser") & "' or c.IsPublic=1)"
	if client_ID<>"" and client_ID<>"all" then
	strsql=strsql & " and client_ID=" & client_ID
	end if
	if Contact_Name<>"" then
	strsql=strsql & " and Contact_Name like '%" & Contact_Name & "%'"
	end if
	'response.write strsql
	Set objRs = Server.CreateObject("adodb.recordset")
	    objRs.Open strsql,objConn,1,1
	    
	If Request("Page") = "" Then
		intPage = 1
	Else
		intPage = Clng(Request("Page"))
	End If
	objRs.PageSize = 15
	If intPage > objRs.PageCount Then
		intPage = objRs.PageCount
	End If
	If intPage <= 0 Then
		intPage = 1
	End If
	If Not objRs.EOF Then
		objRs.AbsolutePage = intPage
	End If
%>
<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 ContactID=document.all.Contact_ID;
		for(i=1;i<ContactID.length;i++){
			if(ContactID[i].checked==true){
				rNum=rNum +1 ;
			}
		}
		return rNum;
	}
	function checkAll()
	{
		var ContactID=document.all.Contact_ID;
		if(document.form1.checkall.checked==false){
			for(i=0;i<ContactID.length;i++){
				ContactID[i].checked=false;
			}
		}else{
			for(i=0;i<ContactID.length;i++){
				ContactID[i].checked=true;
			}
		}
	}
	function modify()
	{
		if(checkNum()!=1)
		{
			alert('修改的项目只能是一个.');
		}else{
			contact_id=getValue();
			window.open('contact_edit.asp?contact_id='+ contact_id,'修改联系活动','left=150,top=150,width=630,height=360');
			//document.form1.action="editcontact.asp";
			//document.form1.submit();
		}
	}
	
	function formsubmit(page)
	{
		str=document.form1;
		str.page.value=page;
		str.submit();
	}
	function changepage()
	{
		str=document.form1;
		str.page.value=str.selectpage.value;
		str.submit();
	}
	
	function getValue(){
		var actID=document.all.Contact_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="contactlist.asp">
  <tr> 
	<td  align="left" height="22" colspan="7" bgcolor="#ffffff"> 
		联系人:<input type="text" name="Contact_Name" size="20" class="input" value="<%=Contact_Name%>">&nbsp;<input type="submit" value=" 检索 " class="button1">
	<td>
 </tr>
  <tr class="tablehead"> 
    <td width="4%"><input type="checkbox" name="checkall" value="1" onclick="checkAll();"><input type="checkbox" name="Contact_ID" value="0" disabled style="display:none;"></td>
    <td width="20%" nowrap> 
      <div align="center">联系人</div>
    </td>
    <td width="19%" nowrap> 
      <div align="center">联系电话</div>
    </td>
    <td width="19%" nowrap> 
      <div align="center">Email</div>
    </td>
    <td width="19%" nowrap> 
      <div align="center">部门</div>
    </td>
    <td width="19%" nowrap> 
      <div align="center">地址</div>
    </td>
    <td width="19%" nowrap> 
      <div align="center">添加日期</div>
    </td>
  </tr>
  <%
  if not objrs.eof then
	    For intLoop = 1 To objRs.PageSize
		If Not objRs.EOF Then
  %>
  <tr align="center"> 
    <td width="4%" class="tablehead">
        <input type="checkbox" name="Contact_ID" value="<%=objrs.fields("Contact_ID")%>">
      </td>
    <td width="20%" nowrap>&nbsp;<a href="#" onclick="javascript:window.open('contact_edit.asp?contact_id=<%=objrs.fields("Contact_ID")%>','修改联系人','left=150,top=150,width=630,height=360');"><%=objrs.fields("Contact_Name")%></a></td>
    <td width="19%" nowrap>&nbsp;<%=objrs.fields("Phone1")%></td>
    <td width="19%" nowrap>&nbsp;<%=objrs.fields("Email1")%></td>
    <td width="19%" nowrap>&nbsp;<%=objrs.fields("Department")%></td>
    <td width="19%" nowrap>&nbsp;<%=objrs.fields("Address")%></td>
    <td width="19%" nowrap>&nbsp;<%=objrs.fields("Create_Date")%></td>
  </tr>
  <%
  	objRs.MoveNext
	End If
	Next
  else%>
  <tr align="center"> 
	  <td colspan="7">
	  	没有联系人
	  </td>
  </tr>
  <%end if%>
    <input type="hidden" name="meth" value="del">
    <input type="hidden" name="client_ID" value="<%=client_ID%>">
  <tr> 
		      <td  align="Right" height="22" colspan="7" bgcolor="#ffffff"> 
		        <%
		        If intPage = 1 Or intPage = 0 Then
					Response.Write "前一页"
		        Else
		        %>
		        <a href="javascript:formsubmit('<%=intPage - 1%>');">前一页</a> 
		        <%
		        End If
		        %>
		        &nbsp;&nbsp; 
		        <%
		        If intPage = objRs.PageCount or objRs.PageCount=0 Then
					Response.Write "下一页"
		        Else
		        %>
		        <a href="javascript:formsubmit('<%=intPage + 1%>');">下一页</a> 
		        <%
		        End If
		        %>
		        &nbsp; 转向 
		        <select name="selectpage" onchange="changepage();">
		          <%
					If objRs.PageCount <= 0 Then
						Response.Write "<option value=''>无</option>"
					Else
						For intLoop = 1 To objRs.PageCount
							If intPage = intLoop Then
								Response.Write "<option value='" & intLoop & "' selected>" & intLoop & "</option>"
							Else
								Response.Write "<option value='" & intLoop & "'>" & intLoop & "</option>"
							End If
						Next
					End If
					%>
		        </select>页
		      </td>
		    </tr>
	    <input type="hidden" name="page" value="">
  <tr align="center"> 
	  <td colspan="7">
	  	<input type="button" value=" 添加 " class="button" onclick="window.open('contact.asp','联系人','left=150,top=150,width=630,height=360');" >&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 + -