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

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
	<!-- DataTables -->
	<link rel="stylesheet" href="../plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
	<link rel="stylesheet" href="../plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
	<link rel="stylesheet" href="../plugins/datatables-buttons/css/buttons.bootstrap4.min.css">

    <style type="text/css">
        .header-center {
            text-align: center;
        }
    </style>

    <script language="javascript" type="text/javascript">

        <%--function validate() {
            var message = "";
            if (document.getElementById("<%=DatePicker1.TextBoxClientID%>").value == "") {
                message += "You have to at enter the transaction date\n";
            }
            if (message.length > 0) {
                message = "please notice the following requirments:\n\n" + message;
                alert(message);
                return false;
            }
            return true;
        }--%>
    </script>

</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) -->
        <section class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1>ATM Cash Reconciliation Summary</h1>
                    </div>
                    <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">Reconciliation</li>
                            <li class="breadcrumb-item active">ATM Cash Reconciliation Summary</li>
                        </ol>
                    </div>
                </div>
            </div>
            <!-- /.container-fluid -->
        </section>
        <!-- /.content-header -->
        <!-- Main content -->
        <section class="content">
            <div class="container-fluid">
                <div class="card card-warning">
                    <%--<div class="card-header">
                <h3 class="card-title">Search Filters</h3>
              </div>--%>
                    <!-- /.card-header -->
                    <div class="card-body">
                        <div class="row">
                            <%--<div class="col-sm-12">--%>
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <label>Replenishment Date</label>
                                    <div class="input-group date" id="sreplenishmentdate" data-target-input="nearest">
                                        <asp:TextBox ID="txtsrepldate" data-target="#sreplenishmentdate" runat="server" class="form-control datetimepicker-input"></asp:TextBox>
                                        <div class="input-group-append" data-target="#sreplenishmentdate" data-toggle="datetimepicker">
                                            <div class="input-group-text"><i class="fa fa-calendar"></i></div>
                                        </div>
                                        <asp:TextBox ID="picksrepldate" runat="server" Visible="false" class="form-control"></asp:TextBox>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <label>Record Type</label>
                                <div class="form-group">
                                    <asp:DropDownList ID="ddlRecordType" runat="server" class="form-control select" AutoPostBack="True" OnSelectedIndexChanged="ddlRecordType_SelectedIndexChanged">
                                        <asp:ListItem Value="0">All</asp:ListItem>
                                        <asp:ListItem Value="009">Withdrawal</asp:ListItem>
                                        <asp:ListItem Value="030">Deposit</asp:ListItem>
                                        <asp:ListItem Value="039">Recycle</asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-sm-12" style="text-align: center">
                                <asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="btn btn-primary btn-l" OnClick="btnSearch_Click" OnClientClick="return validate()" />
                            </div>
                            <%--</div>--%>
                        </div>
                        <!-- /.card-body -->
                    </div>
                </div>
                <!-- Default box -->
                <div id="pnlATMSummary" class="card card-info color-palette-box" runat="server" visible="false">
                    <div class="card-header">
                        <h3 class="card-title">
                            <i class="fas fa-tag"></i>
                            <!-- Search Results -->
                            ATM Summary
                        </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 class="card-body">
                        <table border="0" width="100%" cellpadding="0" cellspacing="0" class="add_ItemTB">
                            <tr>
                                <td class="tdNormal">
                                    <asp:GridView ID="GridView1" class="table table-striped table-bordered" runat="server" AutoGenerateColumns="False"
                                        DataKeyNames="record_status" OnRowCommand="GridView1_RowCommand" EmptyDataText="There are no results">
                                        <Columns>
                                            <asp:BoundField DataField="record_status_display" HeaderText="Reconciliation&nbsp;Status&nbsp;(EJ&nbsp;v/s&nbsp;Switch)" HeaderStyle-CssClass="header-center" />
                                            <asp:BoundField DataField="atm_count" HeaderText="ATM&nbsp;Count" HeaderStyle-CssClass="header-center" />
                                            <asp:TemplateField HeaderText="Actions" Visible="true" HeaderStyle-CssClass="header-center">
                                                <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="btn_view" CssClass="btn-outline-info btn-block btn-sm" runat="server" Text="View" CommandName="v" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" /></a>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                        </Columns>
                                    </asp:GridView>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" style="padding-top: 1%; padding-bottom: 1%;"></td>
                            </tr>
                            <tr>
                                <td class="tdNormal">
                                    <asp:GridView ID="GridView3" class="table table-striped table-bordered" runat="server" AutoGenerateColumns="False"
                                        DataKeyNames="recon_status" OnRowCommand="GridView3_RowCommand" EmptyDataText="There are no results">
                                        <Columns>
                                            <asp:BoundField DataField="recon_status_display" HeaderText="Reconciliation&nbsp;Status&nbsp;(GL&nbsp;v/s&nbsp;Switch)" HeaderStyle-CssClass="header-center" />
                                            <asp:BoundField DataField="atm_count" HeaderText="ATM&nbsp;Count" HeaderStyle-CssClass="header-center" />
                                            <asp:TemplateField HeaderText="Actions" Visible="true" HeaderStyle-CssClass="header-center">
                                                <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="btn_view" CssClass="btn-outline-info btn-block btn-sm" runat="server" Text="View" CommandName="v" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" /></a>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                    </asp:GridView>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" style="padding-top: 1%; padding-bottom: 1%;"></td>
                            </tr>
                            <tr>
                                <td class="tdNormal">
                                    <asp:GridView ID="gvGL" class="table table-striped table-bordered" runat="server" AutoGenerateColumns="False"
                                        DataKeyNames="row_id" OnRowCommand="gvGL_RowCommand" OnSelectedIndexChanged="gvGL_SelectedIndexChanged" EmptyDataText="There are no results">
                                        <Columns>
                                            <asp:BoundField DataField="record_status_display" HeaderText="Status" HeaderStyle-CssClass="header-center" />
                                            <asp:BoundField DataField="atm_count" HeaderText="ATM&nbsp;Count" HeaderStyle-CssClass="header-center" />
                                            <asp:TemplateField HeaderText="Actions" Visible="true" HeaderStyle-CssClass="header-center">
                                                <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="btn_view" CssClass="btn-outline-info btn-block btn-sm" runat="server" Text="View" CommandName="v" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" /></a>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                    </asp:GridView>
                                </td>
                            </tr>
                        </table>
                        <%--<div class="row">
                    Go To Page&nbsp;: &nbsp;<asp:DropDownList ID="ddlPages" runat="server" class="form-control select2" AutoPostBack="True" Width="100px" Height="30px" OnSelectedIndexChanged="ddlPages_SelectedIndexChanged"></asp:DropDownList>
                </div>--%>
                    </div>

                    <!-- /.card-body -->
                </div>


                <!-- /.card -->
                <div class="row">
                    <div class="modal fade" id="pnlBR-modal-xl">

                        <div class="modal-dialog modal-xl" style="max-width: max-content;">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h4 class="modal-title">
                                        <asp:Label ID="lblATMList" runat="server"></asp:Label></h4>
                                    <h4 class="modal-title"></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" style="min-height: 100px; width: 100%; display: inline-block; vertical-align: top; overflow-x: auto;">
                                        <asp:GridView ID="GridView2" class="table table-striped table-bordered" runat="server" AutoGenerateColumns="False" OnRowCommand="GridView2_RowCommand" OnRowCreated="GridView2_RowCreated" DataKeyNames="atm_number" EmptyDataText="There are no results">
                                            <Columns>
                                                <asp:BoundField DataField="branch_code" HeaderText="Branch&nbsp;Code" HeaderStyle-CssClass="header-center" />
                                                <asp:BoundField DataField="atm_number" HeaderText="ATM&nbsp;No" HeaderStyle-CssClass="header-center" />
                                                <asp:BoundField DataField="record_type" HeaderText="Record&nbsp;Type" HeaderStyle-CssClass="header-center" />
                                                <asp:BoundField DataField="prev_replenishment_date" HeaderText="Prev&nbsp;Rep&nbsp;Date" HeaderStyle-CssClass="header-center" />
                                                <asp:BoundField DataField="prev_replenishment_time" HeaderText="Prev&nbsp;Rep&nbsp;Time" HeaderStyle-CssClass="header-center" />
                                                <asp:BoundField DataField="replenishment_date" HeaderText="Repl&nbsp;Date" HeaderStyle-CssClass="header-center" />
                                                <asp:BoundField DataField="replenishment_time" HeaderText="Repl&nbsp;Time" HeaderStyle-CssClass="header-center" />
                                                <asp:BoundField DataField="diff_amt" HeaderText="Diff&nbsp;Amount" HeaderStyle-CssClass="header-center" />
                                                <asp:BoundField DataField="opening_balance" HeaderText="Opening&nbsp;Balance" HeaderStyle-CssClass="header-center" />
                                                <asp:BoundField DataField="closing_balance" HeaderText="Closing&nbsp;Balance" HeaderStyle-CssClass="header-center" />
                                                <asp:BoundField DataField="status" HeaderText="Status" HeaderStyle-CssClass="header-center" />
                                                <asp:BoundField DataField="repl_curr" HeaderText="Repl&nbsp;Curr" HeaderStyle-CssClass="header-center" />
                                                <asp:ButtonField ButtonType="Link" CommandName="v" Text="Details" ControlStyle-CssClass="btn btn-outline-info btn-block btn-sm" />
                                            </Columns>
                                        </asp:GridView>
                                    </div>
                                    <div class="row" style="margin-left: 1%; margin-top: 1%; margin-bottom: 1%">
                                        <div style="margin-top: 3px;">
                                            <asp:Label ID="lblValToAcct_3" runat="server" Text="Go To Page"></asp:Label>&nbsp;: &nbsp;
                                        </div>
                                        <asp:DropDownList ID="ddlPages" runat="server" class="form-control select2" AutoPostBack="True" Width="7%" Height="6%" OnSelectedIndexChanged="ddlPages_SelectedIndexChanged"></asp:DropDownList>
                                    </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>

                            </div>
                            <!-- /.modal-content -->
                        </div>
                        <!-- /.modal-dialog -->

                    </div>

                    <!-- /.modal -->
                </div>
            </div>
            <!-- /.container-fluid -->
        </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>
    <script src="../plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
	<!-- AdminLTE App -->
	<script src="../dist/js/adminlte.min.js"></script>
	<!-- AdminLTE for demo purposes -->
	<script src="../dist/js/demo.js"></script>
    <script src="../plugins/select2/js/select2.full.min.js"></script>
    <!-- Bootstrap4 Duallistbox -->
    <script src="../plugins/bootstrap4-duallistbox/jquery.bootstrap-duallistbox.min.js"></script>
    <!-- InputMask -->
    <script src="../plugins/moment/moment.min.js"></script>
    <script src="../plugins/inputmask/jquery.inputmask.min.js"></script>
    <!-- date-range-picker -->
    <script src="../plugins/daterangepicker/daterangepicker.js"></script>
    <!-- bootstrap color picker -->
    <script src="../plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js"></script>
    <!-- Tempusdominus Bootstrap 4 -->
    <script src="../plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
    <!-- Bootstrap Switch -->
    <script src="../plugins/bootstrap-switch/js/bootstrap-switch.min.js"></script>
    <!-- BS-Stepper -->
    <script src="../plugins/bs-stepper/js/bs-stepper.min.js"></script>
    <!-- dropzonejs -->
    <script src="../plugins/dropzone/min/dropzone.min.js"></script>
    <!-- AdminLTE App -->
	<script>

	    $(function () {

	        $('#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)');

	        //Date picker
	        $('#reservationdate').daterangepicker();
//	        $('#ctl00_ContentPlaceHolder1_reservation').daterangepicker()({
//	            format: 'DD/MM/YYYY - DD/MM/YYYY'
//	        });
	        $('#ctl00_ContentPlaceHolder1_txtDate').daterangepicker({
	            locale: {
                    format: 'DD-MM-YYYY'
	            }
            })

            $('#prev_replenishmentdate').datetimepicker({
                //format: 'L'
                format: 'DD-MM-YYYY'
            });

            $('#replenishmentdate').datetimepicker({
                //format: 'L'
                format: 'DD-MM-YYYY'
                //format: 'YYMMDD'
            });

            $('#aprevrepldate').datetimepicker({
                //format: 'L'
                format: 'DD-MM-YYYY'
            });

            $('#arepldate').datetimepicker({
                //format: 'L'
                format: 'DD-MM-YYYY'
            });

            $('#adateB24PrevDate').datetimepicker({
                //format: 'L'
                format: 'DD-MM-YYYY'
            });

            $('#adateB24Date').datetimepicker({
                //format: 'L'
                format: 'DD-MM-YYYY'
            });

            $('#dtReplDate').datetimepicker({
                //format: 'L'
                format: 'DD-MM-YYYY'
            });

            $('#sreplenishmentdate').datetimepicker({
                //format: 'L'
                format: 'DD-MM-YYYY'
            });

            $('#areplenishmentdate').datetimepicker({
                //format: 'L'
                format: 'DD-MM-YYYY'
            });
	        
	        //		    $('#reservationdate').datetimepicker({
	        //		        format: 'DD/MM/YYYY'
	        //		    });

	        //        $('#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)');

	        //        $('#ContentPlaceHolder1_gvChannel').DataTable({
	        //            "responsive": true, "lengthChange": false, "autoWidth": false,
	        //            "buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
	        //        }).buttons().container().appendTo('#example1_wrapper .col-md-6:eq(0)');

	        //        $('#ContentPlaceHolder1_gvEJ').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>
</asp:Content>