Your IP : 18.119.133.43


Current Path : /data/web/virtuals/51568/virtual/www/www/galerie/
Upload File :
Current File : /data/web/virtuals/51568/virtual/www/www/galerie/galerie-seznam.php

<?php
if (session_id() == '') { session_start(); }
$id = (isset($_SESSION["user_id"])) ? $_SESSION["user_id"] : 0;
if (!isset($pdo)){
 require "../../class/pdoDB.class.php";
 $pdo = new pdoDB();
}

$letosRok = intval (date("Y"));
$letosMesic = intval (date("n"));
if ($letosMesic < 9) {$letosRok--;}

$letos = $letosRok.'/'.(($letosRok + 1) % 100);
$rok = (isset($_REQUEST["rok"])) ? $_REQUEST["rok"] : $letos;  ?>


<div class="upload-div d-flex flex-row flex-wrap my-3" >
<a href="http://w4.zsrepubliky.cz/fotogalerie" target="w4galerie"><button class="btn btn-outline-primary mr-2 rounded-0">Staré <i class="fas fa-external-link-alt"></i></button></a>
<?php
 $dotaz = "SELECT distinct `rok`
from soubory_galerie
where `rok` >= '0000' and `verejna` = '1' 
order by `rok`";
if ($roky = $pdo->queryAll($dotaz, Array())) {
  $i = 0;
 forEach($roky as $tlacitko){ $i++;
 $tlacitkoRok = "'".$tlacitko->rok."'"; 
 $aktualni = $tlacitko->rok == $rok;
 ?>
<button class="btn <?= $aktualni ? 'btn-primary' : 'btn-outline-primary';?> mr-2 rounded-0 <?= ($i == 1) ? " ml-auto " : "";?>"<?= $aktualni ? '' : ' onclick="zvolRokGalerie('.$tlacitkoRok.')"'; ?>><?= $tlacitko->rok?></button>
<?php }
}
?>
</div>
<?php                                                                                     
 $dotaz = "select soubory_galerie.id, nazev, datum, autor_fotek, soubory_galerie.zobrazeno
from soubory_galerie 
where soubory_galerie.verejna = '1' and `rok` = :rok
order by soubory_galerie.datum DESC
limit 0, 100";

 if ($galerie = $pdo->queryAll($dotaz, Array(':rok' => $rok))) { ?> 
<div id="div-tabulka-galerie"  galerie-rok="<?= $rok?>"><table class="table table-sm table-striped" id="tabulka-tabulka-galerie" ><tr style="background-color: #d1ecf1"  id="seznamTit"><th style="width:55%; ">Galerie fotek <?= $rok?></th><th style="width:15%" class="text-right pr-4">vytvořena</th><th style="width:22%">autor fotek</th><th style="width:8%">viděno</th></tr>
<?php forEach($galerie as $gal){        //
  $datum = substr($gal->datum, 0, 10);
  $datum = explode("-", $datum);
  $datum = "$datum[2].$datum[1].$datum[0]"; 
?>
<tr id="radekGalerie<?= $gal->id;?>" style="cursor: pointer;" onclick="galerieUkaz(<?= $gal->id;?>)"> <td ><?= $gal->nazev;?></td> <td class=""><?= $datum;?></td> <td ><?= $gal->autor_fotek;?></td> <td class=""><?= $gal->zobrazeno;?></td></tr><?php     }?></table></div>
<?php

   } else {?>
<div id="div-tabulka-galerie" galerie-rok="<?= $rok?>" class="alert alert-info h5 rounded-0"> Není vytvořena žádná zveřejněná galerie fotek v nastaveném roce.</div>
<?php }

?>
<div id="msg"></div>
<script>
 $(document).ready(function () {

        function checkWidth() {
            var windowWidth = $(window).width();
            if (windowWidth <= 768) {
                $("#seznamTit").addClass("d-none");
            } else {
                $("#seznamTit").removeClass("d-none");
            }
        }
        checkWidth();

        $(window).resize(checkWidth);

        $("#tabulka-tabulka-galerie").basictable({
            breakpoint: 768,
        });
  })
</script>