{if $action == ''}
<!DOCTYPE html>
<html lang="de">
   <head>
     <title>JU & MI Umfragen bearbeiten</title>
      <link rel="stylesheet" href="../jquery/jquery-ui.css">
      <link rel="stylesheet" href="../jquery/jquery.timepicker.min.css">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <script src="../jquery/jquery-3.4.1.min.js"></script>
      <link href="../bootstrap/node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
      <script src="../bootstrap/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
      <!-- nochmals bootstrap.css mit Erweiterungen vom Dashboard -->
      <link href="css/styles.css" rel="stylesheet" />
      <!-- icons in nav-->
      <script src="js/all.js" crossorigin="anonymous"></script>

      <link rel="stylesheet" href="../bootstrap/node_modules/bootstrap-icons/font/bootstrap-icons.css">

   </head>
   <body class="sb-nav-fixed">
      <div id="navtop"></div>
      {literal}
      <script>
         $(function(){
           // im Navbar muss der toggle in der Callbackfunktion definiert werden. Sonst findet jquery getelementbyID nicht
           $("#navtop").load('navtop.php', null, function(){$.getScript('js/scripts.js');});
           $("#navleft").load("nav.php");
           $("#footer").load("footer.php");
         });
      </script>
      {/literal}
      <div id="layoutSidenav">
         <!-- Navigation left -->
         <div id="navleft"></div>
         <div id="layoutSidenav_content">
            <main>
            <!--Anwendung-->
            <script src="../js/components/admin_edit.js"></script>

            <div class="container-fluid">
               <div class="card">
                  <div class="card-header">
                     <i class="fas fa-edit me-1"></i>
                     Erfasste Umfragen
                  </div>
                  <div class="card-body">
                     <div class="row">
                         <!-- bei mobilen Geäten ausblenden:  d-none d-lg-block -->
                         <div class="d-none col-1 col-lg-1 mb-2 mb-sm-3  d-lg-block"><b>Nr</b></div>
                         <div class="d-none col-8 col-lg-5 mb-2 mb-sm-3 d-lg-block"><b>Überschrift</b></div>
                         <div class="d-none d-lg-block col-lg-2 mb-2 mb-sm-3  d-lg-block"><b>Startdatum</b></div>
                         <div class="d-none d-lg-block col-lg-2 mb-2 mb-sm-3 d-lg-block"><b>Enddatum</b></div>
                         <div class="d-none col-3 col-lg-2 mb-2 mb-sm-3  d-lg-block"><b>Bearbeiten</b></div>
                      </div>
                  {section name=table_data1 loop=$table_data1}
                     <div class="row mt-0 mb-0">
                         <div class="col-1 col-lg-1 mb-2 mb-sm-3">{$smarty.section.table_data1.rownum}</div>
                         <div class="col-8 col-lg-5 mb-2 mb-sm-3">{$table_data1[table_data1].headline}
                           <div class="d-block d-lg-none">{$table_data1[table_data1].datum_von} -</div>
                           <div class="d-block d-lg-none">{$table_data1[table_data1].datum_bis}</div>
                         </div>
                         <div class="d-none d-lg-block col-lg-2 mb-2 mb-sm-3">{$table_data1[table_data1].datum_von}</div>
                         <div class="d-none d-lg-block col-lg-2 mb-2 mb-sm-3">{$table_data1[table_data1].datum_bis}</div>
                         <div class="col-3 col-lg-2 mb-2 mb-sm-3">
                           <a href="survey_erfassen.php?edit=1&umid={$table_data1[table_data1].umid}" class="btn btn-primary btn-rounded btn-icon btn-sm"><i class="fa fa-edit" style="width:18px;"></i></a>
                           <a class="btn btn-success btn-rounded btn-icon btn-sm" data-bs-toggle="modal" value="{$table_data1[table_data1].umid}" onclick="ShowDetails(this)" data-bs-target="#exampleModal"><i class="fa fa-eye" style="width:18px;"></i></a>
                           <a class="btn btn-danger btn-rounded btn-icon btn-sm" onclick="onClickDeleteSurvey({$table_data1[table_data1].umid})"><i class="fa fa-trash" style="width:18px;"></i></a>
                         </div>
                      </div>
                  {/section}

<!-- Modal -->
<div class="modal" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Umfrageergebnis</h5>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <div class="modal-body">
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
        <!--<button type="button" class="btn btn-primary">Save changes</button>-->
      </div>
    </div>
  </div>
</div>
<!-- Lösen Sie das Modal mit einem Button aus -->



{literal}
<script>
function ShowDetails(a){
 let value = a.getAttribute("value");
    $( '.modal-body' ).load( 'result_latest.php?editumid='+value , function () {
        $( '#exampleModal' ).modal({show: true });
    });
}
</script>
{/literal}


                  </div>
               </div>
            </div>
            </main>
            <!-- footer -->
            <div id="footer"></div>
         </div>
      </div>
   </body>
</html>
{/if}
