<?php include template('header');?>
<SCRIPT LANGUAGE="JavaScript" src="<?php echo STATIC_ROOT;?>/views/<?php echo TPL_DIR;?>/js/global.js"></SCRIPT>
<div class="subnav">
	<ul>
		<li <?php if(empty($_REQUEST['cateid'])){?>class="subxz"<?php }?>><a href="index.php">首页</a></li><li><a href="index.php">今日全部</a><span class="slhz">(<?php echo intval($totals);?>)</span></li>
		<?php foreach($GLOBALS['cate'] as $k=>$v){?>
		<li <?php if($_REQUEST['cateid']==$k){?>class="subxz"<?php }?>><a href="<?php echo url('index','groups',array('cateid'=>$k));?>"><?php echo $v['catename'];?></a><span class="slhz">(<?php echo intval($count[$k]);?>)</span></li>
		<?php }?>
	</ul>
</div>
<div class="tk15"></div>

<!--第一种形式-->
		<div id="tabs1">
		<ul class="menuwz0" id="menuwz0">
			<li id="cat0" onclick="wzTab(0)">精品团购</li>
		    <li id="cat1" onclick="wzTab(1)">网购大全</li>
		</ul>
		<SCRIPT LANGUAGE="JavaScript">
		<!--
			$('#menuwz0 li').eq(0).addClass('hover');
		//-->
		</SCRIPT>
		<div class="mainwz" id="mainwz0">

		    <ul class="block" id="url0">
		   		<div class="wzb01">
				<?php  foreach($indexgroup as $k=>$v){?>
				<li><a href="<?php echo url('index','site',array('id'=>$v['id']));?>" target="_blank" style="<?php echo $v['css'];?>"><?php echo $v['sitename'];?></a></li>
				<?php  }  ?>
				<li>
				<a href="<?php echo url('index','sites',array('id'=>$k));?>" target="_blank">更多>></a></li>
				</div>
		    </ul>
	
		    <ul class="block" id="url1" style="display:none;" >
		   		<div class="wzb01">
				<?php  foreach($indexother as $key=>$val){?>
				<li><a href="<?php  echo url('index','goothersite',array('id'=>$val['id'])); ?>" target="_blank"> <p style="color:<?php echo $val['color']; ?>;<?php echo $val['font'];  ?>" ><?php echo $val['sitename'];?></p></a></li>
				<?php  }  ?>
				<li>
				<a href="<?php echo url('index','othersite');?>" target="_blank">更多>></a></li>
				</div>
		    </ul>

		</div>
	</div>
	<script>

	function wzTab(m){
		$('#mainwz0 ul').hide();
		$('#menuwz0 li').removeClass('hover');

		$('#cat'+m).addClass('hover');
		$('#url'+m).show();
	}

	</script>

<?php include template('nav');?>


<div class="tk10"></div>

	<div class="ty1000">
			<div id="recos">
				<div style="position: absolute; width: 3675px; left: 0px;" id="j-recos-list">
				<?php if($recommends){foreach($recommends as $k=>$v){?>
					<div class="recoDeal">
						<a class="recoCover" target="_blank" href="<?php echo url('index','group',array('id'=>$v['id']));?>"><img data-scover="<?php echo $v['thumb'];?>" src="<?php echo $v['thumb'];?>"></a>
						<a class="recoTitle" target="_blank" href="<?php echo url('index','group',array('id'=>$v['id']));?>"><span class="recoSource"><?php echo $v['groupsite'];?>：</span><?php echo $v['subject'];?></a>
						<span class="recoWorth">原价：<span class="value"><?php echo $v['oldprice'];?></span></span>
						<span class="recoDiscount">折扣：<?php echo $v['discount'];?>折</span>
						<span class="recoAmount"><?php echo $v['nowprice'];?></span>
						<a class="recoBuy" target="_blank" href="<?php echo url('index','group',array('id'=>$v['id']));?>">购买</a>
					</div>
				<?php }}?>
				</div>
				<ul id="j-recos-page" class="recoPager"></ul>
			</div>
			<div class="ycad">
				<!-- 广告位：团购窝窝 -->
				<?php if(is_file('data/adjs/headbanner.js')){?>
				<script language='javascript' src='data/adjs/headbanner.js'></script>
				
				<?php }?>
			</div>
	</div>

<div class="tk10"></div>

 
<div class="xtbt">
	<div class="t01"></div>
	<?php
	$parem=array('biz'=>$bizid,'smallcatelist'=>$small_catelist,'cateid'=>$bigcateid,'biz'=>$bizid,'desctype'=>$_REQUEST['desctype']=='asc'?'desc':'asc');
	?>
	<div class="t02"><div class="px"><li <?php if(empty($_REQUEST['field'])){?> class="xz"<?php }?>> <a href="<?php echo url('index','index',$parem);?>">默认排序</a></li>
			<li <?php if($_REQUEST['field']=='price'){?> class="xz"<?php }?>> <a href="<?php echo url('index','index',array_merge(array('field'=>'price'),$parem));?>">价格排序</a></li>
			<li <?php if($_REQUEST['field']=='discount'){?> class="xz"<?php }?>> <a href="<?php echo url('index','index',array_merge(array('field'=>'discount'),$parem));?>">折扣排序</a></li>
			<li <?php if($_REQUEST['field']=='time'){?> class="xz"<?php }?>> <a href="<?php echo url('index','index',array_merge(array('field'=>'time'),$parem));?>">时间排序</a></li>		
	</div></div>
</div>	
<div class="tk10"></div>

<div class="tgxxlr">

	<?php if($groups['data']){foreach($groups['data'] as $k=>$v){?>
	<div class="xlr">
			<?php if($v['starttime']>=time()-86400 && $v['starttime']<=time()){?>
			<div class="xlr_news"></div>
			<div class="xlr_bt">
			<?php } else{?>
			<div class="xlr_btw">
			<?php }?><h1><font class="tylzi"><a href="<?php echo url('index','groupsite',array('id'=>$v['siteid']));?>" target="_blank"><?php echo $v['groupsite'];?></a></font> | <a href="<?php echo url('index','group',array('id'=>$v['id']));?>" target="_blank"><?php echo $v['subject'];?></a></h1>
			</div>
			<div class="xlr_img">
			<div class="xbtime">
					<h1>
						<label class="xbcs" id="lasttime_<?php echo $v['id'];?>"></label>
						<SCRIPT LANGUAGE="JavaScript">
						<!--
							normal_time("<?php echo date('m/d/Y H:i:s',$v['lasttime']);?>","lasttime_<?php echo $v['id'];?>","团购已结束");
						//-->
						</SCRIPT><?php echo $v['cityname'];?>
					</h1>
			</div>
			<A HREF="<?php echo url('index','group',array('id'=>$v['id']));?>" title="<?php echo $v['subject'];?>" target="_blank"><img src="<?php echo $v['thumb'];?>" /></A></div>
			<div class="xlr_jg"><h1><a href="<?php echo url('index','group',array('id'=>$v['id']));?>" target="_blank"><?php echo $v['nowprice'];?></a></h1><h2><a href="<?php echo url('index','group',array('id'=>$v['id']));?>" target="_blank"><font class="sc">￥<?php echo $v['oldprice'];?></font> | <?php echo $v['discount'];?>折 </a></h2></div>
			<div class="xlr_qt"><h1><font class="hz"><?php echo $v['hits']>0?$v['hits']:$v['nowpeople'];?></font>人已关注</h1><h2 class="tylzi"><a href="#"></a></h2></div>
	</div>	
	<?php }}?>
		

</div>

<div class="tk15"></div>

<div class="xgd">
	<div class="qt" id="countshow">
	<SPAN id="countsite">
	<?php 
	$alltotal=$groups['page']->count;
	if($alltotal>$limit){
		?>
	<a href="<?php echo url('index','groups');?>">后面还有 <font class="xmz01"><?php echo $alltotal-$limit;?></font> 条<?php echo $GLOBALS['nowcity'];?>团购,点此打开更多 	&gt;&gt;</a>
	<?php } else{?>
	<a href="#">没有更多团购了,回到顶部</a>
	<?php }?>
	</SPAN>
</div>
</div>
<div class="tk15"></div>

<div class="inlink">
<?php
	foreach($GLOBALS['link'] AS $key => $val)
		{
			if($val['type']==1)
			{
				$text[] = $val;		
			}		
			if($val['type']==2)
			{
				$thumb[] =$val;
			}			
			
		}
?>
	<ul>
	
		<?php   foreach($thumb AS $key => $val){  ?>
			<li><a href="<?php echo $val['url']; ?>" target="_blank"><img src="<?php  echo $val['thumb']; ?>"></a></li>
		<?php   } ?>
	
		<?php   foreach($text AS $key => $val){  ?>
			<li><a href="<?php echo $val['url']; ?>" target="_blank"><?php  echo $val['title']; ?></a></li>
		<?php   } ?>
	</ul>
</div>

<SCRIPT LANGUAGE="JavaScript" src="<?php echo STATIC_ROOT;?>/views/<?php echo TPL_DIR;?>/js/focusimg.js"></SCRIPT>
<?php include template('footer');?>