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

<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <script>
        var BatchId;
        var ExamSubGroupId;
        var Header = [];
        var ReHeader;

        $(document).ready(function () {
            var myurl = window.location.href;
            var keyval = myurl.split('?')[1].split('&');
            OrgId = parseInt(keyval[0].split('=')[1].toString());
            Id = OrgId = parseInt(keyval[0].split('=')[1].toString());
            BatchId = parseInt(keyval[1].split('=')[1].toString());
            ExamSubGroupId = parseInt(keyval[2].split('=')[1].toString());

            $.ajax({
                type: "POST",
                url: "MarkEntryStatusVerify.aspx/GetOrgId",
                data: JSON.stringify({ "Id": Id }),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (result) {
                    var obj = (result.d);
                    Header[0] = "<h5 class='page-title'><a href='#' onclick='dashboardpage()'>" + obj[0].Title + "</a></h5>" +
                    " <h5 class='page-title' ><a href='#' onclick='PageName()'>Mark Entry Status Verify</a></h5>";
                    $("#HeaderLabel").text("Assessment Dashboard");
                    document.getElementById("HeaderTitle").innerHTML = Header;
                    ReHeader = document.getElementById("HeaderTitle").innerHTML;
                }
            });

            MarkEntryStatusDataBind(BatchId, ExamSubGroupId);
        });
        function PageName() {
            window.location.href = "../MobileView/AssessmentDetailDashboard.aspx?OrgId=" + Id;
        }

        function MarkEntryStatusDataBind(BatchId, ExamSubGroupId) {
            $.ajax({
                type: "POST",
                url: "MarkEntryStatusVerify.aspx/MarkEntryStatusGet",
                data: JSON.stringify({ "BatchId": parseInt(BatchId), "ExamSubGroupId": parseInt(ExamSubGroupId) }),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (result) {
                    var obj = (result.d);
                    var tblMarkEntryVerify = "";
                    if (obj != "") {
                        //Header[0] = "<h3 class='page-title text-muted'><a href ='#' onclick='dashboardpage()'>Assessment Dashboard</a></h3>" +
                        //            "<div class='cBoth'></div>" + " <h5 class='page-title' ><a href='#' onclick='PageName()'>Mark Entry Status Verify</a></h5>";
                        document.getElementById("HeaderTitle").innerHTML = Header;
                        ReHeader = document.getElementById("HeaderTitle").innerHTML;

                        var newObj = {};
                        var keyCount = 0;
                        tblMarkEntryVerify += "<tr>";

                        for (var item in obj[0]) {
                            if (item === "ClassId") { continue; }
                            else if (item === "DivisionId") { continue; }
                            else if (item === "ExamId") { continue; }
                            else {
                                tblMarkEntryVerify += "<th>" + item + "</th>";
                                newObj[keyCount] = {};
                                newObj[keyCount++][item] = 0;
                            }
                        }
                        tblMarkEntryVerify += "</tr>";
                        keyCount = 1;
                        $.each(obj, function (i, item1) {
                            tblMarkEntryVerify += "<tr>";
                            keycount = 0;

                            for (var item in item1) {
                                if (item !== "ClassId") {
                                    if (item !== "DivisionId") {
                                        if (item !== "ExamId") {
                                            if (item1[item] === null || item1[item] === undefined) {
                                                if (item === "Status") { item1[item] = "Process Schedule"; }
                                                else { item1[item] = 0; }
                                            }
                                            tblMarkEntryVerify += "<td>" + item1[item] + "</td>";
                                        }
                                    }
                                }
                            }
                        });
                    }
                    else { tblMarkEntryVerify += "<tr><td colspan='8' class='record'>No records found..!!</td></tr>"; }
                    document.getElementById("tblMarkEntryVerify").innerHTML = tblMarkEntryVerify;
                    document.getElementById("MarkEntryStatusverifyHead").style.display = "block";
                }
            });
        }

        function dashboardpage() {
            window.location.href = "../MobileView/AssessmentDetailDashboard.aspx?OrgId=" + Id;
        }

        function BackOrgFunction() {
            window.location.href = "../MobileView/AssessmentDetailDashBoard.aspx?OrgId=" + Id;
        }

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

    </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="page-header row mb20">
                <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>
            </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="MarkEntryStatusverifyHead">
                            <h3 class="table-topic">Mark Entry Status Verify</h3>
                            <div class='himsBoxContent'>
                                <div class='table-responsive'>
                                    <table id='tblMarkEntryVerify' class='table table-striped table-bordered'>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
