<%@ page language="java" import="java.util.*,com.letousky.lottery.action.AuxiliaryData,com.letousky.exception.LotteryException" pageEncoding="UTF-8"%>
<%
	String[] params=new String[3];
	params[0]=request.getParameter("starTime");
	params[1]=request.getParameter("pages"); //当前页数
	params[2]=request.getParameter("every"); //当前页显示的条数
	try{
	List list=new AuxiliaryData().resultsTheLottery(params);
	String[] str=null;
	String d=",";
	Object[] obj=list.toArray();
	List items=(List)obj[0];
	String[] record=(String[])obj[1];
	Object[] item=items.toArray();
	
	out.print("{\"result\":\"0000\",\"record\":\""+record[0]+"\",\"items\":[");
	for(int i=0;i<item.length;i++){
		
		str=(String[])item[i];
		
		if(i==(item.length-1)){ d=""; }
		
		out.print("{\"id\":\""+str[0]+"\",\"leagueName\":\""+str[1]+"\",\"leagueNumber\":\""+str[2]+"\",\"hometeam\":\""+str[3]+"\",\"visitingteam\":\""+str[4]+"\",\"giveBall\":\""+str[5]+"\",\"gameType\":\""+str[6]+"\",\"stopTime\":\""+str[7]+"\",\"singleStopTime\":\""+str[8]+"\",\"complexStopTime\":\""+str[9]+"\",\"hometeamSemiScore\":\""+str[10]+"\",\"visitingSemiScore\":\""+str[11]+"\",\"hometeamFullScore\":\""+str[12]+"\",\"visitingFullScore\":\""+str[13]+"\",\"spfSingleRe\":\""+str[14]+"\",\"bfSingleRe\":\""+str[15]+"\",\"zjqSingleRe\":\""+str[16]+"\",\"bqcSingleRe\":\""+str[17]+"\",\"spfSinglePr\":\""+str[18]+"\",\"bfSinglePr\":\""+str[19]+"\",\"zjqSinglePr\":\""+str[20]+"\",\"bqcSinglePr\":\""+str[21]+"\",\"status\":\""+str[22]+"\",\"otherMsg\":\""+str[23]+"\",\"eventType\":\""+str[24]+"\",\"color\":\""+str[25]+"\",\"rqSingleRe\":\""+str[26]+"\",\"rqSinglePr\":\""+str[27]+"\"}"+d+"");
		
	}
	out.print("]}");
	}catch(LotteryException e){
		
		out.print("{\"result\":\""+e.getMessage()+"\"}");
	}
%>