<!--#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"):id=request("id")
if not WS_S.HX_IsNUM(id) then    HX_GoBack "非法操作","" 
Orderby=" where WS_CCID="&id
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='"&Infonname&"' and WS_CCID<>"&id&" 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("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
 HX_GoBack "修改成功","CustomContactManage.asp" 
end if
response.write "<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='CustomContactCreate.asp' class='menu'>新建联系人</a>　　　<a href='CustomContactManage.asp' class='menu'>联系人管理</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")&"' "
	   if urs("WS_CIID")=cint(rs("WS_CIID")) then response.write " selected"
	   response.write ">"&urs("WS_CustomInfoName")&"</option>"
	   urs.movenext
	   loop
	  end if
	WS_S.HX_RSClose urs  
	  response.write "</select></td></tr><tr bgcolor='#FFFBE8'><td align='right'>姓　　名：</td><td><input name='ContactName' type='text' value='"&rs("WS_CustomContactName")&"' size='36'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>电话号码：</td><td><input type='text' size='36' name='ContactTel' value='"&rs("WS_CustomContactTel")&"' style='ime-mode:disabled'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>家庭电话：</td><td><input type='text' size='36' name='ContactHomeTel' value='"&rs("WS_CustomContactHomeTel")&"' style='ime-mode:disabled'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>手机号码：</td><td><input type='text' size='36' name='ContactMobile' value='"&rs("WS_CustomContactMobile")&"' style='ime-mode:disabled'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>电子邮件：</td><td><input type='text' size='36' name='ContactEmail' value='"&rs("WS_CustomContactEmail")&"' style='ime-mode:disabled'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>职　　务：</td><td><input type='text' size='36' name='Contactduty' value='"&rs("WS_CustomContactduty")&"'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>生　　日：</td><td><input type='text' size='28' name='ContactBorn' readonly value='"&rs("WS_CustomContactBorn")&"'> <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' value='"&rs("WS_CustomContactHibe")&"'></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=' 重 置 '><input name='id' type='hidden' id='id' value='"&id&"'></td></tr></form></table></td></tr></table>"
	  WS_S.HX_RSClose rs%>