<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.letousky.lottery.delegate.WinMoneyManage"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.letousky.lottery.delegate.SelectIssueCurManage"%>
<%@page import="com.letousky.lottery.util.TimeUtil"%>
<%@page import="com.letousky.lottery.util.StandardFormat"%>
 

<script type="text/javascript">
function number_format(s){
  
    if(/[^0-9\.\-]/.test(s)) 
	return "invalid value";
    s=s.replace(/^(\d*)$/,"$1.");
    s=(s+"").replace(/(\d*\.\d\d)\d*/,"$1");
    s=s.replace(".",",");
    var re=/(\d)(\d{3},)/;
    while(re.test(s))
           s=s.replace(re,"$1,$2");
    s=s.replace(/,(\d\d)$/,".$1");
	 
  return s.replace(/^\./,"0.").replace(/.$/,"")
}
</script>

<link
	href="<%=request.getContextPath()%>/Letousky/numberLetou/ssq/css/winNumber.css"
	rel="stylesheet" type="text/css" />
<%
	String[] nr = new WinMoneyManage().getWinMoneyItems(
			new String[] { request.getParameter("lot") }, "C0046");
	String[] n1 = null;
	if (nr == null) {
		nr = new String[50];
		nr[2] = "--";
		nr[15] = "            ";
		nr[16] = "            ";
		nr[49] = " ";
		n1 = new String[] {};
	} else {
		n1 = (nr[17].split("//")[0]).split("/");
	}
	//out.println("nr[49]="+nr[49]);
	//out.println("nr[47]="+nr[47]);
	if (nr != null) {
		nr[49] = new java.math.BigDecimal(new Double(nr[49])
				.doubleValue()).toString();
		if (nr[49].indexOf(".") != -1) {
			nr[49] = nr[49].substring(0, nr[49].indexOf("."));
		}
	}

	SelectIssueCurManage sc = new SelectIssueCurManage();
	String[] issueAry = sc.getCurIssue(new String[] { request
			.getParameter("lot") }, "C0018");
	if (issueAry != null) {
		issueAry[0] = issueAry[0].trim();
		issueAry[3] = TimeUtil.string2time(issueAry[3]);
		issueAry[4] = StandardFormat.lotStateMap.get(("0"
				.equals(issueAry[4].trim())) ? "0" : "-21");
		 		
	     
	} else {
		issueAry = new String[5];
		issueAry[0] = request.getParameter("lot").trim();//玩法代码
		issueAry[1] = "--";//期号
		issueAry[3] = "--年--月--日 --:--";//截止时间
		issueAry[4] = StandardFormat.lotStateMap.get("-21");//销售状态

	}
%>

<div class="winNumber">
<div class="winNumber1">

<div style="height: 70px; margin: 0px auto;">
<div style="width: 80px; height: 68px; float: left"><img
	style="margin: 0px anto; "
	src="<%=request.getContextPath()%>/Letousky/numberLetou/img/<%=request.getParameter("lot")%>_logo.gif"></div>
<div style="width: 140px; height: 65px; float: left; margin-top: 0px; text-align:center">
<div style="height: 25px; text-align: left; line-height: 25px; width: 140px; margin:0px auto"><font
	style="font-weight: bold"><%=StandardFormat.lotNameMap
							.get(request.getParameter("lot"))%></font> 第 <font color="#FF0000"><%=nr[2]%></font>
期</div>
<div style="height: 20px; text-align: left;  width: 140px; margin:0px auto">开奖日期：<font
	color="#FF0000"><%=(nr[15].substring(0, 4) + "-" + nr[15].substring(4, 6)
							+ "-" + nr[15].substring(6, 8))%></font></div>
<div style="height: 20px; text-align: left; width: 140px; margin:0px auto">兑奖截止：<font
	color="#FF0000"><%=(nr[16].substring(0, 4) + "-" + nr[16].substring(4, 6)
							+ "-" + nr[16].substring(6, 8))%></font></div>
</div>
</div>

<!-- 双色球 Begin -->
<%
	if ("201".equals(request.getParameter("lot").trim())) {
%>
<div class="winNumber12">
<div class="winNumber121">
<div
	style="width: 30px; float: left; height: 25px; color: #ff0000; font-weight: bold; line-height: 25px">红球</div>
<div class="balltored">
<ul>
	<%
		for (int m = 0; m < n1.length; m++) {
				out.print("<li>" + n1[m] + "</li>");
			}
	%>
</ul>
</div>
</div>

<div class="winNumber122">
<div
	style="width: 30px; float: left; height: 25px; color: #0000ff; font-weight: bold; line-height: 25px">蓝球</div>
<div class="balltoblue">
<ul>
	<%
		if (nr != null) {
				if (nr[17].split("//").length > 1) {
					n1 = nr[17].split("//")[1].split("/");
					for (int n = 0; n < n1.length; n++) {
						out.print("<li>" + n1[n] + "</li>");
					}
				}
			}
	%>
</ul>
</div>
</div>
</div>
<!-- 双色球 end -->

<!--七乐彩  36选7  深圳风采  Begin -->
<%
	} else if ("205".equals(request.getParameter("lot").trim())
			|| "104".equals(request.getParameter("lot").trim())
			|| "204".equals(request.getParameter("lot").trim())) {
%>
<div class="winNumber12">
<div class="winNumber121">
<div
	style="width: 30px; float: left; height: 25px; color: #ff0000; font-weight: bold; line-height: 25px">基码</div>
<div class="balltored">
<ul>
	<%
		for (int m = 0; m < n1.length; m++) {
				out.print("<li>" + n1[m] + "</li>");
			}
	%>
</ul>
</div>
</div>
<div class="winNumber122">
<div
	style="width: 30px; float: left; height: 25px; color: #0000ff; font-weight: bold; line-height: 25px">特码</div>
<div class="balltoblue">
<ul>
	<%
		if (nr != null) {
				if (nr[17].split("//").length > 1) {
					n1 = nr[17].split("//")[1].split("/");
					for (int n = 0; n < n1.length; n++) {
						out.print("<li>" + n1[n] + "</li>");
					}
				}
			}
	%>
</ul>

</div>
</div>
</div>

<!--七乐彩  36选7  深圳风采  end -->

<!--七星彩  Begin -->
<%
	} else if ( "108".equals(request.getParameter("lot").trim())) {
%>
<div class="winNumber12">
<div class="winNumber121">
<div
	style="width: 30px; float: left; height: 25px; margin-top: 15px; color: #ff0000; font-weight: bold; line-height: 25px">开奖</div>
<div class="balltoorange">
<ul>
	<%
		for (int m = 0; m < n1.length; m++) {
				out.print("<li>" + n1[m] + "</li>");
			}
	%>
</ul>
</div>
</div>
</div>
<!--七星彩  end -->


<!--大乐透 begin -->
<%
	} else if ("110".equals(request.getParameter("lot").trim())) {
%>
<div class="winNumber12">
<div class="winNumber121">
<div
	style="width: 30px; float: left; height: 25px; color: #ff0000; font-weight: bold; line-height: 25px">前区</div>
<div class="balltored">
<ul>
	<%
		for (int m = 0; m < n1.length; m++) {
				out.print("<li>" + n1[m] + "</li>");
			}
	%>
</ul>
</div>
</div>

<div class="winNumber122">
<div
	style="width: 30px; float: left; height: 25px; color: #0000ff; font-weight: bold; line-height: 25px">后区</div>
<div class="balltoblue">
<ul>
	<%
		if (nr != null) {
				if (nr[17].split("//").length > 1) {
					n1 = nr[17].split("//")[1].split("/");
					for (int n = 0; n < n1.length; n++) {
						out.print("<li>" + n1[n] + "</li>");
					}
				}
			}
	%>
</ul>
</div>
</div>
</div>
<!--大乐透 end -->
<%
	} else {
%> 
 <div class="winNumber12">
<div class="winNumber121">
<div
	style="width: 30px; float: left; height: 25px; margin-top: 15px; color: #ff0000; font-weight: bold; line-height: 25px">开奖</div>
<div class="balltoorange">
<ul>
	<%
		for (int m = 0; m < n1.length; m++) {
				out.print("<li>" + n1[m] + "</li>");
			}
	%>
</ul>
</div>
</div>
</div>
<%
 	}
 %>


<div style="height: 25px; margin: 5px auto; width: 208px; text-align: left">
  <font
	style="font-size: 12px; color: #333333;">奖池滚存:<font
	color="#FF0000"> <%
 	out.println("<script language=\"javascript\">");
 	out.println("document.write(number_format('" + nr[49] + "'));");
 	out.println("</script>");
 %> </font>元</font>
</div>
</div>



<div class="winNumber2">
<div class="winNumber21">
<div class="winNumber211">
<ul style="margin: 0px">
	<li style="width: 72px">奖项</li>
	<li style="width: 68px">中奖注数</li>
	<li style="width: 97px">单注奖金(元)</li>
</ul>
<%
	String[] sn = null;
	if ("201".equals(request.getParameter("lot"))) {
		sn = new String[] { "一等奖", "二等奖", "三等奖", "四等奖", "五等奖", "六等奖", };
	} else if ("202".equals(request.getParameter("lot"))) {
		sn = new String[] { "直选", "组选3", "组选6" };
	} else if ("205".equals(request.getParameter("lot"))) {
		sn = new String[] { "一等奖", "二等奖", "三等奖", "四等奖", "五等奖", "六等奖",
				"七等奖" };
	} else if ("204".equals(request.getParameter("lot"))) {
		sn = new String[] { "一等奖", "二等奖", "三等奖", "四等奖", "五等奖", "六等奖",
				"七等奖", "八等奖" };
	} else if ("110".equals(request.getParameter("lot"))) {
		sn = new String[] { "一等奖/基本", "一等奖/追加", "二等奖/基本", "二等奖/追加",
				"三等奖/基本", "三等奖/追加", "四等奖", "五等奖", "六等奖", "七等奖", "八等奖",
				"12选2" };
	} else if ("108".equals(request.getParameter("lot"))) {
		sn = new String[] {"一等奖", "二等奖", "三等奖", "四等奖", "五等奖" ,"六等奖" };
	} else if ("105".equals(request.getParameter("lot"))) {
		sn = new String[] { "直选", "组选3", "组选6" };
	} else if ("109".equals(request.getParameter("lot"))) {
		sn = new String[] { "一等奖" };
	} else if ("111".equals(request.getParameter("lot"))) {
		sn = new String[] { "一等奖", "二等奖", "三等奖" };
	} else if ("104".equals(request.getParameter("lot"))) {
		sn = new String[] { "一等奖", "二等奖", "三等奖", "四等奖", "五等奖", "六等奖" };
	}
%> <%
 	for (int i = 19, j = 0; i < 19 + sn.length * 2; i++, j++) {
 		String ee = nr[i];
 		//out.println("ee==="+ee);
 		if (ee.indexOf(".") != -1) {
 			ee = ee.substring(0, ee.indexOf("."));
 		}

 		String rr = nr[++i];
 		//out.println("rr==="+rr);
 		rr = new java.math.BigDecimal(new Double(rr).doubleValue())
 				.toString();
 		if (rr.indexOf(".") != -1) {
 			rr = rr.substring(0, rr.indexOf("."));
 		}
 %>
</div>
<div class="winNumber212">
<ul style="background: <%=((j % 2 == 0) ? "#FFFFFF" : "#F1F1F1")%>">
	<li style="width: 72px"><%=sn[j]%></li>
	<li style="width: 68px"><font color="red"><%=ee%></font>注</li>
	<li style="width: 97px"><font color="red"> <%   
	out.println("<script language=\"javascript\">");
    out.println("document.write(number_format('"+ rr  + "'));");
    out.println("</script>"); %> </font>元</li>
</ul>
<%
	}
%>
</div>

</div>
</div>
</div>