Your IP : 18.218.190.20


Current Path : /data/web/virtuals/51568/virtual/www/www/plany/
Upload File :
Current File : /data/web/virtuals/51568/virtual/www/www/plany/textyTydny.php

            
<?php
  if (file_exists('funkce/DbConnect.php')){
     require_once('funkce/DbConnect.php');
  }
  if (file_exists('funkce/DbConnect.php')){
     require_once('funkce/DbConnect.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);
      ?>   
      
     <hr>
     <div class="h4">Týdny</div>                     
<div id="tydny" class="table-scroll-tydny mb-3 table-scroll" style="min-width: 190px;">                    
  <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)) {
          $checked = ($row->id == $idTydenAktualni);  
          $checkedS = ($checked) ? "checked" : "";          
            ?>                        
    <tr <?php echo ($checked) ?  "id='aktualni'" : ""; ?> class="<?php echo ($row->idplan>0 ) ? " text-success " : "";?>"> 
      <td>                                
        <div class="custom-control custom-radio ml-1 pr-0">                                    
          <input type="radio" class="custom-control-input" id="rgTydenZobr<?php echo $row->id; ?>" name="rgTydenZobr"                                         
          <?php echo $checkedS; ?> >                                     
          <label class="custom-control-label" for="rgTydenZobr<?php echo $row->id; ?>">                                         
            <?php echo $row->cislo;?>                                     
          </label>                                
        </div>                            
      </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(200);
          if(row.length) {
            //tableContainer.scrollTop(row.offset().top - (tableContainer.height()/2))
            tableContainer.scrollTop(row.offset().top - (tableContainer.height()/2))
          }
        }
        NastavRadekTabulky ();
        
    })
</script>