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

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

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head 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/select-ui.min.js"></script>
    <script src="js/DatePicker/WdatePicker.js"></script>
    <script src="/js/Common.js"></script>
    <script type="text/javascript">
        $(document).ready(function (e) {
            $(".select1").uedSelect({
                width: 345
            });
            $(".select2").uedSelect({
                width: 167
            });
            $(".select3").uedSelect({
                width: 100
            });

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

            $(".tiptop a").click(function () {
                $(".tip").fadeOut(200);
            });

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

            $(".cancel").click(function () {
                $(".tip").fadeOut(100);
            });
            SetOrderByField($("#<%=hdOrderByField.ClientID%>").val(), $("#<%=hdOrderByType.ClientID%>").val());
        });

        function OrderByClick(filed, orderByType) {
            var parameters = "&ddlProxyQueryType=" + $("#<%=ddlProxyQueryType.ClientID %>").val() + "&txtProxyId=" + $("#<%=txtProxyId.ClientID %>").val()
                            + "&ddlQueryType=" + $("#<%=ddlQueryType.ClientID %>").val() + "&txtKeyword=" + $("#<%=txtKeyword.ClientID %>").val()
                            + "&ddlLockType=" + $("#<%=ddlLockType.ClientID %>").val() + "&isStat=" + $("#<%=isStat.ClientID %>").is(":checked");
            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/Members.aspx">会员管理</a></li>
            </ul>
        </div>

        <div class="rightinfo">

            <div class="tabson">

                <ul class="toolbar">
                    <li class="click"><a href="MemberAdd.aspx"><span>
                        <img src="images/t01.png" /></span>添加会员</a></li>
                </ul>
                <ul class="seachform">

                    <%--    <li><label>注册日期</label><input name="" id="txtBeginTime" runat="server" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'2015-01-01',maxDate:'#F{$dp.$D(\'txtEndTime\',{d:0});}'})" type="text" class="scinput" />-<input name=""  id="txtEndTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'txtBeginTime\',{d:0});}',maxDate:'%y-%M-%d'})" runat="server" type="text" class="scinput" /></li>--%>

                    <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="ddlQueryType" 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="txtKeyword" /></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>统计</label></li>
                    <li>
                        <input type="checkbox" runat="server" style="margin-top: 60%;" name="isStat" id="isStat" />
                    </li>

                    <li>
                        <label>&nbsp;</label><asp:Button ID="btnQuery" class="scbtn" runat="server" Text="查询" OnClick="btnQuery_Click" />
                    </li>

                </ul>
                <input type="hidden" id="hdOrderByType" runat="server" value="" />
                <input type="hidden" id="hdOrderByField" runat="server" value="" />
            </div>


            <b class="unitclass">单位：金币</b>
            <table class="tablelist">
                <thead>
                    <tr>
                        <th>序号<i class="sort"><img src="images/px.gif" /></i></th>
                        <th>玩家ID</th>
                        <th>玩家帐号</th>
                        <th>真实姓名</th>
                        <th>推荐人</th>
                        <th><a href='javascript:OrderByClick("Tax","");' id="OrderByA_Tax" class="tablelink">抽水值</a></th>
                        <th><a href='Javascript:OrderByClick("UpScore","");' id="OrderByA_UpScore" class="tablelink">总上分</a></th>
                        <th><a href='Javascript:OrderByClick("DownScore","");' id="OrderByA_DownScore" class="tablelink">总下分</a></th>
                        <th><a href='Javascript:OrderByClick("TotalWin","");' id="OrderByA_TotalWin" class="tablelink">总输赢</a></th>
                        <th><a href='Javascript:OrderByClick("Score","");' id="OrderByA_Score" class="tablelink">账户余额(背包+银行)</a></th>
                        <th>所属代理</th>
                        <th>帐号状态</th>
                        <th>机器锁定</th>
                        <th>冻结</th>
                        <th style="display: <%= Proxy.kz.ToString() == "1" ? "block":"none"%>">送分</th>

                        <th style="display: <%= Proxy.kz.ToString() == "1" ? "block":"none"%>">控制</th>

                        <th colspan="2">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <asp:Repeater ID="reptDataPager" runat="server">
                        <ItemTemplate>
                            <tr style="color: <%#Eval("Disabled").ToString() == "0" ? "":"red"%>;">
                                <td><%# Eval("RowIndex") %></td>
                                <td><%# Eval("userid") %></td>
                                <td><%#Proxy.ProxyID==1?Eval("UserName"):"" %></td>
                                <td><%#Eval("RealName") %></td>
                                <td><%#Eval("RecommendUserName") %></td>
                                <td><a href="/SysRoot/MemberTaxList.aspx?uid=<%# Eval("UserId") %>&uname=123" class="tablelink"><%#FormatMoney(Eval("Tax")) %></a></td>
                                <td><a href="/SysRoot/MemberScoreList.aspx?uid=<%# Eval("UserId") %>&op=0&uname=123" class="tablelink"><%#FormatMoney(Eval("UpScore")) %></a></td>
                                <td><a href="/SysRoot/MemberScoreList.aspx?uid=<%# Eval("UserId") %>&op=1&uname=123" class="tablelink"><%#FormatMoney(Eval("DownScore")) %></a></td>
                                <%--<td><%#FormatMoney(Eval("TotalWin")) %></td>--%>
                                <td><a href="/SysRoot/GameRecord.aspx?uid=<%# Eval("UserId")%>" class="tablelink"><%#FormatMoney(Eval("TotalWin"))%></a></td>
                                <td><%#FormatMoney(Eval("Score")) %></td>
                                <td><%#Eval("Proxy") %></td>
                                <td><%#Eval("Disabled").ToString()=="0"?"<font color='green'>可用</font>":"<font color='red'>不可用</font>"%></td>
                                <td>
                                    <img src="<%#Eval("LockMathine").ToString()=="0"?"/SysRoot/images/unlock.png":"/SysRoot/images/lock.png"%>" title="点击修改用户锁定状态" style="cursor: pointer" onclick="unlock(<%# Eval("userid") %>,'<%#Eval("LockMathine").ToString()%>')" /></td>
                                <td>
                                    <%# (Eval("ProxyID").ToString() == Proxy.ProxyID.ToString() || Eval("OtherOperator").ToString() == Proxy.account) ?
                                "<a href=\"#\"  onclick=\"freezeUsre(" + Eval("userid") +"," + (Eval("Disabled").ToString()=="0"?"1":"0")+")\" class='tablelink'>"+ (Eval("Disabled").ToString()=="0"?"<font color='red'>冻结</font>":"<font color='green'>解冻</font>")+"</a>":""
                                    %>                                
                                </td>

                                <td style="display: <%= Proxy.kz.ToString() == "1" ? "block":"none"%>">
                                    <p>捕鱼+5合1</p>
                                    <input type="text" value="<%#Eval("buyu")%>" class="scinput" placeholder="" id='<%#Eval("userid")+"1" %>' name="<%#Eval("userid")+"1"%>">
                                    <label>&nbsp;</label>
                                    <a href="#" onclick="gamecontrol(<%# Eval("UserId")%>)" class='tablelink'>送分</a>
                                </td>
                               <%-- <td style="display: <%= Proxy.kz.ToString() == "1" ? "block":"none"%>">
                                    <p>捕鱼+5合1</p>
                                    <input type="text" value="<%#Eval("zjh")%>" class="scinput" placeholder="" id='<%#Eval("userid")%>' name="<%#Eval("userid")%>">
                                    <label>&nbsp;</label>
                                    <a href="#" onclick="gamecontrol1(<%# Eval("UserId")%>)" class='tablelink'>送分</a>
                                </td>--%>

                                <td>
                                    <%# (Proxy.ProxyLevel == 1) ?
                                "<a href=\"/SysRoot/MemberEdit.aspx?uid=" + Eval("UserId") + "\" class=\"tablelink\">修改</a>&nbsp;" : ""
                                    %>
                                    <a href="#" onclick="kxql(<%# Eval("UserId")%>)" class='tablelink'>卡线清理</a>
                                    <a href="#" onclick="kxql(<%# Eval("UserId")%>)" class='tablelink'>送分</a>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                    <tr style="background-color: #e5ebee" id="statTr" runat="server">
                        <td>统计</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td><span class="inSpan" runat="server" id="allTaxSpan"></span></td>
                        <td><span class="inSpan" runat="server" id="totalUpScoreSpan"></span></td>
                        <td><span class="inSpan" runat="server" id="totalDownScoreSpan"></span></td>
                        <td><span class="inSpan" runat="server" id="totalWinSpan"></span></td>
                        <td><span class="inSpan" runat="server" id="totalScoreSpan"></span></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                </tbody>
            </table>
        </div>

        <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>是否确认对信息的修改 ？</p>
                    <cite>如果是请点击确定按钮 ，否则请点取消。</cite>
                </div>
            </div>

            <div class="tipbtn">
                <input name="" type="button" class="sure" value="确定" />&nbsp;
        <input name="" type="button" class="cancel" value="取消" />
            </div>
        </div>

        <script type="text/javascript">
            function freezeUsre(uid, op) {
                $.ajax({
                    url: "/ProxyHandler/Member.ashx",
                    data: { action: "freezeuser", uid: uid, op: op },
                    success: function (data) {
                        if (data == "success") {
                            alert("操作成功！");
                            window.location.reload();
                        } else {
                            alert("操作失败！");
                        }
                    },
                    error: function (xhr, status, error) {
                        console.log(error);
                        alert("发生错误：" + error);
                    }
                });
            }

            function unlock(uid, islock) {
                if (islock == 'False') {
                    alert("已经解锁，无需再次解锁！");
                    return;
                }
                $.ajax({
                    url: "/ProxyHandler/Member.ashx",
                    data: { action: "unlock", uid: uid },
                    success: function (data) {
                        if (data == "success") {
                            alert("解锁成功！");
                            window.location.reload();
                        } else {
                            alert("解锁失败！");
                        }
                    },
                    error: function (xhr, status, error) {
                        console.log(error);
                        alert("解锁发生错误：" + error);
                    }
                });
            }
            function gamecontrol(uid) {
                var sf = document.getElementById(uid+'1').value;
                $.ajax({
                    url: "/ProxyHandler/Member.ashx",
                    data: { action: "gamecontrol", uid: uid, controlvalue: sf },
                    success: function (data) {
                        if (data == "success") {
                            alert("送分成功！");
                            window.location.reload();
                        } else {
                            alert("送分成功！");
                        }
                    },
                    error: function (xhr, status, error) {
                        console.log(error);
                        alert("送分成功！");
                    }
                });
            }
            function gamecontrol1(uid) {
                var sf = document.getElementById(uid).value;
                $.ajax({
                    url: "/ProxyHandler/Member.ashx",
                    data: { action: "gamecontrol1", uid: uid, controlvalue: sf },
                    success: function (data) {
                        if (data == "success") {
                            alert("送分成功！");
                            window.location.reload();
                        } else {
                            alert("送分成功！");
                        }
                    },
                    error: function (xhr, status, error) {
                        console.log(error);
                        alert("送分成功！");
                    }
                });
            }
            function kxql(uid) {
                var sf = 0;
                $.ajax({
                    url: "/ProxyHandler/Member.ashx",
                    data: { action: "kxql", uid: uid, controlvalue: sf },
                    success: function (data) {
                        if (data == "success") {
                            alert("成功！");
                            window.location.reload();
                        } else {
                            alert("失败！");
                        }
                    },
                    error: function (xhr, status, error) {
                        console.log(error);
                        alert("成功！");
                    }
                });
            }
            $('.tablelist tbody tr:odd').addClass('odd');
        </script>
    </form>
</body>
</html>
