query(sprintf("REPLACE INTO setting (setting_name, setting_value) VALUES ('%s', '%s')", $setting_name, $dbs->escape_string(serialize($_POST[$setting_type])))); // write log utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'system', $_SESSION['realname'].' change '.$setting_type.' print settings'); utility::jsAlert(__('Settings saved')); echo ''; } /* Config Vars update process end */ $type = 'barcode'; if (isset($_GET['type'])) { $type = trim($_GET['type']); } if (!in_array($type, array('barcode', 'label', 'membercard'))) { $type = 'barcode'; } // include printed settings configuration file include SB.'admin'.DS.'admin_template'.DS.'printed_settings.inc.php'; // check for custom template settings $custom_settings = SB.'admin'.DS.$sysconf['admin_template']['dir'].DS.$sysconf['template']['theme'].DS.'printed_settings.inc.php'; if (file_exists($custom_settings)) { include $custom_settings; } // create form instance $form = new simbio_form_table_AJAX('mainForm', $_SERVER['PHP_SELF'], 'post'); $form->submit_button_attr = 'name="updateSettings" value="'.__('Save Settings').'" class="btn btn-primary"'; // form table attributes $form->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"'; $form->table_header_attr = 'class="alterCell" style="font-weight: bold;"'; $form->table_content_attr = 'class="alterCell2"'; // load print settings from database loadPrintSettings($dbs, $type); $form->addAnything(__('Print setting for'), ucwords($type)); foreach ($sysconf['print'][$type] as $setting_name => $val) { $setting_name_label = ucwords(str_ireplace('_', ' ', $setting_name)); $form->addTextField('text', $type.'['.$setting_name.']', __($setting_name_label), $val, 'style="width: 90%;"'); } $form->addHidden('settingType', $type); // print out the object echo $form->printOut(); /* main content end */