<%@ page title="" language="C#" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" autoeventwireup="true" inherits="Pages_BaseFramework_Security_SecurityAdmin, App_Web_m2a20lm5" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl" TagPrefix="ScreenGroup" %>
<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DatePickerControl" TagPrefix="Date" %>
<%@ Register Src="~/UserControls/AutoComplete/AutoCompleteControl.ascx" TagName="AutoCompleteControl" TagPrefix="acc" %>
<%@ Register Src="~/UserControls/Common/CommonSearch/CommonSearch.ascx" TagName="CommonSearchUserControl" TagPrefix="Common" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <style>
        .pTop15 {
            padding-top: 0px;
        }
    </style>
    <asp:UpdatePanel ID="UserOrganizationSearchUpdatePanel" runat="server">
        <ContentTemplate>
            <Common:CommonSearchUserControl ID="CommonSearchControl" runat="server" Visible="false" />
            <div id="divContentPage" class="divcontentpagemargin">
                <!-- ContentPlaceHolder Box Starts -->

                <div class="dashBoardLeftCont" valign="top">
                    <div class="himssuHeader3WireBox">
                        <%-- <div class="himsBoxHeader">
                                        <div class="leftdiv">
                                        </div>
                                        <div class="himsBoxTitle">
                                            <div class="headerText">
                                                <asp:Label runat="server" ID="ScreenGroupNameLabel"></asp:Label>
                                            </div>
                                        </div>
                                    </div>--%>
                        <table width="0px" cellpadding="0" cellspacing="0">
                            <tr>
                                <td>
                                    <div class="himsBoxContent">
                                        <div class="leftUlMenu">
                                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="122"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="row whiteboxpaddingleft">
                    <div class="himssuHeader1WireBox card card-box">
                        <div class="himsBoxHeader card-head">
                            <div class="leftdiv">
                            </div>
                            <div class="himsBoxTitle">
                                <div class="headerText">
                                    <header>
                                        <i class="fas fa-tasks"></i>
                                        <asp:Label ID="Label1" runat="server" Text="Security Admin"></asp:Label>
                                    </header>
                                </div>
                            </div>
                        </div>
                        <div class="himsBoxContent card-body">

                            <div class="col-md-12 pTop15 pb15" style="padding: 0px 0px 0px 0px">
                                <div class="outerBox pTop5 col-md-3">
                                    <div class="controlLabelWidth">
                                        <asp:Label ID="SearchOrganizationLabel" Text="Organization" runat="server" CssClass="mandatory"></asp:Label>
                                    </div>
                                    <div class="fLeft pRight5">
                                        <asp:DropDownList ID="SearchOrganizationDropDownList" runat="server" onmouseleave="showHideTooltip()" OnSelectedIndexChanged="SearchOrganizationDropDownList_SelectedIndexChanged" AutoPostBack="true"
                                            onmouseenter="showHideTooltip()" SkinID="CustomWidthDropDownList" CssClass="form-control">
                                        </asp:DropDownList>
                                    </div>
                                </div>
                                <div class="outerBox pTop5 col-md-3">
                                    <div class="controlLabelWidth">
                                        <asp:Label ID="RoleLabel" Text="Role" runat="server" CssClass="mandatory"></asp:Label>
                                    </div>
                                    <div class="fLeft pRight5">
                                        <asp:DropDownList ID="RoleDropDownList" runat="server" onmouseleave="showHideTooltip()" OnSelectedIndexChanged="RoleDropDownList_SelectedIndexChanged" AutoPostBack="true"
                                            onmouseenter="showHideTooltip()" SkinID="CustomWidthDropDownList" CssClass="form-control">
                                        </asp:DropDownList>
                                    </div>
                                </div>
                                <div class="himsBoxContent width-100">
                                    <div class="contentHolder">
                                        <div class="outerBox pTop5 col-md-12" style="margin-top: 10px">
                                            <div class="">
                                                <asp:RadioButtonList ID="AutoAssignDivisionRadioButtonList" runat="server" RepeatDirection="Horizontal" OnSelectedIndexChanged="AutoAssignDivisionRadioButtonList_SelectedIndexChanged" AutoPostBack="true">
                                                    <asp:ListItem Text="Division Wise" Value="1" Selected="True"></asp:ListItem>
                                                    <asp:ListItem Text="Teacher Subject Division Wise" Value="2"></asp:ListItem>
                                                </asp:RadioButtonList>
                                            </div>
                                        </div>
                                        <div class="alignCenter col-md-12 pt-3 ">
                                            <asp:Button ID="SaveUserAccess" SkinID="0" runat="server" Text="&#xf0c7; Save" OnClick="SaveUserAccess_Click" CssClass="btn-save btn fas" />
                                            <asp:Button ID="ResetUserAccess" runat="server" OnClick="ResetUserAccess_Click"
                                                Text="&#xf0e2; Reset" CssClass="btn-reset btn fas" SkinID="0" CausesValidation="False" TabIndex="4" meta:resourcekey="ClearSearchButtonResource1" />
                                            <asp:Button ID="DeleteUserAccess" runat="server" OnClick="DeleteUserAccess_Click"
                                                meta:resourcekey="ClearButtonResource1" Text="&#xf2ed; Delete" CssClass="btn-delete btn fas" SkinID="0" />
                                        </div>
                                    </div>
                                </div>


                                <div class="himsBoxContent" style="padding: 0px 10px 0px 10px">

                                    <div id="Div14" runat="server" class="table-responsive">
                                        <asp:GridView ID="SecurityAdminGridView" runat="server" Width="100%" AutoGenerateColumns="False"
                                            EmptyDataText="No Records Found !!" DataKeyNames="EmployeeId,SourceId,UserId"
                                            CssClass="table table-striped table-bordered table-hover" AllowPaging="false" ShowHeader="true">
                                            <Columns>

                                                <asp:TemplateField HeaderText="Select" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="5%"
                                                    ItemStyle-Wrap="true">
                                                    <HeaderTemplate>
                                                        <label class="rt-chkbox rt-chkbox-outline">
                                                            <asp:CheckBox ID="HeaderSelectCheckBox" runat="server" Enabled="true" AutoPostBack="true"
                                                                Visible="true" OnCheckedChanged="HeaderSelectCheckBox_checked" />
                                                            <span></span>
                                                        </label>
                                                    </HeaderTemplate>
                                                    <ItemStyle HorizontalAlign="Center" />
                                                    <ItemTemplate>
                                                        <label class="rt-chkbox rt-chkbox-outline">
                                                            <asp:CheckBox ID="SelectCheckBox" runat="server" Checked='<%#Convert.ToBoolean(Eval("IsObsolete")) %>' />
                                                            <span></span>
                                                        </label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="User Name" ItemStyle-Width="10%" ItemStyle-Wrap="true"
                                                    HeaderStyle-HorizontalAlign="Left">
                                                    <ItemTemplate>
                                                        <asp:Label ID="UserNameLabel" runat="server" ClientIDMode="Static" Text='<%# Bind("UserName") %>'
                                                            Width="100%" SkinID="CustomWidthLabel"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Division Name" ItemStyle-Width="10%" ItemStyle-Wrap="true"
                                                    HeaderStyle-HorizontalAlign="Left">
                                                    <ItemTemplate>
                                                        <asp:Label ID="DivisionNameLabel" runat="server" ClientIDMode="Static" Text='<%# Bind("SourceName") %>'
                                                            Width="100%" SkinID="CustomWidthLabel"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Code" ItemStyle-Width="10%" ItemStyle-Wrap="true"
                                                    HeaderStyle-HorizontalAlign="Left">
                                                    <ItemTemplate>
                                                        <asp:Label ID="EmployeeCodeLabel" runat="server" ClientIDMode="Static" Text='<%# Bind("EmployeeCode") %>'
                                                            Width="100%" SkinID="CustomWidthLabel"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Employee Name" ItemStyle-Width="10%" ItemStyle-Wrap="true"
                                                    HeaderStyle-HorizontalAlign="Left">
                                                    <ItemTemplate>
                                                        <asp:Label ID="EmployeeNameLabel" runat="server" ClientIDMode="Static" Text='<%# Bind("EmployeeName") %>'
                                                            Width="100%" SkinID="CustomWidthLabel"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>



                                            </Columns>
                                            <PagerSettings Visible="False" />
                                        </asp:GridView>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <script type="text/javascript">

        function checkAll(obj) {
            var objGridview = obj.closest('table');
            var list = objGridview.getElementsByTagName("input");
            for (var i = 0; i < list.length; i++) {
                var objRow = list[i].parentNode.parentNode;
                if (list[i].type == "checkbox" && obj != list[i]) {
                    if (obj.checked) {
                        list[i].checked = true;
                    }
                    else {
                        list[i].checked = false;
                    }
                }
            }
        }
    </script>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/security-admin")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
</asp:Content>

