<%@ Page Title="Aufträge VERAG" Language="VB" MasterPageFile="~/Customers/Customers.master" AutoEventWireup="false" CodeFile="CustomsAviso.aspx.vb" Inherits="CustomsAviso_Default" UnobtrusiveValidationMode="None"%>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">  
        <!-- Bootstrap -->
    <html lang="en"></html>
    <!-- Required meta tags -->
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <link rel="shortcut icon" href="../images/Icons/favicon/favicon.ico" />
    <style>    
    .nav-item dropdown::marker {
    background-color: #fff;
    font-size: 0;
    visibility: hidden;
    color: #043381;
    }    
    </style>    
     <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"/>
    <link rel="stylesheet" href="https://unpkg.com/bootstrap-table@1.18.3/dist/bootstrap-table.min.css"/>     
    <link rel="stylesheet" type="text/css" href="../css/main.css"/>
    <link rel="stylesheet" type="text/css" href="../css/style.css"/>
    <link rel="stylesheet" href="https://unpkg.com/bootstrap-table@1.18.3/dist/bootstrap-table.min.css"/>
    <link rel="stylesheet" type="text/css" href="../css/Dropdown.css"/>
   
    <link rel="stylesheet" type="text/css" href="../css/Customers/MasterpageCustomers.css"/>       
    <link rel="stylesheet" type="text/css" href="../css/navbarsidebar2.css"/>      
    <link rel="stylesheet" type="text/css" href="../css/Customers/CustomsAVISO.css"/>      
</asp:Content> 

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="script1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="panelupdate1" runat="server"><ContentTemplate>
        <!-- Webiste-Content-->  
            <div id="containerseiterand" style="margin-left:auto;margin-right:auto">                
                <div class="container-fluid">
                    <div id="cont1">
                            <h1>Aufträge</h1>
                            <div id="line" style="width: 92%;"></div>
                            <br/>                      
                            <h3>Hier finden Sie Informationen zu den aktuellen Aufträgen.</h3>
                        </div>
                   
                     <%Try
                             VERAG_PROG_ALLGEMEIN.cAllgemein.ERR_OP_GLOBAL = VERAG_PROG_ALLGEMEIN.ERROR_OP.SHOW
                             'Dim AD As New VERAG_PROG_ALLGEMEIN.cAdressen(799124)
                             Dim VERAGSQL = New VERAG_PROG_ALLGEMEIN.SQL
                             ' MsgBox(VERAGSQL.GetADMINConnectionString())
                             'Response.Write(AD.Ordnungsbegriff)
                             Dim STANDORT = "SUB"
                             If (Request.QueryString.Count > 0) AndAlso (Request.QueryString("STANDORT") IsNot Nothing) Then
                                 Try
                                     STANDORT = (Request.QueryString("STANDORT"))
                                 Catch ex As Exception
                                     STANDORT = "SUB"
                                 End Try
                             End If
                             If True Then
                                 Dim AVISO_dt As System.Data.DataTable = VERAG_PROG_ALLGEMEIN.cAviso.getAVISO_List(STANDORT)
                                 If AVISO_dt IsNot Nothing Then

                                     If True Then 'AVISO.Status <> 1 And AVISO.Status <> 2 Then 'SENDUNGSTABELLE'%>  
                    
                        <div class="col-12" style="margin-left:4px">
                            <div>
                                  <div style="height:0.936768149882904vh"></div>    
                            <div class="col-12" style="margin-left:2px">
                                        <h2><%=Server.HtmlEncode("Auftrags-Suche")%></h2>                                             
                            </div>
                            <div style="margin-left:6px">
                            <div class="col-12" style="text-align:end">                                                                           
                                        <asp:LinkButton ID="btn_resetForm" runat="server" onclick="btn_resetForm_Click"><%=Server.HtmlEncode("Filter zurücksetzen") %></asp:LinkButton>                               
                             </div>                           
                             <div style="height:0.936768149882904vh"></div>                            
                                <div class="col-12" style="margin-left:8px">
                                        <asp:Label ID="lbl_ArtderAuftraege" runat="server" Text="Auftrags-Status:" data-bs-toggle="tooltip" data-bs-placement="top" title="Wenn nichts angewählt ist, bitte das Datum eingrenzen."></asp:Label> 
                                </div>                                   
                                <div class="d-none d-md-block">                                  
                                <div  style=" width:780px; margin-left:8px">            
                                      <fieldset>
                                         <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>                                       
                                        <label><input id="rbt_Alle" onselect="GetSelectedVal(this)" type="radio" name="art" value="Alle" data-bs-toggle="tooltip" style="margin-right:4px" data-bs-placement="top" title="Wenn dieser Filter angewählt ist, bitte das Datum eingrenzen." runat="server"/>Alle</label>
                                        <label style="margin-right:4px;"><input id="rbt_Erf" onclick="GetSelectedVal(this)" type="radio" name="art" value="Erfasst" style="margin-right:4px" runat="server"/>Erfasst</label>
                                        <label style="margin-right:4px;"><input id="rbt_Vorb" onclick="GetSelectedVal(this)" type="radio" name="art" value="Vorbereitet" style="margin-right:4px" runat="server"/>Vorbereitet</label>
                                        <label style="margin-right:4px;"><input id="rbt_Vorg" onclick="GetSelectedVal(this)" type="radio" name="art" value="Vorgeschrieben"  style="margin-right:4px" runat="server"/>Vorgeschrieben</label>
                                        <label style="margin-right:4px;"><input id="rbt_Ankunft" onclick="GetSelectedVal(this)" type="radio" name="art" value="Ankunft" style="margin-right:4px" runat="server"/>Ankunft</label>
                                        <label style="margin-right:4px;"><input id="rbt_Freig" onclick="GetSelectedVal(this)" type="radio" name="art" value="Freigabe" data-bs-toggle="tooltip" data-bs-placement="top" title="Wenn dieser Filter angewählt ist, bitte das Datum eingrenzen." style="margin-right:4px" runat="server">Freigabe</label>                                                                               
                                     </fieldset>                                                                    
                                 </div>                                    
                                  </div>
                                   <div class="d-md-none"> 
                                       <div class="col-8" style="margin-left:8px">
                                        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>                                        
                                        <label><input id="rbt_Alle_M" onclick="GetSelectedVal(this)" type="radio" name="art2" value="Alle" data-bs-toggle="tooltip" data-bs-placement="top" title="Wenn dieser Filter angewählt ist, bitte das Datum eingrenzen." class="CSS_input" runat="server"/>Alle</label>
                                        <label style="margin-right:144px;"><input id="rbt_Erf_M" onclick="GetSelectedVal(this)" type="radio" name="art2" value="Erfasst" style="margin-right:4px" runat="server"/>Erfasst</label>
                                        <label><input id="rbt_Vorb_M" onclick="GetSelectedVal(this)" type="radio" name="art2" value="Vorbereitet" style="margin-right:4px" runat="server"/>Vorbereitet</label>
                                        <label><input id="rbt_Vorg_M" onclick="GetSelectedVal(this)" type="radio" name="art2" value="Vorgeschrieben" style="margin-right:4px" runat="server"/>Vorgeschrieben</label>
                                        <label style="margin-right:22px"><input id="rbt_Ankunft_M" onclick="GetSelectedVal(this)" type="radio" name="art2" value="Ankunft" style="margin-right:4px" runat="server"/>Ankunft</label>
                                        <label style="margin-right:52px"><input id="rbt_Freig_M" onclick="GetSelectedVal(this)" type="radio" name="art2" value="Freigabe" data-bs-toggle="tooltip" data-bs-placement="top" title="Wenn dieser Filter angewählt ist, bitte das Datum eingrenzen." style="margin-right:4px" runat="server">Freigabe</label>                                                                              
                                       </div>                                  
                                  </div> 
                                </div>
                             <div style="height:0.936768149882904vh"></div>           
                            <div class="col-12" id="cont4">                                
                            <div class="col-12" id="container2" style="margin-left:2px;">                                                                     
                                            <asp:Label ID="lbl_von" runat="server" Text="Von:"></asp:Label>                                             
                                            <asp:TextBox id="pickdate1" Type="Date" CssClass="classTarget" requiered="true" OnTextChanged="pickdate1_TextChanged" runat="server"></asp:TextBox>  
                                            <asp:CustomValidator runat="server" ID="valDateRange_1" ControlToValidate="pickdate1"  Display="Dynamic" onservervalidate="valDateRange_1_ServerValidate" ErrorMessage="" SetFocusOnError="true" ValidationGroup="DateValid" />   
                                <!--<asp:RequiredFieldValidator ID="RequiredFieldValidatorvon" runat="server" ErrorMessage="Field required" ControlToValidate="pickdate1" Text="Required" ForeColor="White" Font-Strikeout="False" Font-Underline="False" Font-Overline="False" Font-Bold="True" BackColor="Red"></asp:RequiredFieldValidator>              
                                            <asp:CustomValidator ValidateEmptyText="false" ClientValidationFunction="instantValidation"></asp:CustomValidator>            -->
                                <asp:Label ID="lbl_bis" runat="server" Text="Bis:"></asp:Label> 
                                           <!-- <asp:RequiredFieldValidator ID="RequiredFieldValidatorbis" ClientValidationFunction="validate" runat="server" ErrorMessage="Field required" ControlToValidate="pickdate2" Text="Required" ForeColor="White" Font-Strikeout="False" Font-Underline="False" Font-Overline="False" Font-Bold="True" BackColor="Red"></asp:RequiredFieldValidator>              -->
                                            <asp:TextBox id="pickdate2" Type="Date" CssClass="classTarget" OnTextChanged="pickdate2_TextChanged" required="true" runat="server"></asp:TextBox>
                                            <asp:CustomValidator runat="server" ID="valDateRange_2" ControlToValidate="pickdate2" Display="Dynamic" onservervalidate="valDateRange_2_ServerValidate" ErrorMessage="" SetFocusOnError="true" ValidationGroup="DateValid"/>             
                            </div>                                      
                             <div id="Abstand"></div>  
                              <hr>
                                
                                <div id="accordion">                                    
                                 <div class="accordion" id="accordionExample">
                                      <div class="accordion-item">
                                        <h2 class="accordion-header" id="headingOne">
                                          <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne" style="height:10px;">Erweiterte Suche</button>
                                          </h2>
                                        </div>
                               <asp:HiddenField ID="hfAccordionIndex" runat="server" />
                                        <div id="collapseOne" class="accordion-collapse collapse hide" aria-labelledby="headingOne" data-bs-parent="#accordionExample">   
                                                    <div class="card card-body">
                                                     <div class="col-12" id="cont3">                                  
                                                         <div class="container">                                
                                                          <div id="Abstand"></div>     
                                                              <div class="d-none d-md-block">
                                                                     <!-- Optionale Suchparameter-->
                                                         <div class="row">
                                                              <div id="rowcol1" class="col-12">    
                                                                  <form class="myform" id="commentForm">
                                                                    <asp:Label ID="lbl_LKWNr" runat="server" Text="LKW Nr"></asp:Label>                                        
                                                                    <asp:TextBox ID="txt_LKWNr" runat="server" style="width:117px; margin-left:25px;" OnTextChanged="txt_LKWNr_TextChanged"></asp:TextBox>                                                                       
                                                                    <asp:RegularExpressionValidator ControlToValidate="txt_LKWNr" runat="server" ID="regexval_txt_LKW" ValidationGroup="additional_TXTs" ValidationExpression="^([A-Z0-9]{30})\d$" Display="Dynamic" ErrorMessage="Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
                                                                    <asp:Label ID="lbl_KdNrAuftrag" runat="server" Text="Kunden Auftrags Nr" style="margin-left:45px"></asp:Label>                                                                  
                                                                    <asp:TextBox ID="txt_KdNrAuftrag" runat="server" style="width:117px; margin-left:6px;" OnTextChanged="txt_KdNrAuftrag_TextChanged"></asp:TextBox> 
                                                                    <asp:RegularExpressionValidator ControlToValidate="txt_KdNrAuftrag" runat="server" ID="regexval_txt_KdNrAuftrag" ValidationGroup="additional_TXTs" ValidationExpression="[0-9]{7}" Display="Dynamic" ErrorMessage="Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
                                                                 </form>
                                                             </div>
                                                             <div  id="rowcol2" class="col-12">
                                                                    <asp:Label ID="lbl_Absender" runat="server" Text="Absender"></asp:Label>                              
                                                                    <asp:TextBox ID="txt_Absender" runat="server" style="width:155px; margin-left:8px;" OnTextChanged="txt_Absender_TextChanged"></asp:TextBox>             
                                                                    <asp:RegularExpressionValidator ControlToValidate="txt_Absender" runat="server" ID="regexval_txt_Absender" ValidationGroup="additional_TXTs" ValidationExpression="^([A-Z0-9]{90})\d$" Display="Dynamic" ErrorMessage="Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
                                                                    <asp:Label ID="lbl_Empfaenger" runat="server" Text="Empfänger" style="margin-left:9px"></asp:Label>                                         
                                                                    <asp:TextBox ID="txt_Empfaenger" runat="server" style="width:155px; margin-left:52px;" OnTextChanged="txt_Empfaenger_TextChanged"></asp:TextBox>
                                                                    <asp:RegularExpressionValidator ControlToValidate="txt_Empfaenger" runat="server" ID="regexval_txt_Empfaenger" ValidationGroup="additional_TXTs" ValidationExpression="^([A-Z0-9]{90})\d$" Display="Dynamic" ErrorMessage="Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
                                                            </div>                                                             
                                                             </div>
                                                                  </div>
                                                              <div class="d-md-none"> 
                                                                <div id="rowcol3" class="col-10 row" style="margin-right:/*1.52px;*/0.33480176211453744vw;">
                                                                 <div class="row">
                                                                    <asp:Label ID="lbl_LKWNr_M" runat="server" Text="LKW Nr"></asp:Label>                                        
                                                                    <asp:TextBox ID="txt_LKWNr_M" runat="server" style="width:117px; margin-left:25px;" OnTextChanged="txt_LKWNr_M_TextChanged"></asp:TextBox> 
                                                                     <asp:RegularExpressionValidator ControlToValidate="txt_LKWNr" runat="server" ID="regexval_txt_LKWNr_M" ValidationGroup="additional_TXTs" ValidationExpression="^([A-Z0-9]{30})\d$" Display="Dynamic" ErrorMessage="Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
                                                                 </div>
                                                                 <div id="rowcol4" class="col-10 row" style="margin-right:/*1.52px;*/0.33480176211453744vw;">

                                                                        <asp:Label ID="lbl_KdNrAuftrag_M" runat="server" Text="Kunden Auftrags Nr" style="margin-left:45px"></asp:Label>                                                                  
                                                                        <asp:TextBox ID="txt_KdNrAuftrag_M" runat="server" style="width:117px; margin-left:6px;" OnTextChanged="txt_KdNrAuftrag_M_TextChanged"></asp:TextBox>
                                                                     <asp:RegularExpressionValidator ControlToValidate="txt_KdNrAuftrag_M" runat="server" ID="regval_txt_KdNrAuftrag_M" ValidationGroup="additional_TXTs" ValidationExpression="^[0-9]{7}$" Display="Dynamic" ErrorMessage="Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
                                                                    </div>
                                                                 <div  id="rowcol5" class="col-10 row" style="margin-right:/*1.52px;*/0.33480176211453744vw;">
                                                                        <asp:Label ID="lbl_Absender_M" runat="server" Text="Absender"></asp:Label>                              
                                                                        <asp:TextBox ID="txt_Absender_M" runat="server" style="width:155px; margin-left:8px;" OnTextChanged="txt_Absender_M_TextChanged"></asp:TextBox> 
                                                                     <asp:RegularExpressionValidator ControlToValidate="txt_Absender_M" runat="server" ID="regval_txt_Absender_M" ValidationGroup="additional_TXTs" ValidationExpression="^([A-Z0-9]{90})\d$" Display="Dynamic" ErrorMessage="Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
                                                                 </div>
                                                                    <div id="rowcol6" class="col-10 row" style="margin-right:/*1.52px;*/0.33480176211453744vw;">
                                                                        <asp:Label ID="lbl_Empfaenger_M" runat="server" Text="Empfänger" style="margin-left:9px"></asp:Label>                                         
                                                                        <asp:TextBox ID="txt_Empfaenger_M" runat="server" style="width:155px; margin-left:52px;" OnTextChanged="txt_Empfaenger_M_TextChanged"></asp:TextBox>
                                                                        <asp:RegularExpressionValidator ControlToValidate="txt_Empfaenger_M" runat="server" ID="regval_txt_Empfaenger_M" ValidationGroup="additional_TXTs" ValidationExpression="^([A-Z0-9]{90})\d$" Display="Dynamic" ErrorMessage="Falsche Eingabe!" SetFocusOnError="true"></asp:RegularExpressionValidator>
                                                                    </div>                                                                     
                                                             </div>
                                                           </div>
                                                         </div>
                                                        </div>  
                                                   </div>
                                        </div>                        </div> 
                                <div id="Abstand_laenger" style="height: /*24px*/ 1.873536299765808vh;"></div>     
                                    <asp:Button ID="btn_Auftraege" class="btn-primary" runat="server" Text="Erhalte Aufträge" OnClick="btn_Auftraege_Click" style="background-color:#fff;color:#043381;height:30px;width:18%;font-size:1.33em;" OnClientClick="return verify()"/>
                              <div id="Abstand_lang" style="height: /*32px*/ 2.498048399687744vh;"></div> 
                                    
                            <div class="g-3">                                            
                                             <div id="conovertab" style="overflow-x:auto;"margin-left="-2px"> 
                                                   <asp:Table class="table table-responsive table-striped table-borderless" id="normaltable" runat="server" EnableViewState="false" BorderWidth="2px">
                                                        <asp:TableHeaderRow id="tbl_Header_row" runat="server" style="background-color:#043381;color:#fff">                                                        
                                                            <asp:TableHeaderCell ID="tbl_HeaderCellIndexNr" runat="server">Index-Nr</asp:TableHeaderCell>   
                                                            <asp:TableHeaderCell ID="tbl_HeaderCell_LKWs" runat="server">LKW-Nr</asp:TableHeaderCell>
                                                            <asp:TableHeaderCell ID="tbl_HeaderCell_Status" runat="server">Status</asp:TableHeaderCell>
                                                            <asp:TableHeaderCell ID="tbl_HeaderCell_Auftragsdatum" runat="server">Auftragsdatum</asp:TableHeaderCell>                                                            
                                                            <asp:TableHeaderCell ID="tbl_HeaderCell_Absender" runat="server">Absender</asp:TableHeaderCell>
                                                            <asp:TableHeaderCell ID="tbl_HeaderCell_Empfaenger" runat="server">Empfänger</asp:TableHeaderCell>                                                            
                                                            <asp:TableHeaderCell ID="tbl_HeaderCell_KundAuftNr" runat="server">Auftrags-Nr</asp:TableHeaderCell>
                                                            <asp:TableHeaderCell ID="tbl_HeaderCell_Info" runat="server">Info</asp:TableHeaderCell>
                                                        </asp:TableHeaderRow>
                                                   </asp:Table>                                                                                        
                                           </div> 
                            </div>
                                       
                                       </div></div>
                       </div>                                              
                          <br /><br /><br />
                   <%                 End If
                               End If
                           End If
                       Catch ex As Exception
                           Response.Write(ex.Message & ex.StackTrace)
                       End Try %>                                                                          
                                                                                     <div></div></div>  
                    </ContentTemplate></asp:UpdatePanel>                                                                                  
    
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>   
    <script>
        $('#accordion').on('shown.bs.collapse', function (e) {
            $(e.target).data('bs.collapse').$trigger.attr('src', 'https://s22.postimg.org/hkrauaofx/Mathematic_Minus2.png');
        });
        $('#accordion').on('hidden.bs.collapse', function (e) {
            $(e.target).data('bs.collapse').$trigger.attr('src', 'https://s22.postimg.org/9takvqkal/Mathematic_Plus2.png');
        });
    </script>
   
    <script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script>
    <script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/additional-methods.min.js"></script>
    <script>       
       function GetSelectedVal(ele) {        
           var el = $(ele).closest('label').text();

           var date1 = document.getElementById('<%=pickdate1.ClientID%>');
           var date2 = document.getElementById('<%=pickdate2.ClientID%>');
           $("#container2").hide();
           if (el == "Alle") {           
               date1.required = true;
               date2.required = true;
               $("#container2").show();              
            } else if (el == "Freigabe") {           
               date1.required = true;
               date2.required = true;
               $("#container2").show();                        
            } else {            
               date1.required = false;
               date2.required = false;
               date1.text() = null;                                
               date2.text() = null;
               $("#container2").hide();               
            }
        }        
    </script>    
    <script type="text/javascript">
        $(document).ready(function () {
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
            function EndRequestHandler(sender, args) {
                $('.classTarget).datepicker({ dateFormat: 'dd.MM.yyyy' });
            }
        });
    </script>        
    <script type="text/javascript">
        function compareDate(str1, str2){
            // str1 format should be dd/mm/yyyy. Separator can be anything e.g. / or -. It wont effect
            var date1 = new Date(str1);
            var date2 = new Date(str2);
            var year0 = new Date('01.01.2001')
            if (date1.getFullYear() < year0.getFullYear()) {
                return false;
            } else {
                return true;
            }
        };
    </script>   
    <script>
       $(document).ready(function () {
           //when a group is shown, save it as the active accordion group
           $("#accordionExample").on('shown.bs.collapse', function () {
               var active = $("#accordionExample .in").attr('id');
               $.cookie('activeAccordionGroup', active);
               //alert(active);
           });
           $("#accordionExample").on('hidden.bs.collapse', function () {
               $.removeCookie('activeAccordionGroup');
           });
           var last = $.cookie('activeAccordionGroup');
           if (last != null) {
               //remove default collapse settings
               $("#accordionExample").removeClass('in');
               //show the account_last visible group
               $("#" + last).addClass("in");
           }
       });
     </script>    
</asp:Content>