Current Path : /data/web/virtuals/51568/virtual/www/www/plany/ |
Current File : /data/web/virtuals/51568/virtual/www/www/plany/textyUvodSeznam.php |
<?php if (file_exists('funkce/DbConnect.php')){ require_once('funkce/DbConnect.php'); } if (file_exists('DbConnect.php')){ require_once('DbConnect.php'); } if (IsSet($_POST["idRok"])){$idRok = $_POST["idRok"];} if (IsSet($_POST["idTyden"])){$idTyden = $_POST["idTyden"];} if (IsSet($_POST["idTydenAktualni"])){$idTydenAktualni = $_POST["idTydenAktualni"];} if (!IsSet($idUvod)){ if (IsSet($_POST["idUvod"])){$idUvod = $_POST["idUvod"];} else {$idUvod = 0;} } ?> <button class="btn btn-outline-info rounded-0 my-2" id="pznNova">Nová poznámka <i class="far fa-file"></i></button> <?php $sql = "SELECT `id`, `idtyden`, `idautor`, `poradi`, `obsah` FROM `pl_uvod` WHERE idtyden = $idTydenAktualni order by poradi"; if ($result = mysqli_query($conn, $sql)) { $pocetUvod = mysqli_num_rows($result); $countUvod = 0; if ($pocetUvod>0) {?> <div class="table-scroll-plany mb-2"> <table class="table table-striped table-bordered table-sm"> <?php while ($row = mysqli_fetch_object($result)) { $countUvod++; $checked = ($row->id == $idUvod) || (($countUvod == 1) && ($idUvod == 0)); $checkedS = ($checked) ? "checked" : ""; if ($checkedS == "checked") { $aktualni = $countUvod; $idUvod = $row->id; $ed = $row->obsah; $poradi = $row->poradi; }?> <tr> <td style="width: 55px; "> <div class="custom-control custom-radio ml-1 pr-0"> <input type="radio" class="custom-control-input" id="rgUvod#<?php echo "$row->id#$countUvod#$pocetUvod"; ?>" name="rgUvod" <?php echo $checkedS; ?>> <label class="custom-control-label" for="rgUvod#<?php echo "$row->id#$countUvod#$pocetUvod"; ?>"> <?php echo $row->poradi;?> </label> </div> </td> <td> <?php echo html_entity_decode(mb_substr(strip_tags($row->obsah), 0, 40, 'utf-8')) .((mb_strlen(strip_tags($row->obsah)) > 40) ? '...' : '' );?> </td> </tr> <?php }?> </table> </div> <div class="row"> <div class="col-5 text-left"> <button class="btn btn-outline-danger text-left rounded-0" id="pznDel">Smazat <i class="far fa-trash-alt"></i></button> </div> <?php if ($pocetUvod>1) {?> <div class="col-3 text-right mx-0"> <button id="btnUvodMoven" class="btn btn-outline-warning rounded-0 <?php echo ($aktualni == 1) ? " d-none" : ""; ?>"><i class="fas fa-arrow-up"></i></button> </div> <div class="col-2 text-left mx-0"> <button id="btnUvodMoved" class="btn btn-outline-warning rounded-0 <?php echo ($aktualni == $pocetUvod) ? " d-none" : ""; ?>"><i class="fas fa-arrow-down"></i></button> </div> <?php } ?> </div> <div id="pznDlgDel" class="alert alert-danger mt-3 d-none rounded-0"> <div class="h5">Mazání</div> Chystáš se smazat položku <span id="textzUvodMazatKtery"></span>.<br> Chceš pokračovat? <div class="row mt-3"> <div class="col text-left"> <button class="btn btn-danger rounded-0" id="pznDelAno">Ano</button> </div> <div class="col text-right"> <button class="btn btn-success rounded-0" id="pznDelNe">Ne</button> </div> </div> </div> <?php } } ?> <script src="www/plany/textyUvodSeznam.js"></script>