<%@ Page Language="C#" AutoEventWireup="true"   CodeBehind="lowerbetdata.aspx.cs" Inherits="AgentManager.admin.lowerbetdata" %>

    <link rel="stylesheet" href="css/bootstrap/css/bootstrap.min.css"/>
      <link rel="stylesheet" href="css/AdminLTE.css" />
      <link rel="stylesheet" href="css/plugins/iCheck/flat/blue.css"/> 

<script src="js/jquery-1.9.1.min.js"></script>
<script src="css/bootstrap/js/bootstrap.min.js"></script>
<script src="css/My97DatePicker/WdatePicker.js"></script>
<script src="js/mainData.js"></script>
<script src="js/gameConfig.js"></script>
<style>


</style>
     <div class="content-wrapper">
       

<section class="content-header">
    <h1>
    下级会员下注记录
    <small></small>
    </h1>
    
</section>
         <form  action="lowerbetdata.aspx" method="post">
 <div class="col-md-6">
              <table class="table">
                  <tr>
                      <td><label>账号</label></td>
                       <td>
                         <input  name="username"  value="<%=username %>" id="username"  maxlength="15" autocomplete="off"  class="form-control" list="a"/>

<datalist id="a"> 
  

                          <%foreach (var item in li)
                              {
                                 

                                  %>

                              <option value="<%=item.Username %>"><%=item.Myname  %></option>

                          <%

                              } %>
</datalist>

                    <%-- <input name="username" type="text" id="username" maxlength="15" autocomplete="off" value="<%=username %>" class="form-control" />--%>

                       </td>



                      <td><label>时间范围</label></td>
                    <td colspan="2">
                        <div class="btn-group">
                          <button type="button" class="btn btn-default" onclick="setAutoTime('1','starttime','endtime')">最近3天</button>
                          <button type="button" class="btn btn-default" onclick="setAutoTime('2','starttime','endtime')">最近7天</button>
                          <button type="button" class="btn btn-default" onclick="setAutoTime('3','starttime','endtime')">最近30天</button>
                        </div>
                    </td>
                  </tr>
                  <tr>
                      <td><label>开始时间</label></td>
                      <td><input name="starttime" type="text" id="starttime" maxlength="10" autocomplete="off" value="<%=start %>" class="form-control" onclick="WdatePicker()" /></td>
                      <td><label>结束时间</label></td>
                      <td><input name="endtime" type="text" id="endtime" maxlength="10" autocomplete="off" value="<%=end %>" class="form-control" onclick="WdatePicker()" /></td>
                      <td><input type="submit" name="Submit" value="搜索" class="btn btn-block btn-primary"/></td>
                  </tr>
              </table>
        </div>
         </form>
<section class="content">

<div id="mainbox">
<form id="form1" name="form1" method="post">

<table id="tabList" class="box">
   
  <tr>
    <td><strong>ID</strong></td>
    <td><strong>下注单号</strong></td>
    <td><strong>玩家名字</strong></td>
        <td><strong>平台</strong></td>
      <td><strong>游戏</strong></td>
      <td><strong>下注时间</strong></td>
    <td><strong>下注金额</strong></td>
    <td><strong>实际下注金额</strong></td>
    <td><strong>输赢金额</strong></td>
    
    <td><strong>下注详情</strong></td>

  </tr>
   
  <%
      if (li1!=null)
      {

     
      foreach (var item in li1)
      {%>
      <tr>
    <td><strong><%=item.Id %></strong></td>
    <td><strong><%=item.BillNo %></strong></td>
    <td><strong><%=item.UserName %></strong></td>
    <td><strong class="plateform"><%=item.PlatformType %></strong></td>
    <td><strong class="trs"><%=item.GameType %></strong></td>
    <td><strong><%=item.BetTime %></strong></td>
    <td><strong><%=item.BetAmount %></strong></td>
    <td><strong><%=item.ValidBetAmount %></strong></td>
    <td><strong><%=item.NetAmount %></strong></td>
    <td class="content" data-name="<%=item.PlatformType %>"><%=item.BetContent %></td>

  </tr>
    <%

      }%>
      <tr><td style="color:red"><strong>汇总</strong></td>
        <td>-</td>
        <td>-</td>
        <td>-</td>
        <td>-</td>
        <td>-</td>
    
        <td style="color:red"><strong><%=li1.Sum(u=>u.BetAmount) %></strong></td>
        <td style="color:red"><strong><%=li1.Sum(u=>u.ValidBetAmount) %></strong></td>
        <td style="color:red"><strong><%=li1.Sum(u=>u.NetAmount) %></strong></td>
        <td style="color:red">-</td>
    </tr>
    
    <% } %>
  
   
</table>
</form>

</div>

</section>



<div class="page" id="pagebox" runat="server">
     <div>页码<strong><%= pageindex %></strong>/<%= pagecount %>，共<span><%=count %></span>条记录，每页显示<span><%= pagesize %></span>条</div>
    <div>
        <a  class="btn btn-primary btn-sm" href="lowerbetdata.aspx?username=<%=username %>&page=<%= 1 %>&starttime=<%= start %>&endtime=<%=end %>">首页</a>
        <a  class="btn btn-primary btn-sm" href="lowerbetdata.aspx?username=<%= username %>&page=<%= pageindex-1 %>&starttime=<%= start %>&endtime=<%=end %>">上一页</a>
        <a  class="btn btn-primary btn-sm" href="lowerbetdata.aspx?username=<%= username %>&page=<%= pageindex+1%>&starttime=<%= start %>&endtime=<%=end %>">下一页</a>
        <a  class="btn btn-primary btn-sm" href="lowerbetdata.aspx?username=<%= username %>&page=<%= pagecount %>&starttime=<%= start %>&endtime=<%=end %>">末页</a>
     </div>
   
</div>




</div>

<script>

        window.onload = function () {
            
            


            $("#tabList td .trs").each(function (x, y) {
                debugger
                var platformCode = $(y).parent().parent().find(".plateform").html();
                try {
                    var ZH = "";
                    if (platformCode == "IG") {
                        ZH = IGName(platformCode, $(y).html());
                        $(y).html(ZH);
                    } else {
                        var data = eval('(' + 'electronicgame' + platformCode + ')').find(function (e) {
                            return e.gameType == $(y).html();
                        });
                  }
                if (data != undefined) $(y).html(data.gameName);
                } catch (e) {

                }
              
            })
             $("#tabList .content").each(function (x, y) {
                var con = $(y).html();

                if (con.indexOf("注单状态") == 0) {
                    var s = con.substring(5, con.indexOf(','))
                    var plat = $(y).attr('data-name')
                    var content = "注单状态:" + changeState(plat, s) + con.substring(con.indexOf(','))
               
                    if (changeState(plat, s) != undefined) { $(y).html(content) }
                }
            })



        }
        function IGName(platformCode, gameType) {
            var ZH = gameType;
            var typeArr = gameType.split("-");
            var bigName = "";
            switch (typeArr[0]) {
                case "LOTTERY":
                    bigName = "时时彩";
                    break;
                case "GFC":
                    bigName = "官方彩";
                    break;
                case "LOTTO":
                    bigName = "六合彩";
                    break;
            }
            var data = eval('(' + 'electronicgame' + platformCode + ')').find(function (e) {
                if (e.gameLottery == typeArr[0] && e.gameType == typeArr[1]) {
                    return e.gameType == typeArr[1];
                }
            });
            if (data != undefined) ZH = data.gameName +'(' +bigName+')';
            return ZH;
        }
      
</script>





