$permissions = get_permissions($_SESSION['ID'], $_GET['id']); if ($permissions == 3 || $permissions == 2) { show('document_editor', null, null); $document = get_document($_GET['id']); echo ' <form class="basic-grey-e" action="./document_editor.php?id=' . $_GET['id'] . '" name="save_doc" method="post"> <a class="basic-grey-text" href="./documents.php">Вернуться к документам</a> <input type="text" id="title" name="title"></br> <textarea class="basic-grey-e" name="body" id="body"></textarea></br> <input type="submit" name="save_doc" value="Сохранить документ"> <a class="basic-grey-text" href="./document_editor.php?id=' . $document['ID'] . '&sign=' . $document['ID'] . '">Подписать документ</a> <a class="basic-grey-text" href="./contributors.php?document_id=' . $document['ID'] . '">Настроить доступ сотрудников к документу</a> </form>'; set_element_value('title', $document['TITLE']); set_element_value('body', $document['BODY']); if (isset($_POST['save_doc'])) { $title = $_POST['title']; $body = $_POST['body']; if ($title !== '' && $body !== '') { edit_document($title, $body, $document['ID'], null); } } if (isset($_GET['sign'])) { sign($_SESSION['ID'], $_GET['sign']); header('location:./document_editor.php?id=' . $document['ID']); } echo ''; } else { if ($permissions == 1) { show('document_editor', null, null);
<?php include 'functions.php'; session_start(); if (isset($_SESSION['ID'])) { show('settings', null, null); $user = get_user($_SESSION['ID']); set_element_value('name', $user['NAME']); set_element_value('surname', $user['SURNAME']); set_element_value('email', $user['EMAIL']); set_element_value('phone', $user['PHONE']); if (isset($_POST['set'])) { $name = $_POST['name']; $surname = $_POST['surname']; $email = $_POST['email']; $phone = $_POST['phone']; if ($name !== '' && $surname !== '' && $email !== '' && $phone !== '') { set($_SESSION['ID'], $name, $surname, $email, $phone); } else { notify('Поля не должны быть пустыми!'); } } } else { header('Location:./index.php'); }