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

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

<!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1 class="m-0">Group Screens </h1>
          </div><!-- /.col -->
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="#">Home</a></li>
              <li class="breadcrumb-item active">Security</li>
              <li class="breadcrumb-item active">Manage Groups</li>
              <li class="breadcrumb-item active">Group Screens</li>
            </ol>
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    <!-- /.content-header -->

    <!-- Main content -->
    <section class="content">
    <div class="container-fluid">
                <!-- Default box -->
                <div class="card card-info color-palette-box">
                    <div class="card-header">
				        <h3 class="card-title">
                            <i class="fas fa-tag"></i>
                            Screens
                        </h3>

				        <div class="card-tools">
					        <button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse">
						        <i class="fas fa-minus"></i>
					        </button>
					        </div>
			        </div>
                    <div><asp:Label ID="lblError" runat="server" Text="Label"></asp:Label></div>
                    <div class="card-body">
                    <asp:GridView ID="GridView1" class="table table-striped table-bordered table-sm" BorderStyle="None" BorderWidth="0"
					GridLines="None" runat="server" AutoGenerateColumns=false 
                    OnRowCommand="GridView1_RowCommand" DataKeyNames="PID">
                        <Columns>
                            <asp:BoundField DataField="NAME" ItemStyle-Width="20%" HeaderText="Screen&nbsp;Name" />
                            <asp:BoundField DataField="DESCRIPTION" HeaderText="Description" />
                            <asp:BoundField DataField="status_txt" HeaderText="Status" />
                            <asp:BoundField DataField="app_status" HeaderText="Approval Status" />

                            <asp:TemplateField HeaderText="Actions" Visible="true">
                                <ItemTemplate>
                                    <button type="button" class="btn btn-default btn-block btn-xs dropdown-toggle" data-toggle="dropdown">
                                        Action
                                    </button>
                                    <div class="dropdown-menu">
                                        <a class="dropdown-item" href="#">
                                            <asp:Button ID="Button5" CssClass="btn btn-outline-success btn-block btn-sm" runat="server" Text="Approve" CommandName="a" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" /></a>
                                        <a class="dropdown-item" href="#" runat="server" visible="false">
                                            <asp:Button ID="update" CssClass="btn btn-outline-info btn-block btn-sm" runat="server" Text="Edit" CommandName="v" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" /></a>
                                        <a class="dropdown-item" href="#">
                                            <asp:Button ID="delete" CssClass="btn btn-outline-danger btn-block btn-sm" runat="server" Text="Delete" CommandName="d" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" /></a>
                                        <a class="dropdown-item" href="#">
                                            <asp:Button ID="Button6" CssClass="btn btn-outline-warning btn-block btn-sm" runat="server" Text="Decline" CommandName="decline" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" /></a>
                                    </div>
                                </ItemTemplate>
                            </asp:TemplateField>

                            <%--<asp:ButtonField ButtonType="Link" CommandName="d" Text='<i class="fas fa-trash"></i> Delete' ControlStyle-CssClass="btn btn-danger btn-sm" />
                            <asp:ButtonField ButtonType="Link" CommandName="v" Text="View Screen Functions"  ControlStyle-CssClass="btn btn-primary btn-sm" Visible=false />
                            <asp:ButtonField ButtonType="Link" CommandName="approve" Text="Approve"  ControlStyle-CssClass="btn btn-success btn-sm"/>
                            <asp:ButtonField ButtonType="Link" ItemStyle-Width="20px" CommandName="decline" Text="Decline"  ControlStyle-CssClass="btn btn-danger btn-sm"/>--%>
                        </Columns>
                    </asp:GridView>
                    </div>
                    
                    <div class="row">
                        <div class="col-12" style="text-align: center; margin-bottom:2%">
                            <asp:Button ID="btnAdd" runat="server" Text="Add" OnClick="btnAdd_Click" class="btn btn-primary btn-1" />
                        </div>
                    </div>
                    <!-- /.card-body -->
                </div>
                <!-- /.card -->
                <div class="row">
                    
                    <div class="modal fade" id="modal-xl">
                    
                        <div class="modal-dialog modal-xl">
                          <div class="modal-content">
                            <div class="modal-header">
                              <h4 class="modal-title">Screen</h4>
                              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                              </button>
                            </div>
                            <div class="modal-body">
                            
                            <div class="card-body">
                                <div class="form-group">
                                <label for="exampleInputEmail1">Screen Name</label>
                                <asp:DropDownList ID="ddlPages" runat="server" class="form-control select2" style="width: 100%;" DataTextField="NAME" DataValueField="PID"></asp:DropDownList>
                                </div>
                            </div><!-- /.card-body -->
                            <div class="modal-footer justify-content-between">
                              <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                              <asp:Button ID="btnSave" runat="server" Text="Save changes" OnClick="btnSave_Click" class="btn btn-primary" />
                            </div>
                          </div>
                          <!-- /.modal-content -->
                        </div>
                        <!-- /.modal-dialog -->
                        
                      </div>
                      <!-- /.modal -->
                </div>
                </div>
                <div class="card" id="rowFunctions" runat="server" visible=false>
                    <div class="card-header">
                        <h3 class="card-title">Functions</h3>

                        <div class="card-tools">
                            <button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse">
                                <i class="fas fa-minus"></i>
                            </button>
                            <button type="button" class="btn btn-tool" data-card-widget="remove" title="Remove">
                                <i class="fas fa-times"></i>
                            </button>
                        </div>
                    </div>
                    <div><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></div>
                    <div class="card-body p-0">
                <asp:GridView ID="grd_pageFunctions" class="table table-striped projects" GridLines="None" runat="server" AutoGenerateColumns=false onrowcommand="grd_pageFunctions_RowCommand" ataKeyNames="fid">
                    <Columns>
                        <asp:BoundField DataField="NAME" ItemStyle-Width="20%" HeaderText="Function Name" />
                        <asp:BoundField DataField="DESCRIPTION" HeaderText="Description" />
                        <asp:BoundField DataField="status_txt"  HeaderText="Status" />
                        <asp:BoundField DataField="app_status" HeaderText="Approval Status" />

                        <%--<asp:TemplateField HeaderText="Actions" Visible="true">
                                <ItemTemplate>
                                    <button type="button" class="btn btn-default btn-block btn-xs dropdown-toggle" data-toggle="dropdown">
                                        Action
                                    </button>
                                    <div class="dropdown-menu">
                                        <a class="dropdown-item" href="#">
                                            <asp:Button ID="Button5" CssClass="btn btn-outline-success btn-block btn-sm" runat="server" Text="Approve" CommandName="pf_a" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" /></a>
                                        <a class="dropdown-item" href="#">
                                            <asp:Button ID="delete" CssClass="btn btn-outline-danger btn-block btn-sm" runat="server" Text="Delete" CommandName="pf_d" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" /></a>
                                        <a class="dropdown-item" href="#">
                                            <asp:Button ID="Button6" CssClass="btn btn-outline-warning btn-block btn-sm" runat="server" Text="Decline" CommandName="pf_decline" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" /></a>
                                    </div>
                                </ItemTemplate>
                            </asp:TemplateField>--%>

                        <asp:ButtonField ButtonType="Link" CommandName="del" Text='<i class="fas fa-trash"></i> Delete' ControlStyle-CssClass="btn btn-danger btn-sm" />
                        <asp:ButtonField ButtonType="Link" CommandName="approve" Text="Approve"  ControlStyle-CssClass="btn btn-success btn-sm"/>
                        <asp:ButtonField ButtonType="Link" CommandName="decline" Text="Decline"  ControlStyle-CssClass="btn btn-danger btn-sm"/>
                    </Columns>
                </asp:GridView><br />
                <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                                    <tr>
                                                        <td class="tdNormal" style="width: 15%">
                                                            Functions <span style="color: Red">*</span>
                                                        </td>
                                                        <td colspan="3" class="tdNormal" style="width: 30%">
                                                            <asp:DropDownList ID="ddl_pageFunctions" runat="server" class="fieldNormal" DataTextField="NAME"
                                                                DataValueField="FID">
                                                            </asp:DropDownList>
                                                        </td>
                                                        <td class="tdNormal" style="width: 30%">
                                                            <asp:Button ID="btn_AddFnction" runat="server" Text="     Add     " 
                                                class="Btn_M_Normal" onclick="btn_AddFnction_Click"/>
                                                        </td>
                                                    </tr>
                                                </table>
                                                </div>
                    
                    <!-- /.card-body -->
                </div>

                <!-- UR-Confirmation-modal -->
            <div class="row">
                <div id="UR-confirmation-modal-xl" class="modal fade modal-full" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
                    <button aria-label="" type="button" class="close px-2" data-dismiss="modal" aria-hidden="true">
                        <span aria-hidden="true">×</span>
                    </button>
                    <div class="modal-dialog modal-dialog-centered" role="document">
                        <div class="modal-content">
                            <div class="modal-body text-center">
                                <table border="0" width="100%" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                    <tr>
                                        <td colspan="2" class="tdNormal" align="center">
                                            <asp:Label ID="Lbl_CommandName" Visible="false" runat="server"></asp:Label>
                                            <asp:Label ID="Lbl_CommandArgument" Visible="false" runat="server"></asp:Label>
                                            <asp:Label ID="Lbl_URC_Message" runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" class="tdNormal">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" class="tdNormal" align="center">
                                            <asp:Button ID="btn_URConfirm_OK" runat="server" Text="Yes" CssClass="btn btn-primary" OnClick="btn_URConfirm_OK_Click" />
                                            <button type="button" class="btn btn-primary" data-dismiss="modal">No</button>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

                </div>
            </section>
    <!-- /.content -->
  </div>
  <!-- Toastr -->
	<!-- jQuery -->
	<script src="../plugins/jquery/jquery.min.js"></script>
	<!-- Bootstrap 4 -->
	<script src="../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
	<!-- SweetAlert2 -->
	<script src="../plugins/sweetalert2/sweetalert2.min.js"></script>
	<!-- Toastr -->
	<script src="../plugins/toastr/toastr.min.js"></script>
	<!-- AdminLTE App -->
	<script src=".../dist/js/adminlte.min.js"></script>
	<!-- AdminLTE for demo purposes -->
	<script src="../plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
	<script src="../plugins/datatables/jquery.dataTables.min.js"></script>
	<script src="../plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
	<script src="../plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
	<script src="../plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
	<script src="../plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
	<script src="../plugins/datatables-buttons/js/buttons.bootstrap4.min.js"></script>
	<script src="../plugins/jszip/jszip.min.js"></script>
	<script src="../plugins/pdfmake/pdfmake.min.js"></script>
	<script src="../plugins/pdfmake/vfs_fonts.js"></script>
	<script src="../plugins/datatables-buttons/js/buttons.html5.min.js"></script>
	<script src="../plugins/datatables-buttons/js/buttons.print.min.js"></script>
	<script src="../plugins/datatables-buttons/js/buttons.colVis.min.js"></script>
	<!-- AdminLTE App -->
	<script src="../dist/js/adminlte.min.js"></script>
	<!-- AdminLTE for demo purposes -->
	<script src="../dist/js/demo.js"></script>
	<!-- /.content-wrapper -->
	<script>
	    $(function () {

	        $('#ctl00_ContentPlaceHolder1_GridView1').DataTable({
	            "responsive": true, "lengthChange": false, "autoWidth": false,
	            "buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
	        }).buttons().container().appendTo('#example1_wrapper .col-md-6:eq(0)');
	    });
 
</script>
    
  <!-- /.content-wrapper -->
  
</asp:Content>

