<%@ page language="C#" autoeventwireup="true" inherits="Pages_MobileView_StudentSearch, App_Web_5zjh4ae2" masterpagefile="~/Pages/Common/MasterPages/MobileViewMasterPage.master" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <%--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>--%>
    <script src="https://code.jquery.com/jquery-1.12.1.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
    <%--<script src="~/App_Themes/mis_db/Java Script/sorttable.js"></script>--%>

  
    <asp:UpdatePanel ID="DoctorScheduleUpdatePanel" runat="server">
        <ContentTemplate>
            <div class="col-md-12 ptb12 d-inline-flex">
                <span class='btn btn-home btn-icon' onclick='DashBoard()' title='home'><span><i class='material-icons'>home</i></span></span>
                <label class="header-topic justify-content-center" id="HeaderLabel"></label>
                <input type="button" value="&#xf3e5;" id="bntBackOrg" onclick="BackOrgFunction()" skinid="0" class="float-right btn btn-back btn-icon fas" />
            </div>
            <div class="top-btn col-md-12">
                <div class="custom-select ">
                    <div class='fLeft pRight5'>
                        <select id="drpOrganization" onchange="OrganizationFunction()">
                            <option value='0'>demo</option>
                        </select>
                    </div>
                </div>
                <div class="custom-select width-31">
                    <div class='fLeft pRight5'>
                        <select id='drpBatch' onchange="BatchFunction()">
                            <option selected="selected" value='0'>Select</option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="page-header mb37">
                <div class="col-xl-12 col-sm-12 col-xs-12 border-bottom-inline xs-padd0">
                    <div class="main-topic inner" id="HeaderTitle">
                    </div>
                    <div class="misbtn">
                        <button id="btnMIS" class="btn bg-white-outline btn-icon exdb" onclick="MISDashboar()" style="display: none"><i class="ti-dashboard"></i>&nbsp;MIS</button>
                    </div>
                </div>
            </div>
            <div class="bg-body-dark row center-block">

                <div class="container-fluid">
                    <div class="gutters-tiny push js-appear-enabled animated fadeIn" data-toggle="appear">
                        <div class="tab row">
                            <div class="block row arrow-up">



                                <div class="col-xl-3 col-sm-6 col-xs-12 " id="CollectionFeeBlog" style="display: block">
                                    <div class="card  pull-up">
                                        <div class="card-body">
                                            <a>
                                                <h5 class="card-title text-capitalize">Fee Collection<i class="ti-arrow-right text-anchor float-right"></i></h5>
                                                <ul class="nav nav-pills">
                                                    <li class="nav-item">
                                                        <a class="nav-link" id="pills-1-tab" data-toggle="pill" href="#pills-1" role="tab">Yesterday</a>
                                                    </li>
                                                    <li class="nav-item">
                                                        <a class="nav-link" id="pills-2-tab" data-toggle="pill" href="#pills-2" role="tab">Today</a>
                                                    </li>
                                                    <li class="nav-item">
                                                        <a class="nav-link" id="pills-3-tab" data-toggle="pill" href="#pills-3" role="tab">Month</a>
                                                    </li>
                                                    <li class="nav-item">
                                                        <a class="nav-link" id="pills-4-tab" data-toggle="pill" href="#pills-4" role="tab">Year</a>
                                                    </li>
                                                </ul>
                                                <div class="tab-content">
                                                    <div class="tab-pane" id="pills-1" onclick="FeeCollectionFunction(1)">
                                                        <div class="d-flex align-items-center no-block m-t-20">
                                                            <h1 class="pl8"><i class='fas fa-money-bill-wave text-orange'></i></h1>
                                                            <div class="ml-auto">
                                                                <h1 id="YesterdayCount"></h1>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="tab-pane" id="pills-2" onclick="FeeCollectionFunction(2)">
                                                        <div class="d-flex align-items-center no-block m-t-20">
                                                            <h1 class="pl8"><i class='fas fa-money-bill-wave text-orange'></i></h1>
                                                            <div class="ml-auto">
                                                                <h1 id="DailyCount"></h1>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="tab-pane" id="pills-3" onclick="FeeCollectionFunction(3)">
                                                        <div class="d-flex align-items-center no-block m-t-20">
                                                            <h1 class="pl8"><i class='fas fa-money-bill-wave text-orange'></i></h1>
                                                            <div class="ml-auto">
                                                                <h1 id="WeeklyCount"></h1>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="tab-pane" id="pills-4" onclick="FeeCollectionFunction(4)">
                                                        <div class="d-flex align-items-center no-block m-t-20">
                                                            <h1 class="pl8"><i class='fas fa-money-bill-wave text-orange'></i></h1>
                                                            <div class="ml-auto">
                                                                <h1 id="MonthlyCount"></h1>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </a>
                                        </div>
                                        <div class="se-pre-con" id="LoaderDiv1" style="display:none"></div>
                                    </div>
                                </div>
                                <div class="col-xl-3 col-sm-6 col-xs-12 " id="ReceiptEntry" style="display: block">
                                    <div class="card  pull-up">
                                        <div class="card-body">
                                            <a onclick="ReceiptEntryFunction()">
                                                <h5 class="card-title text-capitalize">Receipt Entry<i class="ti-arrow-right text-anchor float-right"></i></h5>

                                                <div class="tab-content">
                                                    <div class="tab-pane active">
                                                        <div class="d-flex align-items-center no-block m-t-51">
                                                            <h1 class="pl8"><i class='fas fa-edit text-grey'></i></h1>
                                                            <div class="ml-auto">
                                                                <h1 id="ReceiptEntryCount"></h1>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </a>
                                        </div>
                                        <div class="se-pre-con" id="LoaderDiv2" style="display:none"></div>
                                    </div>
                                </div>
                                <div class="col-xl-3 col-sm-6 col-xs-12 " id="CancelReceiptBlog" style="display: block">
                                    <div class="card  pull-up">
                                        <div class="card-body">
                                            <a onclick="CancelReceiptFunction()">
                                                <h5 class="card-title text-capitalize">Cancel Receipt<i class="ti-arrow-right text-anchor float-right"></i></h5>

                                                <div class="tab-content">
                                                    <div class="tab-pane active">
                                                        <div class="d-flex align-items-center no-block m-t-51">
                                                            <h1 class="pl8"><i class='fas fa-times-circle text-warning'></i></h1>
                                                            <div class="ml-auto">
                                                                <h1 id="CancelReceiptCount"></h1>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </a>
                                        </div>
                                        <div class="se-pre-con" id="LoaderDiv3" style="display:none"></div>
                                    </div>
                                </div>
                                <div class="col-xl-3 col-sm-6 col-xs-12 " id="CollectionPaytypeBlog" style="display: block">
                                    <div class="card  pull-up">
                                        <div class="card-body">
                                            <h5 class="card-title text-capitalize">Collection Paytype Fee<i class="ti-arrow-right text-anchor float-right"></i></h5>
                                            <ul class="nav nav-pills">
                                                <li class="nav-item">
                                                    <a class="nav-link" id="pills-5-tab" data-toggle="pill" href="#pills-5" role="tab">Yesterday</a>
                                                </li>
                                                <li class="nav-item">
                                                    <a class="nav-link" id="pills-6-tab" data-toggle="pill" href="#pills-6" role="tab">Today</a>
                                                </li>
                                                <li class="nav-item">
                                                    <a class="nav-link" id="pills-7-tab" data-toggle="pill" href="#pills-7" role="tab">Month</a>
                                                </li>
                                                <li class="nav-item">
                                                    <a class="nav-link" id="pills-8-tab" data-toggle="pill" href="#pills-8" role="tab">Year</a>
                                                </li>
                                            </ul>
                                            <div class="tab-content">
                                                <div class="tab-pane" id="pills-5" onclick="CollectionPaytypeFunction(1)">
                                                    <div class="d-flex align-items-center no-block m-t-20">
                                                        <h1 class="pl8"><i class="fas fa-grip-horizontal text-yellow"></i></h1>
                                                        <div class="ml-auto">
                                                            <h1 id="CollectionPaytypeYesterdayCount"></h1>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="tab-pane" id="pills-6" onclick="CollectionPaytypeFunction(2)">
                                                    <div class="d-flex align-items-center no-block m-t-20">
                                                        <h1 class="pl8"><i class="fas fa-grip-horizontal text-yellow"></i></h1>
                                                        <div class="ml-auto">
                                                            <h1 id="CollectionPaytypeDatCount"></h1>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="tab-pane" id="pills-7" onclick="CollectionPaytypeFunction(3)">
                                                    <div class="d-flex align-items-center no-block m-t-20">
                                                        <h1 class="pl8"><i class="fas fa-grip-horizontal text-yellow"></i></h1>
                                                        <div class="ml-auto">
                                                            <h1 id="CollectionPaytypeMonthlyCount"></h1>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="tab-pane" id="pills-8" onclick="CollectionPaytypeFunction(4)">
                                                    <div class="d-flex align-items-center no-block m-t-20">
                                                        <h1 class="pl8"><i class="fas fa-grip-horizontal text-yellow"></i></h1>
                                                        <div class="ml-auto">
                                                            <h1 id="CollectionPaytypeYearlyCount"></h1>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="se-pre-con" id="LoaderDiv4" style="display:none"></div>
                                    </div>
                                </div>

                                <div class="col-xl-3 col-sm-6 col-xs-12 " id="PaytypeReceiptCollectionBlog" style="display: block">
                                    <div class="card  pull-up">
                                        <div class="card-body">
                                            <h5 class="card-title text-capitalize">Paytype Receipt Collection
                                                      <a class="float-right" href="#"><i class="ti-arrow-right text-anchor"></i></a>
                                            </h5>
                                            <ul class="nav nav-pills">
                                                <li class="nav-item">
                                                    <a class="nav-link" id="pills-9-tab" data-toggle="pill" href="#pills-9" role="tab">Yesterday</a>
                                                </li>
                                                <li class="nav-item">
                                                    <a class="nav-link" id="pills-10-tab" data-toggle="pill" href="#pills-10" role="tab">Today</a>
                                                </li>
                                                <li class="nav-item">
                                                    <a class="nav-link" id="pills-11-tab" data-toggle="pill" href="#pills-11" role="tab">Month</a>
                                                </li>
                                                <li class="nav-item">
                                                    <a class="nav-link" id="pills-12-tab" data-toggle="pill" href="#pills-12" role="tab">Year</a>
                                                </li>
                                            </ul>
                                            <div class="tab-content">
                                                <div class="tab-pane " id="pills-9" onclick="PaytypeReceiptCollection(1)">
                                                    <div class="d-flex align-items-center no-block m-t-20">
                                                        <h1 class="pl8"><i class='fas fa-receipt text-purple'></i></h1>
                                                        <div class="ml-auto">
                                                            <h1 id="PaytypeReceiptCollectionYesterdayCount"></h1>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="tab-pane " id="pills-10" onclick="PaytypeReceiptCollection(2)">
                                                    <div class="d-flex align-items-center no-block m-t-20">
                                                        <h1 class="pl8"><i class='fas fa-receipt text-purple'></i></h1>
                                                        <div class="ml-auto">
                                                            <h1 id="PaytypeReceiptCollectionDailyCount"></h1>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="tab-pane" id="pills-11" onclick="PaytypeReceiptCollection(3)">
                                                    <div class="d-flex align-items-center no-block m-t-20">
                                                        <h1 class="pl8"><i class='fas fa-receipt text-purple'></i></h1>
                                                        <div class="ml-auto">
                                                            <h1 id="PaytypeReceiptCollectionMonthlyCount"></h1>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="tab-pane" id="pills-12" onclick="PaytypeReceiptCollection(4)">
                                                    <div class="d-flex align-items-center no-block m-t-20">
                                                        <h1 class="pl8"><i class='fas fa-receipt text-purple'></i></h1>
                                                        <div class="ml-auto">
                                                            <h1 id="PaytypeReceiptCollectionYearlyCount"></h1>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="se-pre-con" id="LoaderDiv5" style="display:none"></div>
                                    </div>
                                </div>
                                <div class="col-xl-3 col-sm-6 col-xs-12 " id="ExamptionFeeBlog" style="display: block">
                                    <div class="card  pull-up">
                                        <div class="card-body">
                                            <a onclick="ExamptionFeeFunction()">
                                                <h5 class="card-title text-capitalize">Exemption Fee<i class="ti-arrow-right text-anchor float-right"></i></h5>

                                                <div class="tab-content">
                                                    <div class="tab-pane active">
                                                        <div class="d-flex align-items-center no-block m-t-51">
                                                            <h1 class="pl8"><i class='fas fa-coins text-info'></i></h1>
                                                            <div class="ml-auto">
                                                                <h1 id="ExamptionFeeCount"></h1>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </a>
                                        </div>
                                        <div class="se-pre-con" id="LoaderDiv6" style="display: none"></div>
                                    </div>
                                </div>

                                <div class="col-xl-3 col-sm-6 col-xs-12 " id="AdditionalFeeBlog" style="display: block">
                                    <div class="card  pull-up">
                                        <div class="card-body">
                                            <a onclick="AdditionalFeeFunction()">
                                                <h5 class="card-title text-capitalize">Additional Fee<i class="ti-arrow-right text-anchor float-right"></i></h5>

                                                <div class="tab-content">
                                                    <div class="tab-pane active">
                                                        <div class="d-flex align-items-center no-block m-t-51">
                                                            <h1 class="pl8"><i class='fas fa-plus-circle text-success'></i></h1>
                                                            <div class="ml-auto">
                                                                <h1 id="AdditionalFeeCount"></h1>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </a>
                                        </div>
                                        <div class="se-pre-con" id="LoaderDiv7" style="display:none"></div>
                                    </div>
                                </div>
                                <div class="col-xl-3 col-sm-6 col-xs-12 " id="NotApplicableFeeBlog" style="display: block">
                                    <div class="card  pull-up">
                                        <div class="card-body">
                                            <a onclick="NotApplicableFeeFunction()">
                                                <h5 class="card-title text-capitalize">Not Applicable Fee<i class="ti-arrow-right text-anchor float-right"></i></h5>

                                                <div class="tab-content">
                                                    <div class="tab-pane active">
                                                        <div class="d-flex align-items-center no-block m-t-51">
                                                            <h1 class="pl8"><i class='fas fa-ban text-danger'></i></h1>
                                                            <div class="ml-auto">
                                                                <h1 id="NotApplicableFeeCount"></h1>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </a>
                                        </div>
                                        <div class="se-pre-con" id="LoaderDiv8" style="display:none"></div>
                                    </div>
                                </div>

                                <div class="col-xl-3 col-sm-6 col-xs-12 " id="StudentCountStatusBlog" style="display: block">
                                    <div class="card  pull-up">
                                        <div class="card-body">
                                            <a onclick="StudentCountStatusFunction()">
                                                <h5 class="card-title text-capitalize">Student Count Status<i class="ti-arrow-right text-anchor float-right"></i></h5>

                                                <div class="tab-content">
                                                    <div class="tab-pane active">
                                                        <div class="d-flex align-items-center no-block m-t-51">
                                                            <h1 class="pl8"><i class='far fa-chart-bar text-pink'></i></h1>
                                                            <div class="ml-auto">
                                                                <h1 id="StudentCountStatus"></h1>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </a>
                                        </div>
                                        <div class="se-pre-con" id="LoaderDiv9" style="display:none"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
              <script type="text/javascript">
                  var Count =0;
                  var BatchId=0;
                  var OrgId=0;
                  var NewBatchId=0;
                  var mySessionVar;
                  var mySessionOrg;
                  var NewId = 0;
                  var ij = 0;

                  $(document).ready(function () {
                      var myurl = window.location.href;
                      var ij = '<%= Session["Flag"] %>';
            if (myurl != "") {
                var spliturl = myurl.split('?');

                if (spliturl.length > 1) {
                    var keyval = myurl.split('?')[1].split('&');
                    OrgId = parseInt(keyval[0].split('=')[1].toString());
                }
                else { sessionStorage.clear(); }
            }

            // var keyval = myurl.split('?')[1].split('&');
            //  OrgId = parseInt(keyval[0].split('=')[1].toString());
            $.ajax({
                type: "POST",
                url: "FeeDashBoard.aspx/GetOrgDropDownList",
                // data: JSON.stringify({ "OrgGroupId": parseInt(OrgId) }),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
               async: false,
                success: function (result) {
                    // $("#drpOrganization").val(0);
                    $("#drpOrganization").html(result.d);
                    mySessionOrg = sessionStorage.getItem("NewId");
                    if (mySessionOrg == null || mySessionOrg == "" || mySessionOrg == undefined) {
                        // alert("iff1");
                        OrgId = $("#drpOrganization option:first").val();
                    }
                    else {
                        $("#drpOrganization").val(mySessionOrg);
                        //alert("iff2");

                        OrgId = mySessionOrg;
                    }
                    // document.getElementById("HeaderTitle").innerHTML = Header;
                    //GetOrgId();
                    //CurrentBatchGet();
                    GetOrgId();
                    ij = '<%= Session["Flag"] %>';

                },
                error: function (xhr, status, error) {
                    var err = eval("(" + xhr.responseText + ")");
                    console.log(err.Message);
                }
            });
            
            //FeeCollectionCountDataBind();
            if (ij == 0) {
                $("#pills-1-tab").addClass('nav-link active');
                $("#pills-1").addClass('tab-pane active');
                $("#pills-2-tab").addClass('nav-link');
                $("#pills-2").addClass('tab-pane');

                $("#pills-5-tab").addClass('nav-link active');
                $("#pills-5").addClass('tab-pane active');
                $("#pills-6-tab").addClass('nav-link');
                $("#pills-6").addClass('tab-pane');

                $("#pills-9-tab").addClass('nav-link active');
                $("#pills-9").addClass('tab-pane active');
                $("#pills-10-tab").addClass('nav-link');
                $("#pills-10").addClass('tab-pane');

            }
            else {
                $("#pills-1-tab").addClass('nav-link');
                $("#pills-1").addClass('tab-pane');
                $("#pills-2-tab").addClass('nav-link active');
                $("#pills-2").addClass('tab-pane active');

                $("#pills-5-tab").addClass('nav-link');
                $("#pills-5").addClass('tab-pane');
                $("#pills-6-tab").addClass('nav-link active');
                $("#pills-6").addClass('tab-pane active');

                $("#pills-9-tab").addClass('nav-link');
                $("#pills-9").addClass('tab-pane');
                $("#pills-10-tab").addClass('nav-link active');
                $("#pills-10").addClass('tab-pane active');

            }

        });

        function AssignPermission() {
            $.ajax({
                type: "POST",
                url: "FeeDashBoard.aspx/AssignPermission",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (result) {
                    var obj = (result.d);
                    //console.log(result.d);
                    var OrgGroupId = "";
                    $.each(obj, function (i, item) {
                        if (item.RoleDashletId == 48 && item.IsCheck == true) {
                            document.getElementById("CollectionFeeBlog").style.display = "block";
                        }
                        else if (item.RoleDashletId == 49 && item.IsCheck == true) {
                            document.getElementById("ReceiptEntry").style.display = "block";
                        }
                        else if (item.RoleDashletId == 50 && item.IsCheck == true) {
                            document.getElementById("CancelReceiptBlog").style.display = "block";
                        }
                        else if (item.RoleDashletId == 51 && item.IsCheck == true) {
                            document.getElementById("CollectionPaytypeBlog").style.display = "block";
                        }
                        else if (item.RoleDashletId == 52 && item.IsCheck == true) {
                            document.getElementById("PaytypeReceiptCollectionBlog").style.display = "block";
                        }
                        else if (item.RoleDashletId == 53 && item.IsCheck == true) {
                            document.getElementById("ExamptionFeeBlog").style.display = "block";
                        }
                        else if (item.RoleDashletId == 54 && item.IsCheck == true) {
                            document.getElementById("AdditionalFeeBlog").style.display = "block";
                        }
                        else if (item.RoleDashletId == 55 && item.IsCheck == true) {
                            document.getElementById("NotApplicableFeeBlog").style.display = "block";
                        }
                        else if (item.RoleDashletId == 56 && item.IsCheck == true) {
                            document.getElementById("StudentCountStatusBlog").style.display = "block";
                        }

                    });
                    //document.getElementById("MisDashBoard").innerHTML = OrgGroupId;
                    GetOrgId();
                },
                error: function (xhr, status, error) {
                    var err = eval("(" + xhr.responseText + ")");
                    console.log(err.Message);
                }
            });
        }


        function OrganizationFunction() {

            OrgId = $("#drpOrganization").val();
            sessionStorage.setItem('NewId', OrgId);
            $("#drpOrganization").val(OrgId);
            sessionStorage.removeItem('NewBatchId');
            GetOrgId();
            CurrentBatchGet();
           // FeeCollectionCountDataBind();

            //alert(Id);
        }
        function CurrentBatchGet() {
            $.ajax({
                type: "POST",
                url: "FeeDashBoard.aspx/GetBatch",
                data: JSON.stringify({ "OrgGroupId": parseInt(OrgId) }),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                //async: false,
                success: function (result) {
                    $("#drpBatch").val(0);

                    mySessionVar = sessionStorage.getItem("NewBatchId");
                    $("#drpBatch").html(result.d);
                    if (mySessionVar == null || mySessionVar == "" || mySessionVar == undefined) {
                        BatchId = $("#drpBatch").val();
                    }
                    else {
                        $("#drpBatch").val(mySessionVar);
                        BatchId = mySessionVar;
                    }
                    // document.getElementById("HeaderTitle").innerHTML = Header;
                  //  GetOrgId();
                    FeeCollectionCountDataBind();
                },
                error: function (xhr, status, error) {
                    var err = eval("(" + xhr.responseText + ")");
                    console.log(err.Message);
                }
            });
        }
        function GetOrgId() {
            $.ajax({
                type: "POST",
                url: "FeeDashBoard.aspx/GetOrgId",
                data: JSON.stringify({ "OrgId": OrgId }),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (result) {
                    var obj = (result.d);
                    var Header ="<h5 class='page-title'>" + obj[0].Title + "</h5>";
                    $("#HeaderLabel").text("Fee Dashboard");
                    document.getElementById("HeaderTitle").innerHTML = Header;
                    CurrentBatchGet();
                },
                error: function (xhr, status, error) {
                    var err = eval("(" + xhr.responseText + ")");
                    console.log(err.Message);
                }
            });
        }
        function BatchFunction() {
            BatchId = $("#drpBatch").val();
            sessionStorage.setItem('NewBatchId', BatchId);
            $("#drpBatch").val(BatchId);
            FeeCollectionCountDataBind();
        }

        function FeeCollectionCountDataBind() {
             $("#LoaderDiv1").show();
            // alert(OrgId);
            //var $div2 = $("#LoaderDiv1");
            //if ($div2.data("active")) { return; }
            //$div2.show().data("active", true);
            //setTimeout(function () {
            //    $div2.hide().data("active", false);
            //}, 10000);
            $.ajax({
                type: "POST",
                url: "FeeDashBoard.aspx/FeeCollectionCountDataBind",
                data: JSON.stringify({ "BatchId": parseInt(BatchId), "OrgGroupId": parseInt(OrgId) }),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                //async: false,
                success: function (result) {
                    // alert(result.d);
                    var obj = (result.d);
                    document.getElementById("YesterdayCount").innerHTML = obj[0].YesterdayAmount;
                    document.getElementById("DailyCount").innerHTML = obj[0].DailyAmount;
                    document.getElementById("WeeklyCount").innerHTML = obj[0].MonthlyAmount;
                    document.getElementById("MonthlyCount").innerHTML = obj[0].YearlyAmount;
                    //setTimeout(function () {
                    //    document.getElementById("LoaderDiv1").style.display = "hide";
                    //}, 3000);
                    $("#LoaderDiv1").hide();
                    ReceiptEntryCountDataBind();
                },
                error: function (xhr, status, error) {
                    var err = eval("(" + xhr.responseText + ")");
                    console.log(err.Message);
                    $("#LoaderDiv1").hide();
                }
            });

          
        }

        function ReceiptEntryCountDataBind() {
            $("#LoaderDiv2").show();
            //var $div2 = $("#LoaderDiv2");
            //if ($div2.data("active")) { return; }
            //$div2.show().data("active", true);
            //setTimeout(function () {
            //    $div2.hide().data("active", false);
            //}, 10000);
            $.ajax({
                type: "POST",
                url: "FeeDashBoard.aspx/ReceiptEntryCountDataBind",
                data: JSON.stringify({ "BatchId": parseInt(BatchId), "OrgGroupId": parseInt(OrgId) }),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
              //  async: false,
                success: function (result) {
                    var obj = (result.d);
                    //alert(obj[0].StudentCount);
                    document.getElementById("ReceiptEntryCount").innerHTML = parseInt(obj[0].ReceiptAmount);
                    // setTimeout(function () { $("#LoaderDiv2").hide(); }, 3000);
                    $("#LoaderDiv2").hide();
                    CancelReceiptCountDataBind();
                },
                error: function (xhr, status, error) {
                    var err = eval("(" + xhr.responseText + ")");
                    console.log(err.Message);
                    $("#LoaderDiv2").hide();
                }
            });
           
        }
        function CancelReceiptCountDataBind() {
             $("#LoaderDiv3").show();
            //var $div2 = $("#LoaderDiv3");
            //if ($div2.data("active")) { return; }
            //$div2.show().data("active", true);
            //setTimeout(function () {
            //    $div2.hide().data("active", false);
            //}, 10000);
            $.ajax({
                type: "POST",
                url: "FeeDashBoard.aspx/CancelReceiptCountDataBind",
                data: JSON.stringify({ "BatchId": parseInt(BatchId), "OrgGroupId": parseInt(OrgId) }),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
               // async: false,
                success: function (result) {
                    var obj = (result.d);
                    //alert(obj[0].StudentCount);
                    document.getElementById("CancelReceiptCount").innerHTML = parseInt(obj[0].ReceiptAmount);
                    //  setTimeout(function () { $("#LoaderDiv3").hide(); }, 3000);
                    //$("#LoaderDiv3").delay(3000);
                    $("#LoaderDiv3").hide();
                    CollectionPaytypeFeeCountDataBind();
                },
                error: function (xhr, status, error)
            { 
                var err = eval("(" + xhr.responseText + ")");
                console.log(err.Message);
                $("#LoaderDiv3").hide();
            }
            });
            
        }
        function CollectionPaytypeFeeCountDataBind() {
            $("#LoaderDiv4").show();
            //var $div2 = $("#LoaderDiv4");
            //if ($div2.data("active")) { return; }
            //$div2.show().data("active", true);
            //setTimeout(function () {
            //    $div2.hide().data("active", false);
            //}, 10000);
            $.ajax({
                type: "POST",
                url: "FeeDashBoard.aspx/CollectionPaytypeFeeCountDataBind",
                data: JSON.stringify({ "BatchId": parseInt(BatchId), "OrgGroupId": parseInt(OrgId) }),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
               // async: false,
                success: function (result) {
                    var obj = (result.d);
                    document.getElementById("CollectionPaytypeYesterdayCount").innerHTML = obj[0].YesterdayAmount;
                    document.getElementById("CollectionPaytypeDatCount").innerHTML = obj[0].DailyAmount;
                    document.getElementById("CollectionPaytypeMonthlyCount").innerHTML = obj[0].MonthlyAmount;
                    document.getElementById("CollectionPaytypeYearlyCount").innerHTML = obj[0].YearlyAmount;
                    $("#LoaderDiv4").hide();
                    PaytypeReceiptCollectionDataBind();
                },
                error: function (xhr, status, error) {
                    var err = eval("(" + xhr.responseText + ")");
                    console.log(err.Message);
                    $("#LoaderDiv4").hide();
                }
            });
            
        }
        function PaytypeReceiptCollectionDataBind() {
             $("#LoaderDiv5").show();
            //var $div2 = $("#LoaderDiv5");
            //if ($div2.data("active")) { return; }
            //$div2.show().data("active", true);
            //setTimeout(function () {
            //    $div2.hide().data("active", false);
            //}, 10000);
            $.ajax({
                type: "POST",
                url: "FeeDashBoard.aspx/PaytypeReceiptCollectionDataBind",
                data: JSON.stringify({ "BatchId": parseInt(BatchId), "OrgGroupId": parseInt(OrgId) }),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                //async: false,
                success: function (result) {
                    var obj = (result.d);
                    document.getElementById("PaytypeReceiptCollectionYesterdayCount").innerHTML = obj[0].YesterdayAmount;
                    document.getElementById("PaytypeReceiptCollectionDailyCount").innerHTML = obj[0].DailyAmount;
                    document.getElementById("PaytypeReceiptCollectionMonthlyCount").innerHTML = obj[0].MonthlyAmount;
                    document.getElementById("PaytypeReceiptCollectionYearlyCount").innerHTML = obj[0].YearlyAmount;
                    $("#LoaderDiv5").hide();
                   // ExamptionFeeCountDataBind();
                },
                error: function (xhr, status, error) {
                    var err = eval("(" + xhr.responseText + ")");
                    console.log(err.Message);
                    $("#LoaderDiv5").hide();
                }
            });
            
        }
        function ExamptionFeeCountDataBind() {
            $("#LoaderDiv6").show();
            //var $div2 = $("#LoaderDiv6");
            //if ($div2.data("active")) { return; }
            //$div2.show().data("active", true);
            //setTimeout(function () {
            //    $div2.hide().data("active", false);
            //}, 10000);
            $.ajax({
                type: "POST",
                url: "FeeDashBoard.aspx/ExamptionFeeCountDataBind",
                data: JSON.stringify({ "BatchId": parseInt(BatchId), "OrgGroupId": parseInt(OrgId) }),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                //async: false,
                success: function (result) {
                    var obj = (result.d);
                    document.getElementById("ExamptionFeeCount").innerHTML = parseInt(obj[0].ExamptionAmount);
                    $("#LoaderDiv6").hide();
                    AdditionalFeeCountDataBind();
                },
                error: function (xhr, status, error) {
                    var err = eval("(" + xhr.responseText + ")");
                    console.log(err.Message);
                    $("#LoaderDiv6").hide();
                }
            });
            
        }
        function AdditionalFeeCountDataBind() {
            $("#LoaderDiv7").show();
            //var $div2 = $("#LoaderDiv7");
            //if ($div2.data("active")) { return; }
            //$div2.show().data("active", true);
            //setTimeout(function () {
            //    $div2.hide().data("active", false);
            //}, 10000);
            $.ajax({
                type: "POST",
                url: "FeeDashBoard.aspx/AdditionalFeeCountDataBind",
                data: JSON.stringify({ "BatchId": parseInt(BatchId), "OrgGroupId": parseInt(OrgId) }),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
               // async: false,
                success: function (result) {
                    var obj = (result.d);
                 //   alert(obj[0].AdditionalAmount);
                    document.getElementById("AdditionalFeeCount").innerHTML = parseInt(obj[0].AdditionalAmount);
                    $("#LoaderDiv7").hide();
                    NotApplicableFeeCountDataBind();
                },
                error: function (xhr, status, error) {
                    var err = eval("(" + xhr.responseText + ")");
                    console.log(err.Message);
                    $("#LoaderDiv7").hide();
                }
            });
           
        }
        function NotApplicableFeeCountDataBind() {
             $("#LoaderDiv8").show();
            //var $div2 = $("#LoaderDiv8");
            //if ($div2.data("active")) { return; }
            //$div2.show().data("active", true);
            //setTimeout(function () {
            //    $div2.hide().data("active", false);
            //}, 10000);
            $.ajax({
                type: "POST",
                url: "FeeDashBoard.aspx/NotApplicableFeeCountDataBind",
                data: JSON.stringify({ "BatchId": parseInt(BatchId), "OrgGroupId": parseInt(OrgId) }),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (result) {
                    var obj = (result.d);
                    //alert(obj[0].StudentCount);
                    document.getElementById("NotApplicableFeeCount").innerHTML = parseInt(obj[0].NotApplicableAmount);
                    $("#LoaderDiv8").hide();
                    StudentCountStatusDataBind();
                },
                error: function (xhr, status, error) {
                    var err = eval("(" + xhr.responseText + ")");
                    console.log(err.Message);
                    $("#LoaderDiv8").hide();
                }
            });
           
        }
        function StudentCountStatusDataBind() {
             $("#LoaderDiv9").show();
            //var $div2 = $("#LoaderDiv9");
            //if ($div2.data("active")) { return; }
            //$div2.show().data("active", true);
            //setTimeout(function () {
            //    $div2.hide().data("active", false);
            //}, 10000);
            $.ajax({
                type: "POST",
                url: "FeeDashBoard.aspx/StudentCountStatusDataBind",
                data: JSON.stringify({ "BatchId": parseInt(BatchId), "OrgGroupId": parseInt(OrgId) }),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                //async: false,
                success: function (result) {
                    var obj = (result.d);
                    var total = 0;

                    $.each(obj, function (i, item) {
                        // tblClassDivision += "<tr><td><a onclick='StudentListDataBind(" + ReceiptBookId + "," + OrgId + "," + item.DivisionId + ",\"" + item.DivisionName + " \")'>" + item.DivisionName + "</a></td><td>" + item.ReceiptAmount + "</td></tr>";
                        total += parseInt(item.FullyPaid + item.FullyUnPaid + item.PartiallyPaid);
                    });
                    document.getElementById("StudentCountStatus").innerHTML = total;
                    $("#LoaderDiv9").hide();
                },
                error: function (xhr, status, error) {
                    var err = eval("(" + xhr.responseText + ")");
                    console.log(err.Message);
                    $("#LoaderDiv9").hide();    
                }
            });
        }

        function FeeCollectionFunction(id) {
            if (id == 1) {
                window.location.href = "../MobileView/FeeCollectionNewDash.aspx?Count=-1&BatchId=" + BatchId + "&OrgId=" + OrgId;
            }
            else if (id == 2) {
                window.location.href = "../MobileView/FeeCollectionNewDash.aspx?Count=1&BatchId=" + BatchId + "&OrgId=" + OrgId;
            }
            else if (id == 3) {
                window.location.href = "../MobileView/FeeCollectionNewDash.aspx?Count=30&BatchId=" + BatchId + "&OrgId=" + OrgId;
            }
            else if (id == 4) {
                window.location.href = "../MobileView/FeeCollectionNewDash.aspx?Count=365&BatchId=" + BatchId + "&OrgId=" + OrgId;
            }
            else {
                alert('Record Not Found');
            }
        }
        function ReceiptEntryFunction() {
            window.location.href = "../MobileView/ReceiptEntry.aspx?BatchId=" + BatchId + "&OrgId=" + OrgId;
        }
        function CancelReceiptFunction() {
            window.location.href = "../MobileView/CancelReceipt.aspx?BatchId=" + BatchId + "&OrgId=" + OrgId;
        }
        function CollectionPaytypeFunction(id) {
            if (id == 1) {
                window.location.href = "../MobileView/CollectionPaytypeFee.aspx?Count=-1&BatchId=" + BatchId + "&OrgId=" + OrgId;
            }
            else if (id == 2) {
                window.location.href = "../MobileView/CollectionPaytypeFee.aspx?Count=1&BatchId=" + BatchId + "&OrgId=" + OrgId;
            }
            else if (id == 3) {
                window.location.href = "../MobileView/CollectionPaytypeFee.aspx?Count=30&BatchId=" + BatchId + "&OrgId=" + OrgId;
            }
            else if (id == 4) {
                window.location.href = "../MobileView/CollectionPaytypeFee.aspx?Count=365&BatchId=" + BatchId + "&OrgId=" + OrgId;
            }
            else {
                alert('Record Not Found');
            }
        }
        function PaytypeReceiptCollection(id) {
            if (id == 1) {
                window.location.href = "../MobileView/PaytypeReceiptCollection.aspx?Count=-1&BatchId=" + BatchId + "&OrgId=" + OrgId;
            }
            else if (id == 2) {
                window.location.href = "../MobileView/PaytypeReceiptCollection.aspx?Count=1&BatchId=" + BatchId + "&OrgId=" + OrgId;
            }
            else if (id == 3) {
                window.location.href = "../MobileView/PaytypeReceiptCollection.aspx?Count=30&BatchId=" + BatchId + "&OrgId=" + OrgId;
            }
            else if (id == 4) {
                window.location.href = "../MobileView/PaytypeReceiptCollection.aspx?Count=365&BatchId=" + BatchId + "&OrgId=" + OrgId;
            }
            else {
                alert('Record Not Found');
            }
        }
        function ExamptionFeeFunction() {
            window.location.href = "../MobileView/ExamptionFee.aspx?BatchId=" + BatchId + "&OrgId=" + OrgId;
        }

        function AdditionalFeeFunction() {
            window.location.href = "../MobileView/AdditionalFee.aspx?BatchId=" + BatchId + "&OrgId=" + OrgId;
        }

        function NotApplicableFeeFunction() {
            window.location.href = "../MobileView/NotApplicableFee.aspx?BatchId=" + BatchId + "&OrgId=" + OrgId;
        }
        function StudentCountStatusFunction() {
            window.location.href = "../MobileView/StudentCountStatus.aspx?BatchId=" + BatchId + "&OrgId=" + OrgId;
        }

        function BackOrgFunction() {

            window.location.href = "../MobileView/DashBoard.aspx"; CurrentBatchGet();
        }

        function DashBoard() {
            window.location.href = "../MobileView/DashBoard.aspx";
        }


    </script>
            <script>
                function openNav() {
                    document.getElementById("mySidenav").style.width = "344px";
                }

                function closeNav() {
                    document.getElementById("mySidenav").style.width = "0";
                }
            </script>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
