<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="sysConfig.aspx.cs" Inherits="JRAPI.Admin.Systematic.sysConfig" %>

<%@ Register Src="../Controls/SubPageTop.ascx" TagName="SubPageTop" TagPrefix="uc1" %>
<uc1:SubPageTop ID="SubPageTop1" runat="server" />
<body>
<script src="../statics/js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<style type="text/css">
	html{_overflow-y:scroll}
</style>
<script type="text/javascript">
<!--
            $(function () {
                
                SwapTab('setting', 'on', '', 5, 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(); }) } });
                $("#txtSiteName").formValidator({ onshow: "请输入站点名称", onfocus: "请输入站点名称" }).inputValidator({ min: 3, max: 20, onerror: "请输入站点名称" });
                $("#txtSiteUrl").formValidator({ onshow: "请填写站点URL，格式为：http://www.api.cn,结尾不包含“/”", onfocus: "请填写站点URL，格式为：http://www.api.cn,结尾不包含“/”", tipcss: { width: '300px' }, empty: false }).inputValidator({ onerror: "请填写站点URL，格式为：http://www.api.cn,结尾不包含“/”" }).regexValidator({ regexp: "http:\/\/(.+)[^/]$", onerror: "请填写站点URL，格式为：http://www.api.cn,结尾不包含“/”" });
                $("#txtRecUrl").formValidator({ onshow: "请填写回发接收地址，格式为：http://www.api.cn,结尾不包含“/”", onfocus: "请填写回发接收地址，格式为：http://www.api.cn,结尾不包含“/”", tipcss: { width: '300px' }, empty: false }).inputValidator({ onerror: "请填写回发接收地址，格式为：http://www.api.cn,结尾不包含“/”" }).regexValidator({ regexp: "http:\/\/(.+)[^/]$", onerror: "请填写回发接收地址，格式为：http://www.api.cn,结尾不包含“/”" });
                $("#dpdGroup").formValidator({ onshow: "请选择注册用户默认用户组", onfocus: "请选择注册用户默认用户组" }).inputValidator({ min: 1, onerror: "请选择注册用户默认用户组" });
                $("#dpdPersonGroup").formValidator({ onshow: "请选择免登录功能所属用户组", onfocus: "请选择免登录功能所属用户组" }).inputValidator({ min: 1, onerror: "请选择免登录功能所属用户组" });
                $("#txtCost").formValidator({ onshow: "请输入默认手续费率", onfocus: "请输入默认手续费率" }).inputValidator({ onerror: "默认手续费率输入有误" }).regexValidator({ regexp: "decmal1", datatype: "enum", onerror: "默认手续费率为小数" });
                $("#txtCostUpper").formValidator({ onshow: "请输入手续费上限", onfocus: "请输入手续费上限" }).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: "最低提现金额为整数或小数" });
                $("#txtsmtpServer").formValidator({ onshow: "请输入邮件服务器地址", onfocus: "请输入邮件服务器地址" }).inputValidator({ min: 3, max: 30, onerror: "请输入邮件服务器地址" });
                $("#txtsmtpPort").formValidator({ onshow: "请输入邮件服务器端口", onfocus: "请输入邮件服务器端口" }).inputValidator({ onerror: "邮件服务器端口输入有误" }).regexValidator({ regexp: "^\\d{2,5}$", onerror: "邮件服务器端口为数字" });
                $("#txtsmtpUser").formValidator({ onshow: "请输入SMTP用户名", onfocus: "请输入SMTP用户名" }).inputValidator({ min: 3, max: 30, onerror: "请输入SMTP用户名" });
                $("#txtsmtpPass").formValidator({ onshow: "请输入SMTP密码", onfocus: "请输入SMTP密码" }).inputValidator({ min: 3, max: 30, onerror: "请输入SMTP密码" });
                $("#txtBankMoney").formValidator({ onshow: "请输入网银限额", onfocus: "请输入网银限额" }).inputValidator({ onerror: "网银限额输入有误" }).regexValidator({ regexp: "num1", datatype: "enum", onerror: "网银限额为整数" });
                $("#txtAliMoney").formValidator({ onshow: "请输入支付宝限额", onfocus: "请输入支付宝限额" }).inputValidator({ onerror: "支付宝限额输入有误" }).regexValidator({ regexp: "num1", datatype: "enum", onerror: "支付宝限额为整数" });
                $("#txtTenMoney").formValidator({ onshow: "请输入财付通限额", onfocus: "请输入财付通限额" }).inputValidator({ onerror: "财付通限额输入有误" }).regexValidator({ regexp: "num1", datatype: "enum", onerror: "财付通限额为整数" });
                $("#txtWeiXinMoney").formValidator({ onshow: "请输入微信限额", onfocus: "请输入微信限额" }).inputValidator({ onerror: "微信限额输入有误" }).regexValidator({ regexp: "num1", datatype: "enum", onerror: "微信限额为整数" });
                $("#txtWithdrawStartTime").formValidator({ onshow: "请输入系统过帐开始时间,格式为 23:40:00", onfocus: "请输入系统过帐开始时间,格式为 23:40:00" }).inputValidator({ min: 8, max: 8, onerror: "请输入系统过帐提现开始时间,格式为 23:40:00" });
                $("#txtWithdrawEndTime").formValidator({ onshow: "请输入系统过帐结束时间,格式为 23:59:00", onfocus: "请输入系统过帐结束时间,格式为 23:59:00" }).inputValidator({ min: 8, max: 8, onerror: "请输入系统过帐提现结束时间,格式为 23:59:00" });
                $("#txtMasterMobile").formValidator({ onshow: "请输入管理员手机号码", onfocus: "请输入管理员手机号码" }).inputValidator({ min: 11, max: 11, onerror: "管理员手机号码输入错误" }).regexValidator({ regexp: "mobile", datatype: "enum", onerror: "管理员手机号码输入错误" });
                $("#txtMasterEmail").formValidator({ onshow: "请输入管理员邮件地址", onfocus: "请输入管理员邮件地址" }).inputValidator({ min: 5, max: 32, onerror: "管理员邮件地址错误" }).regexValidator({ regexp: "email", 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','',5,1);">基本配置</li>
            <li id="tab_setting_2" onclick="SwapTab('setting','on','',5,2);">提现设置</li>
            <li id="tab_setting_3" onclick="SwapTab('setting','on','',5,3);">短信设置</li>
            <li id="tab_setting_4" onclick="SwapTab('setting','on','',5,4);">邮箱配置</li>
			<li id="tab_setting_5" onclick="SwapTab('setting','on','',5,5);">支付限额</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="txtSiteName" runat="server" CssClass="input-text"></asp:TextBox></td>
  </tr>
  <tr>
    <th width="120">站点URL</th>
    <td class="y-bg"><asp:TextBox id="txtSiteUrl" runat="server"  CssClass="input-text" 
            Columns="50"></asp:TextBox></td>
  </tr>
  <tr>
    <th width="120">回发接收地址</th>
    <td class="y-bg"><asp:TextBox id="txtRecUrl" runat="server"  CssClass="input-text" 
            Columns="50"></asp:TextBox></td>
  </tr>
  <tr>
    <th width="120">站点描述</th>
    <td class="y-bg"><asp:TextBox id="txtSiteDescription" runat="server" CssClass="input-text" Width="400px" Height="50px" 
                                    TextMode="MultiLine"></asp:TextBox>
  </tr> 
  <tr>
    <th width="120">站点关键字</th>
    <td class="y-bg"><asp:TextBox id="txtSiteKeyword" runat="server" Width="400px" CssClass="input-text"  Height="50px" 
                                    TextMode="MultiLine"></asp:TextBox></td>
  </tr> 
  <tr>
    <th width="120">管理员手机号</th>
    <td class="y-bg"><asp:TextBox id="txtMasterMobile" runat="server" Width="400px" CssClass="input-text" Columns="50"></asp:TextBox></td>
  </tr> 
  <tr>
    <th width="120">财务邮件地址</th>
    <td class="y-bg"><asp:TextBox id="txtMasterEmail" runat="server" Width="400px" CssClass="input-text" Columns="50"></asp:TextBox></td>
  </tr> 	
  <tr>
    <th width="120">是否开放注册</th>
    <td class="y-bg"><asp:RadioButtonList ID="rbtnIsReg" runat="server" RepeatDirection="Horizontal" 
                                    RepeatLayout="Flow">
                                    <asp:ListItem Value="1">开放</asp:ListItem>
                                    <asp:ListItem Value="0">关闭</asp:ListItem>
                                </asp:RadioButtonList></td>
  </tr>
  <tr>
    <th width="120">注册用户默认用户组</th>
    <td class="y-bg">
        <asp:DropDownList ID="dpdGroup" runat="server" AppendDataBoundItems="True">
        <asp:ListItem Value="">请选择用户组</asp:ListItem>
        </asp:DropDownList>
    </td>
  </tr>
  <tr>
    <th width="120">新用户是否需要审核</th>
    <td class="y-bg"><asp:RadioButtonList ID="rbtnNewUserFlag" runat="server" RepeatDirection="Horizontal" 
                                    RepeatLayout="Flow">
                                    <asp:ListItem Value="1">需要</asp:ListItem>
                                    <asp:ListItem Value="0">不需要</asp:ListItem>
                                </asp:RadioButtonList></td>
  </tr>
  <tr>
    <th width="120">是否邮件审核</th>
    <td class="y-bg"><asp:RadioButtonList ID="rbtnNewUserSendMail" runat="server" RepeatDirection="Horizontal" 
                                    RepeatLayout="Flow">
                                    <asp:ListItem Value="1">发送</asp:ListItem>
                                    <asp:ListItem Value="0">不发送</asp:ListItem>
                                </asp:RadioButtonList></td>
  </tr>
</table>
</div>
<div id="div_setting_2" 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>

  <tr>
    <th>系统过帐开始时间</th>
    <td class="y-bg"><input id="txtWithdrawStartTime" runat="server" CssClass="input-text" ReadOnly="true" onfocus="WdatePicker({startDate:'00:00:00',dateFmt:'HH:mm:ss'})" ></td>
  </tr>
  <tr>
    <th>系统过帐结束时间</th>
    <td class="y-bg"><input id="txtWithdrawEndTime" runat="server" CssClass="input-text"  ReadOnly="true" onfocus="WdatePicker({startDate:'23:40:00',dateFmt:'HH:mm:ss'})"></td>
  </tr>
  <tr>
    <th>提现时通知管理员</th>
    <td class="y-bg">
        <asp:CheckBox ID="cboxSms" runat="server" />短信 <asp:CheckBox ID="cboxEmail" runat="server" />邮件
    </td>
  </tr>
</table>
</div>
<div id="div_setting_3" class="contentList pad-10 hidden">
<table width="100%"  class="table_form">
  <tr>
    <th width="120">短信网关ID</th>
    <td class="y-bg"><asp:TextBox id="txtSmsUser" runat="server" CssClass="input-text" MaxLength="16"></asp:TextBox></td>
  </tr> 
  <tr>
    <th>短信网关KEY</th>
    <td class="y-bg"><asp:TextBox id="txtSmsKey" runat="server"  CssClass="input-text" MaxLength="128"></asp:TextBox></td>
  </tr>
  </table>
</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="txtsmtpServer" runat="server" CssClass="input-text" MaxLength="128"></asp:TextBox></td>
  </tr>  
  <tr>
    <th width="120">邮件发送端口</th>
    <td class="y-bg"><asp:TextBox id="txtsmtpPort" runat="server" CssClass="input-text" MaxLength="5"></asp:TextBox></td>
  </tr> 
  <tr>
    <th width="120">SMTP用户名</th>
    <td class="y-bg"><asp:TextBox id="txtsmtpUser" runat="server" CssClass="input-text" MaxLength="128"></asp:TextBox></td>
  </tr>   
  <tr>
    <th>SMTP密码</th>
    <td class="y-bg"><asp:TextBox id="txtsmtpPass" runat="server" CssClass="input-text" MaxLength="32"></asp:TextBox></td>
  </tr> 
  <tr style="display:none">
    <th>邮件设置测试</th>
    <td class="y-bg"><input type="text" class="input-text" name="mail_to" id="mail_to" size="30" value=""/> <input type="button" class="button" onClick="javascript:test_mail();" value="测试发送"></td>
  </tr>           
  </table>
</div>

<div id="div_setting_5" class="contentList pad-10 hidden">
<table width="100%"  class="table_form">

  <tr>
    <th width="120">网银限额</th>
    <td class="y-bg"><asp:TextBox id="txtBankMoney" runat="server" CssClass="input-text" MaxLength="128"></asp:TextBox></td>
  </tr>  
  <tr>
    <th width="120">支付宝限额</th>
    <td class="y-bg"><asp:TextBox id="txtAliMoney" runat="server" CssClass="input-text" MaxLength="5"></asp:TextBox></td>
  </tr> 
  <tr>
    <th width="120">财付通限额</th>
    <td class="y-bg"><asp:TextBox id="txtTenMoney" runat="server" CssClass="input-text" MaxLength="128"></asp:TextBox></td>
  </tr>   
  <tr>
    <th width="120">微信限额</th>
    <td class="y-bg"><asp:TextBox id="txtWeiXinMoney" runat="server" CssClass="input-text" MaxLength="128"></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);
        });
    }

</script>
</html> 