ACC SHELL

Path : /srv/www/vhosts/centrumlb/administrace/
File Upload :
Current File : /srv/www/vhosts/centrumlb/administrace/dokumenty_edit.php

<?php
include_once('config/config.php');
$Admin = new UserAdmin();
isset($_GET['logout']) ? $Admin->logout() : $Admin->isLogged();
include_once('libs/funkcephp.php');
include_once('libs/dokumenty.class.php');
include_once('include/dokumenty/dokumenty_zpracuj.php');

if (isset($_POST['odeslat']) || isset($_POST['odeslat_a_zavrit'])) {
    /**/
    $Dokumenty->getInfo($_GET['id']);

    $arr['id'] = $_POST['id'];
    $arr['nazev'] = $_POST['nazev'];
    $arr['stav'] = isset($_POST['stav']) ? 1 : 0;
    $arr['popis'] = isset($_POST['popis']) ? $_POST['popis'] : '';

    if ($Dokumenty->obrazek == 0) {
	$Dokumenty->updateNazevDokumentu($arr['id'], $arr['nazev']);
    }
    $Dokumenty->updateDokumenty($arr['id'], $arr['nazev'], $arr['stav'], $arr['popis']);
    if ($_POST['kategorie'] != 'default')
        $Dokumenty->priraditDokument($_POST['id'], $_POST['kategorie']);
    Tools::message('Všechno proběhlo v pořádku.', 'OK');
    if (isset($_POST['odeslat_a_zavrit'])) {
        Tools::redirect("dokumenty.php");
    }
    Tools::redirect("dokumenty_edit.php?id=" . $arr['id']);
}
if (isset($_GET['id'])) {
    $Dokumenty->getInfo($_GET['id']);
} else {
    Tools::redirect("dokumenty.php");
}
include_once(TEMPLATES . '/header.tpl');
?>


<div id="obsah">

    <!-- drobecky, nechat zakomentovane -->

    <table>

        <tr>

            <td><a class="mainbutton" href="dokumenty_upload.php"><span>Přidat nový dokument</span></a></td>

            <td>
                &nbsp;&nbsp; | &nbsp;&nbsp;<a href="javascript:history.back(-1)" title="Zpět na předchozí stranu">Zpět na předchozí stranu</a>
                &nbsp;&nbsp; | &nbsp;&nbsp;<span id="drobecky">Kde se nacházíte: &nbsp;&nbsp;
                    <a href="index.php" title="Úvodní strana">Úvodní strana</a>&nbsp;&nbsp;/&nbsp;&nbsp;
                    <a href="dokumenty.php" title="Správa dokumentů">Správa dokumentů</a>&nbsp;&nbsp;/&nbsp;&nbsp;
                    <a href="dokumenty_edit.php" title="Editace dokumentu">Editace dokumentu - <?php echo $Dokumenty->nazev; ?></a></span>
            </td>

        </tr>

    </table>

    <?php
    include('messages.php');

    $Widget = new Widget();
    $id_panelu = array(61, 62);
    $user_id = $_SESSION['adminuser']['id'];
    include_once('include/widgety.php');
    ?>

</div> <!-- div id obsah END -->



<?php include_once(TEMPLATES . '/footer.tpl'); ?>

ACC SHELL 2018