<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserGroup_Add.aspx.cs" Inherits="JRAPI.Admin.User.UserGroup_Add" %>
<%@ Register Src="../Controls/SubPageTop.ascx" TagName="SubPageTop" TagPrefix="uc1" %>
<uc1:SubPageTop ID="SubPageTop1" runat="server" />
<body>
<style type="text/css">
	html{_overflow-y:scroll}
</style>
<script type="text/javascript">
<!--
            $(function () {

                SwapTab('setting', 'on', '', 3, 1);
                $.formValidator.initConfig({ formid: "myform", autotip: true, onerror: function (msg, obj) { window.top.art.dialog({ content: msg, lock: true, width: '200', height: '50' }, function () { this.close(); $(obj).focus(); }) } });
                $("#txtGroupName").formValidator({ onshow: "请输入用户组名称", onfocus: "请输入用户组名称" }).inputValidator({ min: 3, max: 20, onerror: "请输入用户组名称" });
                $("#txtCost").formValidator({ onshow: "请输入默认手续费率", onfocus: "请输入默认手续费率" }).inputValidator({ onerror: "默认手续费率输入有误" }).regexValidator({ regexp: "decmal1", datatype: "enum", onerror: "默认手续费率为小数" });
                $("#txtCostUpper").formValidator({ onshow: "请输入手续费上限,-1为无上限", onfocus: "请输入手续费上限,-1为无上限" }).inputValidator({ onerror: "手续费上限输入有误" }).regexValidator({ regexp: "num", datatype: "enum", onerror: "手续费上限为整数或小数" });
                $("#txtCostFloor").formValidator({ onshow: "请输入手续费下限", onfocus: "请输入手续费下限" }).inputValidator({ onerror: "手续费下限输入有误" }).regexValidator({ regexp: "num", datatype: "enum", onerror: "手续费下限为整数或小数" });
                $("#txtCostType").formValidator({ onshow: "请输入提现模式,T+N", onfocus: "请输入提现模式,T+N" }).inputValidator({ onerror: "提现模式输入有误" }).regexValidator({ regexp: "num1", datatype: "enum", onerror: "提现模式为整数" });
                $("#txtWithdrawFloor").formValidator({ onshow: "请输入最低提现金额", onfocus: "请输入最低提现金额" }).inputValidator({ onerror: "最低提现金额输入有误" }).regexValidator({ regexp: "num", datatype: "enum", onerror: "最低提现金额为整数或小数" });
            })
//-->
</script>
<form method="post" runat="server" id="myform" >
<div class="pad-10">
<div class="col-tab">
<ul class="tabBut cu-li">
            <li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',4,1);">基本信息</li>
            <li id="tab_setting_2" onclick="SwapTab('setting','on','',4,2);">接入设置</li>
            <li id="tab_setting_3" onclick="SwapTab('setting','on','',4,3);">费率设置</li>
            <li id="tab_setting_4" onclick="SwapTab('setting','on','',4,4);">提现设置</li>
</ul>
<div id="div_setting_1" class="contentList pad-10">
<table width="100%"  class="table_form">
  <tr>
    <th width="120">用户组名称</th>
    <td class="y-bg"><asp:TextBox id="txtGroupName" runat="server" CssClass="input-text"></asp:TextBox></td>
  </tr>

  <tr>
    <th width="120">用户组备注</th>
    <td class="y-bg"><asp:TextBox id="txtGroupRemark" runat="server" CssClass="input-text" Width="400px" Height="50px" 
                                    TextMode="MultiLine"></asp:TextBox>
  </tr> 
</table>
</div>
<div id="div_setting_2" class="contentList pad-10 hidden">
	<table width="100%"  class="table_form">
        <asp:Repeater ID="repList" runat="server">
        <ItemTemplate>
          <tr>
            <th width="120"><%# Eval("typename")%>通道</th>
            <td class="y-bg">
            <select name="type_<%# Eval("typeid") %>">
                <option value="0" >使用系统默认</option>
                <option value="-1" >禁用此通道</option>
                <%# getSelectItem(JRAPI.Common.TypeConverter.ObjectToInt(Eval("typeid")))%>
            </select></td>
          </tr>
        </ItemTemplate>
        </asp:Repeater>
</table>
</div>
<div id="div_setting_3" class="contentList pad-10 hidden">
<div  class="div_list">
<ul>
<li  style="width:300px"><span style="width:120px">网银通道</span><input name="Rate0" type="text" id="UserRate0" value="<%=getChannelRate(0) %>" size="10" maxlength="6" Class="input-text NumDecText"/>%</li>
    <asp:Repeater ID="repChannel" runat="server">
    <ItemTemplate>
      <li style="width:300px"><span  style="width:120px"><%# Eval("ChannelName")%></span><input name="Rate<%# Eval("Channelid") %>" type="text" id="UserRate<%# Eval("Channelid") %>" value="<%# getChannelRate(JRAPI.Common.TypeConverter.ObjectToInt(Eval("Channelid"))) %>" size="10" maxlength="6" Class="input-text NumDecText"/>%</li>
    </ItemTemplate>
    </asp:Repeater>     
</ul>
  </div>
</div>
<div id="div_setting_4" class="contentList pad-10 hidden">
	<table width="100%"  class="table_form">
  <tr>
    <th width="120">默认手续费率</th>
    <td class="y-bg"><asp:TextBox id="txtCost" runat="server" CssClass="input-text"></asp:TextBox>%</td>
  </tr>
  <tr>
    <th width="120">手续费上限</th>
    <td class="y-bg"><asp:TextBox id="txtCostUpper" runat="server" CssClass="input-text"></asp:TextBox></td>
  </tr> 
  <tr>
    <th>手续费下限</th>
    <td class="y-bg"><asp:TextBox id="txtCostFloor" runat="server" CssClass="input-text"></asp:TextBox></td>
  </tr>     
  <tr>
    <th>最低提现金额</th>
    <td class="y-bg"><asp:TextBox id="txtWithdrawFloor" runat="server" CssClass="input-text"></asp:TextBox></td>
  </tr>
  <tr>
    <th>提现模式T+</th>
    <td class="y-bg"><asp:TextBox id="txtCostType" runat="server" CssClass="input-text" Columns="5"></asp:TextBox></td>
  </tr>
</table>

</div>


<div class="bk15"></div>
    <asp:Button ID="dosubmit" runat="server" Text="提交" CssClass="button" 
        onclick="dosubmit_Click" />
</div>
</div>
</form>
</body>
<script type="text/javascript">

    function SwapTab(name, cls_show, cls_hide, cnt, cur) {
        for (i = 1; i <= cnt; i++) {
            if (i == cur) {
                $('#div_' + name + '_' + i).show();
                $('#tab_' + name + '_' + i).attr('class', cls_show);
            } else {
                $('#div_' + name + '_' + i).hide();
                $('#tab_' + name + '_' + i).attr('class', cls_hide);
            }
        }
    }

    function showsmtp(obj, hiddenid) {
        hiddenid = hiddenid ? hiddenid : 'smtpcfg';
        var status = $(obj).val();
        if (status == 1) $("#" + hiddenid).show();
        else $("#" + hiddenid).hide();
    }
    function test_mail() {
        var mail_type = $('input[checkbox=mail_type][checked]').val();
        var mail_auth = $('input[checkbox=mail_auth][checked]').val();
        $.post('?m=admin&c=setting&a=public_test_mail&mail_to=' + $('#mail_to').val(), { mail_type: mail_type, mail_server: $('#mail_server').val(), mail_port: $('#mail_port').val(), mail_user: $('#mail_user').val(), mail_password: $('#mail_password').val(), mail_auth: mail_auth, mail_from: $('#mail_from').val() }, function (data) {
            alert(data);
        });
    }
    $(function () {
        $(".NumDecText").keyup(function () {
            $(this).val($(this).val().replace(/[^0-9.]/g, ''));
        }).bind("paste", function () {
            $(this).val($(this).val().replace(/[^0-9.]/g, ''));
        }).css("ime-mode", "disabled");
    })
</script>
</html> 