<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="studentsalarymanage.aspx.cs" Inherits="Us.Web.admin.salary.studentsalarymanage" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>学生缴费管理</title>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8,chrome=1" />
    <asp:Literal ID="litregscript" runat="server" Text=""></asp:Literal>
    <link href="../style/default/style.css" rel="stylesheet" type="text/css" />
    <%=ImportScriptStr %>
    <script type="text/javascript" src="/admin/js/jquery/jquery-1.9.1.js"></script>



    <%--<script language="javascript" type="text/javascript">
        var selectid = "#txt应发合计,#txt医保个人"
        var chkL = [];
        chkL[0] = ['txt应发合计', '应发合计', 17, '应发合计不能为空！', '应发合计不能为空！'];
        chkL[1] = ['txt医保个人', '排序', 17, '排序必须输入正整数！', '排序必须输入正整数！'];
    </script>--%>
    <%=sHTMLJS %>
    <script language="javascript" type="text/javascript">

        var RuleData = '<%=sRuleInfo %>';
        var sK = '<%=sK1 %>';
        //var RuleData = '书本费=80;保险费=250;代办费=750';

        



        $(document).ready(function () {
            
            
            $("#txt收费人").attr("readonly", "readonly").attr("class","IsSystem0");
            
            $("#drpRuleID").change(function () {
                ChangeRule();
            });
            $("#txt用户编号").blur(function () {
                GetStudentName();
            });

            var selectopr = "input[FileOpr=2]";
            var fsum = 0.00, fone = 0.00;
            $("#txt余额,#txt应缴费用").attr("readonly", "readonly").attr("class", "IsSystem0");
            if ($("#txt实缴费用").val() == "") {
                $("#txt实缴费用").val("0");
            }

            $(selectopr).blur(function () {
                cacl();
            });


            $("#txt余额,#txt实缴费用").blur(function () {
                ye();
            });


            function cacl() {
                fsum = 0.00;
                $(selectopr).each(function (index) {

                    fone = parseFloat($(this).val());
                    fsum = fone + fsum;
                });

                $("#txt应缴费用").val(fsum.toFixed(2));
                ye();
                //alert(fsum);
            }

            function ye() {
                var ye, yyk, kk;
                ye = parseFloat($("#txt余额").val());

                yyk = parseFloat($("#txt实缴费用").val());
                kk = parseFloat($("#txt应缴费用").val());

                ye = yyk - kk;
                $("#txt余额").val(ye.toFixed(2));

            }
            //$("#txt预交款").val("0");
           
            initRuleData();

            function initRuleData() {
                var strs = RuleData.split(";"); //字符分割 
                for (i = 0; i < strs.length ; i++) {
                    var strN = strs[i].split("=");
                    $("#txt" + strN[0]).val(strN[1]);
                }
                cacl();
                ye();
            }

            function ChangeRule() {
                //RuleData = $("#drpRuleID").attr("RuleData");
                RuleData = $("#drpRuleID").find("option:selected").attr("RuleData");
                //alert(RuleData);
                var info = "您需要将选择的缴费规则数据应用到该记录吗？";
                if (RuleData != "") {
                    if (confirm(info)) {
                        initRuleData();
                    }
                }
            }

            JsSk();
            function getUrlParam(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
                var r = window.location.search.substr(1).match(reg);  //匹配目标参数
                if (r != null) return unescape(r[2]); return null; //返回参数值
            }
            function JsSk()
            {
                if (sK != "")
                {
                    //$("#txt缴费类型").val(sK);
                    $("#txt缴费类型").find("option[value='" + sK + "']").attr("selected", true);

                    var SalaryType = getUrlParam("SalaryType");
                    if (SalaryType != "")
                    {
                        $("#txt缴费类型").find("option[value='" + SalaryType + "']").attr("selected", true);
                    }
                }
                //sK = $("#txt缴费类型").val();
            }

            function GetStudentName() {
                //alert(SkyCID);
                var UserID, sK;
                UserID = $("#txt用户编号").val();
                sK = $("#txt缴费类型").val();

                var data = "UserID=" + UserID + "&sk=" + sK;
                $.ajax({
                    type: "POST",
                    url: "/admin/student/studentregistrationajax.aspx?key=getusername",
                    data: data,
                    success: function (msg) {
                        //alert(msg);
                        $("#txt姓名").val(msg);
                    }, error: function (XMLHttpRequest, textStatus, errorThrown) {
                        alert(XMLHttpRequest.status);
                        alert(XMLHttpRequest.readyState);
                        alert(textStatus);
                    }
                });
            }

        });


        $(document).ready(function () {
            $("#txt实缴总额,#txt欠费金额").attr("readonly", "readonly")
            $("#txt实缴学费,#txt实缴教材费").blur(function () {
                trcacl();
            });

            function trcacl()
            {
                var xf = parseFloat($("#txt实缴学费").val());
                var jcf = parseFloat($("#txt实缴教材费").val());
               //实缴总额  欠费金额
               var sjzf = xf + jcf;
               
               $("#txt实缴总额").val(sjzf.toFixed(2));

               var yjze = parseFloat($("#txt总额").val());
               var qfje = sjzf - yjze;

               $("#txt欠费金额").val(qfje.toFixed(2));
            }



        });

    </script>
</head>
<body onload="win_onLoad();">
    <form id="form1" runat="server">
        
        

        <div id="tbMain">
            <div class="divTbg">
                <div class="divTbgL">
                </div>
                <div class="divTbgInfo">
                    <div class="divTbgTitle">
                        学生缴费管理
                    </div>
                </div>
            </div>
            <div class="divTbgF">
            </div>
            <div class="divTNavBG" id="topURL">
                <ul id="topURLul">
                    <li class="divURLed" id="div1">
                        <div>
                            <img src="../style/default/images/mini_icons_046.gif" width="10" height="10" />
                            基本信息
                        </div>
                    </li>
                </ul>
            </div>
            <div id="mypanel">
                <div class="divInfoContext">
                    <div class="divInfo">
                        <div class="divInfoblack">
                            <div class="divInfoTopList">
                                <div class="listLeft">
                                    <div class="navtitle">
                                        学生缴费管理
                                    </div>
                                </div>
                                <div class="listRight">
                                    <div style="padding-right: 10px;">
                                        <label for="drpRuleID">选择缴费规则：</label>
                                        <asp:DropDownList ID="drpRuleID" runat="server" >
                                        
                                    </asp:DropDownList>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="divInfo">
                        <table width="100%" border="0" cellpadding="0" cellspacing="1" class="tablist" id="mainlist">
                            <%=sHTML%>
                        </table>
                        <div class="divSave">
                            <asp:Button ID="btnSubmit" runat="server" Text="保存(S)" CssClass="SkyButtonFocus"
                                OnClick="btnSubmit_Click" />
                            <asp:Button ID="btnExit" runat="server" Text="取消(C)" CssClass="SkyButtonFocus" OnClick="btnSubmit_Click" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
         <div class="divInfo">
        
         <span class="usHelpMessage">* 注意事项： 使用缴费模板，您可以快速录入不同类型的学生需要录入的基本费用；切换系统会有提示，如果切换错误，可以直接关闭网页系统不保存；
            </span>  
    </div>
    </form>
</body>
</html>
