<%@ Page Title="Show Data All Field" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ScrapReportShowFieldAll.aspx.cs" Inherits="SCRAP_WEB.ScrapReportShowFieldAll" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">


        $(document).ready(function () {

        });



        function printpdf(ctl) {


            let filter = "";
            let docno = $("#MainContent_txt_docno").val();
            let section = $('#MainContent_ddl_section option:selected').text();
            let sectionno = $('#MainContent_ddl_section').val();
            if (docno.length > 0) {
                filter = " and a.DocNo='" + docno + "'";

            }
          

            let dstart = $('#d_RDate').val();
            let mstart = $('#m_RDate').val();
            let ystart = $('#y_RDate').val();

            let dend = $('#d_RDate1').val();
            let mend = $('#m_RDate1').val();
            let yend = $('#y_RDate1').val();

            let startdate = '';
            if (dstart == '') {

                startdate = '';

            } else {

                if (parseFloat(ystart.replace(/,/g, '')) >= 2500) {
                    ystart = parseFloat(ystart.replace(/,/g, '')) - 543;
                }

                startdate = ystart.toString() + "-" + mstart.toString() + "-" + dstart.toString();

            }

            let enddate = '';
            if (dend == '') {

                enddate = '';

            } else {

                if (parseFloat(yend.replace(/,/g, '')) >= 2500) {
                    yend = parseFloat(yend.replace(/,/g, '')) - 543;
                }

                enddate = yend.toString() + "-" + mend.toString() + "-" + dend.toString();

            }

            let filtedate = ''
            if (dstart != '' && dend != '') {

                filtedate = " and a.DocDate between '" + startdate + "' and '" + enddate + " 23:59:59'";

            } else if (dstart.length > 0) {
                filtedate = " and a.DocDate = '" + startdate + "'";

            }

            else {

                filtedate = "";
            }
            filter = filter + filtedate;

            $('#iframe').attr('src', 'rptScrapReportShowFieldAll?filter=' + filter + '&item=' + docno + '|' + startdate + '|' + enddate);




        }








 </script>


<asp:Panel ID="Panel1" runat="server" style="overflow:no-display;" Width="100%" Height="600px"> 


        <div id="g1" class="grouplist">

            
             <div class="form-row">
                <div class="frmrow">
                     <span class="sp1">
                    <label>
                    <asp:Label ID="lblPageName" runat="server"  CssClass="frmheader"  Text="Export data"  width="120px"></asp:Label>
                   
                    </label>
                    </span>
                    <span class="sp3">
                    <label>
                    <asp:Label ID="lbl_docno" runat="server" CssClass="fontlabel"  ToolTip="codegen"   Text="Doc entry no." width="120px"></asp:Label>
                    <asp:TextBox ID="txt_docno"  runat="server" Width="160px"  ToolTip="codegen"   CssClass="ctlsearchinput" style="text-align:left;"></asp:TextBox> 
                    <ajax:AutoCompleteExtender 
  ID="ac_docno"  
  BehaviorID="bi_docno"  
  runat="server"  
  CompletionSetCount="10"  
  MinimumPrefixLength="1"  
  TargetControlID="txt_docno"  
  ServicePath="~/Autokeyword.asmx" 
  ServiceMethod="GetCodeFilter" 
  ContextKey="DocNo,SCRAP_MASTER,DocNo,'',''" 
  CompletionInterval="100" 
  DelimiterCharacters=";," 
  CompletionListCssClass="completionLists80" 
  CompletionListHighlightedItemCssClass="itemHighlighted"  
  CompletionListItemCssClass="listItem"> 
  </ajax:AutoCompleteExtender>    
                    </label>
                    </span>
                </div>
            </div>

     <div class="form-row">
<div class="frmrow" style="padding-left:115px;">                    
<span class="sp1">
    
    
    <div class="column">
 <label> 
<div class="column"><lbl id="lbl_RDate" class="fontlabel" style="width:195px;">Date</lbl></div> 
<div class="column"><input type="text" placeholder="DD" id="d_RDate" class="inputcss" style="width:40px;"></div>
<div class="column"><input type="text" placeholder="MM" id="m_RDate" class="inputcss" style="width:40px;"></div>
<div class="column"><input type="text" placeholder="YYYY" id="y_RDate" class="inputcss" style="width:60px;">
</div>
<div class="column"><asp:ImageButton ID="imb_RDate" runat="server"  CssClass="ctldatebutton" ImageUrl="~/image/calendar.png" Height="30"  OnClientClick="Javascript:date('d_RDate','m_RDate','y_RDate');return false;"/>
</div></label>

</div>
            
                                
   </span>

    <span  class="sp2"><label> <asp:Label ID="lbl_To2" runat="server"  CssClass="fontlabel"  Text="To"    width="120px" style="text-align: center"></asp:Label></label></span>

    <span  class="sp3">
 
        
<div class="column">
 <label> 
<div class="column"><lbl id="lbl_RDate1" class="fontlabel" style="width:195px;">Date</lbl></div> 
<div class="column"><input type="text" placeholder="DD" id="d_RDate1" class="inputcss" style="width:40px;"></div>
<div class="column"><input type="text" placeholder="MM" id="m_RDate1" class="inputcss" style="width:40px;"></div>
<div class="column"><input type="text" placeholder="YYYY" id="y_RDate1" class="inputcss" style="width:60px;">
</div>
<div class="column"><asp:ImageButton ID="imb_RDate1" runat="server"  CssClass="ctldatebutton" ImageUrl="~/image/calendar.png" Height="30"  OnClientClick="Javascript:date('d_RDate1','m_RDate1','y_RDate1');return false;"/>
</div></label>

</div>
            
                                
   </span>



</div></div>    

       </div>

      <asp:Button ID="btnshow" CssClass="buttonmsg" runat="server" Text="View" OnClientClick="JavaScript:printpdf(this);return false;" />
     <asp:Button ID="btnreload" CssClass="buttonmsg" runat="server" Text="Cancel" OnClientClick="JavaScript:location.reload();" />

    <br />
    <iframe id="iframe" name="myIframe" width="95%" height="500"></iframe>

    </asp:Panel>

</asp:Content>


