Ejemplo n.º 1
0
 if (isset($_GET['id']) && is_numeric($_GET['id'])) {
     $id = (int) $_GET['id'];
 }
 if (isset($_POST['id']) && is_numeric($_POST['id'])) {
     $id = (int) $_POST['id'];
 }
 if ($id <= 0) {
     $editor = new editor('mrbs_room', $_SERVER['PHP_SELF'] . '?area_id=' . $area['area_id'] . '&amp;editor=1');
     $editor->setHeading(_('New room for') . ' ' . $area['area_name']);
     $editor->setSubmitTxt(_('Add'));
 } else {
     $editor = new editor('mrbs_room', $_SERVER['PHP_SELF'] . '?area_id=' . $area['area_id'] . '&amp;editor=1', $id);
     $editor->setHeading(_('Change room'));
     $editor->setSubmitTxt(_('Change'));
 }
 $editor->setDBFieldID('id');
 $editor->showID(TRUE);
 $editor->makeNewField('room_name', _('Area name'), 'text');
 $editor->makeNewField('area_id', _('Area belonging'), 'select', array('defaultValue' => $area['area_id']));
 $Q_area = mysql_query("select id as area_id, area_name from `mrbs_area` order by `area_name`");
 while ($R_area = mysql_fetch_assoc($Q_area)) {
     $editor->addChoice('area_id', $R_area['area_id'], $R_area['area_name']);
 }
 $editor->getDB();
 if (isset($_POST['editor_submit'])) {
     if ($editor->input($_POST)) {
         if ($editor->performDBquery()) {
             // Redirect
             header('Location: admin_room.php?area_id=' . $editor->vars['area_id']['value']);
             exit;
         } else {
Ejemplo n.º 2
0
 if (isset($_GET['id']) && is_numeric($_GET['id'])) {
     $id = (int) $_GET['id'];
 }
 if (isset($_POST['id']) && is_numeric($_POST['id'])) {
     $id = (int) $_POST['id'];
 }
 if ($id <= 0) {
     $editor = new editor('entry_type', $_SERVER['PHP_SELF'] . '?editor=1');
     $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 {
Ejemplo n.º 3
0
 if (isset($_GET['id']) && is_numeric($_GET['id'])) {
     $id = (int) $_GET['id'];
 }
 if (isset($_POST['id']) && is_numeric($_POST['id'])) {
     $id = (int) $_POST['id'];
 }
 if ($id <= 0) {
     $editor = new editor('programs', $_SERVER['PHP_SELF'] . '?editor=1');
     $editor->setHeading(_('New fixed program'));
     $editor->setSubmitTxt(_('Add'));
 } else {
     $editor = new editor('programs', $_SERVER['PHP_SELF'] . '?editor=1', $id);
     $editor->setHeading(_('Change fixed program'));
     $editor->setSubmitTxt(_('Change'));
 }
 $editor->setDBFieldID('program_id');
 $editor->showID(TRUE);
 $editor->makeNewField('program_name', _('Program name'), 'text');
 $editor->makeNewField('program_desc', 'Beskrivelse', 'textarea');
 $editor->makeNewField('area_id', _('Area belonging'), 'select', array('defaultValue' => $area));
 $Q_area = mysql_query("select id as area_id, area_name from `mrbs_area` order by `area_name`");
 while ($R_area = mysql_fetch_assoc($Q_area)) {
     $editor->addChoice('area_id', $R_area['area_id'], $R_area['area_name']);
 }
 $editor->getDB();
 if (isset($_POST['editor_submit'])) {
     if ($editor->input($_POST)) {
         if ($editor->performDBquery()) {
             // Redirect
             header('Location: admin_programs.php');
             exit;
Ejemplo n.º 4
0
 if (isset($_GET['id']) && is_numeric($_GET['id'])) {
     $id = (int) $_GET['id'];
 }
 if (isset($_POST['id']) && is_numeric($_POST['id'])) {
     $id = (int) $_POST['id'];
 }
 if ($id <= 0) {
     $editor = new editor('products', $_SERVER['PHP_SELF'] . '?editor=1');
     $editor->setHeading('Nytt produkt');
     $editor->setSubmitTxt(__('Add'));
 } else {
     $editor = new editor('products', $_SERVER['PHP_SELF'] . '?editor=1', $id);
     $editor->setHeading('Endre produkt');
     $editor->setSubmitTxt(__('Change'));
 }
 $editor->setDBFieldID('product_id');
 $editor->showID(TRUE);
 $editor->makeNewField('product_name', 'Produktnavn', 'text');
 $editor->makeNewField('product_price', 'Pris', 'text');
 $editor->makeNewField('product_tax', 'MVA %', 'text');
 $editor->makeNewField('product_desc', 'Beskrivelse', 'textarea');
 $editor->makeNewField('area_id', __('Area belonging'), 'select', array('defaultValue' => $area));
 $Q_area = mysql_query("select id as area_id, area_name from `mrbs_area` order by `area_name`");
 $editor->addChoice('area_id', 0, 'Alle anlegg');
 while ($R_area = mysql_fetch_assoc($Q_area)) {
     $editor->addChoice('area_id', $R_area['area_id'], $R_area['area_name']);
 }
 $editor->getDB();
 if (isset($_POST['editor_submit'])) {
     if (isset($_POST['product_price'])) {
         $_POST['product_price'] = str_replace(',', '.', $_POST['product_price']);
    if ($redirect3 != '') {
        $redirecting .= '&amp;redirect3=' . $redirect3;
    }
}
if ($id <= 0) {
    $editor = new editor('skjermer', $_SERVER['PHP_SELF'] . $redirecting);
    $editor->setHeading('Opprett skjerm');
    $editor->setSubmitTxt('Opprett');
    $smarty->assign('tittel2', 'Opprett skjerm');
} else {
    $editor = new editor('skjermer', $_SERVER['PHP_SELF'] . $redirecting, $id);
    $editor->setHeading('Endre skjerm');
    $editor->setSubmitTxt('Endre');
    $smarty->assign('tittel2', 'Endre skjerm');
}
$editor->setDBFieldID('skjerm_id');
$editor->showID(TRUE);
## SKJERM_NAVN
$editor->makeNewField('skjerm_navn', 'Navn på skjerm', 'text');
## SKJERM_SLIDE_NR
$editor->makeNewField('skjerm_slidenr', 'Antall slides', 'text');
## SKJERM_DEFAULTSLIDE_HEADING
$editor->makeNewField('skjerm_defaultslide_heading', 'Overskrift på skjerm', 'text');
$editor->vars['skjerm_defaultslide_heading']['desc'] = 'Sett inn &lt;br&gt; for linjeskift (andre HTML-tags er også gyldige).';
## SKJERM_DEFAULTSLIDE
$editor->makeNewField('skjerm_defaultslide', 'Innhold', 'textarea', array('rows' => 30, 'cols' => 135));
$editor->getDB();
if (isset($_POST['editor_submit'])) {
    if ($editor->input($_POST)) {
        if ($editor->performDBquery()) {
            // Redirect
Ejemplo n.º 6
0
     $editor->setHeading('Ny bruker');
     $editor->setSubmitTxt(__('Add'));
     if (!$login['user_access_useredit']) {
         showAccessDenied($day, $month, $year, $area, true);
         exit;
     }
 } else {
     $editor = new editor('users', $_SERVER['PHP_SELF'] . '?editor=1', $id);
     $editor->setHeading('Endre bruker');
     $editor->setSubmitTxt(__('Change'));
     if (!$login['user_access_useredit'] && $id != $login['user_id']) {
         showAccessDenied($day, $month, $year, $area, true);
         exit;
     }
 }
 $editor->setDBFieldID('user_id');
 $editor->showID(TRUE);
 // Login name, only for people with access to editing users can change this
 if (!$login['user_access_useredit']) {
     $user_name_short_txt = ', kan ikke endres av deg';
 } else {
     $user_name_short_txt = '';
 }
 $editor->makeNewField('user_name_short', 'Innloggingsnavn / initialer' . $user_name_short_txt, 'text');
 if (!$login['user_access_useredit']) {
     $editor->vars['user_name_short']['disabled'] = true;
     $editor->vars['user_name_short']['DBQueryPerform'] = false;
 }
 $editor->makeNewField('user_name', 'Navn', 'text');
 $editor->makeNewField('user_email', __('E-mail'), 'text');
 $editor->makeNewField('user_phone', __('Phone'), 'text');
Ejemplo n.º 7
0
 if (isset($_GET['id']) && is_numeric($_GET['id'])) {
     $id = slashes(htmlspecialchars($_GET['id'], ENT_QUOTES));
 }
 if (isset($_POST['id']) && is_numeric($_POST['id'])) {
     $id = slashes(htmlspecialchars($_POST['id'], ENT_QUOTES));
 }
 if ($id <= 0) {
     $editor = new editor('import_dn_vareregister', $_SERVER['PHP_SELF'] . '?area_id=' . $area['area_id'] . '&amp;action=editor_varereg' . $redirect2);
     $editor->setHeading('Ny vare for ' . $area['area_name']);
     $editor->setSubmitTxt(__('Add'));
 } else {
     $editor = new editor('import_dn_vareregister', $_SERVER['PHP_SELF'] . '?area_id=' . $area['area_id'] . '&amp;action=editor_varereg&amp;id=' . $id . $redirect2, array('vare_nr' => $id, 'area_id' => $area['area_id']));
     $editor->setHeading('Endre vare for ' . $area['area_name']);
     $editor->setSubmitTxt(__('Change'));
 }
 $editor->setDBFieldID(array('vare_nr', 'area_id'));
 $editor->showID(TRUE);
 if (isset($_GET['vare_nr'])) {
     $vare_nr = slashes(htmlspecialchars($_GET['vare_nr'], ENT_QUOTES));
 } else {
     $vare_nr = '';
 }
 if (isset($_GET['vare_navn'])) {
     $vare_navn = slashes(htmlspecialchars($_GET['vare_navn'], ENT_QUOTES));
 } else {
     $vare_navn = '';
 }
 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']));