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

<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">
</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>Approve ATM Claims</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">Claims</li>
			  <li class="breadcrumb-item active">Approve ATM Claims</li>
			</ol>
		  </div>
		</div>
	  </div><!-- /.container-fluid -->
	</section>

		<!-- /.content-header -->
		<!-- Main content -->
        <section class="content">
            <div class="container-fluid">
                <div class="card card-warning">
                    <!-- /.card-header -->
                    <div class="card-body">
                        <div class="row">
                            <div class="col-sm-4" style="display: none">
                                <label>Claim Type</label>
                                <div class="form-group">
                                    <div class="form-group">
                                        <asp:RadioButton ID="rdATM" AutoPostBack="true" Text="ATM" GroupName="1" runat="server" Checked="true"
                                            OnCheckedChanged="rdATM_CheckedChanged" />
                                        <asp:RadioButton ID="rdPOS" AutoPostBack="true" Text="POS" GroupName="1" runat="server"
                                            OnCheckedChanged="rdPOS_CheckedChanged" />
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-4">
                                <label>Claim ID <span style="color: Red">*</span></label>
                                <div class="form-group">
                                    <asp:TextBox ID="txtClaimID" runat="server" class="form-control"></asp:TextBox>
                                </div>
                            </div>
                            <div class="col-sm-4">
                                <label>SAMA Claim ID <span style="color: Red">*</span></label>
                                <div class="form-group">
                                    <asp:TextBox ID="txtOrgClaimID" runat="server" class="form-control"></asp:TextBox>
                                </div>
                            </div>
                            <div id="RefNo" class="col-sm-4" runat="server">
                                <label>Reference Number</label>
                                <div class="form-group">
                                    <asp:TextBox ID="txtReference" runat="server" class="form-control"></asp:TextBox>
                                </div>
                            </div>
                            <div id="CardNo" class="col-sm-4" runat="server">
                                <label>Card Number <span style="color: Red">*</span></label>
                                <div class="form-group">
                                    <asp:TextBox ID="txtCardNumber" runat="server" class="form-control"></asp:TextBox>
                                </div>
                            </div>
                            <div id="ATMNo" class="col-sm-4" runat="server">
                                <label>ATM No <span style="color: Red">*</span></label>
                                <div class="form-group">
                                    <asp:TextBox ID="txtATMNo" runat="server" class="form-control"></asp:TextBox>
                                </div>
                            </div>
                            <div id="CEType" class="col-sm-2" runat="server">
                                <label>Claim Event Type</label>
                                <div class="form-group">
                                    <asp:RadioButton ID="rdClaimOnUS" Text="On-Us" GroupName="rd" runat="server" AutoPostBack="False" Checked="True" />&nbsp;&nbsp;
                                    <asp:RadioButton ID="rdClaimOffUs" Text="Off-Us " GroupName="rd" runat="server" AutoPostBack="False" />
                                </div>
                            </div>
                            <div class="col-sm-2">
                                <label>Search Type</label>
                                <div class="form-group">
                                    <asp:RadioButton ID="rdOnUs" runat="server" GroupName="aa" Text="On Us" Checked="True" Enabled="False" />&nbsp;&nbsp;
                                    <asp:RadioButton ID="rdOther" runat="server" GroupName="aa" Text="Others" Enabled="False" />
                                </div>
                            </div>
                            <div id="ClientNo" class="col-sm-4" runat="server">
                                <label>Client Number</label>
                                <div class="form-group">
                                    <asp:TextBox ID="txtClientNo" runat="server" class="form-control"></asp:TextBox>
                                </div>
                            </div>
                            <div id="TerminalID" class="col-sm-4" runat="server">
                                <label>Terminal ID</label>
                                <div class="form-group">
                                    <asp:TextBox ID="txtTermID" runat="server" class="form-control"></asp:TextBox>
                                </div>
                            </div>
                            <div id="RetailerID" class="col-sm-4" runat="server">
                                <label>Retailer ID</label>
                                <div class="form-group">
                                    <asp:TextBox ID="txtRetailerID" runat="server" class="form-control"></asp:TextBox>
                                </div>
                            </div>
                            <div id="CardPOSNo" class="col-sm-4" runat="server">
                                <label>Card Number</label>
                                <div class="form-group">
                                    <asp:TextBox ID="txtCardPOS" runat="server" class="form-control"></asp:TextBox>
                                </div>
                            </div>
                            <div id="RBSType" class="col-sm-4" runat="server">
                                <label>Search Type</label>
                                <div class="form-group">
                                    <asp:RadioButton ID="rdCH" runat="server" GroupName="aaa" Text="Card Holder" Checked="True" />
                                    <asp:RadioButton ID="rdMER" runat="server" GroupName="aaa" Text="Merchant" />
                                </div>
                            </div>
                            <div class="col-sm-4">
                                <label>Claim Status</label>
                                <div class="form-group">
                                    <asp:DropDownList ID="ddlClaimType" runat="server" class="form-control select" AutoPostBack="True"
                                        DataTextField="CLAIM_STATUS_DESC" DataValueField="CL_CODE" OnSelectedIndexChanged="ddlClaimType_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-sm-4">
                                <label>SAMA Status</label>
                                <div class="form-group">
                                    <asp:DropDownList ID="ddlSamaStatuses" runat="server" class="form-control select" AutoPostBack="False" Enabled="False"
                                        DataTextField="status_desc" DataValueField="status_code" OnSelectedIndexChanged="ddlClaimType_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-sm-4">
                                <label>Claim Type</label>
                                <div class="form-group">
                                    <asp:DropDownList ID="ddlClaimType2" runat="server" class="form-control select"
                                        DataTextField="CLAIM_TYPE" DataValueField="CT_CODE" OnSelectedIndexChanged="ddlClaimType_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </div>
                            </div>
                            
                            <div class="col-sm-4">
                                <div class="form-group">
                                    <label>Claim From Date</label>
                                    <div class="input-group date" id="cfdate" data-target-input="nearest">
                                        <asp:TextBox ID="txtcfdate" data-target="#cfdate" runat="server" class="form-control datetimepicker-input"></asp:TextBox>
                                        <div class="input-group-append" data-target="#cfdate" data-toggle="datetimepicker">
                                            <div class="input-group-text"><i class="fa fa-calendar"></i></div>
                                        </div>
                                        <asp:TextBox ID="pickcfdate" runat="server" Visible="false" class="form-control"></asp:TextBox>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-4">
                                <div class="form-group">
                                    <label>Claim To Date</label>
                                    <div class="input-group date" id="ctdate" data-target-input="nearest">
                                        <asp:TextBox ID="txtctdate" data-target="#ctdate" runat="server" class="form-control datetimepicker-input"></asp:TextBox>
                                        <div class="input-group-append" data-target="#ctdate" data-toggle="datetimepicker">
                                            <div class="input-group-text"><i class="fa fa-calendar"></i></div>
                                        </div>
                                        <asp:TextBox ID="pickctdate" runat="server" Visible="false" class="form-control"></asp:TextBox>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-4">
                                <label>Event</label>
                                <div class="form-group">
                                    <asp:DropDownList ID="ddlEvents" runat="server" class="form-control select" AutoPostBack="True" Enabled="False"
                                        DataTextField="evant_name" DataValueField="re_code" OnSelectedIndexChanged="ddlEvents_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-sm-4">
                                <label>ATM Type</label>
                                <div class="form-group">
                                    <asp:DropDownList ID="ddlATM_Type" runat="server" class="form-control select" OnSelectedIndexChanged="ddlATM_Type_SelectedIndexChanged">
                                        <asp:ListItem Value="0">------ All ------</asp:ListItem>
                                        <asp:ListItem Value="1">Deposit</asp:ListItem>
                                        <asp:ListItem Value="4">Withdrawal</asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-sm-4">
                                <div class="form-group">
                                    <label>SAMA From Date</label>
                                    <div class="input-group date" id="sfdate" data-target-input="nearest">
                                        <asp:TextBox ID="txtsfdate" data-target="#sfdate" runat="server" class="form-control datetimepicker-input"></asp:TextBox>
                                        <div class="input-group-append" data-target="#sfdate" data-toggle="datetimepicker">
                                            <div class="input-group-text"><i class="fa fa-calendar"></i></div>
                                        </div>
                                        <asp:TextBox ID="picksfdate" runat="server" Visible="false" class="form-control"></asp:TextBox>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-4">
                                <div class="form-group">
                                    <label>SAMA to Date</label>
                                    <div class="input-group date" id="stdate" data-target-input="nearest">
                                        <asp:TextBox ID="txtstdate" data-target="#stdate" runat="server" class="form-control datetimepicker-input"></asp:TextBox>
                                        <div class="input-group-append" data-target="#stdate" data-toggle="datetimepicker">
                                            <div class="input-group-text"><i class="fa fa-calendar"></i></div>
                                        </div>
                                        <asp:TextBox ID="pickstdate" runat="server" Visible="false" class="form-control"></asp:TextBox>
                                    </div>
                                </div>
                            </div>
                            <div class="col-12" style="text-align: center">
                                <asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="btn btn-primary btn-l" OnClick="btnSearch_Click" />
                            </div>
                        </div>
                        <!-- /.card-body -->
                        <section id="pnlResult" style="margin-top: 2%;" visible="false" runat="server">
                            <div style="min-height: 100px; width: 100%; display: inline-block; vertical-align: top; overflow-x: auto;">
                                <asp:GridView ID="GridView1" class="table table-striped table-bordered table-sm" runat="server" AutoGenerateColumns="False"
                                    DataKeyNames="claim_id" OnRowCommand="GridView1_RowCommand" OnRowCreated="GridView1_RowCreated" EmptyDataText="There are no results">
                                    <Columns>
                                        <asp:BoundField DataField="claim_id" HeaderText="Claim&nbsp;ID" />
                                        <asp:BoundField DataField="card_number" HeaderText="Card&nbsp;No" />
                                        <asp:BoundField DataField="tran_date" HeaderText="Tran&nbsp;Date" />
                                        <asp:BoundField DataField="tran_amount" HeaderText="Tran&nbsp;Amount" />
                                        <asp:BoundField DataField="rrn" HeaderText="Reference&nbsp;No" />
                                        <asp:BoundField DataField="claim_status_desc" HeaderText="Status" />
                                        <asp:BoundField DataField="sama_claim_status" HeaderText="SAMA&nbsp;Status" />
                                        <asp:BoundField DataField="sama_claim_id" HeaderText="SAMA&nbsp;Claim&nbsp;Id" />
                                        <asp:BoundField DataField="product" HeaderText="Product" />
                                        <asp:BoundField DataField="claim_amount" HeaderText="Claim&nbsp;Amount" />
                                        <asp:BoundField DataField="claim_status" HeaderText="Claim&nbsp;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="#">
                                                        <asp:Button ID="Button6" CssClass="btn btn-outline-danger btn-block btn-sm" runat="server" Text="Reject" CommandName="d" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" /></a>
                                                    <a class="dropdown-item" href="#">
                                                        <asp:Button ID="Button1" CssClass="btn btn-outline-warning btn-block btn-sm" runat="server" Text="Reset" CommandName="r" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" /></a>
                                                    <a class="dropdown-item" href="#">
                                                        <asp:Button ID="delete" CssClass="btn btn-outline-info btn-block btn-sm" runat="server" Text="Investigate" CommandName="i" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" /></a>
                                                </div>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                                <div class="row" style="margin-left: 1%; margin-top: 1%; margin-bottom: 1%">
                                    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>
                        </section>
                    </div>
                </div>

                <!-- pnlApprove -->
                <div class="row">
                    <div class="modal fade" id="pnlApprove-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">Approve Details</h4>
                                    <asp:Label ID="lblpnlControls" runat="server" Visible="false"></asp:Label>
                                    <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="row card-body">
                                        <div class="col-sm-3">
                                            <label>Suggested Amount</label>
                                            <div class="form-group">
                                                <asp:TextBox ID="txtSugAmt" Enabled="false" runat="server" class="form-control"></asp:TextBox>
                                            </div>
                                        </div>
                                        <div class="col-sm-3">
                                            <label>Transaction Time</label>
                                            <div class="form-group">
                                                <asp:DropDownList ID="ddlGLtype" Enabled="false" Visible="false" runat="server" class="form-control select">
                                                    <asp:ListItem Value="1">Dr</asp:ListItem>
                                                    <asp:ListItem Value="2">Cr</asp:ListItem>
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                        <div class="col-sm-3">
                                            <label>From (Dr)</label>
                                            <div class="form-group">
                                                <asp:DropDownList ID="ddlFromAcct" Enabled="false" runat="server" class="form-control select"
                                                    DataTextField="acct_desc" DataValueField="acct">
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                        <div class="col-sm-3">
                                            <label>To (Cr)</label>
                                            <div class="form-group">
                                                <asp:DropDownList ID="ddlToAcct" Enabled="false" runat="server" class="form-control select"
                                                    DataTextField="acct_desc" DataValueField="acct">
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer justify-content-between">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                                    <asp:Button ID="btnSavePost" runat="server" Text="Save" class="btn btn-primary btn-l" OnClick="btnSavePost_Click" />
                                </div>
                            </div>
                            <!-- /.modal-content -->
                        </div>
                        <!-- /.modal-dialog -->
                    </div>
                    <!-- /.modal -->
                </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>
             <!-- /.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
            $('#reservationdate22').daterangepicker();

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

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

            $('#ctdate').datetimepicker({
                //format: 'L'
                format: 'DD-MM-YYYY'
            });
            $('#sfdate').datetimepicker({
                //format: 'L'
                format: 'DD-MM-YYYY'
            });
            $('#stdate').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>

