<%@ page language="C#" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" autoeventwireup="true" inherits="Pages_FeeManagement_FeeDiscountReceiptList, App_Web_bt3kc4fp" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DatePickerControl"
    TagPrefix="Date" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControls/GridViewPager/GridViewPager.ascx" TagName="GridViewPager"
    TagPrefix="uc1" %>
<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl"
    TagPrefix="ScreenGroup" %>
<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DatePickerControl"
    TagPrefix="DPC" %>
<%@ Register Src="~/UserControls/Common/StudentSearch/StudentSearch.ascx" TagName="StudentSearch"
    TagPrefix="Std" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="IncidentLogUpdatePanel" runat="server" UpdateMode="Always">
        <ContentTemplate>
            <Std:StudentSearch ID="StudentSearch" Visible="false" runat="server" />
            <div id="divContentPage" class="divcontentpagemargin">
                <div class="dashBoardLeftCont">
                    <div class="himssuHeader3WireBox">
                        <table>
                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="104"
                                Visible="true" runat="server" />
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <div class="himssuHeader5WireBox card card-box">
                        <div class="himsBoxHeader card-head">
                            <asp:Panel ID="Panel1" runat="server">
                                <div class="leftdiv">
                                </div>
                                <div class="himsBoxTitle">
                                    <div class="headerText">
                                        <header>
                                            <i class="fas fa-search"></i>
                                            <asp:Label ID="SearchLabel" runat="server" Text="Search"></asp:Label>
                                        </header>
                                    </div>
                                </div>
                                
                            </asp:Panel>
                        </div>
                        <div class="himsBoxContent card-body">
                            <asp:Panel ID="SearchCriteriaPanel" runat="Server">
                                <div class="contentHolder">
                                    <asp:Panel ID="SearchPanel" runat="Server">
                                        <div class="contentHolder">
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="OrganizationGroupBatchLabel" runat="server" Text="Group Batch" SkinID="MandatoryLabel"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="OrganizationGroupBatchDropDownList" SkinID="CustomWidthDropDownList"
                                                        AutoPostBack="true" class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        OnSelectedIndexChanged="OrganizationGroupBatchDropDownList_OnSelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="OrganizationLabel" Text="Organization" runat="server"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList ID="OrganizationDropDownList" runat="server" onmouseleave="showHideTooltip()"
                                                        onmouseenter="showHideTooltip()" AutoPostBack="true" SkinID="CustomWidthDropDownList"
                                                        class="form-control" OnSelectedIndexChanged="OrganizationDropDownList_OnSelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="BatchLable" Text="Batch" runat="server"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList ID="BatchDropDownList" runat="server" onmouseleave="showHideTooltip()"
                                                        onmouseenter="showHideTooltip()" SkinID="CustomWidthDropDownList" class="form-control"
                                                        AutoPostBack="true" OnSelectedIndexChanged="BatchDropDownList_OnSelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="AdmissionCategoryLabel" runat="server" Text="Fees Category"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="AdmissionCategoryDropDownList" SkinID="CustomWidthDropDownList"
                                                        onmouseleave="showHideTooltip()" class="form-control" onmouseenter="showHideTooltip()">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div id="SUIdDiv" class="outerBox pTop5 col-md-3" runat="server" visible="false">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="SUIdLabel" runat="server" Text="SU Id"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="SUIdTextBox" runat="server" SkinID="CustomWidthTextBox"
                                                        MaxLength="50"></asp:TextBox>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="IdNoLabel" runat="server" Text="ID No"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="IdNoTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" runat="server" MaxLength="200" AutoPostBack="false">
                                                    </asp:TextBox>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="FirstNameLabel" runat="server" Text="First Name"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="FirstNameTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" runat="server" MaxLength="200"> </asp:TextBox>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="LastNameLabel" runat="server" Text="Last Name"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="LastNameTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" runat="server" MaxLength="200"> </asp:TextBox>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="DepartmentLabel" runat="server" Text="Department"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="DepartmentDropDownList" SkinID="CustomWidthDropDownList"
                                                        AutoPostBack="true" onmouseleave="showHideTooltip()" class="form-control" onmouseenter="showHideTooltip()"
                                                        OnSelectedIndexChanged="DepartmentDropDownList_SelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ClassLabel" runat="server" Text="Class"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="ClassDropDownList" SkinID="CustomWidthDropDownList"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        AutoPostBack="true" OnSelectedIndexChanged="ClassDropDownList_OnSelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="DivisionLabel" runat="server" Text="Division"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="DivisionDropDownList" SkinID="CustomWidthDropDownList"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5 col-md-3" runat="server" visible="false">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="SourceTypeLabel" runat="server" Text="Source Type"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="SourceTypeDropDownList" SkinID="CustomWidthDropDownList"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                                        <asp:ListItem Text="- ALL -" Value="0" Selected="True"></asp:ListItem>
                                                        <asp:ListItem Text="Student" Value="2001"></asp:ListItem>
                                                        <asp:ListItem Text="Employee" Value="95"></asp:ListItem>
                                                    </asp:DropDownList>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ReceiptBookLabel" runat="server" Text="Receipt Book" meta:resourcekey="ReceiptBookLabelResource1"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="ReceiptBookDropDownList" SkinID="CustomWidthDropDownList"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        AutoPostBack="false">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="FromReceiptNoLabel" runat="server" Text="From Receipt No"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="FromReceiptNoTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" runat="server" MaxLength="200"> </asp:TextBox>
                                                    <asp:HiddenField ID="ReceiptIdHiddenField" runat="server" />
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ToReceiptNoLabel" runat="server" Text="To Receipt No"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="ToReceiptNoTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" runat="server" MaxLength="200"> </asp:TextBox>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="PayTypeLabel" runat="server" Text="Pay Type" meta:resourcekey="PayTypeLabelResource1"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="PayTypeDropDownList" SkinID="CustomWidthDropDownList"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ChequeNoLabel" runat="server" Text="Cheque / Reference No"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="ChequeNoTextBox" SkinID="CustomWidthTextBox" runat="server"
                                                        MaxLength="20">
                                                    </asp:TextBox>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3" id="UserSearchPanel" runat="server">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="CreatedUserNameLabel" runat="server" Text="User" meta:resourcekey="Label7Resource1"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="CreatedUserNameTextBox" runat="server" SkinID="CustomWidthTextBox"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        MaxLength="100"></asp:TextBox>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="FromDateLabel" runat="server" Text="From Date" Visible="True"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <Date:DatePickerControl DisplayDatePicker="true" ID="FromDatePickerControl" Visible="True"
                                                        runat="server" onkeyup="FormatIt(this);" onchange="isValidDatepicker(this);" placeholder="dd/mm/yyyy" />
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ToDateLabel" runat="server" Text="To Date" Visible="True"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <Date:DatePickerControl DisplayDatePicker="True" ID="ToDatePickerControl" Visible="True"
                                                        runat="server" onkeyup="FormatIt(this);" onchange="isValidDatepicker(this);" placeholder="dd/mm/yyyy" />
                                                </div>
                                            </div>
                                             

                                            <div class="alignCenter col-md-12 pTop15 pb5">
                                                <asp:Button ID="SearchButton" runat="server" Text="&#xf002; Search" OnClick="SearchButton_Click"
                                                    SkinID="0" CssClass="btn-search btn fas" />
                                                <asp:Button ID="ClearButton" runat="server" Text="&#xf0e2; Reset" OnClick="ClearSearch_Click" SkinID="0" CssClass="btn-reset btn fas" />
                                            </div>

                                        </div>
                                    </asp:Panel>
                                    <div id="Div5" class="himssuHeader7WireBox col-md-12" runat="server">
                                        <div id="ReceiptDetailDiv" visible="false" runat="server">
                                            <div class="himsBoxHeader" id="Div2" runat="server" visible="false">
                                                <div class="himsBoxTitle">
                                                    <div class="gridHeaderText">
                                                        <asp:Label ID="GridHeaderLabel" Text="" runat="server" />
                                                    </div>
                                                    <div class="col-md-12 padd-0">
                                                        <div class="col-md-2">
                                                            <asp:Label ID="RecordsPerPage" Text="Records per Page : " runat="server" />
                                                        </div>
                                                        <div class="col-md-3">
                                                            <asp:DropDownList ID="AddRowsToGridDropDownList" SkinID="CustomWidthDropDownList" Width="70px" runat="server"
                                                                AutoPostBack="true" OnSelectedIndexChanged="AddRowsToGridDropDownList_SelectedIndexChanged" class="form-control">
                                                                <asp:ListItem Text="10" Value="10" Selected="True"></asp:ListItem>
                                                                <asp:ListItem Text="20" Value="20"></asp:ListItem>
                                                                <asp:ListItem Text="50" Value="50"></asp:ListItem>
                                                                <asp:ListItem Text="100" Value="100"></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>
                                                        <div class="col-md-7">
                                                            <uc1:GridViewPager ID="FeeReceiptListGridView_GridViewPager" runat="server" OnFirstRecordClick="FeeReceiptListGridView_GridViewPager_FirstRecordClick"
                                                                OnLastRecordClick="FeeReceiptListGridView_GridViewPager_LastRecordClick" OnNextRecordClick="FeeReceiptListGridView_GridViewPager_NextRecordClick"
                                                                OnPrevRecordClick="FeeReceiptListGridView_GridViewPager_PrevRecordClick" OnTextBoxValueChange="FeeReceiptListGridView_GridViewPager_TextBoxValueChange"
                                                                ParentGridView="FeeReceiptListGridView" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="himsBoxContent pTop5 width-100">
                                                <div id="Div3" runat="server" visible="true" class="table-responsive">
                                                    <div id="Div4" class="himsBoxContentMsg" runat="server" visible="False">
                                                    </div>
                                                    <asp:GridView ID="FeeReceiptListGridView" runat="server" AutoGenerateColumns="False"
                                                        EmptyDataText="No Records Found !!" AllowPaging="true" ShowHeader="true" DataKeyNames="ReceiptId,SourceId,ReceiptBookId"
                                                        OnRowDataBound="FeeReceiptListGridView_RowDataBound" PageSize="10" OnPageIndexChanging="FeeReceiptListGridView_PageIndexChanging"
                                                        CssClass="table table-striped table-bordered table-hover">
                                                        <Columns>
                                                            <asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true"
                                                                HeaderText="">
                                                                <ItemTemplate>
                                                                    <asp:LinkButton ID="ApproveButton" runat="server" CommandName="Approve" Text="Approve"
                                                                        CausesValidation="false" OnClick="ApproveButton_Click"></asp:LinkButton>
                                                                    
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:BoundField DataField="Organization" HeaderText="Organization" ItemStyle-Width="10%"
                                                                HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                            <asp:BoundField DataField="Batch" HeaderText="Batch" ItemStyle-Width="6%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                            <asp:TemplateField HeaderText="ID No" ItemStyle-Width="8%">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="IDNoCodeLabel" runat="server" Text='<%#Eval("Code") %>'></asp:Label>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>

                                                            <asp:BoundField DataField="Class" HeaderText="Class" ItemStyle-Width="8%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                            <asp:BoundField DataField="Name" HeaderText="Name" ItemStyle-Width="15%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                            <asp:BoundField DataField="ReceiptNumber" HeaderText="Receipt No" ItemStyle-Width="6%"
                                                                HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                            <asp:TemplateField HeaderText="Receipt Date" ItemStyle-Width="6%" SortExpression="ReceiptDate"
                                                                ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="ReceiptDateLabel" CssClass="boxEllips" ToolTip='<%# Bind("ReceiptDate") %>'
                                                                        runat="server" Text='<%# Bind("ReceiptDate","{0:dd/MM/yyyy}") %>'></asp:Label>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:BoundField DataField="ReceiptAmount" HeaderText="Receipt Amount" ItemStyle-Width="6%"
                                                                HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                            <asp:BoundField DataField="DiscountAmount" HeaderText="Discount Amount" ItemStyle-Width="6%"
                                                                HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                            <asp:BoundField DataField="PayType" HeaderText="Pay Type" ItemStyle-Width="5%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                            <asp:BoundField DataField="ChequeNo" HeaderText="Reference No" ItemStyle-Width="8%"
                                                                HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                            <asp:BoundField DataField="BankName" HeaderText="Bank Name" ItemStyle-Width="10%"
                                                                HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                            <asp:BoundField DataField="ReceiptBook" HeaderText="Receipt Book" ItemStyle-Width="15%"
                                                                HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                             
                                                        </Columns>
                                                        <PagerSettings Visible="False" />
                                                    </asp:GridView>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </asp:Panel>
                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--  <script data-main="../../JavaScript/rjs/encrypt/feereceipt-search-encrypt" src="../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/feereceipt-search")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>

    <script type="text/javascript">

        function checkAllRows(obj) {
            var objGridview = obj.closest('table');
            var list = objGridview.getElementsByTagName("input");
            for (var i = 0; i < list.length; i++) {
                var objRow = list[i].parentNode.parentNode;
                if (list[i].type == "checkbox" && obj != list[i]) {
                    if (obj.checked) {
                        list[i].checked = true;
                    }
                    else {
                        list[i].checked = false;
                    }
                }
            }
        }
        function checkUncheckHeaderCheckBox(obj) {
            var objGridView = obj.closest('table');
            var list = objGridView.getElementsByTagName("input");
            for (var i = 0; i < list.length; i++) {
                var objHeaderChkBox = list[0];
                var checked = true;
                if (list[i].type == "checkbox" && list[i] != objHeaderChkBox) {
                    if (!list[i].checked) {
                        checked = false;
                        break;
                    }
                }
            }
            objHeaderChkBox.checked = checked;
        }
    
    </script>

</asp:Content>
