<%@ Page Language="VB" Debug="true" AutoEventWireup="false" CodeFile="AvisoTV_FLEX.aspx.vb" Inherits="_Default" %>
             
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>      
    <!-- Bootstrap -->
    <html lang="en"></html>
    <!-- Required meta tags -->
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1" title="Verag Spedition AG AvisoTV Flex"/>
   
    <!-- 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"/>
           <!-- 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 href="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"/>
    
    <%@ import Namespace="MySql.Data.MySqlClient" %>
    <script runat="server">

        Sub Page_Load() Handles Me.Load

            'Login-Validierung
            If Not Me.Page.User.Identity.IsAuthenticated Then
                FormsAuthentication.RedirectToLoginPage()
            End If

            '  MsgBox ("test")
            'Dim con As New MySqlConnection
            'Dim cmd As New MySqlCommand
            '   Dim reader As MySqlDataReader

            '  con.ConnectionString = "Server=localhost;Database=verag_homepage;Uid=sec_user;Pwd=eKcGZr59zAa2BEWU;"
            ' cmd.Connection = con
            'cmd.CommandText = "select * from map"
            'Try
            'con.Open()
            'MsgBox("conn")
            'reader = cmd.ExecuteReader
            'grid.DataSource = reader
            'reader.Read()

            'MsgBox(reader("title"))
            'DataBind()

            'reader.Close()

            'Catch ex As Exception
            ' MsgBox("err")
            ' End Try
            ' con.Close()

            'If Ver.LIST.Contains(Environment.UserName) == True Then '
            ' Response.Redirect("~{login/login.aspx")'
            'End If '
        End Sub

        ' Public ReadOnly Property CurrentCity() As String
        '   Get
        '    Return "asd"
        '  End Get
        ' End Property,
    </script>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>VERAG AVISO-TV Online</title>
        <link rel="stylesheet" type="text/css" href="css/main.css"/>
        <link rel="stylesheet" type="text/css" href="css/style.css"/>
        <link rel="stylesheet" type="text/css" href="css/status.css"/>
        <link rel="SHORTCUT ICON" href="images/Icons/favicon/favicon.ico" />
    <!-- <link rel="stylesheet" type="text/css" href="css/edit_main.css"> -->
    <link rel="stylesheet" type="text/css" href="css/Dropdown.css" />
    <style>        
       body {
    background-image: url(images/road.jpg);
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    background-color: #fff;
}
    </style>

    <script src="js/netzwerk.js" type="text/javascript"></script>        
    <link rel="stylesheet" type="text/css" href="../stylesheets/style.css"/>
    <link rel="stylesheet" type="text/css" href="../stylesheets/example.css"/>
    <script type="text/javascript">
        // Vergebe den Event-Handler
        document.onkeydown = handleKeyEvent;
        // Funktion, die den Event verarbeitet
        function handleKeyEvent(e) {
            // MSIE nimmt das Event-Objekt aus window.event, DOM-kompatible Browser aus dem e-Funktionsparameter
            if (!e) e = window.event;
            // keyCode muss 70 sein und ctrlKey true
            if (e.keyCode == 68 && e.ctrlKey) {
                alert('Strg+D wurde gedrückt');
                //topup
            }
        }
    </script>
              
    <!-- Scroll Script-->
    <script src="//code.jquery.com/jquery-1.11.3.min.js"></script>   
    
    <link rel="stylesheet" type="text/css" href="css/StyleSheetWebsiteNew.css"/>

    <script type="text/javascript" src="js/languageupdatescript.js"></script>
     
    <!--Hover Info --> 
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
     <!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> -->
        <script type="text/javascript">
            
                $(document).ready(function(){
                    $(".btn").click(function () {
                        $("#myModal").modal("show");
                    });
                });
        </script>      

    <link rel="stylesheet" type="text/css" href="css/AVISOTV_Flex.css" />
</head>

 <body>   
      <div class="containerall">
        <form id="leftLinks" runat="server">            
                          
                                <div id="bodycontent">                                    
                                     
                 <span class="content_all" style="background-color:#fff">
                                             
                        <!-- <div id="nav-main">
                        <div id="art-logo"></div>
                        </div>        
                        <div id="main-menu">
                        </div> -->
                        <!-- </div> -->       
                                                                    
                                                                              <%
                                                                                  Dim navParent = "AvisoTV_Flex.aspx?"
                                                                                  Dim laenderkuerzel As String = "de"

                                                                                  Dim imgPath As String = ""
                                                                                  If HttpContext.Current.Request.Url.AbsoluteUri.ToString.Contains("admin.aspx") Then
                                                                                      navParent = "admin.aspx"
                                                                                      imgPath = "../"
                                                                                  End If

                                                                                  Dim curentMenuId As String = "1"
                                                                                  If Not Request.QueryString("menuID") Is Nothing Then
                                                                                      curentMenuId = Request.QueryString("menuID")
                                                                                  End If

                                                                                  If Not Request.QueryString("lan") Is Nothing Then
                                                                                      laenderkuerzel = Request.QueryString("lan")
                                                                                  End If
                                                                                  %>          
                                                                                                                                                                                                 
                                                                          <!--  <div class="pagecontent">-->
                                                                       <!--   <div class="content_all"><div class="content_all"> -->
              
                                                                              <!-- Dropdown Button Languages--> 
                                                                         <!--     <%'Dim name As String
'name = "AvisoTV_Flex.aspx"%>

                                                         <div Class="dropdown"> 
                                                                <button Class="dropbtn"> <img id="myImage" src="images/flags/flagge_A.gif" style="border:1px solid #000;width:30px;"/>Language Picker</button>
                                                                <div Class="dropdown-content">                
                                                                    <a id="ButtonOesterreichLangPicker" class="btn btn-primary btn-sm" onclick="changeflag(A)" href="<%'=name %>?AvisoId=<%'=Request.QueryString("AvisoId")%>&lan2=DE"><img src="images/flags/flagge_A.gif" style="border:1px solid #000;width:30px;"/>Österreich</a>
                                                                    <a id="ButtonDeutschLangPicker" class="btn btn-primary btn-sm"  onclick="changeflag(D)" href="<%'=name %>?AvisoId=<%'=Request.QueryString("AvisoId")%>&lan2=de"><img src="images/flags/flagge_D.gif" style="border:1px solid #000;width:30px;"/>Deutsch</a>
                                                                    <a id="ButtonEnglischLangPicker" class="btn btn-primary btn-sm" onclick="changeflag(GB)" href="<%'=name %>?AvisoId=<%'=Request.QueryString("AvisoId")%>&lan2=EN"><img src="images/flags/flagge_GB.gif" style="border:1px solid #000;width:30px;"/>Englisch</a>
                                                                    <a id="ButtonSerbischLangPicker" class="btn btn-primary btn-sm" onclick="changeflag(BIH)" href="<%'=name %>?AvisoId=<%'=Request.QueryString("AvisoId")%>&lan2=SRB"><img  src="images/flags/flagge_BIH.gif" style="border:1px solid #000;width:30px;"/>Bosnien und Herzegowina</a> 
                                                                    <a id="ButtonSerbischZweiLangPicker" class="btn btn-primary btn-sm" onclick="changeflag(SM)" href="<%'=name %>?AvisoId=<%'=Request.QueryString("AvisoId")%>&lan2=SRB"><img src="images/flags/flagge_SM.gif" style="border:1px solid #000;width:30px;"/>Serbien</a> 
                                                                    <a id="ButtonBulgariaLangPicker" class="btn btn-primary btn-sm" onclick="changeflag(BG)" href="<%'=name %>?AvisoId=<%'=Request.QueryString("AvisoId")%>&lan2=BG"><img src="images/flags/flagge_BG.gif" style="border:1px solid #000;width:30px;"/>Bulgarien</a>
                                                                    <a id="ButtonTürkeiLangPicker" class="btn btn-primary btn-sm"  onclick="changeflag(TR)" href="<%'=name %>?AvisoId=<%'=Request.QueryString("AvisoId")%>&lan2=TR"><img src="images/flags/flagge_TR.gif" style="border:1px solid #000;width:30px;"/>Türkei</a>
                                                                </div>
                                                        </div> -->
                                                                                <%
'Dim lan As String = Request.QueryString("lan")
'If lan ="" then lan="de"
'Dim menuID As String = Request.QueryString("menuID")
'If menuID = "" Then menuID = "1"
'Dim DB2 As New cDBFunctions
                                                                               %>
                                                                               <% 
                                                                                   VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False

                                                                                   Dim LT As New VERAG_PROG_ALLGEMEIN.cLanguageText_LIST("HOMEPAGE", "LOGIN", "STATUS", "")
                                                                                   Dim V_LST As New VERAG_PROG_ALLGEMEIN.cVermerkeCodes_LIST
                                                                                   Dim lan = "DE"

                                                                                   'Response.Write(DB2.qry_contentNew(menuID, lan)) %>
                                                                                <!--   </div> -->
                                         <div class="container">
                                                  <!-- Navigation Bar-->                                               
                                                 <nav class="navbar navbar-expand-lg navbar-light">                    
                                                   <li class="nav-item">
                                                            <a class="navbar-brand" href="newpageJulius_Sidebar.aspx"><img src="images/Logo_small.png"  style:"width:120px" alt="Schriftzug: Verag AG Blaue Schrift: Verag Spedition Graue Schrift: AG" data-toggle="tooltip" data-placement="top" title="https://www.verag.ag"/></a>
                                                   </li>                             
                                                </nav>
                                         </div>
                     <!-- Webiste-Content-->
                                          <h1>Verag AVISO-TV Online</h1>
                                            <div id="line"></div>
                                            <br/> 
                                            <h3>Hier finden Sie Informationen zu den aktuell an der Grenze stehenden LKWs.</h3>
            
                                            <!--<br><br>
                                            Die Mitarbeiter der VERAG Spedition AG haben sich auf die Bereiche Zoll und Steuer spezialisiert und können so ihren Kunden einen individuell abgestimmten Service anbieten.
                                            <br><br>
                                            Nehmen Sie sich etwas Zeit, um sich über unser umfangreiches Dienstleistungsangebot zu informieren! -->
                                            <br/><br/><br/>

                                             <% '?key=hello%20world
                                                 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
                                                                 '%>    
                                                                 <h2><%=STANDORT %></h2>
                                                                </span>             
                                     
                                                                <div class="container-xxl" style="overflow-y:auto;scroll-padding-inline:auto;min-width:97%; max-width:100%">                                                                                             
                                                                                             <table class="table table-hover" id="normaltable" border="0" cellspacing="0" contenteditable="false">                                   
                                                                                                                                        <thead style="background-color:#043381; color:white; font-weight:900"><tr ><th>Nr.</th><th>LKW Kennzeichen</th><th>Frächter</th><th>Avisierer</th><th>Ankunft</th><th>Dauer</th><th>LKW fertig</th></tr></thead>
                                                                                                                                      <%
                                                                                                                                          Dim cnt = 0
                                                                                                                                          For Each AVISO_ROW In AVISO_dt.Rows
                                                                                                                                              Dim dauer = ""
                                                                                                                                              If AVISO_ROW("Ankunft") IsNot DBNull.Value Then
                                                                                                                                                  Dim rMinute = DateDiff(DateInterval.Minute, CDate(AVISO_ROW("Ankunft")), Now)
                                                                                                                                                  Dim m_TimeSpan As TimeSpan = New TimeSpan(0, rMinute, 0)
                                                                                                                                                  dauer = Format((m_TimeSpan.Days * 24) + m_TimeSpan.Hours, "0") & " Std. " & Format(m_TimeSpan.Minutes, "00") & " min"
                                                                                                                                              End If

                                                                                                                                              Dim statOK_style = "" '" class=""statusNONE"" "
                                                                                                                                              If AVISO_ROW("LKW_Fertig") = "OK" Then 'IsNot Nothing And s.tblSnd_Vorbereitet IsNot Nothing) Then
                                                                                                                                                  statOK_style = " class=""statusOK"" "
                                                                                                                                              End If

                                                                                                                                              Dim VarA As String = ""
                                                                                                                                              Dim AvisoId = ""
                                                                                                                                              Dim ID As Integer = AVISO_dt.Rows.IndexOf(AVISO_ROW)

                                                                                                                                              Try
                                                                                                                                                  'AvisoId = VERAG_PROG_ALLGEMEIN.cCryptography3.Decrypt("")
                                                                                                                                                  AvisoId = VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(AVISO_ROW("AvisoID"))
                                                                                                                                              Catch ex As Exception
                                                                                                                                                  If Request.QueryString("test") = "VERIMEX" Then
                                                                                                                                                      AvisoId = "596981"
                                                                                                                                                  End If
                                                                                                                                              End Try
                                                                                                                                              'Dim link As String = "Par1=" + AVISO_ROW("LKW_Nr") + "Par2=" + AVISO_ROW("Frächter") + "Par3=" + AVISO_ROW("Auftraggeber") + "Par4=" + AVISO_ROW("Ankunft") + "Par5=" + AVISO_ROW("LKW_Fertig") + "Par6=" + STANDORT + "Par7=" + lan
                                                                                                                                             %>      
                                                                                                                                                
                                                                                                                                             <tbody class="table-light table-responsive-xxl table-striped" contenteditable="false"> 
                                                                                                                                                  <tr style="transform: rotate(0);">
                                                                                                                                                     <th scope="row"><a href="status_Julius.aspx?AvisoId=<%=AvisoId%>&lan2=<%=laenderkuerzel%>" rel="nofollow" target="_blank" class="stretched-link"><%Response.Write(cnt + 1)%></a></th>
                                                                                                                                                   <!--  <td><% 'Response.Write(cnt + 1)%> </td>  -->                                                                                          
                                                                                                                                                     <td><% Response.Write(AVISO_ROW("LKW_Nr"))%> </td>                                                                                                
                                                                                                                                                     <td><% Response.Write(AVISO_ROW("Frächter")) %></td>
                                                                                                                                                     <td><% Response.Write(AVISO_ROW("Auftraggeber")) %></td>
                                                                                                                                                     <td><% Response.Write(AVISO_ROW("Ankunft")) %></td>
                                                                                                                                                     <td><% Response.Write(dauer) %></td>
                                                                                                                                                     <td <%=statOK_style %>><% Response.Write(AVISO_ROW("LKW_Fertig")) %></td>
                                                                                                                                                   </tr>
                                                                                                                                             </tbody>                                                                                       
                                                                                                                                        <% 
                                                                                                                                                cnt += 1
                                                                                                                                            Next
                                                                                                                                                 %>                                                                                                  
                                                                                                                                           </table>
                                                                                              </div></div>                                                                             
                                                                                              <%
                                                                                                              End If
                                                                                                          End If
                                                                                                      End If
                                                                                                  Catch ex As Exception
                                                                                                      Response.Write(ex.Message & ex.StackTrace)
                                                                                                  End Try
                                                                                  %>
                                                                                     <div></div></div>     
                                                                                    <%--  <div class="footer_menu">
                                                                                        <div class="footer_menu_content">      
                                                                                             <table>                    
                                                                                                    <tr>   
                                                                                        </tr>
                                                                                    </table>      
                                                                                     </div>
                                                                                </div>--%>
                                                                <div class="align-self-end">
                             <div class="footer">
                                <div class="footer_content"><b>VERAG Spedition AG</b> &nbsp;&nbsp; A-4975 Suben 100 &nbsp;&nbsp; Tel.: +43 7711 2777-0,&nbsp;&nbsp;Fax: +43 7711 31600,&nbsp;&nbsp;email: info@verag.ag</div> </div>                              
      </div>   </form>
     </div>
         <!-- Bootstrap-->
         <script type="text/javascript" src="js/toptions/top_up-min.js"></script>   
         <script type="text/javascript" src="js/scrollscript.js"></script>   
         <!-- JQUERY Script fuer Modal-->
         <script src="//code.jquery.com/jquery-1.11.1.min.js"></script>

         <!-- jQuery CDN - Slim version (=without AJAX) -->
        <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
        <!-- Popper.JS -->
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
        <!-- Bootstrap JS -->
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>       
        <!-- jQuery Custom Scroller CDN -->
        <script src="https://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.concat.min.js"></script>
</body>  