} $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 ønsker å 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 { echo 'Error occured while performing query on database:<br>' . chr(10); echo '<b>Error:</b> ' . $editor->error(); echo '<br><br>Please forward this message to the system administrator.'; } exit; } } } include "include/admin_middel.php"; echo '<h1>Innstillinger for import fra kasseapparat</h1>' . chr(10) . chr(10); $editor->printEditor();