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

📄 addnew.asp

📁 功能齐全的oa系统
💻 ASP
字号:
<% option explicit%>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/Page.asp" -->
<!-- #include virtual="include/String.asp" -->
<%
Dim ObjRS,rs,conn
%>
<%
if session("AccountID")="" then
%>
<script language=javascript>
  alert("因登录时间过长,会话失效,请退出重新登陆!")
</script>
<%  
  Response.End
end if

Set conn=Server.CreateObject("ADODB.Connection")
OpenDBCrm( conn )
%>

<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
<!--读取分类字段赋给JS数组-->
dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * from T_CRM_Guest_industry",conn,1,1
count = 0
do while not rs.eof 
%>
subcat[<%=count%>] = new Array("<%= trim(rs("Gindustry"))%>","<%= rs("Gtype_ID")%>","<%= rs("ID")%>");
<%
        count = count + 1
        rs.movenext
        loop
        rs.close
%>
		
onecount=<%=count%>;


function changelocation(locationid)
    {
    document.myform._Gindustry.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
             document.myform._Gindustry.options[document.myform._Gindustry.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script> 

<%

If Request.Form.Count > 0 Then
  Dim C,SqlStr
  Dim IntID
  If Trim(Request("_Gname"))="" then
	Response.Write "<script language=javascript>alert('请填写客户名称');history.back();</script>"
    Response.End
  End if
  SqlStr="select * from T_CRM_Guest Where Gname='"&Trim(Request("_Gname"))&"'"
  Set ObjRS=Server.CreateObject("Adodb.Recordset")
  ObjRS.open SqlStr,conn,1,3
  If Not(ObjRS.Eof and ObjRS.Bof) Then
  	ObjRS.close
  	Set ObjRS=Nothing
  	Response.Write "<script language=javascript>alert('该客户已添加过,请重新填写');history.back();</script>"
    Response.End
  End if
  
  conn.Execute("insert into T_CRM_Guest (Gname,Gtel,Gaddress,Gtype,Gindustry,Gemail,Gfox,Gpost,Gweb,Gemployeenum,Greceive,Gsim,Gprovince,Gcity,Gkind,Goutpour,Gcorporate,Gproductsource,Ghonor,Gtechnum,Gachievement,Greview,Ginviter,Gcreater,CreateTime,Remark) values ('"&FixSQL(Request("_Gname"))&"','"&FixSQL(Request("_Gtel"))&"','"&FixSQL(Request("_Gaddress"))&"','"&FixSQL(Cint(Request("_Gtype_ID")))&"','"&FixSQL(cint(Request("_Gindustry")))&"','"&FixSQL(Request("_Gemail"))&"','"&FixSQL(Request("_Gfox"))&"','"&FixSQL(Request("_Gpost"))&"','"&FixSQL(Request("_Gweb")) &"','"&FixSQL(Request("_Gemployeenum"))&"','"&FixSQL(Request("_Greceive"))&"','"&FixSQL(Request("_Gsim"))&"','"&FixSQL(Request("_Gprovince"))&"','"&FixSQL(Request("_Gcity"))&"','"&FixSQL(Request("_Gkind"))&"','"&FixSQL(Request("_Goutpour"))&"','"&FixSQL(Request("_Gcorporate"))&"','"&FixSQL(Request("_Gproductsource"))&"','"&FixSQL(Request("_Ghonor"))&"','"&FixSQL(Request("_Gtechnum"))&"','"&FixSQL(Request("_Gachievement"))&"','"&FixSQL(Request("_Greview"))&"','"&FixSQL(Request("_Ginviter"))&"','"&session("AccountID")&"','"&date()&"','"& FixSQL(Request("_Remark"))&"')")
  conn.Close
  Set conn = Nothing
  Response.Redirect "List.asp"
End If

Sub Main
%>
<HTML><HEAD>
  <form name="myform" action="" method="post" onsubmit="return(CheckForm(this))">
  <input type=hidden name=_AccountID value=<%=Session("AccountID")%>>
  <table class=Ltable cellspacing=1 cellpadding=3>
  <tr class=LHtr align="middle">
    <td width="15%">新增客户</td>
    <td width="85%" colspan=3> </td>
  </tr>
  <tr class=Ltr>
    <td>客户名称</td>
    <td><input type="text" class=Input Check=1 Show="客户名称" name="_Gname" value=""></td>
  </tr>
  <tr class=Ltr>
     <td>行业</td>
     <td>
       <%
		  Set rs = conn.Execute("select * from T_CRM_Guest_type") 
		  if rs.eof and rs.bof then
		  Response.Write "请先添加客户行业信息"
		  else
			%>
	  <select name="_Gtype_ID" onChange="changelocation(document.myform._Gtype_ID.options[document.myform._Gtype_ID.selectedIndex].value)">
        
		<option selected value="<%=rs("ID")%>"><%=trim(rs("Gtype"))%></option>
        <%      
		 dim selclass
		 selclass=rs("ID")
		 rs.movenext
		 do while not rs.eof
		%>
        <option value="<%=rs("ID")%>"><%=trim(rs("Gtype"))%></option>
        <%
		 rs.movenext
		 loop
		end if
		rs.close
		%>

      </select>
	  </td>
  </tr>
  <tr class=Ltr>
    <td>客户类型</td>
    <td>
	<%
		rs.open "select * from T_CRM_Guest_industry where Gtype_ID="&Cint(selclass) ,conn,1,3
		if rs.eof and rs.Bof then
        response.Write "请先添加客户类型信息"
		rs.close
		else
		%>
	<select name="_Gindustry">
        
        
        <option value="<%=rs("ID")%>" selected><%=rs("Gindustry")%></option>
        <%
		rs.movenext
		do while not rs.eof
		%>
        <option value="<%=rs("ID")%>"><%=rs("Gindustry")%></option>
        <%
		rs.movenext
		loop
		end if
		
%>

	</select>
	</td>
  </tr>
  
  <tr class=Ltr>
    <td>联系电话</td>
    <td><input type="text" class=Input Check=0 Show="联系电话" name="_Gtel" value=""></td>
  </tr>

  <tr class=Ltr>
    <td>地址</td>
    <td><input type="text" class=Input Check=0 Show="地址" name="_Gaddress" value=""></td>
  </tr>
  </table>
  <table id=MoreInfo class=Ltable cellspacing=1 cellpadding=3>
  <tr class=LStr>
	<td width="15%">详细信息</td>
	<td width="85%" colspan=3> </td>
  </tr>
  <tr class=Ltr>
    <td>企业性质</td>
    <td><input type="text" class=Input Check=0 Show="企业性质" name="_Gkind" value=""></td>

    <td>注册资金</td>
    <td><input type="text" class=Input Check=0 Show="注册资金" name="_Goutpour" value=""></td>
  </tr>
  <tr class=Ltr>
    <td>法人代表</td>
    <td><input type="text" class=Input Check=0 Show="法人代表" name="_Gcorporate" value=""></td>

    <td>公司网址</td>
    <td><input type="text" class=Input Check=0 Show="公司网址" name="_Gweb" value=""></td>
  </tr>
  <tr class=Ltr>
    <td>邮编</td>
    <td><input type="text" class=Input Check=0 Show="邮编" name="_Gpost" value=""></td>

    <td>传真</td>
    <td><input type="text" class=Input Check=0 Show="传真" name="_Gfox" value=""></td>
  </tr>
  <tr class=Ltr>
	<td>员工总人数</td>
    <td><input type="text" class=Input Check=0 Show="员工总人数" name="_Gemployeenum" value=""></td>
    <td>技术人员人数</td>
    <td><input type="text" class=Input Check=0 Show="技术人员人数" name="_Gtechnum" value=""></td>
  </tr>
  <tr class=Ltr>
    <td>年收入</td>
		<td><input type="text" class=Input Check=0 Show="年收入" name="_Greceive" value=""></td>

    <td>电子信箱</td>
		<td><input type="text" class=Input Check=0 Show="电子信箱" name="_Gemail"  value=""></td>
  </tr>
  <tr class=Ltr>
		<td>所在省份</td>
		<td><input type="text" class=Input Check=0 Show="所在省份" name="_Gprovince"  value=""></td>

		<td>所在城市</td>
		<td><input type="text" class=Input Check=0 Show="所在城市" name="_Gcity"  value=""></td>
	</tr>
	<tr class=Ltr>
		<td>企业产品来源</td>
		<td colspan=3><textarea rows="3" cols="40" class=Input Check=0 Show="企业产品来源" name="_Gproductsource"></textarea></td>
	</tr>
	<tr class=Ltr>
		<td>获得荣誉</td>
		<td colspan=3><textarea rows="3" cols="40" class=Input Check=0 Show="获得荣誉" name="_Ghonor"></textarea></td>
	</tr>
	<tr class=Ltr>
		<td>企业相关业绩</td>
		<td colspan=3><textarea rows="3" cols="40" class=Input Check=0 Show="企业相关业绩" name="_Gachievement"></textarea></td>
	</tr>
	<tr class=Ltr>
		<td>招标小组实地考察</td>
		<td colspan=3><textarea rows="3" cols="40" class=Input Check=0 Show="招标小组实地考察" name="_Greview"></textarea></td>
	</tr>
	<tr class=Ltr>
		<td>招标小组成员</td>
		<td colspan=3><textarea rows="3" cols="40" class=Input Check=0 Show="招标小组成员" name="_Ginviter"></textarea></td>
	</tr>
	<tr class=Ltr>
		<td>备注</td>
		<td colspan=3><textarea rows="3" cols="40" class=Input Check=0 Show="备注" name="_Remark"></textarea></td>
	</tr>

  </table>
  <table cellspacing=1 cellpadding=3>
  <tr>
    <td>
    <input type="submit"  name="Submit" class=Button value="提 交"><input type="button" class=Button value="取 消" onclick="doList()" id=button1 name=button1></td>
    <td></td>
  </tr>
  </table>
  </FORM>
<%
End Sub
%>
<!-- #include virtual="Templet/Templet.asp" -->

⌨️ 快捷键说明

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