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

📄 newcontact.asp

📁 1 除掉了 时间 限制 2 除掉了 人数 限制 改为 500人 原为5人 3 发现一点小缺陷 增加人员的时候没有判断 登陆名是否重复! 自己写吧~~~:) 4 又 是一点缺陷
💻 ASP
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%
Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")

if request("id")<>"" then
	objcheck.CheckUserFunction "contact","edit"
else
	objcheck.CheckUserFunction "contact","add"
end if
set objcheck=nothing

if request("id")<>"" then
	dim connq
	dim rsq
	set connq=server.CreateObject("adodb.connection")
	set rsq=server.CreateObject("adodb.recordset")
	connq.Open connstring
	rsq.Open "select * from contact where contactid="&request("id"),connq,2,3,1
	strcontact=rsq("contact")
	strcontacttype=rsq("contacttype")
	strcontactdepartment=rsq("contactdepartment")
	strtitle=rsq("title")
	stremail=rsq("email")
	strworkphone=rsq("workphone")
	strMotorPhone=rsq("MotorPhone")
	strfax=rsq("fax")
	strbirthday=rsq("birthday")
	strcountry=rsq("country")
	strprovince=rsq("province")
	strzip=rsq("zip")
	strcity=rsq("city")
	straccount=rsq("accountid")
	straccountname=getfieldvalue("account","accountid",rsq("accountid"),"account")
	straddress=rsq("address")
	strowner=rsq("owner")
	strdescription=rsq("description")
	strowner=rsq("owner")
	strownername=getfieldvalue("usertable","loginid",rsq("owner"),"username")
	strdisable=rsq("disable")
	rsq.Close
	set rsq=nothing
	connq.Close
	set connq=nothing
else
	strowner=session("loginid")
	strownername=session("username")
	straccount=-1
	if request("accountid")<>"" then
		set connq=server.CreateObject("adodb.connection")
		connq.Open connstring
		set rsq=connq.Execute("select * from account where accountid="&request("accountid"))
		
		if not rsq.EOF then
			strworkphone=rsq("phone")
			straddress=rsq("billaddress")
			strfax=rsq("fax")
			strcity=rsq("city1")
			strzip=rsq("zip1")
		end if
		straccount=cint(request("accountid"))
		straccountname=request("accountname")
	end if
end if

if request("contact")<>"" then
	Dim objcontact
	Set objcontact=Server.CreateObject("SmartSales.Contact")
	objcontact.SaveContact
	set objcontact=nothing
%>
<script language=javascript>
	window.opener.location.reload();
	window.close();
</script>
<%
end if
%>

<HTML><HEAD><TITLE>联系人</TITLE>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<script language=javascript src="../tools/newcalendar.js"></script>
<script language="javascript">
function save(){
	if (form1.contact.value==''){
		alert('请输入姓名');
		form1.contact.focus();
		return;
	}
	//if (form1.ContactDepartment.value==''){
	//	alert('请输入部门');
	//	form1.ContactDepartment.focus();
	//	return;
	//}
	if (form1.title.value==''){
		alert('请输入职务');
		form1.title.focus();
		return;
	}
	if (form1.workphone.value==''){
		alert('请输入电话');
		form1.workphone.focus();
		return;
	}
	if (form1.fax.value==''){
		alert('请输入传真');
		form1.fax.focus();
		return;
	}		
	if (form1.caccountname.value==''){
		alert('请选择客户');
		form1.caccountname.focus();
		return;
	}							
form1.submit();
}
</script>
<body>
 <form name=form1  method="post"  id=form1>
   <table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
   <tr> 
    <td height="25"><strong><font size="2" class=title><b><%=request("type")%>联系人</b></font></strong></td>
      <td>&nbsp;</td>
    </tr>
    <tr > 
      <td height="16" colspan="2" background="../images/title.gif">&nbsp;</td>
    </tr>
    <tr>
      <td height=4></td>
    </tr>
    <tr><td><div align="center" style="cursor:hand">
		<a onclick="save();"><img src="../images/button_save.gif"></a>&nbsp;&nbsp;&nbsp;&nbsp;
		<a onclick="window.close();"><img src="../images/button_cancel.gif"></a></DIV></td>
    </tr>
 </table>
  <table width="100%" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF">
    <tr bgcolor="white"> 
      <td width="15%" bgcolor="DEDFDE"> <div align="center"><font color=red>*&nbsp;</font>姓名</div></td>
      <td width="35%" bgcolor="EFEFEF" > <input name=contact type=text value="<%=strcontact%>" size="20">
        &nbsp;&nbsp; </td>
      <td width="15%" bgcolor="DEDFDE"> <div align="center">属性</div></td>
      <td width="35%" bgcolor="EFEFEF"><select name=contacttype>
          <%if strcontacttype<>"" then%>
          <option value="<%=strcontacttype%>"><%=strcontacttype%></option>
          <%else%>
          <option value="">--选择属性--</option>
          <%end if%>
          <option value="普通">普通</option>
          <option value="决策">决策</option>
          <option value="助手">助手</option>
        </select> </td>
    </tr>
    <tr  bgcolor="white"> 
      <td width="15%" height="23" bgcolor="DEDFDE" > <div align="center"><font color=red>*&nbsp;</font>客户</div></td>
      <td colspan="3" bgcolor="EFEFEF"> <div align="center"></div>
        <input name="caccount" type="hidden" size="8" value="<%=straccount%>"> 
        <input name="caccountname" type="text" size="40" value="<%=straccountname%>" readonly> 
        <input type="button" name="bncaccount" onClick="JavaScript:opensubwin2('form1','caccount')"    value=... class=black> 
      </td>
    </tr>
    <tr  bgcolor="white"> 
      <td width="15%" nowrap bgcolor="DEDFDE"> <div align="center"><font color=red>*&nbsp;</font>电话</div></td>
      <td width="35%" bgcolor="EFEFEF"><input name=workphone type=text value="<%=strworkphone%>" size="20"> 
      </td>
      <td width="15%" bgcolor="DEDFDE"> <div align="center"><font color=red>*&nbsp;</font>传真</div></td>
      <td width="35%" bgcolor="EFEFEF"> <input name=fax type=text value="<%=strfax%>" size="20"></td>
    </tr>
    <tr  bgcolor="white"> 
      <td width="15%" height="23" align="center" bgcolor="DEDFDE" >城市</td>
      <td width="35%" bgcolor="EFEFEF"> <input name=city type=text value="<%=strcity%>" size="20"></td>
      <td width="15%" align="center" bgcolor="DEDFDE">邮编</td>
      <td width="35%" bgcolor="EFEFEF"> <input name=zip type=text value="<%=strzip%>" size="20"></td>
    </tr>
    <tr  bgcolor="white"> 
      <td width="15%" bgcolor="DEDFDE" > <div align="center">地址</div></td>
      <td colspan="3" bgcolor="EFEFEF"> <input name=address type=text value="<%=straddress%>" size="50"> 
      </td>
    </tr>
    <tr  bgcolor="white"> 
      <td width="15%" bgcolor="DEDFDE" > <div align="center">部门</div></td>
      <td width="35%" bgcolor="EFEFEF"><input name=ContactDepartment type=text value="<%=strContactDepartment%>" size="20"> 
      </td>
      <td width="15%" bgcolor="DEDFDE"> <div align="center"><font color=red>*&nbsp;</font>职务</div></td>
      <td width="35%" bgcolor="EFEFEF"><input name=title type=text value="<%=strtitle%>" size="20"> 
      </td>
    </tr>
    <tr  bgcolor="white"> 
      <td width="15%" bgcolor="DEDFDE" > <div align="center">移动电话</div></td>
      <td width="35%" bgcolor="EFEFEF"> <input name=MotorPhone type=text value="<%=strMotorPhone%>" size="20"></td>
      <td width="15%" bgcolor="DEDFDE"> <div align="center">生日</div></td>
      <td width="35%" bgcolor="EFEFEF"> <input type="text" name="birthday<%=k%>" size="12" language=javascript id="dupdatetime" value="<%=strbirthday%>" readonly> 
        <% call AddImg("date")%>
        <input type = hidden name=clicksource> <input type = hidden name=clickresult > 
      </td>
    </tr>
    <tr  bgcolor="white"> 
      <td width="15%" bgcolor="DEDFDE" > <div align="center">电子邮件</div></td>
      <td width="35%" bgcolor="EFEFEF"><input name=email type=text value="<%=stremail%>" size="20"> 
      </td>
      <td width="15%" bgcolor="DEDFDE"> <div align="center">国家</div></td>
      <td width="35%" bgcolor="EFEFEF"> 
        <select name=country>
          <option value=-1></option>
          <%getdefine "国家",strcountry%>
        </select></td>
    </tr>
    <tr  bgcolor="white">
      <td bgcolor="DEDFDE" ><div align="center">所有者</div></td>
      <td bgcolor="EFEFEF"><input name="owner" type="hidden" size="8" value="<%=strowner%>"> 
        <input name="ownername" type="text" size="8" value="<%=strownername%>" readonly> 
        <input type="button" name="bnowner" onClick="JavaScript:opensubwin2('form1','owner')"    value=... class=black> 
      </td>
      <td bgcolor="DEDFDE"><div align="center">省份</div></td>
      <td bgcolor="EFEFEF"><select name=province>
          <option value=-1></option>
          <%getdefine "省份",strprovince%>
        </select></td>
    </tr>
    <tr  bgcolor="white"> 
      <td width="15%" bgcolor="DEDFDE" > <div align="center">失效</div></td>
      <td bgcolor="EFEFEF"> <input type="checkbox" name="disable" value=1 <%if strdisable=true then Response.Write "checked"%>> 
      </td>
      <td bgcolor="DEDFDE"><div align="center"></div></td>
      <td bgcolor="EFEFEF">&nbsp; </td>
    </tr>
    <tr  bgcolor="white"> 
      <td width="15%" bgcolor="DEDFDE" > <div align="center">描述</div></td>
      <td colspan="4" bgcolor="EFEFEF"> <textarea name="description" cols="45" rows="4"><%=strdescription%></textarea> 
      </td>
    </tr>
  </table>
</form>

⌨️ 快捷键说明

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