<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Masters/AgentMaster.Master"
    CodeBehind="AgentTransReport.aspx.cs" Inherits="CasheeremitAgent.Remittance.AgentTransReport" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cpHead" runat="server">
    <%--<script type="text/javascript" src="../Scripts/js/bootstrap-datepicker.js"></script>--%>
    <%--<script src="../Scripts/js/jquery-ui-1.8.4.custom.min.js" type="text/javascript"></script>--%>
    <script type="text/javascript" src="../Scripts/js/bootstrap-datepicker.js"></script>
    <link href="../Styles/css/datepicker.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/css/datepicker3.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .ui-datepicker-month
        {
            color: #FF4500;
        }
        
        .ui-datepicker-year
        {
            color: #FF4500;
        }
    </style>
    <script type="text/javascript">

        $(function frmDate() {
            $('#<%= txtfromdate.ClientID  %>').datepicker({
                format: 'dd/mm/yyyy',
                todayHighlight: true,
                endDate: '-1d',
                autoclose: true
            });
        });

        $(function toDate() {
            $('#<%= txttodate.ClientID  %>').datepicker({
                format: 'dd/mm/yyyy',
                todayHighlight: true,
                endDate: '0d',
                autoclose: true
            });
        });

        function DatePicker() {

            $('#<%= txtfromdate.ClientID %>').datepicker({
                inline: true,
                dateFormat: 'dd/mm/yyyy',
                showOn: "button",
                buttonImage: "../Styles/images/date.jpg",
                buttonImageOnly: true,
                changeMonth: true,
                changeYear: true,
                yearRange: '-100y:c+nn',
                maxDate: '-1d'
            });
        }

        function DatePicker1() {

            $('#<%= txttodate.ClientID %>').datepicker({
                inline: true,
                dateFormat: 'dd/mm/yyyy',
                showOn: "button",
                buttonImage: "../Styles/images/date.jpg",
                buttonImageOnly: true,
                changeMonth: true,
                changeYear: true,
                yearRange: '-100y:c+nn',
                maxDate: '0d'
            });
        }


        window.document.title = "Agent Transaction Report";
    
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpLyremit" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class=" col-md-12">
        <script type="text/javascript">
//            window.onload = GetSession;

//            function GetSession() {
//                if (sessionStorage.getItem('name') == null) {
//                    alert("You have tried to open a new tab");
//                    window.location.href = "../Account/Login.aspx";
//                }
//            } 
        </script>
        <div class="clearfix">
            &nbsp;</div>
        <div class="bluHD col-md-12">
            AGENT TRANSACTIONS</div>
        <div class="col-md-12 vinobox">
            <div class="blueHeadTxt">
                AGENT TRANSACTIONS LIST
            </div>
            <div class="col-md-6 ">
                <div class="row mrgBot10">
                    <div class="col-md-5">
                        <asp:Label ID="lblAgtName" runat="server" Text="Agent Name"></asp:Label>
                          <span class="text-danger f-s-10 starRed">&lowast;</span>
                    </div>
                    <div class=" col-md-6">
                        <asp:DropDownList ID="ddlAgent" DataValueField="Agent_ID" DataTextField="Agent_Name"
                            runat="server" CssClass="txtboxM">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="req" runat="server" ErrorMessage="Please select Agent Name"
                            ValidationGroup="search" ControlToValidate="ddlAgent" class="errMsg" Display="Dynamic"
                            InitialValue="0"></asp:RequiredFieldValidator>
                    </div>
                </div>
                <div class="row mrgBot10">
                    <div class="col-md-5">
                        <asp:Label ID="lblTransID" runat="server" Text="Choose Transaction Status"></asp:Label>
                    </div>
                    <div class=" col-md-6">
                        <asp:DropDownList ID="ddlStatus" AutoPostBack="true" OnSelectedIndexChanged="ddlStatuschanged"
                            runat="server" CssClass="txtboxM">
                            <asp:ListItem Selected="True" Text="Select" Value="0"></asp:ListItem>
                            <asp:ListItem Text="Success" Value="SUCCESS"></asp:ListItem>
                            <asp:ListItem Text="Failed" Value="FAILED"></asp:ListItem>
                            <asp:ListItem Text="Refunded" Value="REFUNDED"></asp:ListItem>
                            <asp:ListItem Text="Transaction Under Process" Value="TRAN_UNDER_PROCESS"></asp:ListItem>
                        </asp:DropDownList>
                    </div>
                </div>
            </div>
            <div class="col-md-6 ">
                <div class="row mrgBot10">
                    <div class="col-md-3">
                        <asp:Label ID="lblfromdate" runat="server" Text="From Date"></asp:Label>
                        <%--<span class="text-danger f-s-10 starRed">&lowast;</span>--%>
                    </div>
                    <div class=" col-md-7">
                        <input id="txtfromdate" style="width: 92%;" runat="server" type="text" class="txtboxM"
                            data-provide="datepicker" readonly="readonly" />
                        <asp:RegularExpressionValidator ID="reexpdate" runat="server" ValidationGroup="search"
                            ForeColor="Red" ControlToValidate="txtfromdate" Display="Dynamic" class="errMsg starRed"
                            ErrorMessage="Enter Valid From date" ValidationExpression="^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d$"></asp:RegularExpressionValidator>
                    </div>
                </div>
                <div class="row mrgBot10">
                    <div class="col-md-3">
                        <asp:Label ID="lbltodate" runat="server" Text="To Date"></asp:Label>
                        <%--<span class="text-danger f-s-10 starRed">&lowast;</span>--%>
                    </div>
                    <div class=" col-md-7">
                        <input id="txttodate" style="width: 92%;" runat="server" type="text" class="txtboxM"
                            data-provide="datepicker" readonly="readonly" />
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ValidationGroup="search"
                            ForeColor="Red" ControlToValidate="txttodate" Display="Dynamic" class="errMsg starRed"
                            ErrorMessage="Enter Valid To date" ValidationExpression="^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d$"></asp:RegularExpressionValidator>
                    </div>
                </div>
            </div>
            <div class="col-md-6 ">
                <div class="row mrgBot10">
                    <div class="col-md-5">
                        <asp:Label ID="lblremid" runat="server" Text="Remitter ID"></asp:Label>
                    </div>
                    <div class=" col-md-6">
                        <asp:TextBox ID="txtremID" class="txtboxM" runat="server"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="regremID" runat="server" ValidationGroup="search"
                            ControlToValidate="txtremid" Display="Dynamic" class="errMsg" ErrorMessage="Please enter a valid RemitterID"
                            ValidationExpression="^([a-zA-Z0-9]{5,50})$"></asp:RegularExpressionValidator>
                    </div>
                </div>
                <div class="clearfix">
                    &nbsp;
                </div>
            </div>
            <div class="col-md-12">
                <div class="col-md-2">
                    <asp:Button ID="btnSearch" runat="server" Text="Search" class="btnB" OnClick="btnSearch_click"
                        ValidationGroup="search" /></div>
                <div class="col-md-2">
                    <asp:Button ID="btnclear" runat="server" Text="Clear" class="btnG" OnClick="btnClear_click" /></div>
            </div>
        </div>
        <div class="clearfix margT10">
            &nbsp;</div>
        <div style="padding: 10px;" class=" table-responsive overflowMob">
            <asp:GridView ID="gvTransList" Style="width: 60%; margin-left: 1%;" runat="server"
                class="table m-t-15" AutoGenerateColumns="False" DataKeyNames="Tran_Date,Tran_ID,Remitter_ID,Beneficiary Name,Transaction Source Amt,Source Currency,Transaction Status,Tran_Amt"
                OnRowCommand="gvTransList_RowCommand" OnPageIndexChanging="gvTransList_PageIndexChanging"
                GridLines="None" CellPadding="6" CellSpacing="2" OnRowDataBound="gvTransList_RowDataBound"
                AllowPaging="True" EmptyDataText="No Transactions Found" HeaderStyle-CssClass="tbl-head"
                RowStyle-CssClass="tbl-data">
                <RowStyle HorizontalAlign="Left" />
                <Columns>
                    <asp:BoundField DataField="Tran_Date" HeaderText="Date" HeaderStyle-CssClass="wp25" />
                    <asp:BoundField DataField="Tran_ID" HeaderText="Transaction ID" HeaderStyle-CssClass="wp25" />
                    <asp:BoundField DataField="Child_Agent_ID" HeaderText="Agent_ID" HeaderStyle-CssClass="wp25" />
                    <asp:BoundField DataField="UserName" HeaderText="UserName" HeaderStyle-CssClass="wp25" />
                    <asp:BoundField DataField="Remitter_ID" HeaderText="Remitter ID" HeaderStyle-CssClass="wp25" />
                    <%--<asp:BoundField DataField="Source Currency" HeaderText="Currency" HeaderStyle-CssClass="wp25" />--%>
                    <%--<asp:BoundField DataField="Transaction Source Amt" HeaderText="Amount" HeaderStyle-CssClass="wp25" />--%>
                    <asp:BoundField DataField="Tran_Amt" HeaderText="Total Amount in £" HeaderStyle-CssClass="wp25" />
                    <asp:BoundField DataField="Destination_Country" HeaderText="To Country" HeaderStyle-CssClass="wp25" />
                    <asp:BoundField DataField="Beneficiary Name" HeaderText="Beneficiary Name" HeaderStyle-CssClass="wp25" />
                    <asp:BoundField DataField="Destination_Currency" HeaderText="Receiver Currency" HeaderStyle-CssClass="wp25" />
                    <asp:BoundField DataField="Receiver_Amount" HeaderText="Receiver Amount" HeaderStyle-CssClass="wp25" />
                    <asp:BoundField DataField="Transaction Status" HeaderText="Status" HeaderStyle-CssClass="wp25" />
                    <asp:ButtonField ButtonType="Link" Text="Print" HeaderText="Print Details" CommandName="details" />
                </Columns>
                <PagerStyle BackColor="White" ForeColor="White" Width="200px" HorizontalAlign="Center"
                    CssClass="pgg" />
            </asp:GridView>
        </div>
    </div>
</asp:Content>
