<% data_path="../" 'ACC连接数据库路径，对SQL无效 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--#include file="../conn/conn.asp"-->
<!--#include file="../inc/safe.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=webname%>专项商机搜索</title>
<link href="<%=HOPE_InstallDir%>blue/blue.css" rel="stylesheet" type="text/css">
</head>
 <%
 
 	
   if issession=0 then
 	yxflag=Replace_Text(request.Cookies("yxflag"))
	gsid=Replace_Text(request.Cookies("Yxmemberid"))
 	else
 	yxflag=session("yxflag")
	gsid=session("id")
 	end if 
  keywords=replace_text(request("keywords"))
  viptype=Replace_Text(Request("viptype"))
  sortid=Replace_Text(request("p_z_Z_RootCategory")) 
 if   Replace_Text(request("p_z_Z_CategoryId1"))<>"" then
  CategoryId=split(Replace_Text(request("p_z_Z_CategoryId1")),",")
  typeid=CategoryId(0)      
  end if
  if replace_text(request("sortid"))<>"" then 
  sortid=replace_text(request("sortid"))
  end if
  if replace_text(request("typeid"))<>"" then 
   typeid=replace_text(request("typeid"))
  end if
  
sql="select * from Websen_vipinfo where vipinfo_id<>0 "
if keywords<>"" then 
sql=sql&"  and  (vipshowname like '%"&keywords&"%' or vipcontent like '%"&keywords&"%' or keywords like '%"&keywords&"%')"
end if
if sortid<>"" then
if sortid<>0 then
sql=sql&" and sortid="&sortid
end if
end if
if typeid<>"" then
if typeid<>0 then
sql=sql&"  and typeid="&typeid
end if
end if
if viptype<>"" then
if viptype<>"all" then
sql=sql&" and viptype="&viptype
end if
end if
 Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1 

msg_per_page=15 '定义每页显示记录条数
%>
<!--#include file="../inc/headtop.asp"-->
<script language="javascript">
	 function subcheck()
	 {
  	//var str=document.form.keywords.value;
//	if(str.replace(/\s+/g,"")==""||str=="请输入关键字")
//	{
//	alert("请输入关键字！");
//	document.form.keywords.focus();
//	return false;
//	}
	 }
	 </script>
	 <SCRIPT language=javascript> 
<!-- Hide 
function killErrors() { 
return true; 
} 
window.onerror = killErrors; 
 // --> 
</SCRIPT>
<SCRIPT language=JavaScript src="<%=HOPE_InstallDir%>mall.js"  type=text/JavaScript></SCRIPT>
<body>
 <DIV id=popImageLayer 
style=" background-color:#F6F6F6;BORDER-RIGHT: orange 1pt none; BORDER-TOP: orange 1pt none; VISIBILITY: hidden; BORDER-LEFT: orange 1pt none; WIDTH: 180px; CURSOR: hand; BORDER-BOTTOM: orange 1pt none; POSITION: absolute; HEIGHT: 180px" 
align=center calss="" name="popImageLayer"></DIV>
<table cellspacing="0" cellpadding="0" width="952" align="center" border="0">
  <tbody>
    <tr>
      <td height="3"></td>
    </tr>
    <tr>
      <td><table cellspacing="0" bordercolordark="#ffffff" cellpadding="0" width="100%" bordercolorlight="#cccccc" border="1">
        <tbody>
          <tr>
            <td bgcolor="#eeeeee" height="28"><div align="center">
              <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                <form action="<%=HOPE_InstallDir%>search/searchvipinfo.asp" method="post" name="form" id="form" onsubmit="return subcheck();">
                  <tr>
                    <td width="115" height="40"><br />
                      &nbsp;<font color="#CC3300"><b>专项商机搜索</b></font>：</td>
                    <td width="663">行业类别:
                      <select name="p_z_Z_RootCategory" onchange="changeCategory(this)"  >
                          <option value="0" selected="selected">--请选择行业大类--</option>
                        </select>
                      &nbsp;
                      <select name="p_z_Z_CategoryId1" maxlength="80">
                          <option value="0" selected="selected">--请选择行业子类--</option>
                      </select></td>
                  </tr>
                  <tr>
                    <td></td>
                    <td>商机类别:
                      <select size="1" name="viptype">
                          <option value="all">全部</option>
                          <%
 set rsvip=server.CreateObject("adodb.recordset")
 sqlvip="select * from Websen_vipinfo_class"
 rsvip.open sqlvip,conn,1,1
 if not rsvip.eof then 
 do while not rsvip.eof 
 %>
           <option value="<%=rsvip("typeid")%>"><%=rsvip("type")%></option>
   <%
 rsvip.movenext
 loop
 rsvip.close
 end if
 %>
                        </select>
                      &nbsp;关键字:
                      <input name="keywords" type="text" id="keywords"  onfocus="if(this.value=='请输入关键字'){this.value='';}" onblur="this.value=this.value.replace(/\s/g,'')" value=""   maxlength="25" />
                      &nbsp;
                      <input type="submit"  name="seabtn"  value="立即搜索" style=" border-color:#ffffff"/></td>
                  </tr>
                </form>
              </table>
            </div></td>
          </tr>
        </tbody>
      </table></td>
    </tr>
  </tbody>
</table>
<table width="952"  border="1" bordercolor="#F2F2F2" align="center" cellpadding="2" cellspacing="0" bgcolor="#FAFAFA">
        <tr>
          <td   > 
            <% 
			if keywords<>"" then
			response.Write("包含有<b>""<font color=red>"&keywords&"</font>""</b>的：<br>")
			end if
		    response.write" <img src="""&HOPE_InstallDir&"images/icon_point.gif"" border=0 width=18 height=19  align=absmiddle> <A href='"&HOPE_InstallDir&"search/searchproduct.asp?sortid="&sortid&"&typeid="&typeid&"&typeid_2="&typeid_2&"&keywords="&keywords&"'>所有产品信息</a>"
		    %>
            <%response.write" <img src="""&HOPE_InstallDir&"images/icon_point.gif"" border=0 width=18 height=19  align=absmiddle> <A href='"&HOPE_InstallDir&"search/searchsale.asp?sortid="&sortid&"&typeid="&typeid&"&typeid_2="&typeid_2&"&keywords="&keywords&"'>供应信息</A>"%><img src="<%=HOPE_InstallDir%>images/icon_point.gif" border="0" width="18" height="19"  align="absmiddle" />
             <%response.write"<A href='"&HOPE_InstallDir&"search/searchbuy.asp?sortid="&sortid&"&typeid="&typeid&"&typeid_2="&typeid_2&"&keywords="&keywords&"'>求购信息</A>"%>
            </span><img src="<%=HOPE_InstallDir%>images/icon_point.gif" border="0" width="18" height="19"  align="absmiddle" /><a href="<%=HOPE_InstallDir%>member/">发布求购信息</a></td>
        </tr>
      </table>
    <table width="952"   border="1" bordercolor="#F2F2F2" align="center" cellpadding="0" cellspacing="0" style="border-collapse:collapse">
 		   <tr> <td bgcolor="E7E7E7" height="30" align="center" width="16%"  ><font color="666666">图片 </font></td>            
              <td bgcolor="E7E7E7" align="center" width="44%" ><font color="666666">信息主题</font></td>
              <td bgcolor="E7E7E7" align="center" width="11%"  ><div align="center"><font color="666666">有效期</font></div></td>
              <td bgcolor="E7E7E7" align="center" width="11%" ><div align="center"><font color="666666">所属类型</font></div></td>
              <td bgcolor="E7E7E7" align="center" width="18%"  ><div align="center"><font color="666666">所属区域</font></div></td>
          </tr>
   <%
if rs.eof then
 response.Write"<tr><td  colspan=5 height=150 align=center><br><br><font color=red>暂无信息</font></td></tr>"
 else
if gsid="" and yxflag<>"1" then
response.Write("<tr><td  colspan=5 align=center  ><br><br><br><br><font color=red>对不起！你还不是会员，无此服务！</font><br><br><br><br></td></tr> ")
else
 do while not rs.eof and rowcount > 0
 %>
             <tr <%if icolor=0 then response.write"bgColor=#ffffff" else response.write"bgColor=#f6f6f6" end if%> onmouseover="this.style.backgroundColor='#FFF8F4'" onmouseout="this.style.backgroundColor='<%if icolor=0 then response.write"#ffffff" else response.write"#f6f6f6" end if%>'">
			<td  height="80" align="center"><%if rs("picture")<>"" and  rs("picture")<>"nopicture.gif" then %>
			
			<a class="M" href="<%=HOPE_InstallDir%>vipinfo/offerdetail/<%=rs("viptype")%>-<%=rs("vipinfo_id")%>.html" target="_blank"> 
			
  		<IMG    onmouseover="popImage(this,'<%=HOPE_InstallDir%>uploadfile/<%=rs("picture")%>','<%=HOPE_InstallDir%>vipinfo/offerdetail/<%=rs("viptype")%>-<%=rs("vipinfo_id")%>.html');"   src="<%=HOPE_InstallDir%>uploadfile/<%=rs("picture")%>"  width="55" height="55"    border=0 >	
			
			</a>
			<%else%>
			<font color="#999999">无图</font>
			<%end if%>
			</td>
              <td width="44%" class="m">&nbsp;<a class="M" href="<%=HOPE_InstallDir%>vipinfo/offerdetail/<%=rs("viptype")%>-<%=rs("vipinfo_id")%>.html" target="_blank" style="text-decoration:underline"> 
                <% Set re = New RegExp
re.Pattern ="("&keywords&")"
re.IgnoreCase = True
re.Global=True
result = re.Replace(rs("vipshowname"), "<font color=red>$1</font>")%>
                <b><font style="font-size:14px"><%=result%></font></b> </a>
               
				<br />&nbsp;<%=left(rs("vipcontent"),150)%>..
				<br /><font color="#666666">&nbsp;[发布时间：<%=rs("dateandtime")%>] </font>
			  </td>
              <td width="11%" class="cate"><div align="center"> <%=rs("vipperiod")%></div></td>
              <td align="middle" width="11%" class="cate"><div align="center">
                <%
	  set rsvt=server.CreateObject("adodb.recordset")
	  sqlvt="select * from Websen_vipinfo_class where typeid="&rs("viptype")
	  rsvt.open sqlvt,conn,1,1
	  if not rsvt.eof then 
	  response.Write(rsvt("type"))
      rsvt.close
	  end if	  
	%>
              </div></td>
              <td class="s" align="middle" width="18%" style="word-break:break-all"> <%=rs("country")%>   </td>
            </tr>
        <%
icolor=icolor+1
if icolor>1 then icolor=0
rowcount=rowcount-1
rs.movenext
loop
end if
end if

%> 
      
	  <tr><td  colspan="5"  align="center" ><%=listPages(""&HOPE_InstallDir&"search/searchvipinfo.asp")%></td></tr>
	  </table></td>
    </tr>
  </tbody>
</table>
<br />
<script>
   
     function Category(id,title) {
			this.id = id;
			this.title=title;
			this.boardlist=new Array();
			this.addBoard=addBoard;
			this.getOptions = getOptions;
        }        
       function addBoard(board) {
            this.boardlist = this.boardlist.concat(board);
        }
       function getOptions() {
			var tmp = new Array();
			for(var i=0; i < this.boardlist.length;i++) {
			var b = this.boardlist[i];
			tmp[i]= b.getOption();
			}
			return tmp;
        }
      function Board(catid,id,title,total) {                
			this.catid=catid;
			this.id=id;
			this.title=title;
			this.getOption=getOption;
        }
     function getOption() {
       return new Option(this.title,this.id);                
        }
     function changeCategory(list) {
        if (list.selectedIndex<=0) {
                catForm.options[0].selected=true;
                var len = boardForm.options.length;
                for (var i=len-1;i>0;i--){
                        boardForm.options[i]=null;
                }                                        
         }
        else {
                var boards = catArr[list.selectedIndex-1].getOptions();
                var len = boardForm.options.length;
                for (var i=len-1;i>0;i--){
                        boardForm.options[i]=null;
                }                
                for (var i=0;i<boards.length;i++) {
                        boardForm.options[i+1]=boards[i];
                }
                }
                boardForm.options[0].selected=true;
        }
     function selectBoard(catid,bid,list) {
		var isExist = false; //是否是叶子类目
		for(var i=0;i<catForm.length;i++) {
				if (catForm.options[i].value==catid) {
						//alert("get Category");
						catForm.options[i].selected=true;
						changeCategory(catForm);
						break;                        
				}                        
		}                                
		for(var i=0;i<boardForm.length;i++) {
				if (boardForm.options[i].value==bid) {
						//alert("get Board");
						boardForm.options[i].selected=true;  
						isExist = true;                              
						break;
				}                        
		}   
		 if (!isExist) {//如果是二级类目，则下拉框只显示该二级类目下所有类目                   
			var boards = catArr[catForm.selectedIndex-1].getOptions();
			var len = boardForm.options.length;
			for (var i=len-1;i>0;i--){
				boardForm.options[i]=null;
			}     
			var locate = 1;           
			for (var i=0;i<boards.length;i++) {                                                              
				if(boards[i].text.indexOf(bid) == 0){
					boardForm.options[locate]=boards[i];
					locate++;
				}                                                
			}
			 boardForm.options[0].selected=true;   
		}            
        }        
	  var catArr = new Array();
	  var cur;   
	  var catForm = document.form.p_z_Z_RootCategory;
	  var boardForm = document.form.p_z_Z_CategoryId1;
    function showCategorys() {
		var catId = catForm.value
		if(boardForm.value){
			catId = boardForm.value
		}else if(catForm.value){
			catId = catForm.value
		}
	   }
        for (var i=0;i<catArr.length;i++) {
          catForm.options[i+1]=new Option(catArr[i].title,catArr[i].id);
        }
     function initRootCategorys(){
	    for (var i=0;i<catArr.length;i++) {
	    catForm.options[i+1]=new Option(catArr[i].title,catArr[i].id);
	    }
	}  
 </script>
<script src="<%=HOPE_InstallDir%>js/allCategorys.js"></script>
<script>
initRootCategorys(); 
</script><table width="952" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td><!--#include file="../inc/end.asp"--></td>
  </tr>
</table>
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>