Exemplo n.º 1
0
 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 {
             echo 'Error occured while performing query on database:<br>' . chr(10), exit;
         }
     }
 }
 include "include/admin_middel.php";
 $editor->printEditor();
Exemplo n.º 2
0
 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 {
             echo 'Error occured while performing query on database:<br>' . chr(10), exit;
         }
     }
 }
 include "include/admin_middel.php";
 $editor->printEditor();
Exemplo n.º 3
0
     $id = (int) $_POST['id'];
 }
 if ($id <= 0) {
     $editor = new editor('mrbs_area', $_SERVER['PHP_SELF'] . '?editor=1');
     $editor->setHeading(__('New area'));
     $editor->setSubmitTxt(__('Add'));
 } else {
     $editor = new editor('mrbs_area', $_SERVER['PHP_SELF'] . '?editor=1', $id);
     $editor->setHeading(__('Change area'));
     $editor->setSubmitTxt(__('Change'));
 }
 $editor->setDBFieldID('id');
 $editor->showID(TRUE);
 $editor->makeNewField('area_name', __('Area name'), 'text');
 $editor->makeNewField('area_group', 'Standard brukergruppe', 'select');
 $editor->addChoice('area_group', 0, 'Ingen');
 $Q_groups = mysql_query("select group_id, group_name from `groups` order by `group_name`");
 while ($R = mysql_fetch_assoc($Q_groups)) {
     $editor->addChoice('area_group', $R['group_id'], $R['group_name']);
 }
 $editor->makeNewField('importdatanova_shop_id', _h('Datanova import') . ' - ' . _h('Shop id'), 'text');
 $editor->makeNewField('importdatanova_alert_email', _h('Datanova import') . ' - ' . _h('Alert email(s)') . '*', 'text');
 $editor->getDB();
 if (isset($_POST['editor_submit'])) {
     if ($editor->input($_POST)) {
         if ($editor->performDBquery()) {
             // Redirect
             header('Location: admin_area.php');
             exit;
         } else {
             echo 'Error occured while performing query on database:<br>' . chr(10), exit;
Exemplo n.º 4
0
     $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 (isset($_POST['product_tax'])) {
         $_POST['product_tax'] = str_replace(',', '.', $_POST['product_tax']);
     }
     if ($editor->input($_POST)) {
         if ($editor->performDBquery()) {
             // Redirect
             header('Location: admin_products.php');
Exemplo n.º 5
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->makeNewField('program_inactive', _l('Inactive'), 'select');
 $editor->addChoice('program_inactive', 0, _l('No'));
 $editor->addChoice('program_inactive', 1, _l('Yes'));
 $editor->getDB();
 if (isset($_POST['editor_submit'])) {
     if ($editor->input($_POST)) {
         if ($editor->performDBquery()) {
             // Redirect
             header('Location: admin_programs.php');
             exit;
         } else {
             echo 'Error occured while performing query on database:<br>' . chr(10), exit;
         }
     }
Exemplo n.º 6
0
 } 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');
 $editor->makeNewField('user_position', 'Stilling', 'text');
 $editor->makeNewField('user_area_default', __('Default area'), 'select');
 $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('user_area_default', $R_area['area_id'], $R_area['area_name']);
 }
 $editor->makeNewField('user_ews_sync', _h('Syncronize with Exchange'), 'boolean');
 $editor->makeNewField('user_ews_sync_email', _h('Main Exchange e-mail'), 'text');
 if ($login['user_access_userdeactivate']) {
     $editor->makeNewField('deactivated', 'Er brukeren deaktivert', 'boolean');
 }
 if ($login['user_access_changerights']) {
     $editor->makeNewField('user_access_changerights', 'Tilgang til &aring; endre brukeres rettigheter', 'boolean');
     $editor->vars['user_access_changerights']['before'] = "\t<tr>\n\t\t<td><h2>" . __('Userrights') . "</h2></td>\n\t</tr>" . "\t<tr>\n\t\t<td>";
     $editor->makeNewField('user_access_useredit', 'Tilgang til &aring; endre brukere', 'boolean');
     $editor->makeNewField('user_access_userdeactivate', 'Tilgang til &aring; deaktivere brukere', 'boolean');
     $editor->makeNewField('user_access_areaadmin', __('Access to edit area and room'), 'boolean');
     $editor->makeNewField('user_access_entrytypeadmin', 'Tilgang til &aring; endre bookingtyper', 'boolean');
     $editor->makeNewField('user_access_importdn', 'Tilgang til &aring; importere tall fra Datanova kassesystem', 'boolean');
     $editor->makeNewField('user_access_productsadmin', 'Tilgang til &aring; endre i produktsregister', 'boolean');
Exemplo n.º 7
0
 } 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']));
 $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);