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);
}
Exemple #2
0
function admMacro(&$session, $message)
{
    $session->trace(TC_Gui1, 'admMacro');
    admStandardHeader($session, 'Makros');
    getTextareaSize($session, $width, $height);
    if (empty($_POST['macro_theme'])) {
        $_POST['macro_theme'] = Theme_All;
    }
    if (!empty($message)) {
        guiParagraph($session, $message, false);
    }
    outDivision($session);
    guiStartForm($session);
    outTableAndRecord();
    outTableCell('Theme/Name: ');
    outTableDelim();
    outTextField($session, 'macro_theme', null, 4, 4);
    echo ' / ';
    outTextField($session, 'macro_name', null, 32, 64);
    echo ' ';
    outButton($session, 'macro_load', 'Datensatz laden');
    outTableDelimEnd();
    outTableRecordDelim();
    outTableTextField($session, 'Beschreibung:', 'macro_description', null, 64, 255);
    outTableRecordDelim();
    outTableTextArea($session, 'Wert:', 'macro_text', null, $width, $height);
    outTableRecordDelim();
    outTableCell('');
    outTableDelim();
    outButton2($session, 'macro_insert', 'Eintragen', ' | ', 'macro_change', 'Ändern');
    echo ' | Eingabefeld: Breite: ';
    outTextField($session, U_TextAreaWidth, null, 3, 3);
    echo ' Höhe: ';
    outTextField($session, U_TextAreaHeight, null, 3, 3);
    outTableDelimAndRecordEnd();
    outTableEnd();
    guiHeadline($session, 2, 'Makros von Theme ' . $_POST['macro_theme']);
    outTableAndRecord(1);
    outTableCellStrong('Id');
    outTableCellStrong('Theme');
    outTableCellStrong('Name');
    outTableCellStrong('Beschreibung');
    outTableCellStrong('Wert');
    outTableRecordEnd();
    $row = dbFirstRecord($session, 'select id,theme,name,description,value from ' . dbTable($session, T_Macro) . ' where theme=' . $_POST['macro_theme'] . ' order by name');
    while ($row) {
        outTableRecordAndDelim();
        echo $row[0];
        outTableCellDelim();
        echo htmlentities($row[1]);
        outTableCellDelim();
        echo htmlentities($row[2]);
        outTableCellDelim();
        echo htmlentities($row[3]);
        outTableCellDelim();
        echo htmlentities($row[4]);
        outTableDelimAndRecordEnd();
        $row = dbNextRecord($session);
    }
    outTableEnd();
    guiFinishForm($session);
    outDivisionEnd($session);
    admFinishBody($session);
}