{{:ModuleInclude('aapublic/header')}}

<!-- nav start -->
{{:ModuleInclude('aapublic/nav')}}

<!-- header top nav -->
{{:ModuleInclude('aapublic/header_top_nav')}}

<!-- search -->
{{:ModuleInclude('aapublic/nav_search')}}

<!-- header nav -->
{{:ModuleInclude('aapublic/header_nav')}}

<div class="home-floor">
    <div class="floor">
        <div class="am-container">
            {{foreach $ploutos_article_list as $key=>$va}}
            <div class="items-nav-title">
                <h1 style='color: {{$va["title_color"]}} '>{{$va['title']}}</h1>
            </div>
            <p>{{$va['content']|raw}}</p>
            {{/foreach}}
        </div>
    </div>
    <div class="nextJackpot floora">
        <div class="live">
            <a href="{{:MyUrl('index/user/live')}}" target="_blank" rel="noopener noreferrer">
            <video muted src="https://live.hkstv.hk.lxdns.com/live/hks/playlist.m3u8" id='previewVideo' controls="controls" autoplay="autoplay" width='200' height='200'></video>
            <i class="fa fa-display fa-3x"></i>
            </a>
		</div>
        <div class="liveright">
            <div class="data">
                <div class="jackpotdata">{{$goods_floor_list.jackpot.lottery_date}} NO.{{$goods_floor_list.jackpot.lotteryissue}}</div>
                <div class="standard"><i class="fa fa-dollar"></i>100,000,000</div>
                <div class="rupees">
                    <span>{{:Mylang('common.index_that_is')}}</span><i class="fa fa-dollar"></i>{{:Mylang('common.web_100_million')}}
			    </div>
		    </div>
		    <div class="adstime">
			    <div class="sari">
				    <p>{{:Mylang('common.do_you_know_when_the_God_of_Wealth_will_arrive')}}</p>
			    </div>
			    <div class="bottom">
				    <div class="w100">
					    <div class="red">
                            <i class="fa fa-2x fa-alarm-clock fa-beat"></i>
						    <span>{{:Mylang('common.remaining_time')}}</span>
					    </div>
					    <div class="counters" sv="{{:date('Y-m-d')}} 00:00:00" ev="{{:date('Y-m-d')}} 22:00:00" sc="{{:date('Y-m-d H:i:s')}}">
                            <span class="ctrP">
                                <span class="ctrT">{{:Mylang('common.web_hours')}}</span><span class="ctrV aution_h">-</span>
                            </span>
                            <span class="ctrP">
                                <span class="ctrT">{{:Mylang('common.web_minute')}}</span><span class="ctrV aution_i">-</span>
                            </span>
                            <span class="ctrP">
                                <span class="ctrT">{{:Mylang('common.web_second')}}</span><span class="ctrV aution_s">-</span>
                            </span>
                        </div>
				    </div>
			    </div>
            </div>
		</div>        
    </div>
    <div class="floor flooram">
        <div class="live">
            <a href="{{:MyUrl('index/user/live')}}" target="_blank" rel="noopener noreferrer">
            <video muted src="https://live.hkstv.hk.lxdns.com/live/hks/playlist.m3u8" id='previewVideo' controls="controls" autoplay="autoplay" width='100%' height='200'></video>
            <i class="fa fa-display fa-2x"></i>
            </a>
		</div>
        <div class="clear"></div>
        <div class="data">
            <div class="jackpotdata">{{$goods_floor_list.jackpot.lottery_date}}  NO. {{$goods_floor_list.jackpot.lotteryissue}}</div>
            <div class="standard"><i class="fa fa-dollar"></i>100,000,000</div>
            <div class="rupees">
                <span>{{:Mylang('common.index_that_is')}}</span><i class="fa fa-dollar"></i>{{:Mylang('common.web_100_million')}}
			</div>
		</div>
        <div class="clear"></div>
		<div class="adstime">
			<div class="sari">
				<p>{{:Mylang('common.do_you_know_when_the_God_of_Wealth_will_arrive')}}</p>
			</div>
			<div class="bottom">
				<div class="w100">
					<div class="redbg">
                        <i class="fa fa-alarm-clock fa-beat"></i><br>
						<span>{{:Mylang('common.remaining_time')}}</span>
					</div>
					<div class="counters" sv="{{:date('Y-m-d')}} 00:00:00" ev="{{:date('Y-m-d')}} 22:00:00" sc="{{:date('Y-m-d H:i:s')}}">
                        <span class="ctrP">
                            <span class="ctrT">{{:Mylang('common.web_hours')}}</span><span class="ctrV aution_h">-</span>
                        </span>
                        <span class="ctrP">
                            <span class="ctrT">{{:Mylang('common.web_minute')}}</span><span class="ctrV aution_i">-</span>
                        </span>
                        <span class="ctrP">
                            <span class="ctrT">{{:Mylang('common.web_second')}}</span><span class="ctrV aution_s">-</span>
                        </span>
                    </div>
				</div>
			</div>
        </div>
        <div class="clear"></div>
    </div>	
    <div class="floor">
        <div class="floor_centered bg555">
            <div class="result">
                <div class="result_left">
                    <div class="floor_date"><i class="fa-regular fa-calendar-days"></i> {{$goods_floor_list.ploutos.lottery_date}} <span>NO.{{$goods_floor_list.ploutos.lotteryissue}}</span></div>
                    <ul class="balls">
                        <li class="resultBall powerball">{{$goods_floor_list.ploutos.number_d}}</li>
                        <li class="resultBall powerball">{{$goods_floor_list.ploutos.grouping}}</li>
                        <li class="resultBall ball">{{$goods_floor_list.ploutos.number_a}}</li>
                        <li class="resultBall ball">{{$goods_floor_list.ploutos.number_b}}</li>
                        <li class="resultBall ball">{{$goods_floor_list.ploutos.number_c}}</li>
                    </ul>
                </div>
                <div class="result_right inline">
                    <div class="info">{{:Mylang('common.accumulated_bonus')}}: <span><br><i class="fa fa-dollar cred"></i> {{:number_format($goods_floor_list.ploutos.jackpot)}}</span></div>
                    <div class="info w299">{{:Mylang('common.jackpot_winners')}}: <span><br><i class="fa fa-map-marker cgreen"></i> {{$goods_floor_list.ploutos.area_name}}</span></div>
                    <div class="info">{{:Mylang('common.total_winners')}}: <span><br><i class="fa fa-user-secret"></i>  {{:number_format($goods_floor_list.ploutos.total_winners)}}</span></div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="floor">
        <div class="floor_centered">
            <h1>{{:Mylang('common.menu_lottery_history')}}</h1>
			<table class="styled bgeee">
				<thead>
					<tr>
						<th>{{:Mylang('common.draw_date')}}</th>
						<th>No.</th>
						<th>{{:Mylang('common.lottery_result')}}</th>
						<th>{{:Mylang('common.highest_bonus')}}</th>
						<th>{{:Mylang('common.region')}}</th>
					</tr>
				</thead>
				<tbody>
					{{volist name='$data_list' id='vo'}}
					<tr>
						<td><i class="fa-regular fa-calendar-days"></i>{{$vo['lottery_date']}}</td>
						<td>NO. {{$vo['lotteryissue']}}</td>
						<td>
							<ul class="xballs">
                                <li class="xresultBall powerball">{{$vo['number_d']}}</li>
                                <li class="xresultBall powerball">{{$vo['grouping']}}</li>
								<li class="xresultBall ball">{{$vo['number_a']}}</li>
								<li class="xresultBall ball">{{$vo['number_b']}}</li>
								<li class="xresultBall ball">{{$vo['number_c']}}</li>
							</ul>
						</td>
						<td class="cred"><i class="fa fa-dollar"></i> {{:number_format($vo['jackpot'])}}</td>
						<td><i class="fa fa-map-marker red"></i>{{$vo['areaid']}}</td>
					</tr>
					{{/volist}}
				</tbody>
			</table>
			<ul class="mstyled bgeee">
				{{volist name='$data_list' id='vo'}}
				<li>
					<p>{{:Mylang('common.draw_date')}} : {{$vo['lottery_date']}} NO. <span>{{$vo['lotteryissue']}}</span></p>
					<ul class="xballs">
                        <li class="xresultBall powerball">{{$vo['number_d']}}</li>
                        <li class="xresultBall powerball">{{$vo['grouping']}}</li>
						<li class="xresultBall ball">{{$vo['number_a']}}</li>
						<li class="xresultBall ball">{{$vo['number_b']}}</li>
						<li class="xresultBall ball">{{$vo['number_c']}}</li>
					</ul>
					<p>{{:Mylang('common.highest_bonus')}} : <span><i class="fa fa-dollar"></i> {{:number_format($vo['jackpot'])}}</span></p>
					<p>{{:Mylang('common.jackpot_winners')}} : <span><i class="fa fa-map-marker"></i> {{$vo['areaid']}}</span></p>
				</li>
				{{/volist}}
			</ul>			
			<div style="padding-right:50px;">
	  		    {{$page_html|raw}}
		    </div>
        </div>
    </div>
    <div class="floor">
        <div class="am-container">
            {{foreach $ploutos_article_bottom_list as $key=>$va}}
            <div class="items-nav-title">
                <h1 style='color: {{$va["title_color"]}} '>{{$va['title']}}</h1>
            </div>
            <p>{{$va['content']|raw}}</p>
            {{/foreach}}
        </div>
        <div style="height:50px;display:block;"></div>
    </div>
</div>
{{:ModuleInclude('aapublic/footer')}}

<script>
$(function() {
    //倒计时
	var nowTime = new Date(Date.parse($('.counters').attr('sc').replace(/-/g, "/")));
	$('.counters').each(function(){
		var g = $(this);
        var startTime = new Date(Date.parse(g.attr('sv').replace(/-/g, "/")));
        var endTime = new Date(Date.parse(g.attr('ev').replace(/-/g, "/")));
        if(startTime.getTime()<= nowTime && endTime.getTime() >=nowTime){
            var opts = {
	            nowTime: nowTime,
			    endTime: endTime,
			    callback: function(data){
			    	if(data.last>0){
				        g.find('.ctrP .aution_h').html(data.hour);
				        g.find('.ctrP .aution_i').html(data.mini);
				        g.find('.ctrP .aution_s').html(data.sec);
			    	}else{
			    		g.find('.counters').html(' ');
			    	}

			    }
			};
			FloorCountDown(opts);
        }else{
        	g.find('.counters').html(' ');
        }
	})       
}); 
function FloorCountDown(opts){
	var f = {
		zero: function(n){
			var n = parseInt(n, 10);
			if(n > 0){
				if(n <= 9){
					n = n;
				}
				return String(n);
			}else{
				return "0";
			}
		},
		count: function(){
			if(opts.nowTime){
				var d = new Date();
				d.setTime(opts.nowTime.getTime()+1000);
				opts.nowTime = d;
				d = null;
			}else{
				opts.nowTime = new Date();
			}
			//现在将来秒差值
			var dur = Math.round((opts.endTime.getTime() - opts.nowTime.getTime()) / 1000), pms = {
				sec: "0",
				mini: "0",
				hour: "0",
				day: "0"
			};
			if(dur > 0){
				pms.sec = f.zero(dur % 60);
				pms.mini = Math.floor((dur / 60)) > 0? f.zero(Math.floor((dur / 60)) % 60) : "0";
				pms.hour = Math.floor((dur / 3600)) > 0? f.zero(Math.floor((dur / 3600)) % 24) : "0";
				pms.day = Math.floor((dur / 86400)) > 0? f.zero(Math.floor(dur / 86400)) : "0";
			}
			pms.last = dur;
			pms.nowTime = opts.nowTime;
			opts.callback(pms);
			if(pms.last>0)setTimeout(f.count, 1000);
		}
	};
	f.count();
};
</script>