<!--
<?php
print <<<EOT
--> 
<link rel="stylesheet" type="text/css" href="$webdb[www_url]/images/fashion/shoptg/index.css">
<div class="MainAdCont">
    <div class="ad1">$label[fashion_stgindext1]</div>
    <div class="ad2">$label[fashion_stgindext2]</div>
    <div class="ad3">$label[fashion_stgindext3]</div>
</div>
<div class="MainCont">
	<div class="MainL">
<!--
EOT;
$listtg = list_title($type='new',$rows=3);
$i=0;
foreach($listtg AS $key=>$rs){
$i++;
$rs[save] = $rs[market_price] - $rs[price];
//$rs[end_time] && $rs[end_time] = strtotime("$rs[end_time] 23:59:59");
$rs[end_time] && $rs[end_time]=preg_replace("/([\d]+)-([\d]+)-([\d]+) ([\d]+):([\d]+):([\d]+)/eis","mk_time('\\4','\\5', '\\6', '\\2', '\\3', '\\1')","$rs[end_time] 23:59:59");
$listtime = $rs[end_time] - $timestamp;
if($listtime>=0){
$displayword = $rs[pay_num] >= $rs[min_num] ? "<img src=\"$webdb[www_url]/images/yellow/stg-buy.gif\">团购成功,还可以<br/>继续购买..." : "<img src=\"$webdb[www_url]/images/yellow/stg-no.gif\">团购还没成功,请大家<br/>继续推荐...";
}else{
$displayword = "<img src=\"$webdb[www_url]/images/yellow/stg-over.gif\">活动已经结束,请不要<br/>再抢购...";
}
print <<<EOT
-->
<SCRIPT LANGUAGE="JavaScript">   
<!-- 
	var maxtime{$i} = $listtime; //一个小时，按秒计算，自己调整!
	function CountDown{$i}(){ 
		if(maxtime{$i}>=0){
			days{$i} = Math.floor(maxtime{$i}/86400);
			hours{$i} = Math.floor(maxtime{$i}%86400/3600); 
			minutes{$i} = Math.floor(maxtime{$i}%86400%3600/60);   
			seconds{$i} = Math.floor(maxtime{$i}%60);
			msg{$i} = "<div class='pic'><img src='$webdb[www_url]/images/fashion/shoptg/time.gif'></div><div class='word'>距离本这团购结束还有:<br/><font color=red>"+days{$i}+"</font>天<font color=red>"+hours{$i}+"</font>时<font color=red>"+minutes{$i}+"</font>分<font color=red>"+seconds{$i}+"</font>秒</div>" ;
			--maxtime{$i};
		} 
		else{
			msg{$i} = "<div class='pic'><img src='$webdb[www_url]/images/fashion/shoptg/time0.gif'></div><div class='word'><font color='red'>本次团购活动<br/>已经结束</font></div>" ;
		} 
		document.getElementById('timer'+$i).innerHTML=msg{$i};
	}
	timer{$i} = setInterval("CountDown{$i}()",1000);
//-->   
</SCRIPT> 
		<div class="ListTg">
        	<div class="num"><span>{$i}</span></div>
            <div class="about">
           		<span>{$city_DB[name][$rs[city_id]]}</span><a href="bencandy.php?fid=$rs[fid]&id=$rs[id]" target="_blank">{$rs[about]}</a>              
            </div>
            <dl>
            	<dt>
                	<div class="Atc">
                    	<div class="price">￥{$rs[price]}</div>
                        <div class="cg"><a href="join.php?fid=$rs[fid]&cid=$rs[id]&hownum=1" target="_blank"><img src="$webdb[www_url]/images/fashion/shoptg/cg.gif"></a></div>
                    </div>
                    <div class="Offer">
                        <div><span>原价</span><em><strike>￥{$rs[market_price]}</strike></em></div>
                        <div><span>折扣</span><em>{$rs[shoptype]}折</em></div>
                        <div><span>节省</span><em>￥{$rs[save]}</em></div>
                    </div>
                    <div class="timeover" id="timer{$i}"><p>这里是用JS调用出来的剩余时间...</p></div> 
                    <div class="Status">
                    	<div class="now">
                        	<div class="n1">报名<span>{$rs[join_num]}</span>人 </div>
                        	<div class="n2">确定参与<span>{$rs[pay_num]}</span>人</div>
                        </div>
                        <div class="red">{$displayword}</div>
                        <div class="m">最低团购人数:{$rs[min_num]}人</div>
                    </div> 
                </dt>
                <dd>
                	<div class="img">
                        <a href="bencandy.php?fid=$rs[fid]&id=$rs[id]" target="_blank"> 
                            <img src='$rs[picurl]' onError="this.src='$webdb[www_url]/images/default/nopic.jpg'" height="300" /> 
                        </a>
              		</div>
                    <div class="title"><a href="bencandy.php?fid=$rs[fid]&id=$rs[id]" target="_blank">{$rs[title]}</a></div>
                    <div class="Address"><span>地址:</span>$rs[address]</div>
                </dd>
            </dl>
        </div>
<!--
EOT;
}
print <<<EOT
--> 
    </div>
    <div class="SideR">
    	<div class="ShowSorts">
        	<div class="head"><div class="tag">官方团购分类</div></div>
            <div class="cont">
<!--
EOT;
foreach($Fid_db[0] AS $key=>$name){
$name=get_word($name,20);
print <<<EOT
-->
				<div class="list"><a href="list.php?fid=$key" target="_blank">$name</a></div>
<!--
EOT;
}print <<<EOT
-->	          
            </div>
        </div>
        <div class="NoteCont">
        	<div class="head">
            	<div class="tag">$label[shoptg_tt4]</div>
                <div class="more">$label[shoptg_m5]</div>
            </div>
            <div class="cont">
            	$label[shoptg_a4]
            </div>
        </div>
    </div>
    <div style="clear:both;"></div>
</div>
<!--
EOT;
?>
-->