Your IP : 3.16.69.218


Current Path : /data/web/virtuals/51568/virtual/www/plan/
Upload File :
Current File : /data/web/virtuals/51568/virtual/www/plan/planyTydny.php

            
<?php
      $sql = "select pl_idtydne_dnes($idRok, $idTyden)";
      $result = mysqli_query($conn, $sql);
      $row = mysqli_fetch_array($result, MYSQLI_NUM);
      $idTydenAktualni = $row[0];   
  
      $sql = "SELECT `id`, `idrok`, `cislo`, `zacatek`, `idplan` FROM `pl_tydny` WHERE idrok=$idRok"; 
      $result = mysqli_query($conn, $sql);
      ?>                        
<div id="tydny" class="table-scroll-container-40 mb-3 table-scroll" style="min-width: 150px; max-width: 150px;">                    
  <table class="table table-striped table-bordered table-sm ">                        
    <thead>                            
      <tr>                                
        <td>týden</td>                                
        <td>začátek</td>                            
      </tr>                        
    </thead>                        
<?php   while ($row =  mysqli_fetch_object($result)) {   ?>                        
    <tr <?php echo ($row->id == $idTydenAktualni) ?  "id='aktualni'" : ""; ?>> 
      <td class="text-center <?php echo ($row->idplan > 0) ? "text-success font-weight-bold" : "text-danger"?>"><?php echo $row->cislo;?></td>                            
      <td>                                
        <?php echo date('d.m.Y', strtotime($row->zacatek));?>
      </td>                        
    </tr>                        
    <?php  }  ?>                    
  </table>                
</div>

<script>
    $(document).ready(function () {
    
        function NastavRadekTabulky (){
          var
            tableContainer = $('#tydny'),
            row  = $('#aktualni');
            //tableContainer.scrollTop(220);
            tableContainer.scrollTop(0);
          if(row.length) {
            //tableContainer.scrollTop(row.offset().top - (tableContainer.height()/2))
            tableContainer.scrollTop(row.offset().top - (tableContainer.height()/2))
          }
        }
        NastavRadekTabulky ();
        
    })
</script>