<!--#include file="../conn.asp"-->
<%
keyb = request.QueryString("keyb")
prm = "keyb="& keyb &"&"			'分页时需要保留的岑数

page=request.QueryString("page")
if page="" or isnumeric(page)=false then page=1
page_size = 21

set rs_tt = server.CreateObject("adodb.recordset")
sql_tt = "select tuangouCar.pinpaiImg,tuangouCar.sort1,tuangouCar.sort2,tuangouCar.id from tuangouCar,carSort where   carSort.sortName like '%"& keyb &"%' and carSort.id = tuangouCar.sort2 and tuangouCar.ifshenhe='yes' order by  tuangouCar.id desc"

'response.write sql_tt
'response.End()

rs_tt.open sql_tt,conn,1,1
if not rs_tt.eof then
	have = 1
	rs_tt.pagesize     = page_size
	rs_tt.absolutePage = page
	recordCountNum  = rs_tt.recordcount
else
	have = 0
	recordCountNum = 0
end if


%>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>搜索结果</title>
<link href="/css/comm.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/comm.js"></script>
<script type="text/javascript" src="/inc/showo_page.js"></script>
<style type="text/css">
.jieduan{ overflow:hidden; text-overflow:ellipsis; width:70px; white-space:nowrap;}
.car_biaoti {font-size:14px; color:#3b393a; text-decoration:none;}
.car_biaoti a:link{font-size:14px; color:#3b393a; text-decoration:none;}
.car_biaoti a:visited{font-size:14px; color:#3b393a; text-decoration:none;}
.car_biaoti a:hover{font-size:14px; color:#3b393a; text-decoration:underline;}
.car_biaoti a:active{font-size:14px; color:#3b393a; text-decoration:none;}
</style>
</head>

<body>
<div class="bodyDiv">
	<!--#include file="tuangou_top.asp"-->
	<!--#include file="daohang.asp"-->
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="267" valign="top" style="background-image:url(/images/leftbg.gif);">
		<!--#include file="model_paihang.asp"-->
        <br />
        <!--#include file="model_bidu.asp"--><br />
        <!--#include file="model_liucheng.asp"--><br />
        <!--#include file="model_shili.asp"--></td>
        <td valign="top" width="22">&nbsp;</td>
        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5" style="margin-top:10px;">
          <tr>
            <td bgcolor="#ECF4F6"><strong>以下是本次搜索的结果：共搜索到<span style="color:#FF0000;"><%=recordCountNum%></span>条信息</strong></td>
          </tr>
        </table>
        <%if have = 1 then%>
          <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#dad8db" style="border:solid 1px #cfb6a2; margin-top:10px;">
          <tr>
            <td height="36" bgcolor="#FFFFFF" style="color:#6e5c50; padding-left:10px; font-size:14px; font-weight:bold;">团购品牌</td>
          </tr>
         
          <tr>
            <td bgcolor="#f6f5f1">
             <%
		  i = 1
		  do while not rs_tt.eof and i <=page_size
		  %>
            <div style="float:left; width:205px; border-right:solid 1px #d9d9db;">
              <table width="100%" border="0" cellpadding="5" cellspacing="0">
                <tr>
                  <td colspan="2" style="border-bottom:solid 1px #dad8db; background-color:#ecf4f6; font-size:14px;" class="car_biaoti"><%="<a href='viewCar.asp?id="& rs_tt("id") &"&sort2="& rs_tt("sort2") &"&sort1="& rs_tt("sort1") &"'>"& getSortNameById(rs_tt("sort2")) &"</a>"%></td>
                </tr>
                <tr>
                  <td width="63"><img src="<%if rs_tt("pinpaiImg")<>"" then response.write "/"& rs_tt("pinpaiImg") &"" else response.write "/smallimg/pinpaiImg/noimg.jpg"%>" width="63"  /></td>
                  <td width="122" valign="top" class="moren">
				<%
				set rs_last = server.CreateObject("adodb.recordset")
				  rs_last.open "SELECT sum(carNum) AS carNum1, sort3 FROM tuangou_tongji WHERE sort2="& rs_tt("sort2") &" GROUP BY sort3",conn,1,1
				  
				  do while not rs_last.eof
					response.write "<div><a href='viewCar.asp?id="& rs_tt("id") &"&sort2="& rs_tt("sort2") &"&sort1="& rs_tt("sort1") &"&sort3="&  rs_last("sort3") &"'>"&getSortNameById(rs_last("sort3"))&"</a>("&rs_last("carNum1")&")人&nbsp;<a href='viewCar.asp?id="& rs_tt("id") &"&sort2="& rs_tt("sort2") &"&sort1="& rs_tt("sort1") &"&sort3="&  rs_last("sort3") &"'>报名</a></div>"
				  rs_last.movenext
				  loop
				  
				  rs_last.close
				  set rs_last = nothing%></td>
                </tr>
              </table>
            </div>
            
            <%
			if i mod 3 = 0 then response.write "<div style='clear:both;'></div>"
		  i = i + 1
		  rs_tt.movenext
		  loop
		  rs_tt.close
		  set rs_tt = nothing
		  %>
              </td>
          </tr>
          
        </table>
        <Script Language="JavaScript">
ShowoPage("<table style='BORDER-COLLAPSE: collapse' borderColor='#111111' height='10' cellSpacing='0' cellPadding='0' width='95%' border='0'><tr><td vAlign='bottom'  style='font-family: Verdana,宋体; font-size: 11.5px; line-height: 15px'>","</td></tr></table>","页次:<font color='red'>","</font>/","","&nbsp;","&nbsp;每页<font color='red'>","</font>&nbsp;","&nbsp;共计:<font color='red'>","</font></td><td vAlign='bottom' align='right'  style='font-family: Verdana,宋体; font-size: 11.5px; line-height: 15px'>","<font face=webdings>9</font>","<font face=webdings>7</font>","<font face=webdings>8</font>","<font face=webdings>:</font>","&nbsp;&nbsp;跳转:","<font color='orange'>[","]</font>","","","<font color='red'>","</font>","","",<%=recordCountNum%>,<%=page_size%>,4,"?p=parm1&<%=prm%>")
</Script>
          <%end if%>
        </td>
      </tr>
  </table>
<!--#include file="../model_bottom.asp"-->
</div>
</body>
</html>
<%
'=============================
'功能：根据ID号获得sortName
function getSortNameById(iddd)
	if iddd = "" then
		getSortNameById = "未定义"
	else
		set rs_1232456 = conn.execute("select sortName from carSort where id="& iddd &"")
		if rs_1232456.eof then 
			getSortNameById = "未定义"
		else
			getSortNameById = rs_1232456("sortName")
		end if
		set rs_1232456 = nothing
	end if
end function
%>