{template 'yp', 'header'}
<div id="main">
  <div id="right">
    <div id="position"><strong>当前位置：</strong><a href="{$M[url]}">企业黄页</a><a href="{$M[url]}buy.php">商机</a>搜索结果</div>
    <dl id="catlist">
      {if $catid}
	  <dt>{$CATEGORY[$catid][catname]}</dt>
	  {get sql="SELECT catname,catid FROM `phpcms_category` WHERE module = 'yp' AND parentid = '$catid' ORDER BY listorder ASC"}
      <dd><a href="{$M[url]}buy.php?pagesize={$pagesize}&tid={$tid}&areaname={$areaname}&catid={$r[catid]}&order={$order}">{$r['catname']}</a><span>(1203)</span></dd>
	  {/get}
	  {/if}
    </dl>
    <div class="bk_10"></div>
    <div class="gsxx_1">
      <span class="gsjs2">公司信息</span>
      <span class="zczj">单价（元）</span>
      <span class="area">公司所在地</span>
    </div>
    <div class="clear"></div>
    <div id="show_0">
	{get sql="SELECT b.*,c.companyname,c.areaname FROM `phpcms_yp_buy` `b`, `phpcms_member_company` `c` WHERE b.status = 99 AND $where" rows="20" page="$page" urlrule="$M[url]buy.php?action=searchlist&areaname=$areaname&catid=$catid&lprice=$lprice&hprice=$hprice&q=$q|$M[url]buy.php?action=searchlist&areaname=$areaname&catid=$catid&lprice=$lprice&hprice=$hprice&q=$q&page=\\$page"}	
	<dl class="list_1 list_2">
      <dt><strong><a href="{show_url('buy',$r['id'])}">{$r['title']}</a><span class="time">{date("Y-m-d H:i:s",$r['inputtime'])}</span></strong><span class="zczj">{$r['price']}</span><span class="area">{$r['areaname']}</span></dt>
      <dd class="pic"><a href="{show_url('buy',$r['id'])}"><img src="{thumb($r['thumb'],120,80)}" alt="{$r['title']}" width="120" height="80"/></a></dd>
      <dd><strong>产品简介：</strong>{str_cut(strip_tags($r['content']),120)} </dd>
      <dd><strong>生产商：</strong><a href="{company_url($r['userid'])}">{$r['companyname']}</a>&nbsp; <img src="{$M[url]}images/cellect.gif" align="absmiddle" alt="添加至收藏夹" style="cursor:pointer;" onclick="favorite('{$title}',window.location.href)"></dd>
    </dl>
	{/get}
    </div>    
    <div id="pages">{$pages}</div>
  </div>
  <div id="left">
    <div class="box_t">
      <h3>产品库大类列表</h3>
    </div>
    <div class="box_c">
      <ul class="text_list w_100">
      {get sql="SELECT catname,catid FROM `phpcms_category` WHERE module = 'yp' AND parentid = '0' ORDER BY listorder ASC"}
		<li><a href="{list_url('buy',$r[catid])}">{$r['catname']}</a></li>
	  {/get}
      </ul>
      <div class="clear"></div>
    </div>
    <div class="box_b"></div>
    <div class="bk_10"></div>
    <div class="box_t">
      <h3>浏览过的产品</h3>
    </div>
    <div class="box_c">
      <ul class="pic_list_1">
      {if $prowhere}
	  {get sql="SELECT id,title,thumb FROM `phpcms_yp_product` WHERE id IN ($prowhere) ORDER BY FIND_IN_SET(id,'$prowhere')" rows="10"}
	  <li><a href="{show_url('product',$r['id'])}"><img src="{thumb($r['thumb'],48,48,1,'images/no_pic_50_50.gif')}" alt="" width="48" height="48"/></a><a href="{show_url('product',$r['id'])}" title="{$r['title']}">{$r['title']}</a></li>
	  {/get}
	  {else}
	  <li>您还没有浏览过任何商品</li>
	  {/if}
      </ul>
      <div class="clear"></div>
    </div>
    <div class="box_b"></div>
    <div class="bk_10"></div>
    <div class="box_t">
      <h3>最新产品</h3>
    </div>
    <div class="box_c">
      <ul class="pic_list">
        {get sql="SELECT p.id,p.title,p.thumb,c.companyname,p.userid FROM `phpcms_yp_product` `p`,`phpcms_member_company` `c` WHERE c.userid = p.userid ORDER BY id DESC" rows="10"}
			<li>
				<img src="{thumb($r['thumb'],48,48,1,'images/no_pic_50_50.gif')}" alt="" width="48" height="48"/>
				<a href="{show_url('product',$r['id'])}" title="{$r['title']}"><strong>{str_cut($r['title'],20,'')}</strong></a>
				<span><a href="{company_url($r['userid'])}" title="{$r['companyname']}">{$r['companyname']}</a></span>
			</li>
		{/get}
      </ul>
    </div>
    <div class="box_b"></div>
    <div class="bk_10"></div>
    <div class="box_t">
      <h3>推荐产品</h3>
    </div>
    <div class="box_c">
      <ul class="pic_list">
        {get sql="SELECT p.id,p.title,p.thumb,c.companyname,p.userid FROM `phpcms_yp_product` `p`,`phpcms_member_company` `c` WHERE c.userid = p.userid AND p.elite = 1 ORDER BY id DESC" rows="10"}
			<li><img src="{thumb($r['thumb'],48,48)}" alt="" width="48" height="48"/><a href="{show_url('product',$r[id])}"><strong>{str_cut($r['title'],20,'')}</strong></a><a href="{company_url($r['userid'])}"><span>{$r['companyname']}</span></a></li>
		{/get}
      </ul>
    </div>
    <div class="box_b"></div>
  </div>
</div>
<SCRIPT LANGUAGE="JavaScript">
<!--
function my_submit(form)
{
	form.submit();
}
function favorite(title,url)
{
	alert(url);
}
//-->
</SCRIPT>
{template 'yp', 'footer'}
