if (isset($_REQUEST['SALEDISC'])) { CoreLocal::set('DiscountableSaleItems', $_REQUEST['SALEDISC']); } if (CoreLocal::get('DiscountableSaleItems') === '') { CoreLocal::set('DiscountableSaleItems', 1); } echo '<select name="SALEDISC">'; if (CoreLocal::get('DiscountableSaleItems') == 0) { echo '<option value="1">Yes</option>'; echo '<option value="0" selected>No</option>'; } else { echo '<option value="1" selected>Yes</option>'; echo '<option value="0">No</option>'; } echo '</select>'; InstallUtilities::paramSave('DiscountableSaleItems', CoreLocal::get('DiscountableSaleItems')); ?> <span class='noteTxt'> Items that are on sale are eligible for transaction-level discounts - e.g., members save 5%. </span> </td></tr> <tr><td colspan=2> <hr /> <p>Special Department modules add extra steps to open rings in specific departments. Enter department number(s) that each module should apply to.*</p> </td></tr> <tr><td> <?php $sdepts = AutoLoader::listModules('SpecialDept'); $db = Database::pDataConnect(); $specialDeptMapExists = $db->table_exists('SpecialDeptMap');
/** Examine configuration file. Extract settings that do not belong in the configuration file, write them to opdata.parameters, then remove them from the configuration file */ public static function migrateSettings() { if (file_exists(dirname(__FILE__) . '/../../ini.php') && class_exists('InstallUtilities')) { $file = dirname(__FILE__) . '/../../ini.php'; $settings = self::readIniPhp(); foreach ($settings as $key => $value) { if (!in_array($key, self::$INI_SETTINGS)) { if ($key == 'SpecialDeptMap') { // SpecialDeptMap has a weird array structure // and gets moved to a dedicated table $db = Database::pDataConnect(); if ($db->table_exists('SpecialDeptMap')) { $mapModel = new \COREPOS\pos\lib\models\op\SpecialDeptMapModel($db); $mapModel->initTable($sconf); InstallUtilities::confRemove($key); } } else { // other settings go into opdata.parameters $saved = InstallUtilities::paramSave($key, $value); if ($saved && is_writable($file)) { InstallUtilities::confRemove($key); } } } } } }
if (!is_array($settings2)) { $settings2 = array(); } if (isset($_REQUEST['TR_LIST'])) { $saveStr2 = "array("; $settings2 = array(); foreach ($_REQUEST['TR_LIST'] as $dt) { if ($dt == "") { continue; } list($code2, $name2) = explode(":", $dt); $settings2[$code2] = $name2; $saveStr2 .= "'" . $code2 . "'=>'" . addslashes($name2) . "',"; } $saveStr2 = rtrim($saveStr2, ",") . ")"; InstallUtilities::paramSave('TRDesiredTenders', $settings2); } //end TR desired tenders $db = Database::pDataConnect(); $res = $db->query("SELECT TenderCode, TenderName FROM tenders ORDER BY TenderName"); ?> <table cellspacing="0" cellpadding="4" border="1"> <?php echo "<thead><tr><th>Tender Name</th><th>Map To</th><th>Tender Rpt</th></tr></thead><tbody>\n"; while ($row = $db->fetch_row($res)) { printf('<tr><td>%s (%s)</td>', $row['TenderName'], $row['TenderCode']); echo '<td><select name="TenderMapping[]">'; echo '<option value="">default</option>'; foreach ($mods as $m) { printf('<option value="%s:%s" %s>%s</option>', $row['TenderCode'], $m, isset($settings[$row['TenderCode']]) && $settings[$row['TenderCode']] == $m ? 'selected' : '', $m); }
} if (!is_array(CoreLocal::get('ReceiptMessageMods'))) { CoreLocal::set('ReceiptMessageMods', array()); } $available = AutoLoader::listModules('ReceiptMessage'); $current = CoreLocal::get('ReceiptMessageMods'); for ($i = 0; $i <= count($current); $i++) { $c = isset($current[$i]) ? $current[$i] : ''; echo '<select name="RM_MODS[]">'; echo '<option value="">[None]</option>'; foreach ($available as $a) { printf('<option %s>%s</option>', $a == $c ? 'selected' : '', $a); } echo '</select><br />'; } InstallUtilities::paramSave('ReceiptMessageMods', CoreLocal::get('ReceiptMessageMods')); ?> </td></tr> <tr> <td colspan="2"><h3>Email Receipts</h3></td> </tr> <tr> <td><b>Email Receipt Sender Address</b>:</td> <td><?php echo InstallUtilities::installTextField('emailReceiptFrom', ''); ?> </td> </tr> <tr> <td><b>Email Receipt Sender Name</b>:</td> <td><?php
$invert[$value] = $label; } $attributes = array(); if (is_array($default)) { $attributes['multiple'] = 'multiple'; $attributes['size'] = 5; } echo InstallUtilities::installSelectField($field, $invert, $default, InstallUtilities::EITHER_SETTING, true, $attributes); } else { echo InstallUtilities::installTextField($field, $default); } if (isset($info['description'])) { echo '<span class="noteTxt" style="width:200px;">' . $info['description'] . '</span>'; } InstallUtilities::paramSave($field, CoreLocal::get($field)); echo '</td></tr>'; } $instance->settingChange(); } } } echo '</table>'; InstallUtilities::paramSave('PluginList', CoreLocal::get('PluginList')); ?> <hr /> <input type=submit name=psubmit value="Save Changes" /> </form> </div> <!-- wrapper --> </body> </html>