<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%if WS_S.MemberPriv("WS_SaleManageSaleShopManage")<>1 then HX_GoBack "对不起,您的权限不够!",""
ColumnName="":Tablename="HX_SaleShop":Orderby=" where 1=1":page=request("page"):action=request("action"):id=request("id")
select case action
case "del"  
 if WS_S.HX_IsNUM(id) then   conn.execute("delete from "&Tablename&" where WS_SSID="&id):WS_S.HX_Redirect("SaleShopManage.asp?page="&page)
case "search"
 BankName=WS_s.HX_Replace(request("BankName")):BankNo=WS_s.HX_Replace(request("BankNo")):SaleShopname=WS_s.HX_Replace(request("SaleShopname")):SaleShoptel=WS_s.HX_Replace(request("SaleShoptel")):SaleShopfax=WS_s.HX_Replace(request("SaleShopfax")):SaleShopurl=WS_s.HX_Replace(request("SaleShopurl")):SaleShopemail=WS_s.HX_Replace(request("SaleShopemail")):SaleShopaddress=WS_s.HX_Replace(request("SaleShopaddress")):SaleShoppost=WS_s.HX_Replace(request("SaleShoppost")):SaleShopDescribe=WS_s.HX_Replace(request("SaleShopDescribe"))
 if SaleShopname<>"" then Orderby=Orderby&" and WS_SaleShopname='"&SaleShopname&"'"
 if SaleShoptel<>"" then Orderby=Orderby&" and WS_SaleShoptel='"&SaleShoptel&"'"
 if SaleShopfax<>"" then Orderby=Orderby&" and WS_SaleShopfax='"&SaleShopfax&"'"
 if SaleShopurl<>"" then Orderby=Orderby&" and WS_SaleShopurl='"&SaleShopurl&"'"
 if SaleShopemail<>"" then Orderby=Orderby&" and WS_SaleShopemail='"&SaleShopemail&"'"
 if SaleShopaddress<>"" then Orderby=Orderby&" and WS_SaleShopaddress='"&SaleShopaddress&"'"
 if SaleShoppost<>"" then Orderby=Orderby&" and WS_SaleShoppost='"&SaleShoppost&"'"
 if SaleShopDescribe<>"" then Orderby=Orderby&" and WS_SaleShopDescribe='"&SaleShopDescribe&"'"
 if BankName<>"" then Orderby=Orderby&" and WS_SaleShopBankName='"&BankName&"'"
 if BankNo<>"" then Orderby=Orderby&" and WS_SaleShopBankNo='"&BankNo&"'"
end select
Orderby=Orderby&" and WS_SaleShopCreateMan="&loginuid&" order by WS_SSID 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='SaleShopCreate.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='9%'><div align='center'>电话号码</div></td><td width='8%'><div align='center'>传 真</div></td><td width='11%'><div align='center'>网 址</div></td><td width='8%'><div align='center'>电子邮件</div></td><td width='15%'><div align='center'>地 址</div></td><td width='8%'><div align='center'>邮 编</div></td><td width='7%'><div align='center'>备 注</div></td><td width='10%'><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_SSID")&"</td><td align='center'><a href='ProductManage.asp?SSID="&rs("WS_SSID")&"'>"&rs("WS_SaleShopName")&"</a></td><td align='center'>"&rs("WS_SaleShopTel")&"</td><td align='center'>"&rs("WS_SaleShopFax")&"</td><td align='center'>"
	if rs("WS_SaleShopUrl")<>"" then response.Write "<a href='http://"&replace(rs("WS_SaleShopUrl"),"http://","")&"' target='_blank'>"&replace(rs("WS_SaleShopUrl"),"http://","")&"</a>"
	response.Write "</td><td align='center'>"&rs("WS_SaleShopEmail")&"</td><td align='center'>"&rs("WS_SaleShopAddress")&"</td><td align='center'>"&rs("WS_SaleShopPost")&"</td><td align='center'>"&rs("WS_SaleShopDescribe")&"</td><td align='left'>"
	if rs("WS_SaleShopBankName")<>"" and rs("WS_SaleShopBankNo")<>"" then
	  response.write rs("WS_SaleShopBankName")&"<br>"&rs("WS_SaleShopBankNo")
	else
	 response.write rs("WS_SaleShopBankName")&rs("WS_SaleShopBankNo")
	end if
	response.write "</td><td align='center'><a href='SaleShopModify.asp?id="&rs("WS_SSID")&"'>修改</a> <a href='#' onclick=""if(!confirm('确认要删除此供应商记录吗？')) {return false};else {location.href='SaleShopManage.asp?action=del&id="&rs("WS_SSID")&"';return true;}"">删除</a></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>"%>
