<%@ page language="C#" autoeventwireup="true" inherits="Business_T24Setttl, App_Web_ilbxgk41" viewStateEncryptionMode="Always" maintainScrollPositionOnPostBack="true" %>

<%@ Register Src="../UserControls/BMenu.ascx" TagName="Menu" TagPrefix="uc1" %>
<%@ Register Src="../UserControls/logout.ascx" TagName="Logout" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link href="../css/Menu.css" rel="stylesheet" type="text/css">
    <link href="../css/Buttons.css" rel="stylesheet" type="text/css">
    <link href="../css/commone.css" rel="stylesheet" type="text/css">
    <link href="../css/footer.css" rel="stylesheet" type="text/css">
    <link href="../css/nav.css" rel="stylesheet" type="text/css">
    <link href="../css/tab.css" rel="stylesheet" type="text/css">
    <link href="../Scripts/jquery-ui-themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
    <!-- jTable style file -->
    <link href="../Scripts/jtable.2.4.0/themes/metro/lightgray/jtable.css" rel="stylesheet"
        type="text/css" />
    <%-- <script src='<%= this.ResolveClientUrl("~/Scripts/modernizr-2.6.2.js")%>' type="text/javascript"></script>
    --%>
    <!--JS jQuery 1.9.0 -->
    <script src='<%= this.ResolveClientUrl("~/Scripts/jquery-1.9.0.js")%>' type="text/javascript"></script>
    <!--JS jQuery UI 1.9.0 -->
    <script src='<%= this.ResolveClientUrl("~/Scripts/jquery-ui-1.9.2.js")%>' type="text/javascript"></script>
    <!--JS jTable -->
    <%--  <script src='<%= this.ResolveClientUrl("~/Scripts/jtablesite.js")%>' type="text/javascript"></script>
    --%>
    <!-- A helper library for JSON serialization -->
    <script src='<%= this.ResolveClientUrl("~/Scripts/jtable.2.4.0/external/json2.js")%>'
        type="text/javascript"></script>
    <!-- Core jTable script file -->
    <script src='<%= this.ResolveClientUrl("~/Scripts/jtable.2.4.0/jquery.jtable.js")%>'
        type="text/javascript"></script>
    <script type="text/javascript" src="../"></script>
    <!-- ASP.NET Web Forms extension for jTable -->
    <script src='<%= this.ResolveClientUrl("~/Scripts/jtable.2.4.0/extensions/jquery.jtable.aspnetpagemethods.js")%>'
        type="text/javascript"></script>
    <!-- Import CSS file for validation engine (in Head section of HTML) -->
    <link href="../Scripts/validationEngine/validationEngine.jquery.css" rel="stylesheet"
        type="text/css" />
    <!-- Import Javascript files for validation engine (in Head section of HTML) -->
    <script src='<%= this.ResolveClientUrl("~/Scripts/validationEngine/jquery.validationEngine.js")%>'
        type="text/javascript"></script>
    <script type="text/javascript" src=".."></script>
    <script src='<%= this.ResolveClientUrl("~/Scripts/validationEngine/jquery.validationEngine-en.js")%>'
        type="text/javascript"></script>
</head>
<body style="direction: ltr">
    <form id="form1" runat="server">
    <table cellpadding="0" border="0" cellspacing="0" height="100%" width="100%">
        <tr>
            <td colspan="2">
                <table border="0" cellpadding="0" cellspacing="0" class="header_Bgx">
                    <tr>
                        <td align="left" width="25%">
                            <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/logo.jpg" />
                        </td>
                        <td align="center" width="50%">
                            <table border="0" width="50%" cellpadding="0" cellspacing="0" class="header_Main">
                                <tr>
                                    <td valign="top" style="text-align: right">
                                        <table width="50%" border="0" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td align="center" valign="top">
                                                    <table border="0" class="header_commoneLinkTB" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                            <td>
                                                                <uc2:Logout ID="Logout1" runat="server" />
                                                                &nbsp; |
                                                            </td>
                                                            <td>
                                                                Help &nbsp;
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: right">
                                        <table width="50%" class="header_UserN_L_TTB" border="0" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td>
                                                    <span class="header_UserN_L_T">
                                                        <asp:Label ID="Label1" runat="server" Text="User Name" CssClass="style1"></asp:Label>&nbsp;&nbsp;|&nbsp;&nbsp;
                                                        <asp:Label ID="Label2" runat="server" Text="Date" CssClass="style1"></asp:Label>
                                                        &nbsp;&nbsp;|&nbsp;&nbsp;
                                                        <asp:Label ID="Label3" runat="server" Text="Time" CssClass="style1"></asp:Label>
                                                    </span>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td valign="top" width="100%">
                <div>
                    <table class="body_MainTB" border="0" cellpadding="0" cellspacing="0">
                        <tr align="center">
                            <td valign="top" class="style1">
                                <!------------------------------------body St  ---------------------------------------------->
                                <table border="0" cellpadding="0" cellspacing="0" class="body_formTitle">
                                    <tr>
                                        <td>
                                            T24 Settlement
                                        </td>
                                    </tr>
                                </table>
                                <br />
                                <!------------------------------------body End1 ----------------------------------------------->
                                <table border="0" cellpadding="0" cellspacing="0" class="contTB">
                                    <tr>
                                        <td align="center">
                                            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="Frow">
                                                <tr>
                                                    <td>
                                                    </td>
                                                </tr>
                                            </table>
                                            <br />
                                            <table border="0" width="100%" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                                <tr runat="server" id="channelsRow">
                                                    <td class="tdNormal">
                                                        Settlement Date *
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="TextBoxSettleDate" runat="server" class="validate[required]" MaxLength="8"
                                                            Width="250"></asp:TextBox>
                                                        <%--   <uc1:DatePicker ID="DatePicker1" runat="server" width="250" />--%>
                                                    </td>
                                                    <td class="tdNormal">
                                                        Channel Event
                                                    </td>
                                                    <td class="tdNormal">
                                                        <asp:DropDownList ID="ddlEvents" runat="server" DataTextField="evant_name" Width="250px"
                                                            DataValueField="re_code" class="fieldNormal">
                                                        </asp:DropDownList>
                                                        <%--<asp:TextBox ID="TextBox_ReCode" runat="server" class="fieldNormal" MaxLength="8" Width="250"></asp:TextBox>--%>
                                                    </td>
                                                    <td class="tdNormal">
                                                    </td>
                                                </tr>
                                                <tr runat="server" id="POSRow">
                                                    <td class="tdNormal">
                                                        Debit Account
                                                    </td>
                                                    <td class="tdNormal">
                                                        <asp:TextBox ID="txtDebitAccount" runat="server" class="fieldNormal" MaxLength="25"
                                                            Width="250"></asp:TextBox>
                                                    </td>
                                                    <td class="tdNormal">
                                                        Credit Account
                                                    </td>
                                                    <td class="tdNormal">
                                                        <asp:TextBox ID="txtCreditAccount" runat="server" class="fieldNormal" MaxLength="25"
                                                            Width="250"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="5" style="text-align: center">
                                                        <button type="submit" id="LoadRecordsButton" class="Btn_L_Normal">
                                                            <asp:Literal ID="Literal2" runat="server" Text="Search" />
                                                        </button>
                                                        <asp:Button ID="btnSearch" runat="server" Text="Back To Main Site" CssClass="Btn_L_Normal"
                                                            OnClick="btnSearch_Click" />
                                                    </td>
                                                </tr>
                                            </table>
                                            <br />
                                            <asp:Label ID="lblError" runat="server" Text="" class="fieldError"></asp:Label>
                                            <!------------------------------------body End2 ----------------------------------------------->
                                            </br>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div id="SettlementTableContainer">
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                                <!------------------------------------body End2 ----------------------------------------------->
                            </td>
                        </tr>
                    </table>
                </div>
            </td>
        </tr>
        <tr>
            <td height="100%" colspan="2" valign="bottom">
                <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#ADB7C1">
                    <tr>
                        <td height="20">
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    </form>
</body>
<script type="text/javascript">

    $(document).ready(function () {

        $('#<% = TextBoxSettleDate.ClientID %>').datepicker();
        //Prepare jtable plugin
        $('#SettlementTableContainer').jtable({
            title: 'T24 Settlement Entries',
            paging: true,
            pageSize: 5,
            sorting: true,
            defaultSorting: 'CREDIT_ACCOUNT ASC',
            actions: {
                listAction: '<%= this.ResolveClientUrl("~/Business/T24Settlments.aspx/ListDataAll")%>'

            },
            fields: {
                SETTLE_DATE: {
                    title: 'Settle Date',
                    width: '10%'
                },
                CREDIT_ACCOUNT: {
                    title: 'Credit Account',
                    width: '20%'
                },
                DEBIT_ACCOUNT: {
                    title: 'Debit Account',
                    width: '20%'
                },
                AMOUNT: {
                    title: 'Amount',
                    width: '10%'
                },
                NARRATIVE: {
                    title: 'Narrative',
                    width: '30%'

                },
                FILE_NUMBER: {
                    title: 'FILE_NUMBER',
                    width: '10%',
                    list: false
                },
                RE_CODE: {
                    title: 'Event',
                    width: '5%'
                },
                POSTED_DATE: {
                    title: 'POSTED_DATE',
                    width: '10%',
                    list: false
                }


            }



        });


        //Re-load records when user click 'load records' button.
        $('#LoadRecordsButton').click(function (e) {

            e.preventDefault();
            if ($("#form1").validationEngine('validate')) {
                $('#SettlementTableContainer').jtable('load', {
                    Settle_Date: $('#<% = TextBoxSettleDate.ClientID %>').val(),
                    DEBIT_ACCOUNT: $('#<% = txtDebitAccount.ClientID %>').val(),
                    CREDIT_ACCOUNT: $('#<% = txtCreditAccount.ClientID %>').val(),
                    RE_CODE: $('#<% = ddlEvents.ClientID %>').val()
                });
            }
            return false;
        });


        //Load all records when page is first shown
        //$('#LoadRecordsButton').click();


        // Button Even Handler



    });    // Ajax End

</script>
</html>
