Current Path : /data/web/virtuals/51568/virtual/www/www/ucebnice/ |
Current File : /data/web/virtuals/51568/virtual/www/www/ucebnice/ucebnice-sklad-pohyby.php |
<?php if (!isset($pdo)){ if (file_exists("class/pdoDB.class.php")) {require "class/pdoDB.class.php";} else {require "../../class/pdoDB.class.php";} $pdo = new pdoDB(); } $idkniha = isset($_REQUEST["idkniha"]) ? $_REQUEST["idkniha"] : 0; $dotaz = "SELECT `id`, `typ`, `datum`, `kusu`, `poznamka` FROM `skl_prirustky` WHERE `idkniha` = :idkniha order by datum desc, id desc"; $pohyby = $pdo->queryAll($dotaz, Array(':idkniha' => $idkniha)); if ($pohyby){?> <table id="tblUcPohyby" class="table table-sm tabulka-clanky" style="width: 99%"> <tr class="alert alert-info"> <th class=''>datum</th> <th class="text-center">typ</th> <th class='text-center'>počet</th> <th>poznámka</th> </tr> <?php forEach($pohyby as $po){ list($rok, $mes, $den) = explode('-', $po->datum); $datum = "$den.$mes.$rok"; ?> <tr id="radekPoh<?=$po->id?>" > <td width="20%"><?=$datum;?></td> <td class="text-center"><?=($po->typ == '1') ? '<i class="far fa-plus-square text-primary"></i>' : '<i class="far fa-minus-square text-danger"></i>';?></td> <td width="15%" class="text-right pr-3"><?=$po->kusu;?></td> <td width="60%"><?=$po->poznamka;?></td> </tr> <?php } ?> </table> <?php } else { ?> <div class="alert alert-info rounded-0">Žádné pohyby ve skladu u této učebnice.</div> <?php } ?>