function userTableData(&$session, $id)
 {
     $session->trace(TC_Gui3, 'forum.UserTableData');
     $name = 'forum';
     outTableRecord();
     outTableCellStrong(TAG_NEWLINE . 'Modul ' . $name);
     $rec = dbGetRecordById($session, T_User, $id, 'postingsperpage,threadsperpage,postings');
     outTableRecordDelim();
     outTableTextField($session, 'Beiträge je Seite:', 'forum_postingsperpage', $rec[0], 3, 3);
     outTableRecordDelim();
     outTableTextField($session, 'Forumsinhalt: Themen je Seite:', 'forum_threadsperpage', $rec[1], 3, 3);
     outTableRecordEnd();
     outTableRecordCells('Bisher erstellte Forumsbeiträge:', $rec[2]);
 }
function baseAccount(&$session, $message)
{
    $session->trace(TC_Gui1, 'baseAccount');
    $reload = false;
    if (isset($_POST['account_user']) && !empty($_POST['account_user'])) {
        $account_user = $_POST['account_user'];
    } else {
        $account_user = $session->fUserName;
        $reload = true;
    }
    if (!empty($_POST['account_user2']) && $account_user != $_POST['account_user2']) {
        $account_user = $_POST['account_user2'];
        $reload = true;
    }
    if (!$reload) {
        $id = dbUserId($session, $account_user);
    } else {
        list($id, $_POST['account_locked'], $_POST['account_width'], $_POST['account_height'], $_POST['account_maxhits'], $_POST['account_theme'], $_POST['account_startpage'], $_POST['account_email']) = dbGetRecordByClause($session, T_User, 'id,locked,width,height,maxhits,theme,startpage,email', 'name=' . dbSqlString($session, $account_user));
    }
    guiStandardHeader($session, 'Einstellungen für ' . $account_user, Th_StandardHeader, Th_StandardBodyStart);
    if (!empty($message)) {
        guiParagraph($session, $message, false);
    }
    guiStartForm($session);
    outDivision($session);
    outHiddenField($session, 'account_user', $account_user);
    outTable();
    outTableRecordCells('Benutzername', $account_user);
    outTableRecord();
    outTablePasswordField($session, 'Passwort:', 'account_code', '', 64, 32);
    outTableRecordDelim();
    outTablePasswordField($session, 'Wiederholung:', 'account_code2', '', 64, 32);
    outTableRecordDelim();
    outTableTextField($session, 'EMail:', 'account_email', null, 64, 64);
    outTableRecordDelim();
    outTableCheckBox($session, 'Gesperrt', 'account_locked', 'Gesperrt');
    outTableRecordDelim();
    dbGetThemes($session, $theme_names, $theme_numbers);
    outTableComboBox($session, 'Oberfläche (Skin):', 'account_theme', $theme_names, $theme_numbers, array_search($_POST['account_theme'], $theme_numbers));
    outTableRecordDelim();
    outTableTextField($session, 'Eingabefeldbreite:', 'account_width', null, 64, 3);
    outTableRecordDelim();
    outTableTextField($session, 'Eingabefeldhöhe:', 'account_height', null, 64, 3);
    outTableRecordDelim();
    outTableTextField($session, 'Zahl Suchergebnisse:', 'account_maxhits', null, 64, 3);
    outTableRecordDelim();
    $names = array('WikiSeite:', 'Übersicht', 'Einstellungen', 'Wikisuche', 'Letze Änderungen', 'StartSeite', 'Hilfe');
    $values = array('', P_Home, P_Account, P_Search, P_LastChanges, 'StartSeite', 'Hilfe');
    if (($pos = strpos($_POST['account_startpage'], '!')) == 0 && is_int($pos)) {
        $ix = array_search($_POST['account_startpage'], $values);
    } else {
        $ix = 0;
    }
    outTableCell('Startseite:');
    outTableDelim();
    outComboBox($session, 'account_startpageoffer', $names, $values, $ix);
    echo ' ';
    outTextField($session, 'account_startpage', null, 45, 128);
    outTableDelimAndRecordEnd();
    modUserTableData($session, $id);
    outTableEnd();
    modUserOwnData($session, $id);
    outNewline();
    outButton($session, "account_change", "Ändern");
    outNewline();
    outNewline();
    $change = $session->hasRight(R_User, R_Put);
    $new = $session->hasRight(R_User, R_New);
    $new = $session->fUserId <= 2 || $session->fUserName == 'wk' || $session->fUserName == 'admin' || $session->testFeature(FEATURE_SIMPLE_USER_MANAGEMENT) || strpos($session->fUserName, $session->fAdmins) > 0;
    $change = $new;
    if ($change || $new) {
        guiLine($session, 2);
        outTableAndRecord();
        outTableTextField($session, 'Name:', "account_user2", null, 32, 32);
        outTableRecordDelim();
        outTableCell('');
        outTableDelim();
        if ($change) {
            outButton($session, "account_other", "Benutzer wechseln");
        }
        if ($new) {
            echo " ";
            outButton($session, "account_new", "Neu");
        }
    }
    outTableDelimEnd();
    outTableAndRecordEnd();
    outDivisionEnd($session);
    guiFinishForm($session, $session);
    guiStandardBodyEnd($session, Th_StandardBodyEnd);
}
function addressEditCard(&$session, $message = null, $card_id = null)
{
    $session->trace(TC_Gui1, 'addressEditCard');
    if (!isset($_POST['card_id']) || empty($_POST['card_id'])) {
        $session->trace(TC_X, 'addressEditCard-2');
        if ($card_id == null) {
            $card_id = dbGetValueByClause($session, Tab_Card, 'min(id)', '1');
        }
        list($books, $firstname, $lastname, $nickname, $emailprivate, $emailprivate2, $phoneprivate, $phoneprivate2, $faxprivate, $mobileprivate, $emailoffice, $emailoffice2, $phoneoffice, $phoneoffice2, $faxoffice, $mobileoffice, $street, $country, $zip, $city, $functions, $notes) = dbGetRecordById($session, Tab_Card, $card_id, 'books,firstname, lastname, nickname, ' . 'emailprivate, emailprivate2, phoneprivate, phoneprivate2, faxprivate, mobileprivate, ' . 'emailoffice, emailoffice2, phoneoffice, phoneoffice2, faxoffice, mobileoffice, ' . 'street, country, zip, city, ' . 'functions, notes');
    } else {
        $session->trace(TC_Gui1, 'addressEditCard-3: ' . $_POST['card_books']);
        $books = $_POST['card_books'];
        $firstname = $_POST['card_firstname'];
        $lastname = $_POST['card_lastname'];
        $nickname = $_POST['card_nickname'];
        $emailprivate = $_POST['card_emailprivate'];
        $emailprivate2 = $_POST['card_emailprivate2'];
        $phoneprivate = $_POST['card_phoneprivate'];
        $phoneprivate2 = $_POST['card_phoneprivate2'];
        $faxprivate = $_POST['card_faxprivate'];
        $mobileprivate = $_POST['card_mobileprivate'];
        $emailoffice = $_POST['card_emailoffice'];
        $emailoffice2 = $_POST['card_emailoffice2'];
        $phoneoffice = $_POST['card_phoneoffice'];
        $phoneoffice2 = $_POST['card_phoneoffice2'];
        $faxoffice = $_POST['card_faxoffice'];
        $mobileoffice = $_POST['card_mobileoffice'];
        $street = $_POST['card_street'];
        $country = $_POST['card_country'];
        $zip = $_POST['card_zip'];
        $city = $_POST['card_city'];
        $functions = $_POST['card_functions'];
        $notes = $_POST['card_notes'];
        $card_id = $_POST['card_id'];
    }
    guiStandardHeader($session, 'Ändern einer Adresskarte ', Th_AddressHeader, Th_AddressBodyStart);
    $ids = preg_split('/[ ,]+/', $books);
    $books = '';
    foreach ($ids as $ii => $id) {
        $books .= dbSingleValue($session, 'select name from ' . dbTable($session, Tab_Book) . " where id=" . (0 + $id)) . ($ii < count($ids) - 1 ? ',' : '');
        $session->trace(TC_Gui1, 'addressEditCard-4: ' . $id . "/" . $books);
    }
    if (isset($search_title) || isset($search_body)) {
        baseSearchResults($session);
    }
    if ($message != null) {
        guiParagraph($session, $message, false);
    }
    guiStartForm($session);
    outHiddenField($session, 'card_id', $card_id);
    outTable(0);
    outTableRecordCells('Id:', $card_id);
    outTableRecord();
    outTableTextField($session, 'Adressbücher:', 'card_books', $books, 34, 0);
    outTableRecordDelim();
    outTableTextField2($session, 'Vor-, Nachname:', 'card_firstname', $firstname, 16, 64, ' ', 'card_lastname', $lastname, 16, 64);
    outTableRecordEnd();
    outTableTextField($session, 'Spitzname:', 'card_nickname', $nickname, 16, 64);
    outTableRecordEnd();
    outTableRecordCells('Privat', ' ');
    outTableRecord();
    outTableTextField2($session, 'EMail EMail2:', 'card_emailprivate', $emailprivate, 34, 128, ' ', 'card_emailprivate2', $emailprivate2, 34, 128);
    outTableRecordDelim();
    outTableTextField2($session, 'Telefon Telefon2:', 'card_phoneprivate', $phoneprivate, 34, 128, ' ', 'card_phoneprivate2', $phoneprivate2, 34, 128);
    outTableRecordDelim();
    outTableTextField2($session, 'Mobil Fax:', 'card_mobileprivate', $mobileprivate, 34, 128, ' ', 'card_faxprivate', $faxprivate, 34, 128);
    outTableRecordDelim();
    outTableCell('Land PLZ Ort Straße:');
    outTableDelim();
    outTextField($session, 'card_country', $country, 3, 64);
    echo ' ';
    outTextField($session, 'card_zip', $zip, 5, 12);
    echo ' ';
    outTextField($session, 'card_city', $city, 22, 64);
    echo ' ';
    outTextField($session, 'card_street', $street, 34, 128);
    outTableDelimAndRecordEnd();
    outTableRecordCells('Geschäftlich:', ' ');
    outTableRecord();
    outTableTextField2($session, 'EMail: EMail2:', 'card_emailoffice', $emailoffice, 34, 128, ' ', 'card_emailoffice2', $emailoffice2, 34, 128);
    outTableRecordDelim();
    outTableTextField2($session, 'Telefon Telefon2:', 'card_phoneoffice', $phoneoffice, 34, 128, ' ', 'card_phoneoffice2', $phoneoffice2, 34, 128);
    outTableRecordDelim();
    outTableTextField2($session, 'Mobil Fax:', 'card_mobileoffice', $mobileoffice, 34, 128, ' ', 'card_faxoffice', $faxoffice, 34, 128);
    outTableRecordDelim();
    outTableTextField($session, 'Funktionen', 'card_functions', $functions, 34, 128);
    outTableRecordDelim();
    outTableTextArea($session, 'Bemerkungen:', 'card_notes', $notes, 31, 4);
    outTableRecordDelim();
    outTableButton2($session, ' ', 'card_change', 'Ändern', ' ', 'card_new', 'Neu');
    outTableRecordDelim();
    outTableTextField($session, 'Nächster DS (Id):', 'card_next', '', 8, 8);
    outTableRecordEnd();
    outTableEnd();
    guiFinishForm($session);
    guiStandardBodyEnd($session, Th_AddressBodyEnd);
}