<%@ page language="C#" masterpagefile="~/MasterFile/TimeCheck.master" autoeventwireup="true" inherits="Masters_TA_UI_Master_UserGroups_AddRights, App_Web_elpmossn" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="server">
    <!--[if gt IE 5.5]>
	<link rel="stylesheet" type="text/css" href="../css/ProgressforIE.css" />
  <![endif]-->
    <link href="../dist/css/custom.css" rel="stylesheet" type="text/css" />

    <script src="../plugins/datepicker/jquery-1.11.1.min.js"></script>

    <link href="../dist/css/bootstrap-responsive-tabs.css" rel="stylesheet" type="text/css">

    <script src="../dist/js/jquery.bootstrap-responsive-tabs.min.js"></script>

    <script type="text/javascript">
        function chckDiv(val) {

            document.getElementById("<%= hdfDivValue.ClientID%>").value = val;
        }

        function CheckAdd(ctrl, count, j) {
            var k = 0;
            if (ctrl.checked == true) {
                for (i = 1; i <= count; i++) {
                    if (document.getElementById("ctl00_BodyContentPH_chbconfigAdd" + j + k).disabled == false) {
                        document.getElementById("ctl00_BodyContentPH_chbconfigAdd" + j + k).checked = true;
                    }
                    k = k + 1
                }
            }
            else {
                for (i = 1; i <= count; i++) {
                    if (document.getElementById("ctl00_BodyContentPH_chbconfigAdd" + j + k).disabled == false) {
                        document.getElementById("ctl00_BodyContentPH_chbconfigAdd" + j + k).checked = false;
                    }
                    k = k + 1
                }
            }
        }
        function CheckView(ctrl, count, j) {
            var k = 0;
            if (ctrl.checked == true) {
                for (i = 1; i <= count; i++) {
                    if (document.getElementById("ctl00_BodyContentPH_chbconfigView" + j + k).disabled == false) {
                        document.getElementById("ctl00_BodyContentPH_chbconfigView" + j + k).checked = true;
                    }
                    k = k + 1
                }
            }
            else {
                for (i = 1; i <= count; i++) {
                    if (document.getElementById("ctl00_BodyContentPH_chbconfigView" + j + k).disabled == false) {
                        document.getElementById("ctl00_BodyContentPH_chbconfigView" + j + k).checked = false;
                    }
                    k = k + 1
                }
            }
        }
        function CheckModify(ctrl, count, j) {
            var k = 0;
            if (ctrl.checked == true) {
                for (i = 1; i <= count; i++) {
                    if (document.getElementById("ctl00_BodyContentPH_chbconfigModify" + j + k).disabled == false) {
                        document.getElementById("ctl00_BodyContentPH_chbconfigModify" + j + k).checked = true;
                    }
                    k = k + 1
                }
            }
            else {
                for (i = 1; i <= count; i++) {
                    if (document.getElementById("ctl00_BodyContentPH_chbconfigModify" + j + k).disabled == false) {
                        document.getElementById("ctl00_BodyContentPH_chbconfigModify" + j + k).checked = false;
                    }
                    k = k + 1
                }
            }
        }
        function CheckDelete(ctrl, count, j) {
            var k = 0;
            if (ctrl.checked == true) {
                for (i = 1; i <= count; i++) {
                    if (document.getElementById("ctl00_BodyContentPH_chbconfigDelete" + j + k).disabled == false) {
                        document.getElementById("ctl00_BodyContentPH_chbconfigDelete" + j + k).checked = true;
                    }
                    k = k + 1
                }
            }
            else {
                for (i = 1; i <= count; i++) {
                    if (document.getElementById("ctl00_BodyContentPH_chbconfigDelete" + j + k).disabled == false) {
                        document.getElementById("ctl00_BodyContentPH_chbconfigDelete" + j + k).checked = false;
                    }
                    k = k + 1
                }
            }
        }
    </script>

    <div class="content-header">
        <h1 style="background-image: url(../dist/img/user-group-Icon.png); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lbl_HeaderUserGroups" runat="server"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">
        <asp:UpdatePanel ID="upLeave" runat="server">
            <ContentTemplate>
                <asp:Panel ID="pnlProgress" runat="server" Style="display: none;">
                    <asp:Panel ID="pnlLoading" runat="server" HorizontalAlign="center">
                        <div class="InsideProgressBar">
                            <div class="row" style="margin-top: 10px">
                                <img src="../dist/img/logo-Progress.png" />
                            </div>
                            <div class="row" style="min-width: 280px">
                                <img src="../dist/img/default.gif" style="width: 100px" />
                            </div>
                            <div class="row" style="margin-bottom: 10px">
                                <asp:Label ID="lblLoading" runat="server" ForeColor="black" Style="text-align: center"
                                    Text="Please Wait..." Font-Bold="true" Font-Size="12px" Font-Italic="true" Font-Family="Arial"></asp:Label>
                            </div>
                            <div class="clear clearfix">
                            </div>
                        </div>
                    </asp:Panel>
                </asp:Panel>
                <asp:HiddenField ID="hdnProgress" runat="server" />
                <cc1:ModalPopupExtender ID="popupProgress" runat="server" TargetControlID="hdnProgress"
                    BackgroundCssClass="ModalPopup" PopupControlID="pnlProgress" BehaviorID="popupProgress">
                </cc1:ModalPopupExtender>
            </ContentTemplate>
            <Triggers>
                <asp:PostBackTrigger ControlID="btn_save" />
            </Triggers>
        </asp:UpdatePanel>
        <div class="inr-ftr">
            <div class="row">
                <div class="col-sm-12" style="height: 33px; padding: 7px 45px 0 45px; font-size: 15px">
                    <span>
                        <asp:Label ID="lblModuleRights" runat="server" Text="Module Rights"></asp:Label></span>
                </div>
            </div>
        </div>
        <div class="box box-primary">
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="urg-hdr">
                        <div class="col-sm-2">
                            <asp:Label ID="lbl_UserGroup" runat="server"></asp:Label>
                        </div>
                        <div class="col-sm-3">
                            <asp:Label ID="lblGroupName" runat="server"></asp:Label>
                        </div>
                        <div class="clearfix">
                        </div>
                    </div>
                    <div class="row" style="display: none">
                        <div class="col-md-12">
                            <asp:Label runat="server" ID="lbl_Program"></asp:Label>
                        </div>
                        <div class="col-md-12">
                            <asp:DropDownList ID="DDL_Program" runat="server" onchange="chckDiv(this.value);"
                                CssClass="form-control">
                                <asp:ListItem Text="Masters" Value="1"></asp:ListItem>
                                <asp:ListItem Text="Transactions" Value="2"></asp:ListItem>
                                <asp:ListItem Text="Reports" Value="3"></asp:ListItem>
                                <asp:ListItem Text="Organization Settings" Value="4"></asp:ListItem>
                                <asp:ListItem Text="System Settings" Value="5"></asp:ListItem>
                            </asp:DropDownList>
                            <asp:HiddenField ID="hdfDivValue" runat="server" />
                        </div>
                    </div>
                    <div class="col-md-12" style="padding-left: 25px;">
                    </div>
                    <div style="overflow: auto; height: 600px; padding-bottom: 25px; width: 95%;">
                        <div class="user-grptab" style="display: none;">
                            <div class="col-md-12">
                                <table class="table table-bordered user-table" style="margin: 10px; border: 1px solid #c5dffc; width: 95%;">
                                    <tr>
                                        <td class="col-md-4  table-her minwithUser">Modules
                                        </td>
                                        <td class="col-md-2 table-her">Add
                                        </td>
                                        <td class="col-md-2 table-her">View
                                        </td>
                                        <td class="col-md-2 table-her">Modify
                                        </td>
                                        <td class="col-md-2 table-her">Delete
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
                                <div class="user-grptab">
                                    <div class="col-md-12">
                                        <asp:Panel ID="Panel1" runat="server" Style="margin-left: 0px;">
                                        </asp:Panel>
                                    </div>
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </div>
                <div class="panel-footer" style="padding-top: 10px">
                    <div class="row">
                        <div class="col-md-11">
                            <div class="pull-right-button">
                                <asp:LinkButton ID="btn_save" CssClass="btn save-btn fa-floppy-o" runat="server"
                                    OnClick="btn_save_Click" OnClientClick="javascript:if(confirm('Are you sure to save')) $find('popupProgress').show();else return false;" />
                                <asp:LinkButton ID="btn_cancel" CssClass="btn save-btn fa-angle-left" runat="server"
                                    OnClick="btn_cancel_Click" CausesValidation="False" />
                            </div>
                        </div>
                    </div>
                </div>

                <script type="text/javascript" language="javascript">
                    if (document.getElementById("<%= hdfDivValue.ClientID%>").value == "")
                        document.getElementById("<%= hdfDivValue.ClientID%>").value = 1;
        chckDiv(document.getElementById("<%= hdfDivValue.ClientID%>").value);
                </script>

            </div>
        </div>
    </div>

    <script type="text/javascript">
        $('.responsive-tabs').responsiveTabs({
            accordionOn: ['xs', 'sm']
        });
    </script>

</asp:Content>
