<%@ page language="C#" autoeventwireup="true" inherits="go_system_index, App_Web_mn45emcx" %>

<%@ Register Src="top.ascx" TagName="TagName" TagPrefix="MyTop" %>
<%@ Register Src="bottom.ascx" TagName="TagName" TagPrefix="MyBottom" %>
<%@ Register Src="user.ascx" TagName="TagName" TagPrefix="MyUser" %>
<MyTop:TagName ID="uc_01" runat="server" MyValue="System" />
<style type="text/css">
    #softconfigtable tr:hover
    {
        background-color: #f7f7f7;
        cursor: pointer;
    }
    #softconfigtable tr[isselect='1']
    {
        color: #3a3;
    }
</style>
<div class="container" style="padding: 0px; margin: auto; padding-top: 2rem">
    <div class="panel panel-default">
        <div class="panel-body">
            <ul class='nav nav-tabs' role='tablist'>
                <li role='presentation' class='active'><a href='#tab_systeminfo' aria-controls='tab_systeminfo'
                    role='tab' data-toggle='tab'>系统信息</a></li>
                <li role='presentation'><a href='#tab_softreg' aria-controls='tab_softreg' role='tab'
                    data-toggle='tab'>软件注册</a></li>
                <li role='presentation'><a href='#tab_backup' aria-controls='tab_backup' role='tab'
                    data-toggle='tab'>数据备份</a></li>
                <li role='presentation'><a href='#tab_softauth' aria-controls='tab_softauth' role='tab'
                    data-toggle='tab'>软件授权</a></li>
                <li role='presentation'><a href='#tab_gzcchomeaddr' aria-controls='tab_gzcchomeaddr'
                    role='tab' data-toggle='tab'>首页地址</a></li>
                <li role='presentation'><a href='#tab_invoiceandexpress' aria-controls='tab_invoiceandexpress'
                    role='tab' data-toggle='tab'>发票与快递</a></li>
                <li role='presentation'><a href='#tab_emailpost' aria-controls='tab_emailpost'
                    role='tab' data-toggle='tab'>系统设置</a></li>
            </ul>
            <div id="sysinfo" runat="server" class="tab-content">
            </div>
        </div>
    </div>
</div>
<div class="modal fade" tabindex="-1" role="dialog" id="modal_userupdate">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">
                    用户升级</h4>
            </div>
            <div class="modal-body">
                <p id="softconfig">
                </p>
                <ul class="list-group">
                    <li class="list-group-item list-group-item-success">说明</li>
                    <li class="list-group-item"><strong>用户数</strong>：员工数，即工资查询人数量</li>
                    <li class="list-group-item"><strong>价格</strong>：价格含税，软件购买后终身使用</li>
                    <li class="list-group-item"><strong>技术支持软件升级</strong>：在服务期内，享受技术支持与软件升级服务，超期的系统任然可以使用，但不享受软件升级与技术支持服务，如需服务，年服务费用为系统价格的10%(含税)</li>
                    <li class="list-group-item"><strong>短信数</strong>：用于用户注册时发送验证码，财务人员群发工资到帐通知等。短信用完后可购买，价格为80.00元/1000条</li>
                    <li class="list-group-item"><strong>关于发票</strong>：支付完成后，请在本页“发票与快递信息”节提交发票与快递信息</li>
                    <li class="list-group-item list-group-item-warning">购买与支付问题请咨询：18310889319(微信同号)</li>
					</ul>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" tabindex="-1" role="dialog" id="modal_updatebad" data-backdrop="static">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">
                    支付遇到问题</h4>
            </div>
            <div class="modal-body">
                <p>
                    One fine body&hellip;</p>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" tabindex="-1" role="dialog" id="modal_buysms" data-backdrop="static">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">
                    购买短信</h4>
            </div>
            <div class="modal-body">
                <p>
                    <select id="buysmsnum" class="form-control" style="margin-bottom: 30px; margin-top: 30px">
                    </select>
                    <button class="btn btn-success" style="width: 100%" bttype="submitbuysmsbt">
                        提交订单</button>
                    <div id="payarea_sms" style="display: none; box-sizing: border-box; padding: 10px">
                        <img id='payqrcode_sms' class='center-block' /><div class='fa fa-weixin center-block'
                            style='text-align: center; width: 100%'>
                            请打开微信扫描支付，实时充值</div>
                        <div style='width: 100%; margin-top: 10px; margin-bottom: 10px'>
                            <button style='float: left' class='btn btn-warning' bttype='paybad_sms_bt'>
                                支付遇到问题</button>
                            <button style='float: right' class='btn btn-success' bttype='paycomplete_sms_bt'>
                                支付完成</button></div>
                    </div>
                    <div style="height: 10px; width: 100%">
                    </div>
                </p>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" tabindex="-1" role="dialog" id="modal_invoice">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">
                    发票与快递信息</h4>
            </div>
            <div class="modal-body" style="height: 800px; overflow: auto">
                <p>
                    One fine body&hellip;</p>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<MyUser:TagName ID="user" runat="server" />
<MyBottom:TagName ID="TagName1" runat="server" />
</body> </html>
<script>
    var $ordercode = "";
    $(document).ready(function (e) {
        createMask("mymask");
        $(this).bind("click", function (e) {
            var t = e.target;
            var bttype = $(t).attr("bttype");
            switch (bttype) {
                case "submitsoftregbt":
                    submitsoftreg();
                    break;
                case "updateuserbt":
                    updateuser();
                    break;
                case "submituserupdatebt":
                    submituserupdate();
                    break;
                case "paybadbt":
                case "paybad_sms_bt":
                    paycomplete(0);
                    break;
                case "paycompletebt":
                case "paycomplete_sms_bt":
                    paycomplete(1);
                    break
                case "checkupdatebt":
                    checkupdate();
                    break;
                case "downupdatebt":
                    downupdate($(t).attr("v"));
                    break;
                case "querysmsnumbt":
                    querysmsnum()
                    break;
                case "buysmsbt":
                    buysms();
                    break;
                case "submitbuysmsbt":
                    submitbuysms();
                    break;
                case "databakbt":
                    databak();
                    break;
                case "filebakbt":
                    filebak();
                    break;
                case "clearbakbt":
                case "clearfilebakbt":
				
                    clearbak();
                    break;
                case "savegzcchomeaddrbt":
                    savegzcchomeaddr();
                    break;
                case "submitinvoicebt":
                    submitinvoice();
                    break;
                case "invoicequerybt":
                    invoicequery();
                    break;
                case "submitupdatebt":
                    submitupdate();
                    break;
				case "saveemailpostbt":
					saveemailpost();
					break;
				case "testemailpostbt":
					testemailpost();
					break;
            }
        });
    });

function testemailpost(){
	var o = {};
	o.email = $("#emailpost_email").val();
	o.pwd = $("#emailpost_pwd").val();
	o.smtp = $("#emailpost_smtp").val();
	
	if(o.email==""){
		msgbox("请输入email","warning");	
		$("#emailpost_email").focus();
		return;
	}
	if(!o.email._Email()){
		msgbox("email格式错误","warning");	
		$("#emailpost_email").focus();
		return;
	}
	
	if(o.pwd==""){
		msgbox("请输入密码","warning");	
		$("#emailpost_pwd").focus();
	}
	
	if(o.smtp==""){
		msgbox("请输入smtp地址","warning");	
		$("#emailpost_smtp").focus();
		return;
	}
	
	$("#mymask").modal("show");
	$.post("admin_emailpost_test.aspx",o,function(d){
		$("#mymask").modal("hide");
		if(d.result=="ok"){
			msgbox("email发送完成，请登录"+o.email+"邮箱查收是否成功","success");			
		}
		else{
			msgbox("email发送失败","warning");
		}
	},"json");
	
		
}


function saveemailpost(){
	var o = {};
	o.email = $("#emailpost_email").val();
	o.pwd = $("#emailpost_pwd").val();
	o.smtp = $("#emailpost_smtp").val();
	
	if(o.email==""){
		msgbox("请输入email","warning");	
		$("#emailpost_email").focus();
		return;
	}
	if(!o.email._Email()){
		msgbox("email格式错误","warning");	
		$("#emailpost_email").focus();
		return;
	}
	
	if(o.pwd==""){
		msgbox("请输入密码","warning");	
		$("#emailpost_pwd").focus();
	}
	
	if(o.smtp==""){
		msgbox("请输入smtp地址","warning");	
		$("#emailpost_smtp").focus();
		return;
	}
	
	$("#mymask").modal("show");
	$.post("admin_emailpost_save.aspx",o,function(d){
		$("#mymask").modal("hide");
		if(d.result=="ok"){
			msgbox("email服务器保存成功","success");			
		}
		else{
			msgbox("email服务器保存错误","warning");
		}
	},"json");
	
		
}
    function submitupdate() {
        if (!confirm("确定更新吗？")) {
            return;
        }
        var o = {};
        o.r = Math.random();
        $("#mymask").modal("show");
        $.get("update/doupdate.aspx", o, function (d) {
            $("#mymask").modal("hide");
            switch (d.result) {
                case "ok":
                    msgbox("更新完成", "success");
                    break;
                case "currisnew":
                    msgbox("已经是最新版，无需更新", "warning");
                    break;
                case "minsnover":
                    msgbox("当前版本太低，需要先更新到SN=" + d.minsn + "及以上版本", "warning");
                    break;
                case "err":
                    msgbox("更新时发生错误:" + d.step, "warning")
                    break;
            }
        }, "json");
    }

    function invoicequery() {
        var o = {};
        o.r = Math.random();
        $("#mymask").modal("show");
        $.get("invoice_query.aspx", o, function (d) {
            $("#mymask").modal("hide");
            if (d.result == "ok") {

                var a = [];

                var list = d.list;
                for (var i = 0; i < list.length; i++) {
                    d = list[i];
                    a.push("<div class='alert alert-warning'>");
                    a.push("<div class='alert alert-default'>");
                    a.push("<label>发票信息</label><br />");
                    a.push("发票抬头:" + d.title + "<br />");
                    a.push("纳税人识别号:" + d.code + "<br />");
                    a.push("地址/电话/联系人:" + d.addr + "<br />");
                    a.push("银行与帐号:" + d.bank + "<br />");
                    a.push("发票金额:<span class='fa fa-cny'> " + d.total_fee + "</span><br />");
                    a.push("相关订单号:" + d.ordercode + "<br />");
                    a.push("</div>");

                    a.push("<div class='alert alert-default'>");
                    a.push("<label>快递信息</label><br />");
                    a.push("收件人:" + d.express_linkman + "<br />");
                    a.push("收件人电话:" + d.express_tel + "<br />");
                    a.push("地址:" + d.express_addr + "<br />");
                    a.push("当前状态：");
                    if (d.status == 4) {
                        a.push("发票与快递已经完结");
                        a.push("承运快递:" + d.express_name + "<br />");
                        a.push("快递单号:" + d.express_code + "<br />");
                    }
                    else if (d.status == 0) {
                        a.push("尚未处理");
                    }
                    else if (d.status == 1) {
                        a.push("正在开票");
                    }
                    else if (d.status == 2) {
                        a.push("快递处理中...");
                    }
                    else if (d.status == 3) {
                        a.push("快递已经发出<br />");
                        a.push("承运快递:" + d.express_name + "<br />");
                        a.push("快递单号:" + d.express_code + "<br />");
                    }
                    else {
                        a.push("没有运送信息");
                    }

                    a.push("</div>");

                    a.push("<div class='alert alert-default'>");
                    a.push("<label>其它说明</label><br />");
                    a.push(d.memo + "<br />"); ;
                    a.push("</div>");

                    a.push("<div class='alert alert-success'>");
                    a.push("<label>提交日期</label><br />");
                    a.push(d.createdate + "<br />"); ;
                    a.push("</div>");
                    a.push("</div>");
                }
                $("#modal_invoice").find("p").html(a.join(""));
                $("#modal_invoice").modal("show");
            }
            else if (d.result == "notinvoice") {
                msgbox("未提交发票与快递信息", "warning");
            }
            else if (d.result == "err") {
                msgbox("web错误", "warning");
            }
            else if (d.result == "softsignerr") {
                msgbox("签名错误", "warning");
            }
            else if (d.result == "notfound") {
                msgbox("未发现注册信息", "warning");
            }
            else if (d.result == "urltimeover") {
                msgbox("url超时", "warning");
            }
            else if (d.result == "notlogin") {
                msgbox("登录超时", "warning");
            }
            else if (d.result == "notauth") {
                msgbox("没有权限", "warning");
            }
            else {
                msgbox("不明错误", "warning");
            }
        }, "json");

    }

    function submitinvoice() {
        var o = {};
        o.title = $("#invoice_title").val();
        o.code = $("#invoice_code").val();
        o.addr = $("#invoice_addr").val();
        o.bank = $("#invoice_bank").val();
        o.express_linkman = $("#express_linkman").val();
        o.express_tel = $("#express_tel").val();
        o.express_addr = $("#express_addr").val();
        o.memo = $("#memo").val();

        if (o.title == "") {
            msgbox("请输入发票抬头", "warning");
            $("#invoice_title").focus();
            return;
        }

        if (o.code == "") {
            msgbox("请输入纳税人识别号", "warning");
            $("#invoice_code").focus();
            return;
        }

        if (o.addr == "") {
            msgbox("请输入公司地址", "warning");
            $("#invoice_addr").focus();
            return;
        }

        if (o.bank == "") {
            msgbox("请输入开户行与帐号", "warning");
            $("#invoice_bank").focus();
            return;
        }

        if (o.express_linkman == "") {
            msgbox("请输入收件人", "warning");
            $("#express_linkman").focus();
            return;
        }

        if (o.express_tel == "") {
            msgbox("请输入收件人电话", "warning");
            $("#express_tel").focus();
            return;
        }

        if (o.express_addr == "") {
            msgbox("请输入收件地址", "warning");
            $("#express_addr").focus();
            return;
        }





        $("#mymask").modal("show");
        $.post("submitinvoice.aspx", o, function (d) {
            $("#mymask").modal("hide");

            if (d.result == "ok") {
                msgbox("发票与快递信息提交完成", "success");
            }
            else if (d.result == "err") {
                msgbox("web错误", "warning");
            }
            else if (d.result == "softsignerr") {
                msgbox("签名错误", "warning");
            }
            else if (d.result == "notfound") {
                msgbox("未发现注册信息", "warning");
            }
            else if (d.result == "urltimeover") {
                msgbox("url超时", "warning");
            }
            else if (d.result == "notlogin") {
                msgbox("登录超时", "warning");
            }
            else if (d.result == "notauth") {
                msgbox("没有权限", "warning");
            }
            else {
                msgbox("不明错误", "warning");
            }
        }, "json");

    }

    function savegzcchomeaddr() {
        var o = {};
        o.r = Math.random();
        o.addr = $("#gzcchomeaddr").val();
        if (o.addr == "") {
            msgbox("请输入首页地址", "warning");
            return;
        }
        if (o.addr.indexOf("http") != 0) {
            msgbox("首页地址错误", "warning");
            return;
        }
        $.get("savegzcchomeaddr.aspx", o, function (d) {
            switch (d.result) {
                case "ok":
                    msgbox("保存完成", "success");
                    break;
                case "notfound":
                    msgbox("未发现软件", "warning");
                    break;
                case "timeover":
                    msgbox("链接超时", "warning");
                    break;
                case "signerr":
                    msgbox("签名错误", "warning");
                    break;
                case "bad":
                    msgbox("未知的错误", "warning");
                    break
            }
        }, "json");
    }

    function clearbak() {
        $("#mymask").modal("show");
        $.get("clearbak.aspx", function (d) {
            $("#mymask").modal("hide");
            if (d.result == "ok") {
                msgbox("删除了" + d.num + "个文件", "success");
            }
            else {
                msgbox("删除错误", "warning");
            }
        }, "json");
    }

    function databak() {
        $("#mymask").modal("show");
        $.get("databak.aspx", function (d) {
            $("#mymask").modal("hide");
            if (d.result == "ok") {
                msgbox("备份完成", "success");
                $("#downbakbt").css("display", "block");
                $("#clearbakbt").css("display", "block");
                $("#downbakbt").attr("href", "dbbak/" + d.file);
            }
            else {
                msgbox("备份错误" + d.msg, "warning");
            }
        }, "json");
    }
	
	 function filebak() {
        $("#mymask").modal("show");
        $.get("filebak.aspx", function (d) {
            $("#mymask").modal("hide");
            if (d.result == "ok") {
                msgbox("备份完成", "success");
                $("#downfilebakbt").css("display", "block");
                $("#clearfilebakbt").css("display", "block");
                $("#downfilebakbt").attr("href", "dbbak/" + d.file);
            }
            else {
                msgbox("备份错误" + d.msg, "warning");
            }
        }, "json");
    }

    function submitbuysms() {

        $("#payarea_sms").css("display", "none");
        $("#payqrcode_sms").attr("src", "")
        var o = {};
        o.v = $("#buysmsnum").val();
        o.r = Math.random();
        o.buytype = "sms";
        $("#mymask").modal("show");
        $.get("submituserupdate.aspx", o, function (d) {
            $("#mymask").modal("hide");
            if (d.result == "ok") {
                $("#payarea_sms").css("display", "block");
                $("#payqrcode_sms").attr("src", d.img);
                $ordercode = d.ordercode;
            }
            else if (d.result == "err") {
                msgbox("web错误", "warning");
            }
            else if (d.result == "bad") {
                msgbox("调用支付接口错误", "warning");
            }
            else if (d.result == "signerr") {
                msgbox("签名错误", "warning");
            }
            else if (d.result == "timeover") {
                msgbox("url超时", "warning");
            }
            else {
                msgbox("不明错误", "warning");
            }
        }, "json");
    }

    function buysms() {
        var a = [];
        for (var i = 1; i <= 10; i++) {
            a.push("<option value='" + (i * 1000) + "'>" + (i * 1000) + "条," + (i * 80) + "元</option>");
        }

        for (var i = 1; i <= 10; i++) {
            a.push("<option value='" + (i * 10000) + "'>" + (i * 10000) + "条," + (i * 800) + "元</option>");
        }

        $("#buysmsnum").html(a.join(""));
        $("#modal_buysms").modal("show");
    }

    function querysmsnum() {
        $("#mymask").modal("show");
        $.get("querysmsnum.aspx?" + Math.random(), function (d) {
            $("#mymask").modal("hide");
            $("#smsnum").html("短信数:" + d["smsnum"] + ",已使数:" + d["smsnum_use"]);
            $("#buysmsbt").css("display", "block");
        }, "json");
    }

    function downupdate(downaddr) {


        $("#mymask").modal("show");
        var o = {};
        o.r = Math.random();
        o.downaddr = downaddr;
        $.get("update/down.aspx", o, function (d) {
            $("#mymask").modal("hide");
            if (d.result == "ok") {

                msgbox("下载完成", "success");
                $("#submitupdatebt").css("display", "block");
            }
            else {
                msgbox("下载更新文件错误", "danger");
            }
        }, "json");
    }

    function updateuser() {
        $("#modal_userupdate").modal("show");
        var a = softconfig.list;
        var b = [];
        b.push("<table class='table' id='softconfigtable'>");
        b.push("<tr><th>帐户类型</th><th style='text-align:right'>用户数</th><th style='text-align:right'>价格(含税)</th><th style='text-align:center'>技术支持<br />软件升级</th><th>短信数</th></tr>");
        for (var i = 1; i < a.length; i++) {
            b.push("<tr v='" + a[i].type + "' bttype='rowbt' isselect='0' onclick='selectconfig(this)'>");
            b.push("<td>" + a[i].name + "</td>");
            b.push("<td style='text-align:right'>" + a[i].usernum + "用户</td>");
            b.push("<td style='text-align:right'><span class='fa fa-cny'>" + a[i].price + ".00元</span></td>");
            b.push("<td style='text-align:center'>" + a[i].servicetime + "年</td>");
            b.push("<td>" + a[i].smsnum + "条</td>");
            b.push("</tr>");
        }
        b.push("</table>");
        b.push("<div id='payarea' style='box-sizing:border-box; padding:1rem;display:none'>");
        b.push("<img id='payqrcode' class='center-block' /><div class='fa fa-weixin center-block' style='text-align:center;width:100%'>请打开微信扫描支付，实时升级</div>");
        b.push("<div style='width:100%'><button style='float:left'  class='btn btn-warning' bttype='paybadbt'>支付遇到问题</button><button style='float:right' class='btn btn-success' bttype='paycompletebt'>支付完成</button></div>");
        b.push("</div>");
        b.push("<button class='btn btn-success' style='width:100%;margin-top:1rem' bttype='submituserupdatebt'>提交订单，微信扫描支付，实时升级</button>");
        b.push("<div style='clear:both'></div>");
        $("#softconfig").html(b.join(""));
    }


    function submituserupdate() {
        var curr = $("#softconfigtable").find("tr[isselect='1']");
        if (curr.length == 0) {
            msgbox("请选择一个帐户类型", "warning");
            return;
        }
        $("#payarea").css("display", "none");
        $("#payqrcode").attr("src", "")
        var o = {};
        o.v = $(curr).attr("v");
        o.r = Math.random();
        o.buytype = "soft";
		$("#mymask").modal("show");
        $.get("submituserupdate.aspx", o, function (d) {
			$("#mymask").modal("hide");
            if (d.result == "ok") {
                $("#payarea").css("display", "block");
                $("#payqrcode").attr("src", d.img);
                $ordercode = d.ordercode;
            }
            else if (d.result == "err") {
                msgbox("web错误", "warning");
            }
            else if (d.result == "bad") {
                msgbox("调用支付接口错误", "warning");
            }
            else if (d.result == "signerr") {
                msgbox("签名错误", "warning");
            }
            else if (d.result == "notfound") {
                msgbox("未发现注册信息", "warning");
            }
            else if (d.result == "undegrade") {
                msgbox("您当前帐户比目标帐户高，不能降级", "warning");
            }
            else if (d.result == "timeover") {
                msgbox("url超时", "warning");
            }
            else if (d.result == "notsoft") {
                msgbox("没有这种系统", "warning");
            }
            else {
                msgbox("不明错误", "warning");
            }
        }, "json");
    }

    function paycomplete(v) {
        $("#modal_userupdate").modal("hide");
        $("#mymask").modal("show");
        var o = {};
        o.ordercode = $ordercode;
        $.get("queryorder.aspx", o, function (d) {
            $("#mymask").modal("hide");
            $("#modal_buysms").modal("hide");
            switch (d.result) {
                case "ok":
                    msgbox("支付完成", "success");
                    setTimeout(function () {
                        window.location.href = "system_index.aspx";
                    }
				, 1000);
                    break;
                case "NOTPAY":
                    msgbox("订单没有支付", "warning");
                    break;
                default:
                    msgbox("支付状态" + d.result, "warning");
                    $("#modal_updatebad").modal("show");
                    $("#modal_updatebad").find("div[class='modal-body']").html("支付状态:" + d.result + "<br />订单号：" + $ordercode + "<br />请联系：18310889319");

                    break;
            }
        }, "json");
    }




    function checkupdate() {
        var o = {}
        o.r = Math.random();
        $.get("checkupdate.aspx", o, function (d) {
            if (d.hasnew == 0) {
                $("#newversion").html("<div class='alert alert-warning'>版本名:" + d.newversion.version + "<br />发布日期:" + d.newversion.issuedate + "<br />更新内容:" + d.newversion.memo + "</div>");
                msgbox("已是最新版", "success");
            }
            else {
                $("#newversion").html("<div  class='alert alert-warning'>版本名:" + d.newversion.version + "<br />发布日期:" + d.newversion.issuedate + "<br />更新内容:" + d.newversion.memo + "<br /><button class='btn btn-warning' style='width:200px;margin-bottom:10px; display:none' bttype='submitupdatebt' id='submitupdatebt'>点击更新</button><button class='btn btn-info' style='width:200px;margin-bottom:10px' bttype='downupdatebt' v='" + d.newversion.downaddr + "'>下载更新文件</button></div>");
                $("#newversion").html($("#newversion").html() + "");

                msgbox("系统有更新", "info");
            }
        }, "json");
    }


    function submitsoftreg() {
        var o = {};
        o.regname = $("#regname").val();
        o.email = $("#email").val();
        o.regmodeinfo = $("input[name='regmode']:checked").val();
        o.regmode = $("input[name='regmode']:checked").attr("id");

        if (o.regname == "") {
            msgbox("请输入注册人", "warning");
            $("#regname").focus();
            return;
        }

        if (o.email == "") {
            msgbox("请输入注册人email", "warning");
            $("#email").focus();
            return;
        }

        $("#mymask").modal("show");
        $.get("submitsoftreg.aspx", o, function (d) {
            $("#mymask").modal("hide");
            if (d.result == "ok") {
                msgbox("注册成功", "success");
                window.location.href = "system_index.aspx";
            }
            else if (d.result == "reged") {
                msgbox("已经注册过", "warning");
            }
            else {
                msgbox("注册失败，错误消息:" + d.result, "warning");
            }
        }, "json");
    }

    function selectconfig(o) {
        console.log(o)
        $("#softconfig").find("tr").attr("isselect", "0");
        $(o).attr("isselect", "1");
    }
	
	
</script>
