<%@ page language="java" import="java.util.*,com.letousky.lottery.action.AuxiliaryData,com.letousky.lottery.util.StandFormat,com.letousky.lottery.util.InsiderCenterFormat,com.letousky.exception.LotteryException" pageEncoding="UTF-8"%>
<%
	String[] params=null;
	try{
		InsiderCenterFormat m = new InsiderCenterFormat();
		List list=new AuxiliaryData().buyHotSingle(params);
		List wgItems = new AuxiliaryData().buyWinningMsg(params);
		String[] str=null;String[] str1=null;
		String d=",";
		Object[] obj=list.toArray();
		Object[] obj1=wgItems.toArray();
		
		out.print("{\"result\":\"0000\",\"BuyItems\":[");
		for(int i=0;i<obj.length;i++){
			
			str = (String[])obj[i];
			
			if(i==(obj.length-1)){ d=""; }
			
			out.print("{\"id\":\""+str[0]+"\",\"Trading\":\""+str[1]+"\",\"userId\":\""+str[3]+"\",\"userName\":\""+str[4]+"\",\"gameType\":\""+str[5]+"\",\"way\":\""+str[6]+"\",\"csm\":\""+str[13]+"\",\"btPrice\":\""+str[14]+"\",\"multiples\":\""+str[15]+"\",\"countCopis\":\""+str[16]+"\",\"copisPrice\":\""+str[17]+"\",\"downside\":\""+str[18]+"\",\"rgCopis\":\""+str[19]+"\",\"starTime\":\""+str[20]+"\",\"chipinNums\":\""+str[21]+"\",\"igl\":\""+str[26]+"\",\"endTime\":\""+str[27]+"\",\"moneyFw\":\""+str[28]+"\",\"bdCopies\":\""+str[18]+"\"}"+d+"");
			
		}
		out.print("],\"wgItems\":[");
		d = ",";
		for(int s=0;s<obj1.length;s++){
			
			str1 = (String[])obj1[s];
			
			if(s==(obj1.length-1)){ d=""; }
			
			out.print("{\"num\":\""+(s+1)+"\",\"nikeName\":\""+str1[0]+"\",\"lotName\":\""+StandFormat.lotNameMap.get(str1[1])+"\",\"award\":\""+str1[2]+"\"}"+d+"");
			
		}
		out.print("]}");
		
	}catch(LotteryException e){
		
		out.print("{\"result\":\""+e.getMessage()+"\"}");
	}
%>