<%@ page language="java" import="java.util.*,com.letousky.lottery.delegate.WinsFlat,com.letousky.exception.LotteryException" pageEncoding="UTF-8"%>
<%
	String[] params=new String[12];
	params[0]=request.getParameter("gameid");
	params[1]="all"; //过关方式
	params[2]=request.getParameter("status"); //方案状态
	params[3]=request.getParameter("countMoney"); //方案金额
	params[4]=request.getParameter("progress"); //方案进度
	params[5]="all"; //每份单价
	params[6]="all"; //保底份数
	params[7]="all"; //方案提成
	params[8]=request.getParameter("pages"); //当前页数
	params[9]=request.getParameter("every"); //当前页显示的条数
	params[10]=request.getParameter("usernickname"); //合买人
	//读取cookies
	 String sid=null;
	Cookie Cookies[]=request.getCookies();
	if(Cookies!=null){
		for (int i = 0; i < Cookies.length; i++) {
			if("sid".equals(Cookies[i].getName()) ){
				sid=Cookies[i].getValue();
			}
		}
	}
	params[11]=sid; //推广ID
	List list=new WinsFlat().chippedList(params);
	String[] str=null;
	String d=",";
	Object[] obj=list.toArray();
	List items=(List)obj[0];
	request.setAttribute("items",items);
	String[] recod=(String[])obj[1];
	Object[] item=items.toArray();
	
	out.print("{\"recod\":\""+recod[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]+"\",\"Trading\":\""+str[1]+"\",\"userId\":\""+str[3]+"\",\"userName\":\""+str[4]+"\",\"gameType\":\""+str[5]+"\",\"way\":\""+str[6]+"\",\"decoration\":\""+str[9]+"\",\"isopen\":\""+str[10]+"\",\"csm\":\""+str[13]+"\",\"btPrice\":\""+str[14]+"\",\"multiples\":\""+str[15]+"\",\"countCopis\":\""+str[16]+"\",\"copisPrice\":\""+str[17]+"\",\"downside\":\""+str[18]+"\",\"rgCopis\":\""+str[19]+"\",\"starTime\":\""+str[20]+"\",\"igl\":\""+str[26]+"\",\"bdCopies\":\""+str[18]+"\"}"+d+"");
		
	}
	out.print("]}");

%>