Exemplo n.º 1
0
             <div class="basic-grey-text"><a href="./documents.php">Вернуться к документам</a></div>
             <div id="users"></div>
             <span class="basic-grey-text">Может изменять этот документ</span>
             <input type="checkbox" name="can_modify" value="1">
             <input type="submit" name="add_con" value="Добавить сотрудника">
         </form>
         </body>
         </html>
 ';
 $users = get_users($_SESSION['ID']);
 $users_string = '<select name="con_id"><option enabled> Выберите сотрудника</option>';
 foreach ($users['ID'] as $i => $user) {
     $users_string .= '<option value="' . $users['ID'][$i] . '">' . $users['SURNAME'][$i] . ' ' . $users['NAME'][$i] . '</option>';
 }
 $users_string .= '</select>';
 set_element_html('users', $users_string);
 $contributors = get_contributors($_GET['document_id']);
 foreach ($contributors['CONTRIBUTOR'] as $i => $contributor) {
     $user = get_user($contributors['CONTRIBUTOR'][$i]);
     if ($contributors['WATCH_ONLY'][$i] == 1) {
         $watch_string = 'просмотр';
     } else {
         if ($contributors['WATCH_ONLY'][$i] == 2) {
             $watch_string = 'просмотр и редактирование';
         } else {
             $watch_string = 'автор';
         }
     }
     echo '<div class="basic-grey">';
     if ($contributors['WATCH_ONLY'][$i] == 3) {
         echo '<b>' . $user['SURNAME'] . ' ' . $user['NAME'] . '</b> (' . $watch_string . ') </br>';
Exemplo n.º 2
0
            header('location:./document_editor.php?id=' . $document['ID']);
        }
        echo '';
    } else {
        if ($permissions == 1) {
            show('document_editor', null, null);
            echo '<a  class="basic-grey-e" href="./documents.php">Вернуться к документам</a>
                <div class="basic-grey-e" id="title"></div>
                <div class="basic-grey-e" id="tbody"></div>
                <div class="basic-grey-e" id="tsigned"></div>';
            $document = get_document($_GET['id']);
            set_element_html('title', '<i><b>' . $document['TITLE'] . '</b></i>');
            set_element_html('tbody', '<i>' . $document['BODY'] . '</i>');
            if ($document['SIGNED_BY'] > 0) {
                $user = get_user($document['SIGNED_BY']);
                set_element_html('tsigned', 'Документ подписал(а): ' . $user['SURNAME'] . ' ' . $user['NAME'] . ', дата: ' . $document['SD']);
            }
        } else {
            echo 'Error 401';
        }
    }
} else {
    show('document_editor', null, null);
    echo '<form class="basic-grey-e" action="./document_editor.php" name="save_doc" method="post">
                <a href="./documents.php">Вернуться к документам</a>
                <input type="text" placeholder="Название документа" id="title" name="title"></br>
                <textarea name="body" id="body"></textarea></br>

                <input type="submit" name="save_doc" value="Сохранить документ">

            </form>';