<%@ Page Title="RAPO Report" Language="C#" MasterPageFile="~/SunMaster.Master" AutoEventWireup="true" CodeBehind="RAPONew.aspx.cs" Inherits="SUNWEB.RAPONew" %>
<%--<%@ Register Assembly="CrystalDecisions.Web, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
    Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
--%><%@ Register Assembly="AjaxControlToolkit" TagPrefix="asp" Namespace="AjaxControlToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
    <style type="text/css">
    @media only screen and (max-width: 600px) {
    table, th, td {
        font-size: 10px;
        font-weight:bold;
        
    }
    
     .Labels{font-size:10px; }
     .alnright { text-align: right; }
       
             }
    
    
    
    </style>
    <style type="text/css">
        .overlay
        {
            position: fixed;
            top: 0px;
            left: 0px;
            z-index: 0;
            height: 100%;
            width: 100%;
            top: 0;
            background-color: White;
            filter: alpha(opacity=60);
            opacity: 0.9;
            -moz-opacity: 1;
        }
        
        .LoadingDivCss
        {
            margin: 0;
            position: absolute;
            top: 50%;
            left: 50%;
            margin-right: -50%;
            transform: translate(-50%, -50%);
        }
        
        .LoadingImgCss
        {
            height: 100px;
            width: 100px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

 <div align="left">
    <asp:Button ID="Button1" runat="server" CssClass="btn btn-success btn-xs"  onclick="btnExcel_Click" Text="Excel" BackColor="Green" BorderColor="Green" ToolTip="To Export the Report Click Here" />      
    </div>

    <asp:UpdatePanel runat="server" ID="updatepanel1" UpdateMode="Conditional">
        <ContentTemplate>
                <div class="section-block">
                <h5 class="section-title">
                    RECEIVING AMOUNT / PAY OUT
                </h5>
            </div>
            <div class="row">
                <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                    <div class="card">
                        <div class="card-body">
                            <div class="form-row">
                               
                                   <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    <caption>
                                        <label for="validationCustom03">
                                            From
                                        </label>
                                        <asp:TextBox ID="txtStartDt" class="form-control" runat="server"></asp:TextBox>
                                        <asp:CalendarExtender ID="Cal1" Format="yyyy-MM-dd" runat="server" TargetControlID="txtStartDt"
                                            PopupPosition="BottomLeft" FirstDayOfWeek="Sunday"></asp:CalendarExtender>
                                       </caption>
                                </div>
                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    <label for="validationCustom03">
                                        To
                                    </label>
                                    <asp:TextBox ID="txtEndDt" class="form-control" runat="server"></asp:TextBox>
                                    <asp:CalendarExtender ID="Cal2" Format="yyyy-MM-dd" runat="server" TargetControlID="txtEndDt"
                                        PopupPosition="BottomLeft" FirstDayOfWeek="Sunday"></asp:CalendarExtender>
                                </div>


                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    <label for="validationCustom03">
                                        <asp:Label ID="lblBranchAliasName" ForeColor="Gray" runat="server" Text="Branch"></asp:Label></label>
                                    <asp:DropDownList ID="cmbBranches" CssClass="custom-select" runat="server" 
                                        AutoPostBack="true" onselectedindexchanged="cmbBranches_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </div>



                            </div>

                            <div class="form-row">

                               
                            <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                                <label for="validationCustom04"> RA/PO Selection </label>
                                                <asp:DropDownList ID="cmbRAPO" CssClass="custom-select" runat="server" 
                                               AutoPostBack="true" onselectedindexchanged="cmbRAPO_SelectedIndexChanged">
                                               <asp:ListItem Value="0" Text="Select"></asp:ListItem>
                                               <asp:ListItem Value="1" Text="All RA/PO"></asp:ListItem>
                                               <asp:ListItem Value="2" Text="RA"></asp:ListItem>
                                               <asp:ListItem Value="3" Text="PO"></asp:ListItem>
                                               </asp:DropDownList>
                          </div>    
                                           
                            </div>

                            <div>
                                <asp:Button ID="btnGetReports" runat="server" Text="Apply" CssClass="btn btn-primary"
                                    OnClick="btnGetReports_Click" OnClientClick="return validate()" />
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:Button ID="btnGenerateRpt" runat="server" class="btn btn-primary" Text="Generate Report" Visible="false"
                                    OnClick="btnGenerateRpt_Click" />
                            </div>
                        </div>


                        
                                            

                    </div>
                </div>
                  <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                   <div class="card-body">
                                    
                                    
                                </div>

                  </div>

            </div>
            <div>
                <h4>
                    &nbsp;<asp:Label ID="lblGreeting" runat="server"></asp:Label></h4>
              </div>
            <div class="row">
                <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">



                    <div class="card">
                        <div class="card-header">
                            <asp:Label ID="lblMsgTotalSelection" runat="server" CssClass="Labels"></asp:Label>
                            </b> 
                            </p>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive">
                                <table id="Table1" class="table table-striped table-bordered second" style="width: 100%">
                                    <tbody>
                                        <caption>
                                            <div align="left">


                                                <asp:GridView ID="gvRAPOList" runat="server" AutoGenerateColumns="False" Font-Size="12px"
                                                    AllowSorting="true" EmptyDataText="No Data Found ! " Width="700px" ShowFooter="True" OnRowDataBound="gvRAPOList_RowDataBound"
                                                    BorderWidth="1px" CellPadding="3">
                                                    <Columns>
                                                        <asp:BoundField DataField="BusinessDate" HeaderText="Date" DataFormatString="{0:d}"/>
                                                        <asp:TemplateField HeaderText="Pay Type" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lblPaytype" runat="server" Text='<%#Eval("PaymentType") %>'></asp:Label>
                                                            </ItemTemplate>
                                                            <FooterTemplate>
                                                                <b>Grand Total &nbsp;</b>
                                                            </FooterTemplate>
                                                            <FooterStyle HorizontalAlign="Center" />

                                                            <ItemStyle Width="80px"></ItemStyle>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Currency" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Right">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lblRTotamt" runat="server" Text='<%#Eval("PayCurrency") %>'></asp:Label>
                                                            </ItemTemplate>
                                                          
                                                            <FooterStyle HorizontalAlign="Right" />
                                                            <ItemStyle Width="80px"></ItemStyle>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Amount" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lblRDisqty" runat="server" Text='<%#Eval("Amount" ,"{0:F2}") %>'></asp:Label>
                                                            </ItemTemplate>
                                                            <FooterTemplate>
                                                                <asp:Label ID="lblGrandDiscQTY" runat="server" />
                                                            </FooterTemplate>
                                                            <FooterStyle HorizontalAlign="Center" />
                                                            <ItemStyle Width="80px"></ItemStyle>
                                                        </asp:TemplateField>
                                                          <asp:TemplateField HeaderText="RAPO" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Right">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lblRAPO" runat="server" Text='<%#Eval("RAPO") %>'></asp:Label>
                                                            </ItemTemplate>
                                                          
                                                            <FooterStyle HorizontalAlign="Right" />
                                                            <ItemStyle Width="80px"></ItemStyle>
                                                        </asp:TemplateField>


                                                        

                                                        <asp:TemplateField HeaderText="User" ItemStyle-Width="120px" ItemStyle-HorizontalAlign="Right">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lblCashierId" runat="server" Text='<%#Eval("CashierId")%>'></asp:Label>                                                               
                                                            </ItemTemplate>
                                                         
                                                            <FooterStyle HorizontalAlign="Right" />
                                                            <ItemStyle Width="80px"></ItemStyle>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Reason" ItemStyle-Width="200px" ItemStyle-HorizontalAlign="Right">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lblNotes" runat="server" Text='<%#Eval("Notes") %>'></asp:Label>
                                                            </ItemTemplate>                                                            
                                                            <FooterStyle HorizontalAlign="Right" />
                                                            <ItemStyle Width="200px"></ItemStyle>
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <FooterStyle BackColor="White" ForeColor="Black"></FooterStyle>
                                                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                                                    <RowStyle ForeColor="#000066" />
                                                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                                                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                                                    <SortedAscendingHeaderStyle BackColor="#007DBB" />
                                                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                                                    <SortedDescendingHeaderStyle BackColor="#00547E" />
                                                </asp:GridView>
                                            </div>
                                        </caption>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

          <%-- <div align="left">
           <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" />
           </div>--%>
          
        </ContentTemplate>
    </asp:UpdatePanel>
           <asp:UpdateProgress ID="UpdateProgress" runat="server" AssociatedUpdatePanelID="updatepanel1">
        <ProgressTemplate>
            <div class="overlay">
                <%--  <div style="z-index: 1000; margin-left: 450px; margin-top: 0; opacity: 1; -moz-opacity: 1;">--%>
                <div class="LoadingDivCss">
                    <img alt="" src="IMG/Spinner.gif" class="LoadingImgCss" />
                </div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>


    <br />
</asp:Content>

