<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%
ColumnName="":Tablename="HX_CustomInfo":Tablename1="HX_CompanyUser":Orderby=""
action=request("action")
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
if action="saveinfo" then
 saleman=WS_s.HX_Replace(request("saleman"))
 InfoMan=WS_s.HX_Replace(request("InfoMan"))
 Infonname=WS_s.HX_Replace(request("infoname"))
 infotel=WS_s.HX_Replace(request("infotel"))
 infofax=WS_s.HX_Replace(request("infofax"))
 infourl=WS_s.HX_Replace(request("infourl"))
 infoemail=WS_s.HX_Replace(request("infoemail"))
 infoaddress=WS_s.HX_Replace(request("infoaddress"))
 infopost=WS_s.HX_Replace(request("infopost"))
 infoDescribe=WS_s.HX_Replace(request("infoDescribe"))
 CRID=WS_s.HX_Replace(request("CRID"))
 Orderby=" where WS_CustomInfoName='"&Infonname&"' and WS_CustomInfoCreateMan="&loginuid
 set ifrs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
 if ifrs.recordcount>0 then
   WS_S.HX_RSClose ifrs
   HX_GoBack "用户已创建",""
 end if
 rs.addnew  
   rs("WS_CustomInfoSaleMan")=saleman
   rs("WS_CustomInfoMan")=InfoMan
   rs("WS_CustomInfoName")=Infonname
   rs("WS_CustomInfoTel")=infotel
   rs("WS_CustomInfoFax")=infofax
   rs("WS_CustomInfoUrl")=infourl
   rs("WS_CustomInfoEmail")=infoemail
   rs("WS_CustomInfoAddress")=infoaddress
   rs("WS_CustomInfoPost")=infopost
   rs("WS_CustomInfoDescribe")=infoDescribe
   rs("WS_CustomInfoCreateMan")=loginuid
   rs("WS_CRID")=CRID
 rs.update
 response.write "<script>if(confirm('添加成功！是否继续添加？')) {location.href='CustomInfoCreate.asp';}else {location.href='CustomInfoManage.asp';}</script>"
 response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>客户管理</title>
<link rel=stylesheet type=text/css href="../HXinclude/HX_Style.css">
<script src="../HXinclude/HX_Function.js"></script>
</head>
<body topmargin="20" leftmargin="0" bottommargin="0">
<table width="596"  border="0" cellspacing="1" cellpadding="0" align=center bgcolor="#613c25">
  <tr>
    <td colspan="2" bgcolor=FFFBE8><table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="25" background="../hximages/titleline.gif"><font class="fontmenu">新建客户</font>　　　　　　<a href="CustomInfoManage.asp" class="menu">客户管理(客户总数 <%=rs.recordcount%> )</a></td>
  </tr>
</table>
<table width="100%"  border="0" cellspacing="1" cellpadding="3" bgcolor=FFFBE8>
  <form name="form1" method="post" action="?action=saveinfo" onSubmit="return CustomCheck(this);"><tr bgcolor="#FFFBE8">
    <td width="23%" align="right">销 售 员：</td>
    <td width="77%"><select name="saleman" id="saleman">
	<option value="0">所有</option>
	<%
	set urs=WS_S.HX_SetRSD(ColumnName,Tablename1,Orderby)
	if urs.recordcount>0 then
	  do until urs.eof
	%>
      <option value="<%=urs("WS_Uid")%>"><%=urs("WS_Name")%></option><%
	   urs.movenext
	   loop
	  end if
	WS_S.HX_RSClose urs  
	  %>
    </select>
      <font color="#FF0000">*只能查看客户资料</font></td>
  </tr>
  <tr bgcolor="#FFFBE8">
    <td align="right">是否为共享客户：</td>
    <td><select name="InfoMan" id="InfoMan">
      <option value="0">所有</option>
	<%
	set urs=WS_S.HX_SetRSD(ColumnName,Tablename1,Orderby)
	if urs.recordcount>0 then
	  do until urs.eof
	%>
      <option value="<%=urs("WS_Uid")%>"><%=urs("WS_Name")%></option><%
	   urs.movenext
	   loop
	  end if
	WS_S.HX_RSClose urs  
	  %>
    </select>
    <font color="#FF0000">*不仅具有查看权限还具有修改和删除权限</font></td>
  </tr>
  <tr bgcolor="#FFFBE8">
    <td align="right">客户级别：</td>
    <td><select name="CRID" id="CRID">
	<%
	set crs=WS_S.HX_SetRSD("","HX_CustomRank"," order by WS_OrderBy asc")
	if crs.recordcount>0 then
	  do until crs.eof
	%>
      <option value="<%=crs("WS_CRID")%>"><%=crs("WS_CustomRankName")%></option><%
	   crs.movenext
	   loop
	  end if
	WS_S.HX_RSClose crs  
	  %>
    </select></td>
  </tr>
  <tr bgcolor="#FFFBE8">
    <td align="right">客户名称：</td>
    <td><input type="text" size="36" name="InfoName"></td>
  </tr>
  <tr bgcolor="#FFFBE8">
    <td align="right">电话号码：</td>
    <td><input type="text" size="36" name="InfoTel" style="ime-mode:disabled"></td>
  </tr>
  <tr bgcolor="#FFFBE8">
    <td align="right">传　　真：</td>
    <td><input type="text" size="36" name="InfoFax" style="ime-mode:disabled"></td>
  </tr>
  <tr bgcolor="#FFFBE8">
    <td align="right">网　　址：</td>
    <td><input type="text" size="36" name="InfoUrl" style="ime-mode:disabled"></td>
  </tr>

  <tr bgcolor="#FFFBE8">
    <td align="right">电子邮件：</td>
    <td><input type="text" size="36" name="InfoEmail" style="ime-mode:disabled"></td>
  </tr>
  <tr bgcolor="#FFFBE8">
    <td align="right">地　　址：</td>
    <td><input type="text" size="36" name="InfoAddress"></td>
  </tr>
  <tr bgcolor="#FFFBE8">
    <td align="right">邮政编码：</td>
    <td><input type="text" size="36" name="InfoPost" style="ime-mode:disabled" onKeyPress="event.returnValue=IsDigit();"></td>
  </tr>
  <tr bgcolor="#FFFBE8">
    <td align="right">备　　注：</td>
    <td><input type="text" size="36" name="InfoDescribe"></td>
  </tr>
  <tr bgcolor="#FFFBE8">
    <td align="right" valign=top>&nbsp;</td>
    <td><input type="submit" name="Submit" value=" 创 建 ">
      <input type="reset" name="Submit2" value=" 重 置 "></td>
  </tr></form>
</table></td>
  </tr>
</table>
<%WS_S.HX_RSClose rs%>
