function settingCONF_LINKPOINT_INTEGRATION($_SettingID) { $SettingConstName = settingGetConstNameByID($_SettingID); if (isset($_POST["save"])) { if (isset($_POST['setting' . $SettingConstName])) { _setSettingOptionValueByID($_SettingID, $_POST['setting' . $SettingConstName]); } } $res = ""; $currencies = currGetAllCurrencies(); $res = "<select name='setting" . $SettingConstName . "'>"; $selectedID = _getSettingOptionValueByID($_SettingID); $res .= "<option value='1'"; if ((int) $selectedID == 1) { $res .= " selected"; } $res .= ">" . CLINKPOINT_TXT_1 . "</option>"; $res .= "<option value='2'"; if ((int) $selectedID == 2) { $res .= " selected"; } $res .= ">" . CLINKPOINT_TXT_2 . "</option>"; $res .= "<option value='3'"; if ((int) $selectedID == 3) { $res .= " selected"; } $res .= ">" . CLINKPOINT_TXT_3 . "</option>"; $res .= "</select>"; return $res; }
switch ($fACTION) { case 'SAVE_SETTINGS': affp_saveSettings($customerID, isset($_POST['EmailOrders']), isset($_POST['EmailPayments'])); Redirect(set_query('save_settings=ok')); break; } #loading data for subpages switch ($SubPage) { case 'balance': $Commissions = affp_getCommissionsAmount($customerID); $Payments = affp_getPaymentsAmount($customerID); $smarty->assign('CommissionsNumber', count($Commissions)); $smarty->assign('PaymentsNumber', count($Payments)); $smarty->assign('CommissionsAmount', $Commissions); $smarty->assign('PaymentsAmount', $Payments); $smarty->assign('CurrencyISO3', currGetAllCurrencies()); break; case 'payments_history': $Payments = affp_getPayments($customerID); $smarty->assign('PaymentsNumber', count($Payments)); $smarty->assign('Payments', html_spchars(affp_getPayments($customerID, '', '', '', 'pID ASC'))); break; case 'settings': $smarty->assign('SettingsSaved', isset($_GET['save_settings'])); $smarty->assign('Settings', affp_getSettings($customerID)); break; case 'attract_guide': $smarty->assign('_AFFP_STRING_ATTRACT_GUIDE', str_replace(array('{URL}', '{aff_percent}', '{login}'), array('http://' . $_SERVER['HTTP_HOST'] . set_query('') . '?refid=' . $customerID, CONF_AFFILIATE_AMOUNT_PERCENT, $_SESSION["log"]), AFFP_STRING_ATTRACT_GUIDE)); break; } $smarty->assign('affiliate_customers', $affp_CustomersNum);
function setting_WMI_CURRENCY_SELECT($_SettingID) { $Options = array(array('title' => ADMIN_NOT_DEFINED, 'value' => 0)); $Currencies = currGetAllCurrencies(); $Options = array(array('title' => 'Российские рубли', 'value' => 643), array('title' => 'Украинские гривны', 'value' => 980), array('title' => 'Американские доллары', 'value' => 840), array('title' => 'Евро', 'value' => 978)); return setting_SELECT_BOX($Options, $_SettingID); }
function all_currencies() { $curr = currGetAllCurrencies(); if (!empty($curr)) { $arr = array(); foreach ($curr as $k => $v) { $arr[$v['CID']] = $v; } return $arr; } }
$data = ScanPostVariableWithId(array("curr_name", "curr_value", "curr_where", "curr_code", "curr_sort", "curr_currencyIso3", "curr_roundval")); // update existing currencies foreach ($data as $key => $val) { if ($val["curr_name"] == "" || $val["curr_currencyIso3"] == "" || $val["curr_code"] == "") { continue; } $val["curr_value"] = (double) $val["curr_value"]; // fb($val["curr_value"]); $val["curr_sort"] = (int) $val["curr_sort"]; $val["curr_where"] = (int) $val["curr_where"]; $val["curr_where"] = (int) $val["curr_where"]; $val["curr_roundval"] = (int) $val["curr_roundval"]; if ($val["curr_value"] < 0) { continue; } currUpdateCurrency($key, $val["curr_name"], $val["curr_code"], $val["curr_currencyIso3"], $val["curr_value"], $val["curr_where"], $val["curr_sort"], $val["curr_roundval"]); } // exit(); //add a new currency type if ($_POST["curr_new_name"] != "" && $_POST["curr_new_code"] != "" && $_POST["curr_new_value"] != "" && $_POST["curr_new_currencyIso3"]) { currAddCurrency($_POST["curr_new_name"], $_POST["curr_new_code"], $_POST["curr_new_currencyIso3"], $_POST["curr_new_value"], $_POST["curr_new_where"], $_POST["curr_new_sort"], $_POST["curr_new_roundval"]); } Redirect(ADMIN_FILE . "?dpt=conf&sub=currencies&save_successful=yes"); } // get all currencies $currencies = currGetAllCurrencies(); $smarty->assign("currencies", $currencies); //set sub-department template $smarty->assign("admin_sub_dpt", "conf_currencies.tpl"); } }