Exemplo n.º 1
0
        $editor->setHeading(__('New entrytype'));
        $editor->setSubmitTxt(__('Add'));
    } else {
        $editor = new editor('entry_type', $_SERVER['PHP_SELF'] . '?editor=1', $id);
        $editor->setHeading(__('Change entrytype'));
        $editor->setSubmitTxt(__('Change'));
    }
    $editor->setDBFieldID('entry_type_id');
    $editor->showID(TRUE);
    $editor->makeNewField('entry_type_name', __('Entrytype name'), 'text');
    $editor->makeNewField('entry_type_name_short', __('Short entrytype name'), 'text');
    $editor->makeNewField('resourcenum_length', _h('Length of resource number') . '<br />(' . _h('If zero, resource number will not be required') . ')', 'text');
    $editor->makeNewField('entry_type_inactive', _l('Inactive'), 'select');
    $editor->addChoice('entry_type_inactive', 0, _l('No'));
    $editor->addChoice('entry_type_inactive', 1, _l('Yes'));
    $editor->getDB();
    if (isset($_POST['editor_submit'])) {
        if ($editor->input($_POST)) {
            if ($editor->performDBquery()) {
                // Redirect
                header('Location: admin_entry_type.php');
                exit;
            } else {
                echo 'Error occured while performing query on database:<br>' . chr(10), exit;
            }
        }
    }
    include "include/admin_middel.php";
    $editor->printEditor();
} elseif (isset($_GET['entry_type_id']) && isset($_GET['area_id'])) {
    $entry_type = getEntryType($_GET['entry_type_id']);
Exemplo n.º 2
0
 }
 if ($id <= 0) {
     $editor->makeNewField('vare_nr', 'Varenr i Datanova kasseapparat', 'text', array('defaultValue' => $vare_nr));
 }
 $editor->makeNewField('area_id', __('Area'), 'hidden', array('defaultValue' => $area['area_id']));
 $editor->makeNewField('navn', 'Navn p&aring; vare i Datanova kasseapparat', 'text', array('defaultValue' => $vare_navn));
 $editor->makeNewField('kat_id', 'Import-kategori', 'select', array('defaultValue' => 0));
 $Q_area = mysql_query("select kat_id, kat_navn from `import_dn_kategori` order by `kat_navn`");
 $editor->addChoice('kat_id', 0, 'Ignorer (varen f&aring;r ikke advarsel lenger)');
 while ($R_area = mysql_fetch_assoc($Q_area)) {
     $editor->addChoice('kat_id', $R_area['kat_id'], $R_area['kat_navn']);
 }
 $editor->makeNewField('barn', 'Barn/Voksen', 'select', array('defaultValue' => 0));
 $editor->addChoice('barn', 1, 'Barn');
 $editor->addChoice('barn', 0, 'Voksen');
 if (!$editor->getDB()) {
     echo 'Finner ikke det du &oslash;nsker &aring; endre.';
     exit;
 }
 if (isset($_POST['editor_submit'])) {
     if ($editor->input($_POST)) {
         if ($editor->performDBquery()) {
             // Redirect
             header('Location: ' . $redirect_fil . '?' . $redirect);
             exit;
         } else {
             if (strpos($editor->error(), 'Duplicate entry') !== FALSE) {
                 include "include/admin_middel.php";
                 echo '<h1>Feil ved import</h1>';
                 echo '<div class="error">' . 'Vare med dette varenret for dettee anlegget eksiterer allerede.' . '</div>';
             } else {