<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String nikeName=request.getParameter("nikeName");
	String u=request.getParameter("u");
	
%>
<!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/useraccount/css/touzhu.css" rel="stylesheet" type="text/css" />
  </head>
  
  <body>
  	<div class='buy_rec'>
  		<ul class='my_cos'>
  			<li><a href="costum.jsp?u=<%=u%>&nikeName=<%=nikeName%>">我定制的跟单</a></li>
  			<li><a href="myassigned.jsp?u=<%=u%>&nikeName=<%=nikeName%>">我被邀请的记录</a></li>
  			<li><a href="myassign.jsp?u=<%=u%>&nikeName=<%=nikeName%>" class='cur'>跟我单的用户</a></li>
  		</ul>
  	</div>

  	  <table width='100%' cellspacing='0' cellpadding='0' class='b_r_table'>
  	  	<colgroup>
  			<col width="164"/><col width="183"/><col width="218" /><col />
  		</colgroup>
  		<thead>
  			<tr>
  				<th>彩种</th><th>已定制人数</th><th>跟单总金额</th><th>操作</th>
  			</tr>
  		</thead>
  		<tbody class='singleuser'>
  		</tbody>
  	</table><div class='loding'><img src='../../images/loding.gif' /></div>
  	<div class='rec_added'>
  		<p>
  		说明：
  		<font color='gray'>1.定制跟单：用户可提前定购某位发起人的方案的一定份额，则当该发起人发起方案时，系统就自动以用户预定的金额认购该发起人的方案。免去用户守侯跟单、跟不到好单的烦恼。</font><a href="<%=request.getContextPath()%>/letoula/axy/gg_statistic.jsp" target="_blank" class='blue'>查看中奖高手，定制跟单?>></a><br/>
  		</p>
  	</div>
  	
  </body>
  </html>
<script type='text/javascript' src='<%=request.getContextPath()%>/letoula/js/plugin/library.js'></script>
  <script type='text/javascript'>
  		$('.loding').show();
  		$.getJSON('../../data/tary_single_user.jsp?r='+Math.random(),{'userNikeName':nikeName},function(JSON){
  				var tr='';
  				if(JSON.items.length == 0) tr = '<tr><td colspan="10">没有找到相关的记录！</td></tr>';
  				$('.singleuser').empty();
  				if(JSON.result == '0000'){
  					
  					$(JSON.items).each(function(i,v){
  						
  						tr += '<tr><td><strong>'+lotName[v.lotName]+'</strong></td><td><font color="red">'+v.zdr+'</font>人</td><td><font color="red">'+v.price+'</font>元</td><td><a href="javascript:void(0)" class="star" onclick="show_tr(this)">指定操作</a></td></tr><tr style="display:none"><td class="custom-td" colspan="4" align="left">添加自动跟单用户：<input type="text" id="taryName" /><input type="button" class="d_blue" onclick=tartAddSingle("'+v.lotName+'","'+nikeName+'") value="提交"/></td></tr>';
  							
  					})
  					$(tr).appendTo('.singleuser');
  				}else{
  					
  					alert(JSON.result);
  				}
  			$('.loding').hide();
  		});
  		
  		function show_tr(_this){
  			
  			if(_this.className=='star') $(_this).removeClass('star').addClass('end').parents('tr').next('tr').show();
  			else $(_this).removeClass('end').addClass('star').parents('tr').next('tr').hide();
  			
  		}
  		
  		function  tartAddSingle(lotName,nikeName){
  			
  			var canyuNikeName =  KO.$('taryName').value;
  			$.getJSON('../../data/tary_AddSingle_user.jsp?r='+Math.random(),{'lotName':lotName,'userNikeName':nikeName,'canyuNikeName':canyuNikeName,'message':'message'},function(JSON){
  				
  				if(JSON.result=='0000'){
  					
  					alert("添加成功");
  					$('.end').removeClass('end').addClass('star').parents('tr').next('tr').hide();
  				}
  				else{
  				
  					alert(JSON.result);
  				}
  			});
  		}
  		
  		
  </script>