<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%if WS_S.MemberPriv("WS_SaleManageCustomInfoManage")<>1 then HX_GoBack "对不起,您的权限不够!",""
ColumnName="":Tablename="HX_CustomInfo"
page=request("page")
action=request("action")
  if action="del" then
  id=request("id")
  if WS_S.HX_IsNUM(id) then
    conn.execute("delete from "&Tablename&" where WS_CIID="&id)
	WS_S.HX_Redirect("CustomInfoManage.asp?page="&page)
  end if  	
end if
Orderby=" where 1=1"
if action="search" then
 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"))
 if WS_S.HX_IsNUM(InfoMan) and infoman>0 then  Orderby=Orderby&" and WS_CustomInfoMan="&infoman
 if Infonname<>"" then Orderby=Orderby&" and WS_CustomInfoName='"&Infonname&"'"
 if infotel<>"" then Orderby=Orderby&" and WS_CustomInfotel='"&infotel&"'"
 if infofax<>"" then Orderby=Orderby&" and WS_CustomInfofax='"&infofax&"'"
 if infourl<>"" then Orderby=Orderby&" and WS_CustomInfourl='"&infourl&"'"
 if infoemail<>"" then Orderby=Orderby&" and WS_CustomInfoemail='"&infoemail&"'"
 if infoaddress<>"" then Orderby=Orderby&" and WS_CustomInfoaddress='"&infoaddress&"'"
 if infopost<>"" then  Orderby=Orderby&" and WS_CustomInfopost='"&infopost&"'"
 if infoDescribe<>"" then Orderby=Orderby&" and WS_CustomInfoDescribe='"&infoDescribe&"'"
end if
Orderby=Orderby&" and (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 rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
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'></head><body topmargin='20' leftmargin='0' bottommargin='0'><table width='98%'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#613c25'><tr><td colspan='2' bgcolor=FFFBE8 background='../hximages/titlelinebg.gif'><table width='590'  border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>客户管理</font>　　　　　　<a href='CustomInfoCreate.asp' class='menu'>新建客户</a></td></tr></table><table width='100%'  border='0' cellspacing='1' cellpadding='0' bgcolor=FFFBE8><tr bgcolor='#BF9B73'><td width='5%' height='20' align='right'><div align='center'>编 号</div></td><td width='11%'><div align='center'>客户名称</div></td><td width='8%'><div align='center'>客户等级</div></td><td width='8%'><div align='center'>电话号码</div></td><td width='10%'><div align='center'>传 真</div></td><td width='12%'><div align='center'>网 址</div></td><td width='11%'><div align='center'>电子邮件</div></td><td width='11%'><div align='center'>地 址</div></td><td width='10%'><div align='center'>邮 编</div></td><td width='6%'><div align='center'>备 注</div></td><td width='8%'><div align='center'>操 作</div></td></tr>"
 if rs.recordcount>0 then
 rs.PageSize =15 '每页记录条数
	iCount=rs.RecordCount '记录总数
	iPageSize=rs.PageSize
    	maxpage=rs.PageCount 
    	page=request("page")
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    rs.AbsolutePage=Page
	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	ii=0
	do while not rs.EOF
  response.Write "<tr bgcolor='#FFFBE8' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#FFFBE8' align=center><td align='center' height='20'>"&rs("WS_CIID")&"</td><td align='center'>"
  if rs("WS_CustomInfoCreateMan")=cint(loginuid) or rs("WS_CustomInfoMan")=cint(loginuid) or rs("WS_CustomInfoMan")=0 then response.Write "<a href='CustomContactManage.asp?Ciid="&rs("WS_CIID")&"'>"
  response.Write rs("WS_CustomInfoName")&"</a></td><td align='center'>"
  call WS_S.HX_CustomInfoRank(rs("WS_CRID")) 
  response.write WS_CustomRankName&"</td><td align='center'>"&rs("WS_CustomInfoTel")&"</td><td align='center'>"&rs("WS_CustomInfoFax")&"</td><td align='center'>"
  if rs("WS_CustomInfoUrl")<>"" then response.Write "<a href='http://"&replace(rs("WS_CustomInfoUrl"),"http://","")&"' target='_blank'>"&replace(rs("WS_CustomInfoUrl"),"http://","")&"</a>"
  response.Write "</td><td align='center'>"&rs("WS_CustomInfoEmail")&"</td><td align='center'>"&rs("WS_CustomInfoAddress")&"</td><td align='center'>"&rs("WS_CustomInfoPost")&"</td><td align='center'>"&rs("WS_CustomInfoDescribe")&"</td><td align='center'>"
  if WS_S.MemberPriv("WS_SaleManageCustomInfoManage")<>1 then 
    if rs("WS_CustomInfoCreateMan")=cint(loginuid) or rs("WS_CustomInfoMan")=cint(loginuid) or rs("WS_CustomInfoMan")=0 then response.Write "<a href='CustomModify.asp?id="&rs("WS_CIID")&"'>修改</a> <a href='#' onclick=""if(!confirm('确认要删除此客户记录吗？')) {return false};else {location.href='CustomInfoManage.asp?action=del&id="&rs("WS_CIID")&"';return true;}"">删除</a>"
  else
	response.Write "<a href='CustomModify.asp?id="&rs("WS_CIID")&"'>修改</a> <a href='#' onclick=""if(!confirm('确认要删除此客户记录吗？')) {return false};else {location.href='CustomInfoManage.asp?action=del&id="&rs("WS_CIID")&"';return true;}"">删除</a>"
  end if
  response.Write "</td></tr>"
  ii=ii+1
  if ii>=rs.PageSize then Exit Do
	  rs.movenext
loop
end if
 for i=0 to 15-rs.recordcount
   response.Write "<tr bgcolor='#FFFBE8' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#FFFBE8' align=center><td height='25'>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>"
 next
   if rs.recordcount>0 then
   call WS_S.PageControl(iCount,maxpage,page,"border=0 align=right","<p align=right>",11)
   end if
   call WS_S.HX_RSClose(rs) 
   response.Write "</table></td></tr></table>"
%>