<?php defined('G_IN_SYSTEM')or exit('No permission resources.'); ?><?php include templates("index","header");?>
<link rel="stylesheet" type="text/css" href="<?php echo G_TEMPLATES_STYLE; ?>/css/LotteryDetail.css"/>
<div class="clear"></div>
<div class="wrap w1200">
<div class="Current_nav w1200">
	<a href="<?php echo WEB_PATH; ?>">首页</a> <span>&gt;</span> 
	<a href="<?php echo WEB_PATH; ?>/goods_list/<?php echo $item['cateid']; ?>">
	<?php echo $category['name']; ?>
	</a> <span>&gt;</span> 
	<a href="<?php echo WEB_PATH; ?>/goods_list/<?php echo $item['cateid']; ?>e<?php echo $item['brandid']; ?>">
	<?php echo $brand['name']; ?>
	</a> <span>&gt;</span>揭晓详情 
</div>
<div class="show_content">
<style>
.huojiang{
 display:-webkit-box-flex;
  display:-webkit-flex;
  display:flex;
}
.hj-center{
  -webkit-box-flex:1;
  -webkit-flex:1;
  flex:1;
}
.gbtn:hover{
  opacity:0.8;
}


.w_winner_name dl dd{height:38px;color:#999;font-size:14px;line-height:38px;float:left;}
.w_winner_name dl dd.w_time{width:86px;padding-left:28px;}
/*2015-6-29 start*/
.w_winner_name dl dd.w_yin{width:100px;padding-left:120px;}
.w_winner_name dl dd.w_account,.w_account{width:135px;padding-left:15px;}
.w_winner_name dl dd.w_name,.w_name{width:500px;}
.w_winner_name dl dd.w_people,.w_people{width:90px;padding-left:80px;}
/*2015-6-29 end*/
.w_winner_name p{height:30px;line-height:30px;text-align:center;font-size:12px;color:#fff;width:100%;background:#dd2726;}
.w_winner_name .w_specific{margin-top:4px;}
/* .w_winner_name .w_specific ul{float:left;}  */
.w_winner_name .w_specific ul li{float:left;font-size:12px;color:#3c3c3c;}
</style>
	<!-- 商品信息 -->
	<div class="Pro_Details">
		<p style="font-size:20px;padding-bottom: 9px;margin-left:15px;margin-top: 15px;color:#f00">
			<span class="f24">(第<?php echo $item['qishu']; ?>期)</span>
			<span class="f24"><?php echo $item['title']; ?></span></br>
			<span style="<?php echo $item['title_style']; ?>"><?php echo $item['title2']; ?></span>
		</p>
        <div class="Pro_Detleft">
            <div class="Pro_Detimg">
				<div class="zoom-small-image"><a href="<?php echo WEB_PATH; ?>/goods/<?php echo $item['id']; ?>" title="<?php echo $item['title']; ?>"><img width="398" height="398" src="<?php echo G_UPLOAD_PATH; ?>/<?php echo $item['thumb']; ?>"></a></div>
            </div>
            <?php if($itemzx): ?>
			<div class="Result_LConduct">
				<dl>
					<dt><span>第<?php echo $itemzx['qishu']; ?>期</span>正在进行</dt>
					<dd>
						<div class="Result_Progress-bar">
							<p><span style="width:<?php echo width($itemzx['canyurenshu'],$itemzx['zongrenshu'],208); ?>px;"></span></p>
							<ul class="Pro-bar-li">
								<li class="P-bar01"><em><?php echo $itemzx['canyurenshu']; ?></em>已参与人次</li>
								<li class="P-bar02"><em><?php echo $itemzx['zongrenshu']; ?></em>总需人次</li>
								<li class="P-bar03"><em><?php echo $itemzx['shenyurenshu']; ?></em>剩余人次</li>
							</ul>
						</div>
						<p><a href="<?php echo WEB_PATH; ?>/goods/<?php echo $itemzx['id']; ?>" target="_blank" class="Result_LConductBut bg_red b_red">查看详情</a></p>
					</dd>
				</dl>
			</div>
            <?php endif; ?>
        </div>
        <div style="margin-left:0px;" class="Pro_Detright">
           <div style="background:url(<?php echo G_TEMPLATES_IMAGE; ?>/mowokj.gif)no-repeat;background-size:750px 167px;width:750px;height:167px;font-size:50px;color:#dd2726;margin:0px auto 0px;position:relative;">
		     <span style="position:relative;top:20px;left:70px;color:#876009;font-family:'Microsoft YaHei';font-weight:bolder; font-size:15px;"><strong>期号:&nbsp;&nbsp;<?php echo $item['qishu']; ?>&nbsp;&nbsp;&nbsp;&nbsp;幸运夺宝码</strong></span>
			  <span style="position:relative;top:50px;left:-88px;color:#876009;font-family:'Microsoft YaHei';font-weight:bolder; font-size:25px;"><strong>揭晓结果</strong></span>
			 <?php $ln=1;if(is_array($q_user_code_arr)) foreach($q_user_code_arr AS $q_code_num): ?>

			 <span style="position:relative;top:50px;left:-30px ;font-family:'Microsoft YaHei'; font-weight:bold; font-size:70px;color:#d80000;" class=""><?php echo $q_code_num; ?></span>
			  <?php  endforeach; $ln++; unset($ln); ?>

		   </div>
                <div class="Announced_FrameBut">
					<a href="javascript:;"  class="Announced_But">本期详细计算结果</a>
					<a href="javascript:;"  class="Announced_But">看看有谁参与了</a>
					<a href="javascript:;" class="Announced_But">看看有谁晒单</a>
					<a href="javascript:;" class="Announced_But">查看往期夺宝</a>
				</div>
			</div>	
			
			
			
			
			
			
			
			
<!--
        <div class="ygRecord" name="div_tab">
                <div class="RecordOnehundred"><h4>截止该商品揭晓购买时间【<?php echo microt($item['q_end_time']); ?>】最后50条全站购买时间记录</h4>
                <div class="FloatBox"></div>
                    <?php 
                    $addList = $this->db->GetList("select * from `@#_member_go_record` where time < '{$item['overtime']}' order by id desc limit 50");
                     ?>
                   <?php $ln=1;if(is_array($addList)) foreach($addList AS $record): ?>
                   <?php 
                        $itemid = $item['id'];
                        $record_time = explode(".",$record['time']);
                        $record['time'] = $record_time[0];
                        $record['timeadd'] = str_replace(':','',date("H:i:s",$record['time']));
                        $record['timeadd'] = $record['timeadd'].$record_time[1];
                    ?>
                   <ul class="Record_content">
                        <li class="time"><b><?php echo date("Y-m-d",$record['time']); ?></b><?php echo date("H:i:s",$record['time']); ?>.<?php echo $record_time['1']; ?></li>
                        <li class="timeVal"><?php echo $record['timeadd']; ?></li>
                        <li class="nem"><a class="gray02" href="<?php echo WEB_PATH; ?>/uname/<?php echo idjia($record['uid']); ?>" target="_blank"><?php echo get_user_name($record['uid']); ?></a></li>
                        <li class="name"><a class="gray02" href="<?php echo WEB_PATH; ?>/goods/<?php echo $record['shopid']; ?>" target="_blank">（第<?php echo $record['shopqishu']; ?>期）<?php echo $record['shopname']; ?></a></li>
                        <li class="much"><?php echo $record['gonumber']; ?>人次</li>
                    </ul>
                    <?php  endforeach; $ln++; unset($ln); ?>
                </div>
-->
			    <div style="margin-top:10px;height:100px;padding:8px;width:740px;float:left;position:relative;top:0px;" class="m-detail-main-rule">
                    <ul style="margin:0 auto;" class="txt">
                        <li>
                            <span class="title">计算公式</span>
                            <?php 
                                $result1 = 0;
                                foreach ($addList as $key => $value) {
                                    $tmp = explode('.', $value['time']);
                                    $item_time = date("His",$tmp[0]);
                                    $item_time .= $tmp[1];
                                    $result1 = bcadd($result1, $item_time);
                                }
                                $result2 = str_split($item['period1']);
                             ?>
                            <div class="formula">
                                <div class="box red-box">
                                    <b class="txt-red"><?php echo $item['q_user_code']; ?></b><br>
                                    <b class="txt-red" style="font-size:12px">本期幸运号码</b>
                                </div>
                                <div class="operator">=(</div>
                                <div class="box gray-box">
                                    <b class="txt-red"><?php echo $result1; ?></b><br>50个时间求和
                                    <div class="more-box">
                                        <i class="ico ico-arrow ico-arrow-yellow"></i>
                                        <div class="yellow-box f-breakword">奖品的最后一个号码分配完毕，公示该分配时间点前本站全部奖品的<span class="txt-red">最后50个参与时间</span>，并求和</div>
                                    </div>
                                </div>
                                <div class="operator" title="组合">+</div>
                                <div class="box gray-box">
                                    <b class="txt-red"><?php echo $item['period1']; ?></b><br>“老时时彩”开奖号码
                                    <div class="more-box">
                                        <i class="ico ico-arrow ico-arrow-yellow"></i>
                                        <div class="yellow-box f-breakword">取最近一期“老时时彩” (第<span class="txt-red"><?php echo $item['period1_date']; ?></span>期) 开奖结果。 <a href="http://baidu.lecai.com/lottery/draw/sorts/cqssc.php?agentId=5591" target="_blank">开奖查询</a></div>
                                    </div>
                                </div>
                                <div class="operator" title="取余">)%</div>
                                <div class="box"><b class="txt-red"><?php echo $item['canyurenshu']; ?></b><br>该奖品总需人次</div><div class="operator" title="相加">+</div><div class="box"><b class="txt-red">10000001</b><br>原始数</div>
                            </div>
                        </li>
                    </ul>
            </div>				
		<div style="float:left; margin-top:20px;width:758px;height:110px;background-color:#fAfAfA;border:1px solid #E0E0E0; border-radius: 10px; class="huojiang">
	  <div style="float:left;width:90px;height:90px;margin:10px;background-color:#fff;background-image:url(<?php echo G_UPLOAD_PATH; ?>/<?php echo get_user_key($item['q_uid'],'img'); ?>);background-repeat:no-repeat;background-size:80px 80px;background-position:5px 5px;border:1px solid #f2f2f2;" class=""></div>
	  <div style="float:left;height:90px;margin:10px;" class="hj-center">
	     <p style="color:#00A600;font-size:13px;margin-bottom:20px;">恭喜<a style="color:#C40000;" href="<?php echo WEB_PATH; ?>/uname/<?php echo idjia($item['q_uid']); ?>" target="_blank" class="blue" title="Warm">
                                <?php echo get_user_name($q_user); ?> </a> 获得本期商品
                            </p>
							<p style="color:#00A600;"><strong><b>用户ID:<?php echo $item['q_uid']; ?></b></strong>(ID为用户唯一不变标识)</p>
                            <p style="color:#996600;">揭晓时间：<?php echo microt($item['q_end_time']); ?></p>
                            <p style="color:#996600;"><?php echo _cfg('web_name_two'); ?>时间：<?php echo microt($user_shop_time); ?></p>

	  </div>
	  <div style="float:right;width:385px;height:90px;margin:10px;background-color:#fff;border:1px solid #E0E0E0; border-radius:8px; overflow-y:auto; overflow-x:auto; " class="">
	   
         <div style="border:none;" class="MaCenter">
                <p style="border:none;">商品获得者本期总共<?php echo _cfg('web_name_two'); ?>了<em class="orange"><?php echo $user_shop_number; ?></em>人次 &nbsp;&nbsp;<?php echo microt($user_shop_time); ?></p>
				
                    <div style="margin-left:10px;" id="userRnoId" class="MaCenterH">
					<dl style="">
                       
                        <dd id="d" style="text-overflow:ellipsis;white-space:nowrap;overflow:hidden;">
                            <?php echo yunma($user_shop_codes,"b"); ?>
                        </dd>
						
                    </dl>
					
                </div>
            </div>

	  </div>	

		
   </div>
   
   
 </div>	

 </div>	
	
	
	
	
	
	

	

    <!-- 计算结果 所有参与记录 晒单 -->
    <div id="calculate" class="ProductTabNav">
        <div id="divMidNav" class="DetailsT_Tit">
            <div class="DetailsT_TitP">
                <ul>
                    <li class="Product_DetT DetailsTCur"><span class="DetailsTCur">计算结果</span></li>
                    <li class="All_RecordT"><span class="">所有参与记录</span></li>
                    <li class="Single_ConT"><span class="">晒单</span></li>
					<li class="Single_ConT"><span class="">往期夺宝</span></li>
                </ul>
            </div>
        </div>
    </div>

    <!--补丁3.1.6_b.0.1-->
    <div id="divCalResult" class="Product_Content">
        <div class="ygRecord" name="div_tab">
		<ul class="w_winner_name" >
	          		<dl>
	            		<dd class="w_time">夺宝时间</dd>
	            		<dd class="w_yin">时间因子</dd>
		                <dd class="w_account">会员账号</dd>
		                <dd class="w_name">商品名称</dd>
		                <dd class="w_people">夺宝人次</dd>
	          		</dl>
                <div class="RecordOnehundred"><h4>截止该商品揭晓购买时间【<?php echo microt($item['q_end_time']); ?>】最后50条全站购买时间记录</h4>
                <div class="FloatBox"></div>
                    <?php 
                    $addList = $this->db->GetList("select * from `@#_member_go_record` where time < '{$item['overtime']}' order by id desc limit 50");
                     ?>
                   <?php $ln=1;if(is_array($addList)) foreach($addList AS $record): ?>
                   <?php 
                        $itemid = $item['id'];
                        $record_time = explode(".",$record['time']);
                        $record['time'] = $record_time[0];
                        $record['timeadd'] = str_replace(':','',date("H:i:s",$record['time']));
                        $record['timeadd'] = $record['timeadd'].$record_time[1];
                    ?>
                   <ul class="Record_content">
                        <li class="time"><b><?php echo date("Y-m-d",$record['time']); ?></b><?php echo date("H:i:s",$record['time']); ?>.<?php echo $record_time['1']; ?></li>
                        <li class="timeVal"><?php echo $record['timeadd']; ?></li>
                        <li class="nem"><a class="gray02" href="<?php echo WEB_PATH; ?>/uname/<?php echo idjia($record['uid']); ?>" target="_blank"><?php echo get_user_name($record['uid']); ?></a></li>
                        <li class="name"><a class="gray02" href="<?php echo WEB_PATH; ?>/goods/<?php echo $record['shopid']; ?>" target="_blank">（第<?php echo $record['shopqishu']; ?>期）<?php echo $record['shopname']; ?></a></li>
                        <li class="much"><?php echo $record['gonumber']; ?>人次</li>
                    </ul>
                    <?php  endforeach; $ln++; unset($ln); ?>
                </div>



                <div class="m-detail-mainTab-resultList">
                <div class="resultRow">
                    <h4>计算结果<a name="calcResult"></a></br>
					<span class="resultCode">幸运号码：<?php echo $item['q_user_code']; ?></span>
					</h4>
                    <ol>
                        <li><span class="index">1、</span>求和：<?php echo $r2; ?>(上面50条参与记录的时间取值相加)</li>
                        <li><span class="index">2、</span>第 <?php echo $item['period1_date']; ?> 期 “老时时彩”开奖号码：<?php $ln=1;if(is_array($result2)) foreach($result2 AS $r2): ?><b class="ball"><?php echo $r2; ?></b><?php  endforeach; $ln++; unset($ln); ?><a href="http://baidu.lecai.com/lottery/draw/sorts/cqssc.php?agentId=5591" target="_blank">开奖查询&gt;&gt;</a></li>

                        <li><span class="index">3、</span>求余：(<?php echo $result1; ?>+<?php $ln=1;if(is_array($result2)) foreach($result2 AS $r2): ?><b class="square"><?php echo $r2; ?></b><?php  endforeach; $ln++; unset($ln); ?>) % <?php echo $item['canyurenshu']; ?> (奖品所需人次) =
                            <?php 
                                $shop_fmod = fmod($result1 + $item['period1'],$item['canyurenshu']);
                                $shop_fmod_list = str_split($shop_fmod);
                             ?>
                            <?php $ln=1;if(is_array($shop_fmod_list)) foreach($shop_fmod_list AS $listitem): ?><b class="square"><?php echo $listitem; ?></b><?php  endforeach; $ln++; unset($ln); ?>
                            (余数) <i data-func="remainder" class="ico ico-questionMark"></i>
                        </li>
                        <li><span class="index">4、</span>
                            <?php $ln=1;if(is_array($shop_fmod_list)) foreach($shop_fmod_list AS $listitem): ?><b class="square"><?php echo $listitem; ?></b><?php  endforeach; $ln++; unset($ln); ?>
                        (余数) + 10000001 =
                            <?php 
                                $q_user_code = $shop_fmod + 10000001;
                                $q_user_code_list = str_split($q_user_code);
                             ?>
                            <?php $ln=1;if(is_array($q_user_code_list)) foreach($q_user_code_list AS $codeitem): ?><b class="square"><?php echo $codeitem; ?></b><?php  endforeach; $ln++; unset($ln); ?>
                        </li>
                    </ol>
                </div>
                </div>
                <div class="m-detail-mainTab-calcRule">
                    <h4><i class="ico ico-text"></i><br>幸运号码<br>计算规则</h4>
                    <div class="ruleWrap">
                        <ol class="ruleList">
                            <li><span class="index">1</span>奖品的最后一个号码分配完毕后，将公示该分配时间点前本站全部奖品的最后50个参与时间；</li>
                            <li><span class="index">2</span>将这50个时间的数值进行求和（得出数值A）（每个时间按时、分、秒、毫秒的顺序组合，如20:15:25.362则为201525362）；</li>
                            <li><span class="index">3</span>为保证公平公正公开，系统还会等待一小段时间，取最近下一期中国福利彩票“老时时彩”的开奖结果（一个五位数值B）；</li>
                            <li><span class="index">4</span>（数值A、数值B组合）除以该奖品总需人次得到的余数<i style="margin-top:-3px;" data-func="remainder" class="ico ico-questionMark"></i> + 原始数&nbsp;10000001，得到最终幸运号码，拥有该幸运号码者，直接获得该奖品。</li>
                            <li class="txt-red">注：最后一个号码分配时间距离“老时时彩”最近下一期开奖大于24小时，则采用下一期开奖结果,依次顺延。<a href="http://baidu.lecai.com/lottery/draw/sorts/cqssc.php?agentId=5591" style="color:#C40000;" target="_blank">了解更多“老时时彩”信息</a></li>
                        </ol>
                    </div>
                </div></div>

        <!-- 购买记录20条 -->
        <div name="div_tab" id="bitem" class="AllRecordCon">
            <iframe id="iframea_bitem" g_src="<?php echo WEB_PATH; ?>/go/goods/go_record_ifram/<?php echo $itemid; ?>/20" style="width:1188px; border:none;height:0px;" frameborder="0" scrolling="no"></iframe>
        </div>
	<!-- 晒单 start-->
	<div name="div_tab" id="divPost"   class="Single_Content" style="display: none;">
		<iframe id="iframea" src="<?php echo WEB_PATH; ?>/go/shaidan/itemiframstory/<?php echo $itemid; ?>" style="width:1200px; border:none; height:400px;" frameborder="0" scrolling="no"></iframe>
	</div>
	<!-- 晒单 end-->

	<div name="div_tab" id="divPost"   class="qishu" style="display: none;">
	
		<div id="divPeriodList" class="show_Period" style="max-height:99px;">
		<div class="period_Open bt_gray bb_gray bl_gray">
			<a class="gray02" href="javascript:;" id="btnOpenPeriod" click="off">展开<i></i></a>
		</div>		
		<?php echo $loopqishu; ?>	
	</div>
	</div>
<!--往期夺宝end-->
	</div>
</div>
<script>
$("#btnOpenPeriod").click(function(){
		var ui_obj = $("#divPeriodList > ul");
		if($(this).attr("click")=='off'){
			$("#divPeriodList").css("max-height",ui_obj.length*50+"px");	
			$(this).attr("click","on");
			$(this).html("收起<s></s>");
			
		}else{
			$("#divPeriodList").css("max-height","99px");	
			$(this).attr("click","off");
			$(this).html("展开<i></i>");
		}			
});

function set_iframe_height(fid,did,height){
	$("#"+fid).css("height",height);
}

$(function(){
var fouli=$(".DetailsT_TitP ul li");
var divCalResult =  $("div[name='div_tab']");
	fouli.click(function(){		   
		var index=fouli.index(this);
		fouli.removeClass("DetailsTCur").eq(index).addClass("DetailsTCur");
		var iframe = divCalResult.hide().eq(index).find("iframe");
			if (typeof(iframe.attr("g_src")) != "undefined") {
			  	 iframe.attr("src",iframe.attr("g_src"));
				 iframe.removeAttr("g_src");
			}
			
		divCalResult.hide().eq(index).show();
	});   
	

	$(".Announced_But").click(function(){
		var next_li = $(".DetailsT_TitP ul>li");
		var index = $(this).index()
		next_li.eq(index).click();
        $("html,body").animate({scrollTop:800},1500);
	});

	
	$(window).scroll(function(){
		if($(window).scrollTop()>=941){
			$("#divMidNav").addClass("nav-fixed");
		}else if($(window).scrollTop()<941){
			$("#divMidNav").removeClass("nav-fixed");
		}
	});
});
function divOpen(){
var height=$("#userRnoId").css("height");
	if(height=="90px"){
		$("#userRnoId").css("height","auto");
	}else{
		$("#userRnoId").css("height",90);
	};
}
$(function(){	
	$("#divOpen").click(divOpen);
});

$(".yu_ff").mouseover(function(){
  $(".h_1yyg_eject").show();
})
$(".yu_ff").mouseout(function(){
  $(".h_1yyg_eject").hide();
})

	     $("#m_all_sort").hide();
     $(".m_menu_all").mouseenter(function(){
		    $(".m_all_sort").show();
     })
	 $(".m_menu_all").mouseleave(function(){
		    $(".m_all_sort").hide();
     })
	 $(".m_all_sort").mouseenter(function(){
		    $(this).show();
     })
	 $(".m_all_sort").mouseleave(function(){
		    $(this).hide();
     })
</script>	
<?php include templates("index","footer");?>
