
<%@ Page Title="Summary Report Page" Language="C#" MasterPageFile="~/SunMaster.Master" EnableEventValidation="false"
    AutoEventWireup="true" CodeBehind="SummaryReport.aspx.cs" Inherits="SUNWEB.SummaryReport" %>

<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" TagPrefix="asp" Namespace="AjaxControlToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    
    <script type="text/javascript">
        var uri = window.location.toString();
        if (uri.indexOf("?") > 0) {
            var clean_uri = uri.substring(0, uri.indexOf("?"));
            window.history.replaceState({}, document.title, clean_uri);
        }
    </script>
    <script type="text/javascript" language="JavaScript" src="js/FusionCharts.js"></script>
    <script type="text/javascript" language="JavaScript">
        function myJS(myVar) {
            window.alert(myVar);
        }      
    </script>
    <link type="text/css" rel="Stylesheet" href="css/style.css" />
    <script language="javascript" type="text/javascript">
      

        function checkNumber(evt) {
            evt = (evt) ? evt : window.event
            var charCode = (evt.which) ? evt.which : evt.keyCode
            if (charCode > 31 && (charCode < 48 || charCode > 57)) {
                status = "This field accepts numbers only."
                return false
            }
            status = ""
            return true
        }




        function validate() {

            if (document.getElementById("<%=txtStartDt.ClientID %>").value == "") {
                alert("Enter Start Date");
                document.getElementById("<%=txtStartDt.ClientID %>").focus();
                return false;
            }

            if (document.getElementById("<%=txtEndDt.ClientID %>").value == "") {
                alert("Enter  End Date ");
                document.getElementById("<%=txtEndDt.ClientID %>").focus();
                return false;
            }
            

        }

    </script>
    <style type="text/css">
        .chart_div
        {
            width: inherit;
            height: inherit;
           
        }
</style>
<style type="text/css">
 table {
          font-family: arial, sans-serif;
          border-collapse: collapse;
          width: 100%;
          table-layout:fixed;
        }

        td, th {
           border: 1px solid #dddddd;
          text-align: justify;
          padding:5px;
          width:50%;
          
        }
        thead
        {
            
          
          text-align: left;
          padding: 8px;
          width:50%;
        }
        tr:nth-child(even) {
          background-color:white;
        }
        
         @media only screen and (max-width: 600px)
        {
             table {
              font-family: arial, sans-serif;
              border-collapse: collapse;
              width:100%;
              font-size:12px;
              table-layout:fixed;
        }

        td, th {
          border: 1px solid #dddddd;
          text-align: justify;
          padding:3px;
          width:35%;
          
        }
              
          .Lablex
           {
             font-size:10px;  
             font-weight: bold;  
           }
       
        tr:nth-child(even) {
          background-color:white;
        }
        
            
            
       }
        
        

 </style>

    <%--new added funcation for chart : Resize--%>
    <script type="text/javascript">
        function resizeChart() {
            chart.draw(data, options);
        }
        if (document.addEventListener) {
            window.addEventListener('resize', resizeChart);
        }
        else if (document.attachEvent) {
            window.attachEvent('onresize', resizeChart);
        }
        else {
            window.resize = resizeChart;
        }

    </script>
    <%--End --%>
    <style type="text/css">
        /*Calendar Control CSS*/
        .cal_Theme1 .ajax__calendar_container
        {
            background-color: #3D59AB;
            border: solid 1px #77D5F7;
        }
        
        .cal_Theme1 .ajax__calendar_header
        {
            background-color: #ffffff;
            margin-bottom: 4px;
        }
        
        .cal_Theme1 .ajax__calendar_title, .cal_Theme1 .ajax__calendar_next, .cal_Theme1 .ajax__calendar_prev
        {
            color: #004080;
            padding-top: 3px;
        }
        
        .cal_Theme1 .ajax__calendar_body
        {
            background-color: #fffff;
            border: solid 1px #77D5F7;
        }
        
        .cal_Theme1 .ajax__calendar_dayname
        {
            text-align: center;
            font-weight: bold;
            margin-bottom: 4px;
            margin-top: 2px;
            color: #004080;
        }
        
        .cal_Theme1 .ajax__calendar_day
        {
            color: #004080;
            text-align: center;
        }
        
        .cal_Theme1 .ajax__calendar_hover .ajax__calendar_day, .cal_Theme1 .ajax__calendar_hover .ajax__calendar_month, .cal_Theme1 .ajax__calendar_hover .ajax__calendar_year, .cal_Theme1 .ajax__calendar_active
        {
            color: #004080;
            font-weight: bold;
            background-color: #DEF1F4;
        }
        
        
        
        .cal_Theme1 .ajax__calendar_today
        {
            font-weight: bold;
        }
        
        .cal_Theme1 .ajax__calendar_other, .cal_Theme1 .ajax__calendar_hover .ajax__calendar_today, .cal_Theme1 .ajax__calendar_hover .ajax__calendar_title
        {
            color: #bbbbbb;
        }
    </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>
        <script type="text/javascript">
            function showProgress() {
                var updateProgress = $get("<%= UpdateProgress.ClientID %>");
                updateProgress.style.display = "block";
            }
    
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<%--    <div style="padding-left: 15px;">
        <div class="row">
            <div class="column" style="text-align: center; padding-left: 0px">
                <asp:Button ID="btnExcel" runat="server" CssClass="btn btn-success btn-xs" Visible="true"
                    OnClick="btnExcel_Click" Text="Summary Export" BackColor="green" BorderColor="green"
                    ToolTip="Export"/>
                <div>
                </div>
            </div>

                 &nbsp; &nbsp; &nbsp;
              <div class="column" style="text-align: center;">
                <asp:Button ID="btnDatawiseExport" runat="server" Text="Monthly Export" CssClass="btn btn-primary btn-xs"
                    Visible="true" OnClick="btnDatawiseExport_Click" ToolTip="Datewise Export" BackColor="Green" />
                <div>
                </div>
            </div>

               &nbsp; &nbsp; &nbsp;
             
             
             

            </div>
          </div>--%>
  <div class="row">
    <div class="container-fluid ps-3">
    <div class="d-flex align-items-center gap-3">

        <!-- Summary Export Button -->
        <asp:Button ID="btnExcel" runat="server" CssClass="btn btn-success btn-xs"
            OnClick="btnExcel_Click" Text="Summary Export" ToolTip="Export" />

        <!-- Monthly Export Button -->
        <asp:Button ID="btnDatawiseExport" runat="server" Text="Monthly Export"
            CssClass="btn btn-primary btn-xs" OnClick="btnDatawiseExport_Click"
            ToolTip="Datewise Export" BackColor="Green" />

    </div>
</div>
</div>



    <asp:UpdatePanel runat="server" ID="updatepanel1" UpdateMode="Conditional">
        <ContentTemplate>
        
           <div class="section-block">
            <div class="section-title p-2">
                SUMMARY SALES REPORT
            </div>
        </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" runat="server" class="form-control" autocomplete="off"></asp:TextBox>
                                        <asp:CalendarExtender ID="calFirstDueDate" 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" autocomplete="off"></asp:TextBox>
                                    <asp:CalendarExtender ID="CalendarExtender1" 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" runat="server" Text="Branch"></asp:Label></label>
                                    <asp:DropDownList ID="cmbBranches" CssClass="custom-select" AutoPostBack="true" runat="server"
                                        OnSelectedIndexChanged="cmbBranches_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </div>
                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    <asp:Button ID="btnGetReports" runat="server" Text="Apply" CssClass="btn btn-primary"
                                        OnClick="btnGetReports_Click" OnClientClick="return validate()" />
                                </div>

                                 <div class="column" style="text-align: center;">
                                  <asp:Label ID="lblmonthlyerrormsg" runat="server" ForeColor="Red"></asp:Label>
                                  <div>
                                  </div>
                                  </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <br />
           <%-- <div class="row">
                <div class="col-xl-3 col-lg-3 col-md-6 col-sm-12 col-12">
                    <div class="card border-3 border-top border-top-primary">
                        <div class="card-body">
                            <caption>
                                <h4 class="text-muted">
                                    Total Sales</h4>
                                <div class="metric-value d-inline-block">
                                    <h4 class="mb-1">
                                        <asp:Label ID="lblRTotalSale" runat="server"></asp:Label>
                                    </h4>
                                </div>
                            </caption>
                        </div>
                    </div>
                </div>--%>

                    <div class="row">
                    <div class="col-xl-3 col-lg-3 col-md-6 col-sm-12 col-12">
                    <div class="card" style="border-top: 4px solid #007bff;">
                    <div class="card-body">
                      <h4 class="text-muted">Total Sales</h4>
                      <div class="metric-value d-inline-block">
                      <h4 class="mb-1">
                      <asp:Label ID="lblRTotalSale" runat="server"></asp:Label>
                      </h4>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="col-xl-3 col-lg-3 col-md-6 col-sm-12 col-12">
                    <div class="card" style="border-top: 4px solid #007bff;">
                        <div class="card-body">
                            <h4 class="text-muted">
                                Net Amount</h4>
                            <div class="metric-value d-inline-block">
                                <h4 class="mb-1">
                                    <asp:Label ID="lblDNetAmount" runat="server"></asp:Label>
                                </h4>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
          <%--  <b>&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Label ID="lblMsgTotalSelection" runat="server"></asp:Label></b>--%>
            <div class="row">
                

                <div class="col-xl-9 col-lg-12 col-md-6 col-sm-12 col-12">
                    <div class="card">
                        <h5 class="card-header" id="idGenReport" runat="server">
                      
                            <asp:Label ID="lblMsgTotalSelection" runat="server"></asp:Label></b>
       
                        </h5>
                        <h6 class="card-header">
                             Retail Transaction Information  <asp:Label ID="lblLastUpdatedTM" runat="server" CssClass="Lablex"></asp:Label>  </h6>
                        <div class="card-body p-0">
                            <div class="table-responsive">
                                <table class="table">
                                   <%-- <thead class="bg-light">--%>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblTable" runat="server" /><asp:Label ID="Label1" runat="server" />
                                                <asp:Label ID="lblTable1" runat="server" /><asp:Label ID="Label3" runat="server" />
                                                <asp:Label ID="lblPayouts" runat="server" /><asp:Label ID="Label4" runat="server" />
                                                <asp:Label ID="lblReceiving" runat="server" /><asp:Label ID="Label5" runat="server" />
                                            </td>
                                        </tr>
                              <%--      </thead>--%>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>



                <div class="col-xl-9 col-lg-12 col-md-6 col-sm-12 col-12">
                    <div class="card">
                        <h6 class="card-header" id="idRetail" runat="server" style="background-color: #4c4c4c; color: White;">
                            Retail Discount Details</h6>
                        <div class="card-body p-0">
                            <div class="table-responsive">
                                <table class="table">
                                    <thead class="bg-light">
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblCashinDrawer" runat="server" /><asp:Label ID="Label6" runat="server" />
                                                <asp:Label ID="lblRounding" runat="server" /><asp:Label ID="Label7" runat="server" />
                                                <asp:Label ID="lblRefund" runat="server" /><asp:Label ID="Label8" runat="server" />
                                                <asp:Label ID="lblGrossAmount" runat="server" /><asp:Label ID="Label9" runat="server" />
                                                <asp:Label ID="lblItemDiscount" runat="server" /><asp:Label ID="Label10" runat="server" />
                                                <asp:Label ID="lblTotDiscount" runat="server" /><asp:Label ID="Label11" runat="server" />
                                                <asp:Label ID="lblMemberDiscount" runat="server" /><asp:Label ID="lblMemDisc" runat="server" />
                                                <asp:Label ID="lblPriceShiftDiscount" runat="server" /><asp:Label ID="Label13" runat="server" />
                                                <asp:Label ID="lblDiscountTotal" runat="server" /><asp:Label ID="Label12" runat="server" />
                                                <asp:Label ID="lblGST" runat="server" /><asp:Label ID="Label14" runat="server" />
                                                <asp:Label ID="lblSVC" runat="server" /><asp:Label ID="Label15" runat="server" />
                                                <asp:Label ID="lblTax3" runat="server" /><asp:Label ID="Label25" runat="server" />
                                                <asp:Label ID="lblNetAmt" runat="server" /><asp:Label ID="Label16" runat="server" />
                                                <asp:Label ID="lblVoucher" runat="server" /><asp:Label ID="Label17" runat="server" />
                                            </td>
                                        </tr>
                                    </thead>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xl-9 col-lg-12 col-md-6 col-sm-12 col-12">
                    <div class="card">
                        <h6 class="card-header" style="background-color: #4c4c4c; color: White;">
                            Retail Transaction Status&nbsp;</h6>
                        <div class="card-body p-0">
                            <div class="table-responsive">
                                <table class="table">
                                   <%-- <thead class="bg-light">--%>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblHold" runat="server" /><asp:Label ID="Label18" runat="server" />
                                                <asp:Label ID="lblCancel" runat="server" /><asp:Label ID="Label20" runat="server" />
                                                <asp:Label ID="lblVoid" runat="server" /><asp:Label ID="Label22" runat="server" />
                                                <asp:Label ID="lblExchange" runat="server" /><asp:Label ID="Label24" runat="server" />
                                                <asp:Label ID="lblNosalespersonOpen" runat="server" /><asp:Label ID="Label19" runat="server" />
                                                <asp:Label ID="lblNoofReceipts" runat="server" /><asp:Label ID="Label21" runat="server" />
                                                <asp:Label ID="lblAvgReceipts" runat="server" /><asp:Label ID="Label23" runat="server" />
                                            </td>
                                        </tr>
                                   <%-- </thead>--%>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            

             <div class="row">
             <div class="col-xl-9 col-lg-12 col-md-6 col-sm-12 col-12">
               <div class="card">
                   <h6 class="card-header" style="background-color: #4c4c4c; color: White;">
                       Week Wise Comparison&nbsp;</h6>


                   <div id="chart_div">
                    </div>
                   </div>
             </div>
            </div>

      
            <div class="row">
         <div class="col-xl-9 col-lg-12 col-md-6 col-sm-12 col-12">
         <div class="card">

            <div class="card">
           <h6 class="card-header" style="background-color: #4c4c4c; color: White;">
            Total Sale Between&nbsp;  <asp:Label ID="lblLinechartStdt" runat="server" CssClass="me-3"></asp:Label> And 
             <asp:Label ID="lblLineChartEndDt" runat="server" CssClass="ms-3"></asp:Label> &nbsp;</h6>


          <div id="chart_div1">
          </div>

        </div>
        </div>
        </div>
        </div>

            
          
            <%-- Not included --%>
            <asp:Literal ID="lt" runat="server"></asp:Literal>
            <asp:Literal ID="FCLiteral1" runat="server" Visible="false"></asp:Literal>
            <asp:Literal ID="FCLiteral2" runat="server" Visible="true"></asp:Literal>
            <asp:Literal ID="lt1" runat="server"></asp:Literal>
           <%-- Not included --%>
            
        </ContentTemplate>
        <Triggers>
        <asp:PostBackTrigger ControlID="btnGetReports"/>
        
        </Triggers>
    </asp:UpdatePanel>
   <asp:UpdateProgress ID="UpdateProgress" runat="server" AssociatedUpdatePanelID="updatepanel1">
        <ProgressTemplate>
            <div class="overlay">
             <div class="LoadingDivCss">
             <img alt="" src="IMG/Spinner.gif" class="LoadingImgCss" />
             </div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>

<script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css?v=1.1" rel="stylesheet" />
<!-- Bootstrap 5 -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" />
<!-- Optional Bootstrap Icons -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" rel="stylesheet" />

</asp:Content>
