<%@ Page Language="C#" MasterPageFile="~/MasterPages/Main.master" AutoEventWireup="true"
    CodeFile="ReportsGroupPermissions.aspx.cs" Inherits="GroupPermissions"  %>

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

    <script language="javascript" type="text/javascript">
        function selectAll(invoker) {
            var inputElements = document.getElementsByTagName("input");

            for (var i = 0; i < inputElements.length; i++ ) {
                
                var tempElement = inputElements[i];

                if (tempElement.type == "checkbox") {
                    tempElement.checked = invoker.checked;
                }
            }
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table class="body_MainTB" border="0" cellpadding="0" cellspacing="0">
        <tr align="center">
            <td valign="top">
                <!------------------------------------body St  ---------------------------------------------->
                <table border="0" cellpadding="0" cellspacing="0" class="body_formTitle">
                    <tr>
                        <td>
                            Manage Group Permissions
                        </td>
                    </tr>
                    <tr>
                        <td>
                          Group Name: <asp:Literal ID="LiteralGroupName" Text="" runat="server"></asp:Literal>
                        </td>
                    </tr>
                </table>
                <br />
                <!------------------------------------body End1 ----------------------------------------------->
                <asp:Label ID="lbl_error" runat="server" Text="" class="fieldError"></asp:Label>
                <table border="0" cellpadding="0" cellspacing="0" class="contTB">
                    <tr>
                        <td align="center">
                            <table id="tbl1" style="display: block" border="0" width="95%" cellpadding="0" cellspacing="0"
                                class="add_ItemTB1">
                                <tr>
                                    <td class="tdNormal" colspan="5">Please Select Reports' Group: </td>
                                </tr>
                                <tr>
                                    <td class="tdNormal" style="width: 15%" >
                                        Report Group: 
                                    </td>
                                    <td class="tdNormal" style="width: 30%" >
                                        <asp:DropDownList ID="ddl_reportsGroups" runat="server" class="fieldNormal"
                                             DataTextField="NAME" DataValueField="ID" AutoPostBack="True"
                                            onselectedindexchanged="ddl_reportsGroups_SelectedIndexChanged"> 
                                        </asp:DropDownList>
                                    </td>
                                    <td class="tdNormal" style="width: 10%" ></td>
                                    <td class="tdNormal" style="width: 15%" ></td>
                                    <td class="tdNormal" style="width: 30%" ></td>
                                </tr>
                            </table>
                            <br />
                            <br />
                            <asp:Panel ID="pnlGrid" runat="server" Width="100%">
                             
                                <table border="0" cellpadding="0" cellspacing="0" class="grid_TitleBG_B">
                                    <tr>
                                        <td>
                                            Reports
                                        </td>
                                    </tr>
                                </table>
                                <asp:GridView ID="grd_reports" CssClass="gridMaster" Width ="100%" runat="server" AutoGenerateColumns="False"
                                    AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None" AllowPaging="True"
                                    PageSize="30" DataKeyNames="ID" EmptyDataText="Sorry, No Reports Assigned to this Group..." 
                                    onpageindexchanging="grd_reports_PageIndexChanging" 
                                    onrowcommand="grd_reports_RowCommand">
                                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                    
                                                                               
                                    <Columns>
                                        <asp:BoundField DataField="NAME" HeaderText="Report Name"/>
                                        <asp:BoundField DataField="STATUS" ItemStyle-Width="20%" HeaderText="Status" />
                                        <asp:BoundField DataField="AP_STATUS" ItemStyle-Width="20%" HeaderText="Approval Status" />
                                        
                                        <asp:ButtonField ButtonType="Image" ItemStyle-Width="30px" CommandName="d" Text="Delete" 
                                            ImageUrl="~/Images/delete.jpg" />
                                        <asp:ButtonField ButtonType="Image" ItemStyle-Width="20px" CommandName="approve" Text="Approve"
                                            ImageUrl="~/Images/approve.jpg"></asp:ButtonField>
                                        <asp:ButtonField ButtonType="Image" ItemStyle-Width="20px" CommandName="decline" Text="Decline"
                                            ImageUrl="~/Images/reject.jpg"></asp:ButtonField>
                                    </Columns>
                                    
                                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="Black" />
                                    <EditRowStyle BackColor="#999999" />
                                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                </asp:GridView>

                                <table border="0" cellpadding="0" cellspacing="0" class="action_TB_BgForm">
                                    <tr>
                                        <td>
                                            <asp:Button ID="btn_add" runat="server" Text="     Add     " 
                                                class="Btn_M_Normal" onclick="btn_add_Click" />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <br />
                            <!------------------------------------body End1 ----------------------------------------------->
                            <asp:Panel ID="pnlControls" runat="server" Width="100%">
                                <fieldset id="addItem">
                                    <legend id="addItem">Adding new Report</legend>
                                </fieldset>
                                <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                    <tr>
                                        <td class="tdNormal" style="width:15%">
                                            Reports <span style="color:Red">*</span>
                                        </td>
                                        <td colspan="3" class="tdNormal" style="width:30%">
                                            <asp:DropDownList ID="ddl_reports" runat="server" class="fieldNormal" DataTextField="NAME" DataValueField="ID"></asp:DropDownList>
                                        </td>
                                        <td class="tdNormal" style="width:30%">
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            &nbsp;
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                    </tr>
                                </table>
                                <table border="0" cellpadding="0" cellspacing="0" class="action_TB_BgaddItem">
                                    <tr>
                                        <td>
                                            <asp:Button ID="btn_Cancel" runat="server" Text="   Cancel   "
                                                class="Btn_M_Normal" CausesValidation="False" onclick="btn_Cancel_Click" />
                                            <asp:Button ID="btn_save" runat="server" Text="   Save   "
                                                class="Btn_M_Normal" onclick="btn_save_Click"/>
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            
                            <!------------------------------------body End2 ----------------------------------------------->
                            <br />
                        </td>
                    </tr>
                </table>
                <!------------------------------------body End2 ----------------------------------------------->
            </td>
        </tr>
    </table>
</asp:Content>
