<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%
	String nikeName = "--";
	if((String[])session.getAttribute("userAry")!=null){
		String[] sg = (String[])session.getAttribute("userAry");
		nikeName = sg[18];
	}
	String gameid = request.getParameter("gameid");
	String issue = request.getParameter("issue");
	String url = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>贝壳彩--全额投注--合买投注</title>
    
	<meta http-equiv="pragma" content="no-cache"/>

	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
	<meta http-equiv="description" content="This is my page"/>
	<link href="<%=request.getContextPath()%>/letoula/css/betting.css" rel="stylesheet" type="text/css" />
	<script id='betting' language='JavaScript' charset='utf-8'></script>
	<script src="<%=request.getContextPath()%>/letoula/js/plugin/library.js"></script>
    <script src="<%=request.getContextPath()%>/letoula/js/plugin/ajaxupload.js"></script>
	<script type="text/javascript">
	
		var agrs={
			countCopies:'1',
			gameCode:'<%=gameid%>',
			zqmcn:'1',
			multiple:'1',
			tzNumber:'1',
			spzValue:'spzValue',
			moneyFw:'1-1',
			url    :'<%=url%>',
			issue  :'<%=issue%>',
			nikeName:'<%=java.net.URLEncoder.encode(nikeName)%>'
		}
		
		$(function() {
        	// 创建AJAX方式上传文件
        	var $uploadBtn = $("#uploadBtn");
        	new AjaxUpload($uploadBtn, {
            	action: '<%=request.getContextPath()%>/servlet/Upload?lot=<%=gameid%>&r='+Math.random(),
            	name: 'uploadfile',
            	onSubmit: function(file, ext){
                	//$("#info").html("start upload file");
            	},
            	onComplete: function(file, response){
            		var json = eval("("+response+")");
            		$('.u-wrap').show();
            		$('#upfile_title').text(file);
                	if(json.result == "1111"){
					
						$('#up_info').html('<i class="u-ico u-fail"></i>文件检测失败, 请重新上传<strong><font color="red">'+json.error+'</font></strong>');
						$(".submitBtn").css({'display':'none'});
					}else{
					
						var time = json.time;
						time  = time.substring(0,4)+'-'+time.substring(4,6)+'-'+time.substring(6,8);
						$('#up_info').html('<i class="u-ico u-success"></i> <font color="red"  class="mg">上传成功</font> 共<font color="red">'+json.countLine+'</font>注  | <a href="#" class="mg">查看详情</a>  <font color="gary">上传时间：'+time+'</font>	');
					
						$('.up_zs').text(json.countLine);
						var countP = parseInt(json.countLine)*2;
						
						Y.countCopies = countP;
						Y.eachPrice = 1;
						agrs.countCopies = countP;
						Y.gameCode = agrs.gameCode;
						Y.ZQMcN=agrs.zqmcn;
						Y.multiple=agrs.multiple;
						agrs.tzNumber = json.filePath;
						$('.up_countP').text("￥"+countP);
						$("#copies").val(countP);
						
						$(".submitBtn").css({'display':'block'});
					}
            	}
        	});
    	});
		
	</script>
  </head>
  <body>
 <%@include file='../../letoula/top.jsp' %>  
<%@ include file="/common/nav.jsp"%>
    <div id='homeMain' style="margin:5px auto;">
    	<div class='bettingMain'>
    		<div class='m_t'></div>
    		<div class='m_c'>
    			<table cellspacing='0' cellpadding='0' width="100%" id='m_table'>
    				<tr>
    					<td class='m_bt' height="44">单式上传</td>
    					<td class='m_lr' align="left" valign="top">
    						 <div id="info"></div>
    						 <input type="button"  id="uploadBtn" class='a_openfile' value="+上传文件" />
    							<!--<a href="javascript:void(0)" title="点击选择您要上传的txt文件"  class='a_openfile' onclick="javascript:openfile()">+上传文件</a>-->
    							<a href="javascript:void(0)" onclick="create_class.seaDetails('blk3','s')" class='bzyb'>查看标准格式样本</a>
    						<br/>
    						<div class="u-wrap">
    							<div class='hd'>
    								<i class="u-txt"></i>
    								<span id="upfile_title"></span>
    							</div>
    							<div class='bd' id="up_info">
    								<i class="u-ico u-success"></i>
    							</div>
    						</div>
    						<div>
    							上传说明：<br/>
    									1、请严格参照"标准格式样本"格式上传方案。<a href="javascript:void(0)" onclick="create_class.seaDetails('blk3','s')" class='bzyb'>查看帮助</a><br/>
										 2、文件格式必须是.txt格式，单个文件大小不能超过10M。<br/>
										 3、由于上传的文件较大，会导致上传时间及在本页停留时间较长，请耐心等待。</br>
    							
    						</div>
    					</td>
    				</tr>
    				<tr>
    					<td class='m_bt' height="44">认购设置</td>
    					<td class='m_lr'>
    						<div class='tzfs'>
    							<span><input type='radio' name='qerg' id='qerg' checked='checked' value='1' />全额认购</span>
    							<span class='f_m'><input type='radio' name='fqhm' id='fqhm' value='2' />发起合买</span>
    							<input type='hidden' value='0' class='opens' />
    						</div>
    					</td>
    				</tr>
    				<tr>
    					<td class='m_bt' height="71">方案信息</td>
    					<td class='m_lr'>
    						<div class='fa_msg'>
    							<p>方案注数<font color='red' class="up_zs">0</font>注，倍数<input type="text" class="t_input" onkeyup="settingMethod.mltOnkeyUp(this)" value="1" size="3"/>倍，总金额<font color='red' class="up_countP">￥0.00</font> 元。</p>
    						</div>
    					</td>
    				</tr>
    				<tr class='trrg'>
    					<td class='m_bt' height="113">我要认购</td>
    					<td class='m_lr'>
    						<div class='tz_OK'>
    							<p><a class='submitBtn'  onclick="settingMethod.submitBtn('chipin')" title='立即购买'></a></p>
    							<p style='clear:both;margin-top:5px;'><input type='checkbox' id='yes_xy' checked='checked' />我已阅读并同意《<a href="javascript:void(0)" onclick="create_class.seaDetails('blk1','s')">用户合买代购协议</a>》</p>
    						</div>
    					</td>
    				</tr>
    				<tr class='trhm'>
    					<td class='m_bt' height="47">方案金额</td>
    					<td class='m_lr'>
    						<span class='m_l_f'>方案总金额:<font color="red" class="up_countP">￥0.00</font>元 </span> 
    						<%if(userAry!=null){%>
    						
    							<span class='m_l_f'>彩票中国用户定制您的单的总金额:<font color="red" class="dzMoney"></font></span> <span class='m_l_f'>您的账户余额:<font color="red"><b>￥<%=userAry[11]%></b></font>元</span>
    							
    						<%}%>
    					</td>
    				</tr>
    				<tr class='trhm'>
    					<td class='m_bt' height="81">购买形式</td>
    					<td class='m_lr'>
    						<div style='margin-left:20px;line-height:2'>
    						<p><font color="red">*</font> 我要分为：<input size='5' onblur="settingMethod.Copies_onkeyUp(this)" onkeyup="settingMethod.validation_Copies(this)" class='t_input' type='text' value='1' name='copies' id='copies' /> 份,
    							每份<font color="red" id='a_copies'>￥1.00</font>元     <font color="#666666">每份至少1元</font>
    							<font color="red" class="flag">！每份金额不能除尽，请重新填写份数</font>
    						</p>
    						<p>
    							  &nbsp;&nbsp;我要提成：
    							  <select id='comm'>
    							  	<option value='0'>0</option>
    							  	<option value='1'>1</option>
    							  	<option value='2'>2</option>
    							  	<option value='3'>3</option>
    							  	<option value='4'>4</option>
    							  	<option value='5' selected='selected'>5</option>
    							  	<option value='6'>6</option>
    							  	<option value='7'>7</option>
    							  	<option value='8'>8</option>
    							  	<option value='9'>9</option>
    							  	<option value='10'>10</option>
    							  </select>
    							  % <font color='#666666' style='margin-left:10px;'>注：只有方案盈利，发起人才能享受盈利部分的提成。</font>
    						</p>
    						</div>
    					</td>
    				</tr>
    				<tr class='trhm'>
    					<td class='m_bt' height="163">认购设置</td>
    					<td class='m_lr' valign='top' align='left'>
    						<div class='l_f' style='margin-left:20px;_margin-left:10px;line-height:3;'>
    							<%if(session.getAttribute("userAry") == null){%>
    									<p>您尚未登录,请先<a href="#">登录</a></p>		
    							<%}%>
    							<p>我要认购:<input type='text' name='sbCopies' size='3' onkeyup="settingMethod.subscribe_Copies(this)" class='t_input' id='sbConpies' value='1' />份，<font color="red" class="sbbePrice">￥1.00</font>元</p>
    							<p><input type='checkbox' onclick='settingMethod.downside(this)' name='downside' id='downside' />我要保底:<input type='text' name='side' onkeyup="settingMethod.validation_downside(this)" class='t_input' size='3' id='side' value='0' disabled=true />份，<font color="red" class='dse'>￥0.00</font>元</p>
    							<p><font color='#666666'>[注]冻结资金将在网站截止销售时，根据该方案的销售情况，返还到您的预付款中。</font></p>
    							<p style='clear:both;margin-top:5px;'><input type='checkbox' id='yes_xy' checked='checked' />我已阅读并同意《<a href="javascript:void(0)" onclick="create_class.seaDetails('blk1','s')">用户合买代购协议</a>》</p>
    						</div>
    						<div class='r_t'>
    							<p><a class='submitBtn' onclick="settingMethod.submitBtn()" title='立即购买'></a></p>
    						</div>
    					</td>
    				</tr>
    				<tr class='trhm'>
    					<td class='m_bt' height="103">方案宣传</td>
    					<td class='m_lr' valign='top'>
    						<div style='margin-left:20px;line-height:2'>
    						<p>方案标题：<input type='text' class='t_input' name='schmeTitle' id='schmeTitle' maxLength='20' onkeyup="settingMethod.t_inputOnkeyUp(this)" onfocus="settingMethod.t_inputOnfocus(this)" onblur="settingMethod.t_inputOnblur(this)" value="精品合买单" /><font color="#666666">已输入<font class='schmeMany'>0</font>个字符,最多20个</font></p>
    						<p>方案描述：<textarea rows='2' cols='20' maxLength='200' name='description' class='p_input' onkeyup="settingMethod.t_inputOnkeyUp(this)" id='description' onfocus="settingMethod.t_inputOnfocus(this)" onblur="settingMethod.t_inputOnblur(this)">一起中大奖！！</textarea><font color="#666666">已输入<font class='schmedsp'>0</font>个字符,最多200个</font></p>
    						</div>
    					</td>
    				</tr>
    				<tr class='trhm'>
    					<td class='m_bt' height="125">合买对象</td>
    					<td class='m_lr'>
    						<div style='margin-left:20px;' class='buyObj'>
    						<p><input type='radio' name='allBuy' id='allBuy' value='all' checked='checked' />彩票中国所有彩友可以合买</p>
    						<p><input type='radio' name='designated' id='designated' />只有固定的彩友可以合买<br/>
    							<span id='dpn' style='display:none;'><textarea rows='2' cols='20'  name='description'  class='p_input' id='description'></textarea>
    							<br/><font color="#666666">[注]限定彩友的格式是：aaaaa,bbbbb,ccccc,ddddd（,为英文状态下的逗号）</font></span></p>
    						</p>
    						</div>
    					</td>
    				</tr>
    			</table>
    		</div>
    	</div>
    	
        <!--提示层-->
<div class="tips_m" style="width:500px; " id="blk2">
    <div class="tips_b">
         <div class="tips_box">
         	<div class="tips_title">
                 <h2>温馨提示</h2>
             </div>
             <div class='alert_c'>
             	<div class='state error'>
             		<span class='eroorMsg'>您好，请选择过关方式！</span>
             	</div>
             </div>
             <div class='tips_sbt'>
             	<input type='button' class='btn_Dora_b' id='yclass_alert_ok' onclick='settingMethod.closeWindow("l")' value='确   定' />
             </div>
         </div>
    </div>
</div> 

<!--提示层-->
<div class="tips_m" style="width:620px; " id="blk1">
    <div class="tips_b">
         <div class="tips_box">
              <div class="tips_title">
                    <h2>用户合买协议</h2>
                    <span class="closes"><a href="javascript:create_class.seaDetails('blk1','h')" id="close1">关闭</a></span>
               </div>
               <div class="tips_text" style='height:400px;overflow-x:hidden;overflow-y:auto;'>
             		<p><strong><font color='red'>1、</font></strong> 本网站立足于服务彩民，所有用户在本网站发起、认购彩票方案，网站均不收取任何手续费。</p>
					<p><strong><font color='red'>2、</font></strong> 网站用户在本网站购买彩票，须同意授权本网站代为保管彩票、领取奖金和派发奖金及处理相关事宜。</p>
					<p><strong><font color='red'>3、</font></strong> 用户有权自由发起方案，每期方案个数不限制。</p>
					<p><strong><font color='red'>4、</font></strong> 代购方案发起即满员，即可出票，发起后不能撤单。合买方案进度（含保底）超过50%（含50%）的，发起人、认购人均不能自行撤单；当期彩票截止时，未合买成功的方案，系统将进行撤单返款处理。</p>
					<p><strong><font color='red'>5、</font></strong> 为保证方案发起的严肃性，方案最低发起金额为2元，合买方案发起人须先购买至少5%。</p>
					<p><strong><font color='red'>6、</font></strong> 合买方案发起人可自行设置税后奖金的0%-10%作为方案提成。</p>
					<p><strong><font color='red'>7、</font></strong> 代购方案所中取的奖金，均此方案发起人所有；合买方案所中取的奖金，发起人按照事先约定的方式、比例进行提成后，其余奖金按照此方案各用户认购金额所占比例进行分配，除不尽的部分归方案发起人所有。</p>
					<p><strong><font color='red'>8、 </font></strong>单关投注奖金为浮动奖金，方案中奖奖金以彩票中心最终公布的开奖奖金为准；过关投注奖金为固定奖金，方案中奖奖金以成功出票时的奖金为准。过关投注方案成功出票后，网站会在方案中注明方案所选场次赛果对应的奖金、彩票标识以供查询。</p>
					<p><strong><font color='red'>9、</font></strong>彩票开奖后，网站将代为办理兑奖、派奖事宜，并在1个工作日内把税后奖金添入中奖用户之预付款账户。</p>
					<p><strong><font color='red'>10、</font></strong>为了加强对“竞彩”的销售管理，在销售过程中，根据投注额、突发事件等因素，彩票管理中心销售系统可能会拒绝某些大额投注，或者暂停或提前截止某场比赛的某些特定过关组合、特定结果选项的投注，暂停或提前截止针对某场比赛的所有投注。此种情况下，网站对暂停或提前截止销售不承担任何责任。</p>
					<p><strong><font color='red'>11、</font></strong>因出票系统升级、官方停售、突然停电、网络异常等意外因素导致网站未能够出票完毕，网站保有调整销售截止时间的权利，对满员方案中未及时出票部分做撤单返款处理。除此之外，网站不承担其他责任。</p>
					<p><strong><font color='red'>12、</font></strong>如遇方案部分撤单，撤单金额为方案未出票部分金额，撤单金额将在官方销售截止前陆续返还至购彩账户，原方案金额在方案详情页显示不变，已出票部分如中奖，奖金按照原方案的实际认购比例进行分配奖金。 </p>
					<p><strong><font color='red'>13、</font></strong>本网站保留变更本协议条款的权利。</p>
					<p style='float:right'><a href="http://www.beikecai.com">www.beikecai.com</a></br>
					客服热线：0571-87209043</p>
             		
              </div>
         </div>
    </div>
</div>  
<!--提示层-->
<div class="tips_m" style="width:400px; " id="blk3">
    <div class="tips_b">
         <div class="tips_box">
              <div class="tips_title">
                    <h2>上传文件格式样本</h2>
                    <span class="closes"><a href="javascript:create_class.seaDetails('blk3','h')" id="close1">关闭</a></span>
               </div>
               <div class="tips_text" style='height:220px;overflow-x:hidden;overflow-y:auto;'>
					 <%if("102".equals(gameid)){%>
					 		
					 		33133003101331</br>
 						   	33130033101331</br>
 						   	03133033101331</br>
 							33033033103131</br>
 							33133003101331</br>
 							33130033101331</br>
 							03133033101331</br>
 							33033033103131</br>
					 	
					 <%}else if("103".equals(gameid)){%>
					 		<p>第一种方式："*"号代替</p>
					 		13*0*1*13*30*1</br>
 							13*33*0*1*1*01</br>
 							31*113*13*0*1*</br>
 							*113*0*33*301*</br>
 							13*0*1*13*30*1</br>
 							13*33*0*1*1*01</br>
 							31*113*13*0*1*</br>
 							*113*0*33*301*</br>
 							<p>第二种方式："#"号代替</p>
					 		13#0#1#13#30#1</br>
 							13#33#0#1#1#01</br>
 							31#113#13#0#1#</br>
 							#113#0#33#301#</br>
 							13#0#1#13#30#1</br>
 							13#33#0#1#1#01</br>
 							31#113#13#0#1#</br>
 							#113#0#33#301#</br>
 							<p>第三种方式：数字"9"代替</p>
					 		13909191393091</br>
 							13933909191901</br>
 							31911391390919</br>
 							91139093393019</br>
 							13909191393091</br>
					 <%}else if("107".equals(gameid)){%>
					 		331330031013</br>
 						   	331300331013</br>
 						   	031330331013</br>
 							330330331031</br>
 							331330031013</br>
 							331300331013</br>
 							031330331013</br>
 							330330331031</br>
					 <%}else if("106".equals(gameid)){%>
					 		21103012</br>
 						   	00103012</br>
 						   	21103013</br>
 							21333012</br>
 							31103011</br>
 							21103010</br>
 							21103012</br>
 							21103010</br>
					 <%}%>	
              </div>
         </div>
    </div>
</div>  

    </div>
        <div id='bd'>aa</div>
<%@include file='/common/footer.jsp' %>
   
  <script type='text/javascript' src='<%=request.getContextPath()%>/letoula/js/betting.js'></script>
  