<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"--><!--#INCLUDE FILE="../HXINCLUDE/SelectDate.ASP"-->
<%if WS_S.MemberPriv("WS_SaleManageCustomContactManage")<>1 then HX_GoBack "对不起,您的权限不够!",""
ColumnName="":Tablename="HX_CustomContact":Tablename1="HX_CustomInfo":Orderby=""
action=request("action")
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
if action="saveinfo" then
 CIID=WS_s.HX_Replace(request("CIID")):Contactnname=WS_s.HX_Replace(request("Contactname")):Contacttel=WS_s.HX_Replace(request("Contacttel")):ContactHomeTel=WS_s.HX_Replace(request("ContactHomeTel")):ContactMobile=WS_s.HX_Replace(request("ContactMobile")):Contactemail=WS_s.HX_Replace(request("Contactemail")):Contactduty=WS_s.HX_Replace(request("Contactduty")):ContactBorn=WS_s.HX_Replace(request("ContactBorn")):ContactHibe=WS_s.HX_Replace(request("ContactHibe"))
 Orderby=" where WS_CustomContactName='"&Contactnname&"' and WS_CustomContactCreateMan="&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_CIID")=CIID:rs("WS_CustomContactName")=Contactnname:rs("WS_CustomContactTel")=Contacttel:rs("WS_CustomContactHomeTel")=ContactHomeTel:rs("WS_CustomContactMobile")=ContactMobile:rs("WS_CustomContactEmail")=Contactemail:rs("WS_CustomContactduty")=Contactduty
  if isdate(ContactBorn) then rs("WS_CustomContactBorn")=ContactBorn
  rs("WS_CustomContactHibe")=ContactHibe:rs("WS_CustomContactCreateMan")=loginuid:rs.update
 response.write "<script>if(confirm('添加成功！是否继续添加？')) {location.href='CustomContactCreate.asp';}else {location.href='CustomContactManage.asp';}</script>"
 response.end
end if
response.Write "<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='CustomContactManage.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 CustomActCheck(this);'><tr bgcolor='#FFFBE8'><td width='23%' align='right'>所属单位：</td><td width='77%'><select name='CIID' id='CIID'><option value='0'>不属于任何单位</option>"
Orderby=" where WS_CustomInfoSaleMan="&loginuid&" or WS_CustomInfoMan="&loginuid&" or WS_CustomInfoCreateMan="&loginuid&" or WS_CustomInfoMan=0 or WS_CustomInfoCreateMan=0 order by WS_CIID desc"
set urs=WS_S.HX_SetRSD(ColumnName,Tablename1,Orderby)
if urs.recordcount>0 then do until urs.eof:response.Write "<option value='"&urs("WS_CIID")&"'>"&urs("WS_CustomInfoName")&"</option>":urs.movenext:loop
response.Write "</select></td></tr><tr bgcolor='#FFFBE8'><td align='right'>姓　　名：</td><td><input type='text' size='36' name='ContactName'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>电话号码：</td><td><input type='text' size='36' name='ContactTel' style='ime-mode:disabled'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>家庭电话：</td><td><input type='text' size='36' name='ContactHomeTel' style='ime-mode:disabled'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>手机号码：</td><td><input type='text' size='36' name='ContactMobile' style='ime-mode:disabled'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>电子邮件：</td><td><input type='text' size='36' name='ContactEmail' style='ime-mode:disabled'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>职　　务：</td><td><input type='text' size='36' name='Contactduty'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>生　　日：</td><td><input type='text' size='28' name='ContactBorn' readonly> <input onclick=""popUpcalendar(this, form1.ContactBorn, 'yyyy/mm/dd')"" type='button' value='选择' title='选择开始时间'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>爱　　好：</td><td><input type='text' size='36' name='ContactHibe'></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%>
