<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProxyProfit.aspx.cs" Inherits="DimoNetwork.ProxyWeb.SysRoot.ProxyProfit" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <link href="css/select.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/jquery.idTabs.min.js"></script>
    <script type="text/javascript" src="js/select-ui.min.js"></script>
    <script src="/js/Common.js"></script>

    <script type="text/javascript">
        $(document).ready(function () {
            $(".select3").uedSelect({
                width: 120
            });
            $(".tiptop a").click(function () {
                $(".tip").fadeOut(200);
            });

            $(".sure").click(function () {
                $(".tip").fadeOut(300);
            });

            $(".cancel").click(function () {
                $(".tip").fadeOut(100);
            });
            SetOrderByField($("#<%=hdOrderByField.ClientID%>").val(), $("#<%=hdOrderByType.ClientID%>").val());
        });
        function initSendBonus(subproxy, subproxyid, amount) {
            $("#ltSubProxyName").text(subproxy);
            $("#ltProfitNumber").text(amount);
            $("#hfSubProxyId").val(subproxyid);
        }
        function OrderByClick(filed, orderByType) {
            var parameters = "&ddlProxyQueryType=" + $("#<%=ddlProxyQueryType.ClientID %>").val() + "&txtProxyId=" + $("#<%=txtProxyId.ClientID %>").val()
                + "&ddlLockType=" + $("#<%=ddlLockType.ClientID %>").val();
            OrderBy(filed, orderByType, parameters);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div class="place">
            <span>位置：</span>
            <ul class="placeul">
                <li><a href="/SysRoot/index.aspx">首页</a></li>
                <li><a href="/SysRoot/ProxyProfit.aspx">代理利润</a></li>
            </ul>
        </div>

        <div class="rightinfo">

            <div class="itab">
                <%-- style="display:<%=this.Proxy.belongsAgent == -1 ? "" : "none"%>"--%>
                <ul id="tabUl">
                    <li><a href="#tab1">代理利润</a></li>
                    <li><a href="#tab2" onclick="location.href='/SysRoot/SendBounsDetail.aspx#tab2'">发放利润明细</a></li>
                    <li><a href="#tab3" onclick="location.href='/SysRoot/PayOrders.aspx#tab3'">充值提现历史</a></li>
                </ul>
            </div>
            <br />
            <div class="tabson">
                <ul class="seachform">
                    <li>
                        <div class="vocation">
                            <asp:DropDownList ID="ddlProxyQueryType" CssClass="select3" runat="server">
                                <asp:ListItem Text="下级代理ID" Value="0"></asp:ListItem>
                                <asp:ListItem Text="下级代理账号" Value="1"></asp:ListItem>
                            </asp:DropDownList>
                        </div>
                    </li>

                    <li>
                        <input name="" type="text" class="scinput" runat="server" id="txtProxyId" /></li>
                    <li>
                        <div class="vocation">
                            <asp:DropDownList ID="ddlLockType" CssClass="select3" runat="server">
                                <asp:ListItem Text="--帐号状态--" Value="-1"></asp:ListItem>
                                <asp:ListItem Text="可用" Value="0"></asp:ListItem>
                                <asp:ListItem Text="冻结" Value="1"></asp:ListItem>
                            </asp:DropDownList>
                        </div>
                    </li>
                    <li>
                        <label>&nbsp;</label><asp:Button ID="btnQuery" class="scbtn" runat="server" Text="查询" OnClick="btnQuery_Click" />
                    </li>
                </ul>
            </div>
            <input type="hidden" id="hdOrderByType" runat="server" value="" />
            <input type="hidden" id="hdOrderByField" runat="server" value="" />
            <b class="unitclass">单位：金币</b>
            <table class="tablelist">
                <thead>
                    <tr>
                        <th>代理帐号</th>
                        <th>真实姓名</th>
                        <th><a href='javascript:OrderByClick("ProxyLevel","");' id="OrderByA_ProxyLevel" class="tablelink">代理级数</a></th>
                        <th>分红比例</th>
                        <th><a href='javascript:OrderByClick("TotalallTax","");' id="OrderByA_TotalallTax" class="tablelink">总抽水值</a></th>
                        <th><a href='javascript:OrderByClick("allTax","");' id="OrderByA_allTax" class="tablelink">当前抽水值</a></th>
                        <th><a href='javascript:OrderByClick("totalUpScore","");' id="OrderByA_totalUpScore" class="tablelink">总上分</a></th>
                        <th><a href='javascript:OrderByClick("totalDownScore","");' id="OrderByA_totalDownScore" class="tablelink">总下分</a></th>
                        <th>总分红</th>
                        <th>当前分红</th>
                        <th><a href='javascript:OrderByClick("TotalProxyProfit","");' id="OrderByA_TotalProxyProfit" class="tablelink">总纯利润</a></th>
                        <th><a href='javascript:OrderByClick("ProxyProfit","");' id="OrderByA_ProxyProfit" class="tablelink">当前纯利润</a></th>
                        <th>所属代理</th>
                        <th><a href='javascript:OrderByClick("registerdate","");' id="OrderByA_registerdate" class="tablelink">添加时间</a></th>
                        <th>状态</th>
                    </tr>
                </thead>
                <tbody>
                    <asp:Repeater ID="reptDataPager" runat="server">
                        <ItemTemplate>
                            <tr  style="font-weight:<%#Eval("ProxyId").ToString() == this.Proxy.ProxyID.ToString() ? 900 : 100%>;color:<%#Eval("freezeState").ToString() == "False" ? "":"red"%>;">
                                <td><%#Eval("account")%></td>
                                <td><%#Eval("name")%></td>
                                <td><%#Eval("LevelName") %></td>
                                <td><%#Eval("assignProportion")%>%</td>
                                <td><a href="/SysRoot/ProxyTaxList.aspx?pid=<%# Eval("ProxyId")%>&uname=<%# Eval("Account")%>" class="tablelink" style="color:<%#Eval("freezeState").ToString() == "False" ? "":"red"%>;" ><%#FormatMoney(Eval("TotalallTax"))%></a></td>
                                <td><%#FormatMoney(Eval("allTax"))%></td>
                                <td><a href="/SysRoot/ProxyScoreList.aspx?pid=<%# Eval("ProxyId")%>&op=0&uname=<%# Eval("Account")%>" class="tablelink" style="color:<%#Eval("freezeState").ToString() == "False" ? "":"red"%>;"><%#FormatMoney(Eval("totalUpScore"))%></a></td>
                                <td><a href="/SysRoot/ProxyScoreList.aspx?pid=<%# Eval("ProxyId")%>&op=1&uname=<%# Eval("Account")%>" class="tablelink" style="color:<%#Eval("freezeState").ToString() == "False" ? "":"red"%>;"><%#FormatMoney(Eval("totalDownScore"))%></a></td>
                                <td><%# FormatMoney((Convert.ToDecimal(Eval("TotalallTax").ToString()) * Convert.ToDecimal(Eval("assignProportion").ToString())) / 100)%></td>
                                <td><%# FormatMoney((Convert.ToDecimal(Eval("allTax").ToString()) * Convert.ToDecimal(Eval("assignProportion").ToString())) / 100)%></td>
                                <td><%# FormatMoney((Convert.ToInt64(Eval("TotalProxyProfit").ToString())) / 100)%></td>
                                <td><%# FormatMoney((Convert.ToInt64(Eval("ProxyProfit").ToString())) / 100)%></td>
                                <td><%#Eval("BelongsAgentName")%></td>
                                <td><%#Eval("registerdate")%></td>
                                <td><%#Eval("freezeState").ToString() == "False" ? "<font color='green'>可用</font>" : "<font color='red'>不可用</font>"%></td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </tbody>
            </table>


            <div class="pagination pull-right">
                <webdiyer:AspNetPager ID="anpDataPager" runat="server" CustomInfoHTML="共%PageCount%页，当前为第%CurrentPageIndex%页，每页%PageSize%条" FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" PageSize="10" PrevPageText="上一页" ShowCustomInfoSection="Left" CssClass="pagination" LayoutType="Ul" PagingButtonLayoutType="UnorderedList" PagingButtonSpacing="0" CurrentPageButtonClass="active" OnPageChanged="anpDataPager_PageChanged"></webdiyer:AspNetPager>
            </div>

            <div class="tip">
                <div class="tiptop"><span>提示信息</span><a></a></div>

                <div class="tipinfo">
                    <span>
                        <img src="images/ticon.png" /></span>
                    <div class="tipright">
                        <p>是否确认对下级代理 <b id="ltSubProxyName" runat="server"></b>发放红利 <b id="ltProfitNumber" runat="server"></b>？</p>
                        <cite>如果是请点击确定按钮 ，否则请点取消。</cite>
                    </div>
                </div>

                <div class="tipbtn">
                    <asp:HiddenField runat="server" ID="hfSubProxyId" />
                    <asp:Button ID="btnSendBonus" CssClass="sure" runat="server" Text="确定" OnClick="btnSendBonus_Click" />
                    &nbsp;
        <input name="" type="button" class="cancel" value="取消" />
                </div>

            </div>
        </div>
        &nbsp;
    <script type="text/javascript">
        $("#tabUl").idTabs("tab1");

        $(".click").click(function () {
            $(".tip").fadeIn(200);
        });

        $('.tablelist tbody tr:odd').addClass('odd');
    </script>
    </form>
</body>
</html>
