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

<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
       <script>

           var OrgGroupId 
           var TypeId
           //var CommonOrgGroupBatchId = 0;

           $(document).ready(function () {
               GetOrgGroupHomeWorkData();
           });

           function GetOrgGroupHomeWorkData() {
               $.ajax({
                   type: "POST",
                   url: "ConsolidateOrgGroupHomeWorkDashBoard.aspx/OrgGroupHomeWorkGet",
                   //data: JSON.stringify({ "OrgGroupId": parseInt(OrgGroupId), "TypeId": 1, "Type": 'Organization' }),
                   contentType: "application/json; charset=utf-8",
                   dataType: "json",
                   success: function (result) {
                       var obj = (result.d);
                       var tblHomeWorkOrgGroupWise = "";
                       var totalassigned = 0;
                       var totalnotassigned = 0;
                       var totalnotapplicable = 0;
                       if (obj != "") {
                           tblHomeWorkOrgGroupWise += "<tr><th>Org Group Name</th><th>Assigned</th><th>Not Assigned</th><th>Not Applicable</th></tr>";
                           $.each(obj, function (i, item) {
                               tblHomeWorkOrgGroupWise += "<tr><td><a href='../MobileView/ConsolidateOrgHomeWorkDashBoard.aspx?OrgGroupId=" + item.OrgGroupId + "'>" + item.OrgGroup + "</a></td><td>" + item.OrgGroupHomeWorkAssigned + "</td><td>" + item.OrgGroupHomeWorkNotAssigned + "</td><td>" + item.OrgGroupHomeWorkNotApplicable + "</td></tr>";
                               totalassigned += parseInt(item.OrgGroupHomeWorkAssigned);
                               totalnotassigned += parseInt(item.OrgGroupHomeWorkNotAssigned);
                               totalnotapplicable += parseInt(item.OrgGroupHomeWorkNotApplicable);
                           });
                           tblHomeWorkOrgGroupWise += "<tr><td style='font-weight:bold'>Total</td><td style='font-weight:bold'>" + totalassigned + "</td><td style='font-weight:bold'>" + totalnotassigned + "</td><td style='font-weight:bold'>" + totalnotapplicable + "</td></tr>";
                       }
                       else { tblHomeWorkOrgGroupWise += "<tr><td colspan='8' class='record'>No records found..!!</td></tr>"; }
                       document.getElementById("tblHomeWorkOrgGroupWise").innerHTML = tblHomeWorkOrgGroupWise;
                   }
               });
           }

           function BackOrgFunction() { window.location.href = "../MobileView/ConsolidateDashBoard.aspx"; CurrentBatchGet(); }
           function DashBoard() { window.location.href = "../MobileView/DashBoard.aspx"; }
    </script>
    <asp:UpdatePanel ID="DoctorScheduleUpdatePanel" runat="server">
        <ContentTemplate>
            <div class="page-header row mb20">
                <div class="col-xl-12 col-sm-12 col-xs-12 border-bottom-inline padd-0">
                    <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>
                        <div class="d-inline-flex w-100">
                            <label class="header-topic justify-content-center" id="HeaderLabel">Consolidate DashBoard</label>
                        </div>
                        <input type="button" value="&#xf3e5;" id="bntBackOrg" onclick="BackOrgFunction()" skinid="0" class="float-right btn btn-back btn-icon fas" />
                    </div>
                    <div class="main-topic inner" id="HeaderTitle">
                    </div>
                </div>
            </div>

            <div class="bg-white row center-block">
                <div class="container-fluid">
                    <div class="gutters-tiny push js-appear-enabled animated fadeIn overflow-hidden" data-toggle="appear">
                        <div class="himssuHeader1WireBox col-md-12 pTop5" id="AdmissionCountOrgHead" style="display: block">
                            <h3 class="table-topic">HomeWork OrgGroup Count Summary</h3>
                            <div class='himsBoxContent pTop5'>
                                <div class='table-responsive'>
                                    <table id='tblHomeWorkOrgGroupWise' class='table table-striped table-bordered'>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
 
</asp:Content>
