public static function PrepareCurrency4Where($val, $key, $operation, $negative, $field, &$arField, &$arFilter) { $val = DoubleVal($val); $baseSiteCurrency = ""; if (isset($arFilter["LID"]) && strlen($arFilter["LID"]) > 0) $baseSiteCurrency = CSaleLang::GetLangCurrency($arFilter["LID"]); elseif (isset($arFilter["CURRENCY"]) && strlen($arFilter["CURRENCY"]) > 0) $baseSiteCurrency = $arFilter["CURRENCY"]; if (strlen($baseSiteCurrency) <= 0) return False; $strSqlSearch = ""; $dbCurrency = CCurrency::GetList(($by = "sort"), ($order = "asc")); while ($arCurrency = $dbCurrency->Fetch()) { $val1 = roundEx(CCurrencyRates::ConvertCurrency($val, $baseSiteCurrency, $arCurrency["CURRENCY"]), SALE_VALUE_PRECISION); if (strlen($strSqlSearch) > 0) $strSqlSearch .= " OR "; $strSqlSearch .= "(D.ORDER_CURRENCY = '".$arCurrency["CURRENCY"]."' AND "; if ($negative == "Y") $strSqlSearch .= "NOT"; $strSqlSearch .= "(".$field." ".$operation." ".$val1." OR ".$field." IS NULL OR ".$field." = 0)"; $strSqlSearch .= ")"; } return "(".$strSqlSearch.")"; }
static function GetWMCurrency($currency) { $arCurrency = array(); if(CModule::IncludeModule("currency")) { $lcur = CCurrency::GetList(($b="name"), ($order1="asc"), LANGUAGE_ID); while($lcur_res = $lcur->Fetch()) { $arCurrency[$lcur_res['CURRENCY']] = COption::GetOptionString(COnpayPayment::$module_id, "currency_".$lcur_res['CURRENCY']); } } if(isset($arCurrency, $currency)) $currency = $arCurrency[$currency]; return $currency; }
public static function PrepareListItems() { if (!CModule::IncludeModule('currency')) { return array(); } $ary = array(); $dbCurrencies = CCurrency::GetList($by = 'sort', $order = 'asc'); while ($arCurrency = $dbCurrencies->Fetch()) { $ary[$arCurrency['CURRENCY']] = $arCurrency['FULL_NAME']; } return $ary; }
'DEFAULT' => 'N', ); $arComponentParameters["PARAMETERS"]['CONVERT_CURRENCY'] = array( 'PARENT' => 'PRICES', 'NAME' => GetMessage('CP_BCS_CONVERT_CURRENCY'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N', 'REFRESH' => 'Y', ); if (isset($arCurrentValues['CONVERT_CURRENCY']) && 'Y' == $arCurrentValues['CONVERT_CURRENCY']) { $arCurrencyList = array(); $by = 'SORT'; $order = 'ASC'; $rsCurrencies = CCurrency::GetList($by, $order); while ($arCurrency = $rsCurrencies->Fetch()) { $arCurrencyList[$arCurrency['CURRENCY']] = $arCurrency['CURRENCY']; } $arComponentParameters['PARAMETERS']['CURRENCY_ID'] = array( 'PARENT' => 'PRICES', 'NAME' => GetMessage('CP_BCS_CURRENCY_ID'), 'TYPE' => 'LIST', 'VALUES' => $arCurrencyList, 'DEFAULT' => CCurrency::GetBaseCurrency(), "ADDITIONAL_VALUES" => "Y", ); } }
?> </select><br /><br /></td> </tr> <tr class="heading"> <td colspan="2"><?php echo GetMessage('YANDEX_CURRENCIES'); ?> </td> </tr> <tr> <td colspan="2"><br /> <?php $arCurrencyList = array(); $arCurrencyAllowed = array('RUR', 'RUB', 'USD', 'EUR', 'UAH', 'BYR', 'KZT'); $dbRes = CCurrency::GetList($by = 'sort', $order = 'asc'); while ($arRes = $dbRes->GetNext()) { if (in_array($arRes['CURRENCY'], $arCurrencyAllowed)) { $arCurrencyList[$arRes['CURRENCY']] = $arRes['FULL_NAME']; } } $arValues = array('SITE' => GetMessage('YANDEX_CURRENCY_RATE_SITE'), 'CBRF' => GetMessage('YANDEX_CURRENCY_RATE_CBRF'), 'NBU' => GetMessage('YANDEX_CURRENCY_RATE_NBU'), 'NBK' => GetMessage('YANDEX_CURRENCY_RATE_NBK'), 'CB' => GetMessage('YANDEX_CURRENCY_RATE_CB')); ?> <table cellpadding="2" cellspacing="0" border="0" class="internal" align="center"> <thead> <tr class="heading"> <td colspan="2"><?php echo GetMessage('YANDEX_CURRENCY'); ?> </td> <td><?php
{ if(in_array("CATALOG_GROUP_".$CatalogGroups["ID"], $arSelectedFields)) { $arFilter["CATALOG_SHOP_QUANTITY_".$CatalogGroups["ID"]] = 1; $boolPriceInc = true; } } } if ($boolPriceInc) { $bCurrency = Loader::includeModule('currency'); if ($bCurrency) { $by1="sort"; $order1="asc"; $rsCurrencies = CCurrency::GetList($by1, $order1); while ($arCurrency = $rsCurrencies->GetNext()) { $arCurrencyList[] = $arCurrency; } } } unset($boolPriceInc); } $arVisibleColumnsMap = array(); foreach($arSelectedFields as $value) $arVisibleColumnsMap[$value] = true; // Getting list data if(array_key_exists("ELEMENT_CNT", $arVisibleColumnsMap))
$height = intval($_GET["height"]); $max_height = COption::GetOptionInt("sale", "GRAPH_HEIGHT", 600); if ($height <= 0 || $height > $max_height) { $height = $max_height; } if ($mode != "money") { $mode = "count"; } $arColor = array("08738C", "C6B59C", "0000FF", "FF0000", "FFFF00", "F7C684", "8CD694", "9CADCE", "B584BD", "C684BD", "FF94C6", "BDE794", "F7949C", "7BCE6B", "FF6342", "E2F86B", "A5DE63", "42BD6B", "52BDA5", "F79473", "5AC6DE", "94D6C6", "9C52AD", "BD52AD", "9C94C6", "FF63AD", "FF6384", "FE881D", "FF9C21", "FFAD7B", "EFFF29", "7BCE6B", "42BD6B", "52C6AD", "6B8CBD", "3963AD", "F7298C", "A51800", "9CA510", "528C21", "689EB9", "217B29", "6B8CC6", "D6496C", "C6A56B", "00B0A4", "AD844A", "9710B4", "946331", "AD3908", "734210", "008400", "3EC19A", "28D7D7", "6B63AD", "A4C13E", "7BCE31", "A5DE94", "94D6E7", "9C8C73", "FF8C4A", "A7588B", "03CF45", "F7B54A", "808040", "947BBD", "840084", "737373", "C48322", "809254", "1E8259", "63C6DE", "46128D", "8080C0"); $arStatus = array(); $dbStatusList = CSaleStatus::GetList(array("SORT" => "ASC"), array("LID" => LANGUAGE_ID), false, false, array("ID", "NAME", "SORT")); while ($arStatusList = $dbStatusList->GetNext()) { $arStatus[$arStatusList["ID"]] = $arStatusList["NAME"]; } $arCurrency = array(); $dbCur = CCurrency::GetList($b = "sort", $order1 = "asc", LANGUAGE_ID); while ($arCur = $dbCur->GetNext()) { $arCurrency[$arCur["CURRENCY"]] = $arCur["FULL_NAME"]; } $dbSite = CSite::GetList($by = "sort", $order = "desc", array("ACTIVE" => "Y")); while ($arSites = $dbSite->GetNext()) { $arSite[$arSites["LID"]] = $arSites["NAME"]; } $arFind = array("find_canceled" => $find_canceled, "find_allow_delivery" => $find_allow_delivery, "find_payed" => $find_payed, "find_all" => $find_all, "filter_by" => $filter_by, "mode" => $mode); foreach ($arCurrency as $k1 => $v1) { if (${"find_all_" . $k1} == "Y") { $arFind["find_all_" . $k1] = ${"find_all_" . $k1}; } if (${"find_payed_" . $k1} == "Y") { $arFind["find_payed_" . $k1] = ${"find_payed_" . $k1}; }
CIBlockParameters::AddPagerSettings($arComponentParameters, GetMessage("T_IBLOCK_DESC_PAGER_CATALOG"), true, true); if (CModule::IncludeModule('catalog') && CModule::IncludeModule('currency')) { $arComponentParameters["PARAMETERS"]['CONVERT_CURRENCY'] = array( 'PARENT' => 'PRICES', 'NAME' => GetMessage('CP_BCS_CONVERT_CURRENCY'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N', 'REFRESH' => 'Y', ); if (isset($arCurrentValues['CONVERT_CURRENCY']) && 'Y' == $arCurrentValues['CONVERT_CURRENCY']) { $arCurrencyList = array(); $rsCurrencies = CCurrency::GetList(($by = 'SORT'), ($order = 'ASC')); while ($arCurrency = $rsCurrencies->Fetch()) { $arCurrencyList[$arCurrency['CURRENCY']] = $arCurrency['CURRENCY']; } $arComponentParameters['PARAMETERS']['CURRENCY_ID'] = array( 'PARENT' => 'PRICES', 'NAME' => GetMessage('CP_BCS_CURRENCY_ID'), 'TYPE' => 'LIST', 'VALUES' => $arCurrencyList, 'DEFAULT' => CCurrency::GetBaseCurrency(), "ADDITIONAL_VALUES" => "Y", ); } }
$boolSubCurrency = CModule::IncludeModule('currency'); if ($boolSubCurrency) { $rsCurrencies = CCurrency::GetList($by1 = "sort", $order1 = "asc"); while ($arCurrency = $rsCurrencies->GetNext(true, true)) { $arCurrencyList[] = $arCurrency; } } } unset($boolPriceInc); } } if ($boolSubCatalog) { if (is_array($arCatGroup) && !empty($arCatGroup)) { $boolSubCurrency = CModule::IncludeModule('currency'); if ($boolSubCurrency) { $rsCurrencies = CCurrency::GetList($by1 = "sort", $order1 = "asc"); while ($arCurrency = $rsCurrencies->GetNext(true, true)) { $arCurrencyList[] = $arCurrency; } } } } if (!(false == B_ADMIN_SUBELEMENTS_LIST && $bCopy)) { $wf_status_id = ""; /*if ($boolSubWorkFlow && (strpos($find_el_status_id, "-") !== false)) { $ar = explode("-", $find_el_status_id); $wf_status_id = $ar[1]; } if ($wf_status_id)
function InstallDB() { global $DB, $DBType, $APPLICATION; $this->errors = false; RegisterModule("onpay.sale"); $arOptions = array("login", "api_in_key", "success_url", "fail_url", "iframe_form", "convert"); if(CModule::IncludeModule("currency")) { $lcur = CCurrency::GetList(($b="name"), ($order1="asc"), LANGUAGE_ID); while($lcur_res = $lcur->Fetch()) { $arOptions[] = "currency_".$lcur_res['CURRENCY']; } } foreach($arOptions as $name) { COption::SetOptionString("onpay.sale", $name, $_REQUEST[$name], ""); } return true; }
public function CheckFields($strAction, &$arFields, $intID = 0) { global $APPLICATION; global $DB; global $USER; $strAction = strtoupper($strAction); if ('UPDATE' != $strAction && 'ADD' != $strAction) { return false; } $intID = (int) $intID; $arCurrencyList = array(); $by = 'sort'; $order = 'asc'; $rsCurrencies = CCurrency::GetList($by, $order); while ($arCurrency = $rsCurrencies->Fetch()) { $arCurrencyList[] = $arCurrency['CURRENCY']; } $boolResult = true; $arMsg = array(); if (array_key_exists('ID', $arFields)) { unset($arFields['ID']); } if ((is_set($arFields, "SITE_ID") || $strAction == "ADD") && empty($arFields["SITE_ID"])) { $arMsg[] = array('id' => 'SITE_ID', 'text' => Loc::getMessage('BT_MOD_CAT_DSC_SV_ERR_EMPTY_SITE')); $boolResult = false; } else { $rsSites = CSite::GetByID($arFields['SITE_ID']); if (!($arSite = $rsSites->Fetch())) { $arMsg[] = array('id' => 'SITE_ID', 'text' => Loc::getMessage('BT_MOD_CAT_DSC_SV_ERR_BAD_SITE')); $boolResult = false; } } if ((is_set($arFields, "NAME") || $strAction == "ADD") && strlen(trim($arFields["NAME"])) <= 0) { $arMsg[] = array('id' => 'NAME', 'text' => Loc::getMessage('BT_MOD_CAT_DSC_SV_ERR_EMPTY_NAME')); $boolResult = false; } if ((is_set($arFields, "ACTIVE") || $strAction == "ADD") && $arFields["ACTIVE"] != "N") { $arFields["ACTIVE"] = "Y"; } if ((is_set($arFields, 'SORT') || $strAction == 'ADD') && intval($arFields['SORT']) <= 0) { $arFields['SORT'] = 500; } if ((is_set($arFields, "CURRENCY") || $strAction == "ADD") && empty($arFields["CURRENCY"])) { $arMsg[] = array('id' => 'CURRENCY', 'text' => Loc::getMessage('BT_MOD_CAT_DSC_SV_ERR_EMPTY_CURRENCY')); $boolResult = false; } elseif (!in_array($arFields['CURRENCY'], $arCurrencyList)) { $arMsg[] = array('id' => 'CURRENCY', 'text' => Loc::getMessage('BT_MOD_CAT_DSC_SV_ERR_BAD_CURRENCY')); $boolResult = false; } if ((is_set($arFields, "ACTIVE_FROM") || $strAction == "ADD") && !$DB->IsDate($arFields["ACTIVE_FROM"], false, LANGUAGE_ID, "FULL")) { $arFields["ACTIVE_FROM"] = false; } if ((is_set($arFields, "ACTIVE_TO") || $strAction == "ADD") && !$DB->IsDate($arFields["ACTIVE_TO"], false, LANGUAGE_ID, "FULL")) { $arFields["ACTIVE_TO"] = false; } if ((is_set($arFields, 'COUNT_SIZE') || $strAction == 'ADD') && intval($arFields['COUNT_SIZE']) < 0) { $arFields['COUNT_SIZE'] = 0; } if ((is_set($arFields, 'COUNT_TYPE') || $strAction == 'ADD') && !in_array($arFields['COUNT_TYPE'], array('D', 'M', 'Y'))) { $arFields['COUNT_TYPE'] = 'Y'; } if ((is_set($arFields, "COUNT_FROM") || $strAction == "ADD") && !$DB->IsDate($arFields["COUNT_FROM"], false, LANGUAGE_ID, "FULL")) { $arFields["COUNT_FROM"] = false; } if ((is_set($arFields, "COUNT_TO") || $strAction == "ADD") && !$DB->IsDate($arFields["COUNT_TO"], false, LANGUAGE_ID, "FULL")) { $arFields["COUNT_TO"] = false; } if (is_set($arFields, 'COUNT_PERIOD')) { unset($arFields['COUNT_PERIOD']); } $strCountPeriod = self::COUNT_TIME_ALL; if (is_set($arFields, 'COUNT_SIZE') && intval($arFields['COUNT_SIZE']) > 0) { $strCountPeriod = self::COUNT_TIME_PERIOD; } if (!empty($arFields["COUNT_FROM"]) || !empty($arFields["COUNT_TO"])) { $strCountPeriod = self::COUNT_TIME_INTERVAL; } $arFields['COUNT_PERIOD'] = $strCountPeriod; if ((is_set($arFields, 'ACTION_SIZE') || $strAction == 'ADD') && intval($arFields['ACTION_SIZE']) < 0) { $arFields['ACTION_SIZE'] = 0; } if ((is_set($arFields, 'ACTION_TYPE') || $strAction == 'ADD') && !in_array($arFields['ACTION_TYPE'], array('D', 'M', 'Y'))) { $arFields['ACTION_TYPE'] = 'Y'; } $arFields['TYPE'] = self::ENTITY_ID; $arFields["RENEWAL"] = 'N'; $arFields['PRIORITY'] = 1; $arFields['LAST_DISCOUNT'] = 'Y'; $intUserID = 0; $boolUserExist = CCatalog::IsUserExists(); if ($boolUserExist) { $intUserID = (int) $USER->GetID(); } $strDateFunction = $DB->GetNowFunction(); if (array_key_exists('TIMESTAMP_X', $arFields)) { unset($arFields['TIMESTAMP_X']); } if (array_key_exists('DATE_CREATE', $arFields)) { unset($arFields['DATE_CREATE']); } $arFields['~TIMESTAMP_X'] = $strDateFunction; if ($boolUserExist) { if (!array_key_exists('MODIFIED_BY', $arFields) || intval($arFields["MODIFIED_BY"]) <= 0) { $arFields["MODIFIED_BY"] = $intUserID; } } if ('ADD' == $strAction) { $arFields['~DATE_CREATE'] = $strDateFunction; if ($boolUserExist) { if (!array_key_exists('CREATED_BY', $arFields) || intval($arFields["CREATED_BY"]) <= 0) { $arFields["CREATED_BY"] = $intUserID; } } } if ('UPDATE' == $strAction) { if (array_key_exists('CREATED_BY', $arFields)) { unset($arFields['CREATED_BY']); } } if (is_set($arFields, 'RANGES') || $strAction == 'ADD') { if (!is_array($arFields['RANGES']) || empty($arFields['RANGES'])) { $arMsg[] = array('id' => 'RANGES', 'text' => Loc::getMessage('BT_MOD_CAT_DSC_SV_ERR_EMPTY_RANGES')); $boolResult = false; } else { $boolRepeat = false; $arRangeList = array(); foreach ($arFields['RANGES'] as &$arRange) { if (!is_array($arRange) || empty($arRange)) { $arMsg[] = array('id' => 'RANGES', 'text' => Loc::getMessage('BT_MOD_CAT_DSC_SV_ERR_BAD_RANGE')); $boolResult = false; } else { if (empty($arRange['TYPE']) || $arRange['TYPE'] != self::TYPE_FIX) { $arRange['TYPE'] = self::TYPE_PERCENT; } if (isset($arRange['VALUE'])) { $arRange["VALUE"] = str_replace(",", ".", $arRange["VALUE"]); $arRange["VALUE"] = doubleval($arRange["VALUE"]); if (!(0 < $arRange["VALUE"])) { $arMsg[] = array('id' => 'RANGES', 'text' => Loc::getMessage('BT_MOD_CAT_DSC_SV_ERR_BAD_RANGE_VALUE')); $boolResult = false; } elseif (self::TYPE_PERCENT == $arRange['TYPE'] && 100 < $arRange["VALUE"]) { $arMsg[] = array('id' => 'RANGES', 'text' => Loc::getMessage('BT_MOD_CAT_DSC_SV_ERR_BAD_RANGE_VALUE')); $boolResult = false; } } else { $arMsg[] = array('id' => 'RANGES', 'text' => Loc::getMessage('BT_MOD_CAT_DSC_SV_ERR_BAD_RANGE_VALUE')); $boolResult = false; } if (isset($arRange['RANGE_FROM'])) { $arRange["RANGE_FROM"] = str_replace(",", ".", $arRange["RANGE_FROM"]); $arRange["RANGE_FROM"] = doubleval($arRange["RANGE_FROM"]); if (0 > $arRange["RANGE_FROM"]) { $arMsg[] = array('id' => 'RANGES', 'text' => Loc::getMessage('BT_MOD_CAT_DSC_SV_ERR_BAD_RANGE_FROM')); $boolResult = false; } else { if (in_array($arRange["RANGE_FROM"], $arRangeList)) { $boolRepeat = true; } else { $arRangeList[] = $arRange["RANGE_FROM"]; } } } else { $arMsg[] = array('id' => 'RANGES', 'text' => Loc::getMessage('BT_MOD_CAT_DSC_SV_ERR_BAD_RANGE_FROM')); $boolResult = false; } } } if (isset($arRange)) { unset($arRange); } if ($boolRepeat) { $arMsg[] = array('id' => 'RANGES', 'text' => Loc::getMessage('BT_MOD_CAT_DSC_SV_ERR_DUP_RANGE_FROM')); $boolResult = false; } } } if (isset($arFields['GROUP_IDS']) || $strAction == 'ADD') { if (!empty($arFields['GROUP_IDS'])) { if (!is_array($arFields['GROUP_IDS'])) { $arFields['GROUP_IDS'] = array($arFields['GROUP_IDS']); } $arValid = array(); foreach ($arFields['GROUP_IDS'] as &$intGroupID) { $intGroupID = (int) $intGroupID; if (0 < $intGroupID && 2 != $intGroupID) { $arValid[] = $intGroupID; } } if (isset($intGroupID)) { unset($intGroupID); } $arFields['GROUP_IDS'] = array_unique($arValid); } if (empty($arFields['GROUP_IDS'])) { $arMsg[] = array('id' => 'GROUP_IDS', 'text' => Loc::getMessage('BT_MOD_CAT_DSC_SV_ERR_EMPTY_GROUP_IDS')); $boolResult = false; } } if (!$boolResult) { $obError = new CAdminException($arMsg); $APPLICATION->ResetException(); $APPLICATION->ThrowException($obError); } return $boolResult; }
public static function GetList($arOrder, $langID = '') { if (!CModule::IncludeModule('currency')) { return false; } if (!is_array($arOrder)) { $arOrder = array(); } $arOrderFields = array_keys($arOrder); if (count($arOrderFields) > 0) { $by = $arOrderFields[0]; $order = $arOrder[$by]; } else { $by = 'sort'; $order = 'asc'; } $langID = strval($langID); if ($langID === '') { $langID = LANGUAGE_ID; } return CCurrency::GetList($by, $order, $langID); }
foreach ($arCatGroup as &$CatalogGroups) { if (in_array("CATALOG_GROUP_".$CatalogGroups["ID"], $arSelectedFields)) { $arFilter["CATALOG_SHOP_QUANTITY_".$CatalogGroups["ID"]] = 1; $boolPriceInc = true; } } unset($CatalogGroups); } if ($boolPriceInc) { $boolSubCurrency = CModule::IncludeModule('currency'); if ($boolSubCurrency) { $rsCurrencies = CCurrency::GetList(($by1="sort"), ($order1="asc")); while ($arCurrency = $rsCurrencies->GetNext(true,true)) { $arCurrencyList[] = $arCurrency; } } } unset($boolPriceInc); } $arSelectedFieldsMap = array(); foreach ($arSelectedFields as $field) $arSelectedFieldsMap[$field] = true; if (!((false == B_ADMIN_SUBELEMENTS_LIST) && ($bCopy))) {
$by2 = 'sort'; $order2 = 'asc'; $rsSites = CSite::GetList($by2, $order2); while ($arSite = $rsSites->Fetch()) { $arSiteList[$arSite['LID']] = $arSite['LID']; $arSiteLinkList[$arSite['LID']] = '<a href="/bitrix/admin/site_edit.php?lang='.urlencode(LANGUAGE_ID).'&LID='.urlencode($arSite['LID']).'" title="'.GetMessage('BT_CAT_DISC_SAVE_ADM_MESS_SITE_ID').'">'.htmlspecialcharsex($arSite['LID']).'</a>'; } } $arCurrencyList = array(); if ($arSelectFieldsMap['CURRENCY']) { $by2 = 'sort'; $order2 = 'asc'; $rsCurrencies = CCurrency::GetList($by2, $order2); while ($arCurrency = $rsCurrencies->Fetch()) { $arCurrencyList[$arCurrency['CURRENCY']] = $arCurrency['CURRENCY']; } } $arPeriodTypeList = CCatalogDiscountSave::GetPeriodTypeList(true); $arUserList = array(); $arUserID = array(); $strNameFormat = CSite::GetNameFormat(true); $arNavParams = (isset($_REQUEST["mode"]) && "excel" == $_REQUEST["mode"] ? false : array("nPageSize" => CAdminResult::GetNavSize($sTableID))
<?php if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { die; } $arCurrency = array(); $arAmount = array(); $arAvAmount = unserialize(COption::GetOptionString("sale", "pay_amount", 'a:4:{i:1;a:2:{s:6:"AMOUNT";s:2:"10";s:8:"CURRENCY";s:3:"EUR";}i:2;a:2:{s:6:"AMOUNT";s:2:"20";s:8:"CURRENCY";s:3:"EUR";}i:3;a:2:{s:6:"AMOUNT";s:2:"30";s:8:"CURRENCY";s:3:"EUR";}i:4;a:2:{s:6:"AMOUNT";s:2:"40";s:8:"CURRENCY";s:3:"EUR";}}')); if (CModule::IncludeModule("sale")) { if (!empty($arAvAmount)) { foreach ($arAvAmount as $key => $val) { $arAmount[$key] = SaleFormatCurrency($val["AMOUNT"], $val["CURRENCY"]); } } } if (CModule::IncludeModule("currency")) { $rsCurrency = CCurrency::GetList($by = "SORT", $order = "ASC"); while ($arr = $rsCurrency->Fetch()) { $arCurrency[$arr["CURRENCY"]] = "[" . $arr["CURRENCY"] . "] " . $arr["FULL_NAME"]; } } $arComponentParameters = array("PARAMETERS" => array("PATH_TO_BASKET" => array("NAME" => GetMessage("SAPP_PATH_TO_BASKET"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "/personal/basket.php", "COLS" => 25), "REDIRECT_TO_CURRENT_PAGE" => array("NAME" => GetMessage("SAPP_REDIRECT_TO_CURRENT_PAGE"), "TYPE" => "CHECKBOX", "MULTIPLE" => "N", "DEFAULT" => "N"), "SELL_AMOUNT" => array("NAME" => GetMessage("SAPP_SELL_AMOUNT"), "TYPE" => "LIST", "MULTIPLE" => "Y", "VALUES" => $arAmount, "COLS" => 25, "ADDITIONAL_VALUES" => "N"), "SELL_CURRENCY" => array("NAME" => GetMessage("SAPP_SELL_CURRENCY"), "TYPE" => "LIST", "MULTIPLE" => "N", "VALUES" => $arCurrency, "COLS" => 25, "ADDITIONAL_VALUES" => "N"), "VAR" => array("NAME" => GetMessage("SAPP_VAR"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "buyMoney", "COLS" => 25), "CALLBACK_NAME" => array("NAME" => GetMessage("SAPP_CALLBACK_NAME"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "PayUserAccountDeliveryOrderCallback", "COLS" => 25), "SET_TITLE" => array()));
} if(!$bStatusP) { $arFields = Array("ID" => "P", "SORT" => 150); foreach($arLanguages as $langID) { WizardServices::IncludeServiceLang("step1.php", $langID); $arFields["LANG"][] = Array("LID" => $langID, "NAME" => GetMessage("WIZ_SALE_STATUS_P"), "DESCRIPTION" => GetMessage("WIZ_SALE_STATUS_DESCRIPTION_P")); } CSaleStatus::Add($arFields); } if(CModule::IncludeModule("currency")) { $dbCur = CCurrency::GetList($by="currency", $o = "asc"); while($arCur = $dbCur->Fetch()) { if($lang == "ru") CCurrencyLang::Update($arCur["CURRENCY"], $lang, Array("DECIMALS" => 0)); elseif($arCur["CURRENCY"] == "EUR") CCurrencyLang::Update($arCur["CURRENCY"], $lang, Array("DECIMALS" => 2, "FORMAT_STRING" => "€#")); } } WizardServices::IncludeServiceLang("step1.php", $lang); CModule::IncludeModule("catalog"); $dbVat = CCatalogVat::GetList(array(), Array("SITE_ID" => WIZARD_SITE_ID)); if(!($dbVat->Fetch())) { $arF = Array ("ACTIVE" => "Y", "SORT" => "100", "NAME" => GetMessage("WIZ_VAT_1"), "RATE" => 0);
function ShowStep() { $wizard =& $this->GetWizard(); $arResult = $wizard->GetVars(true); $dbSite = CSite::GetByID($arResult["siteID"]); $arSite = $dbSite->GetNext(); CModule::IncludeModule("currency"); $dbCurrency = CCurrency::GetList($b = "SORT", $o = "ASC", $arResult["siteID"]); while ($arCur = $dbCurrency->GetNext()) { $arCurrency[$arCur["CURRENCY"]] = $arCur["FULL_NAME"]; } $dbUGroup = CGroup::GetList($b = "c_sort", $o = "ASC", array("ACTIVE" => "Y")); while ($arUGroup = $dbUGroup->GetNext()) { $arGroups[$arUGroup["ID"]] = $arUGroup["NAME"]; } CModule::IncludeModule("sale"); $dbPersonType = CSalePersonType::GetList(array("SORT" => "ASC"), array("ACTIVE" => "Y", "LID" => $arResult["siteID"])); while ($arPersonType = $dbPersonType->GetNext()) { $arPersons[$arPersonType["ID"]] = $arPersonType["NAME"]; } $dbPaySystem = CSalePaySystem::GetList(array("SORT" => "ASC"), array("ACTIVE" => "Y", "LID" => $arResult["siteID"])); while ($arPaySystem = $dbPaySystem->GetNext()) { $arPaySystems[$arPaySystem["ID"]] = $arPaySystem["NAME"]; } $dbDelivery = CSaleDeliveryHandler::GetList(array("SORT" => "ASC"), array("SITE_ID" => $arResult["siteID"], "ACTIVE" => "Y")); while ($arDelivery = $dbDelivery->GetNext()) { $arDeliveries[$arDelivery["SID"] . "_new"] = $arDelivery["NAME"] . " " . GetMessage("WW_STEP8_1"); } $dbDelivery = CSaleDelivery::GetList(array("SORT" => "ASC"), array("LID" => $arResult["siteID"], "ACTIVE" => "Y")); while ($arDelivery = $dbDelivery->GetNext()) { $arDeliveries[$arDelivery["ID"]] = $arDelivery["NAME"]; } $this->content = GetMessage("WW_2") . "<br />"; $this->content .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"/bitrix/wizards/bitrix/sale.install/styles.css\">"; $this->content .= "<table class=\"data-table\">"; $this->content .= "<tr><th>" . GetMessage("WW_STEP1_2") . "</th><td>[" . $arSite["ID"] . "] " . $arSite["NAME"] . "</td></tr>"; $this->content .= "<tr><th>" . GetMessage("WW_STEP1_3") . "</th><td>" . $arResult["orderEmail"] . "</td></tr>"; $this->content .= "<tr><th>" . GetMessage("WW_STEP1_5") . "</th><td>" . $arResult["currencyID"] . " (" . $arCurrency[$arResult["currencyID"]] . ")" . "</td></tr>"; $this->content .= "<tr><th>" . GetMessage("WW_3") . "</th><td>"; foreach ($arResult["groupID"] as $v) { $this->content .= $arGroups[$v] . "<br />"; } $this->content .= "</td></tr>"; $this->content .= "<tr><th>" . GetMessage("WW_4") . "</th><td>"; foreach ($arResult["personType"] as $v) { $this->content .= $arPersons[$v] . "<br />"; } $this->content .= "</td></tr>"; $this->content .= "<tr><th>" . GetMessage("WW_5") . "</th><td>"; $arPS = array(); foreach ($arResult["paySystem"] as $v) { if (!empty($v)) { foreach ($v as $v1) { if (!in_array($v1, $arPS)) { $arPS[] = $v1; } } } } foreach ($arPS as $v) { $this->content .= $arPaySystems[$v] . "<br />"; } $this->content .= "</td></tr>"; $this->content .= "<tr><th>" . GetMessage("WW_6") . "</th><td>"; if (!empty($arResult["delivery"])) { foreach ($arResult["delivery"] as $v) { $this->content .= $arDeliveries[$v] . "<br />"; } } $this->content .= "</td></tr>"; $this->content .= "</table>"; }
} } } $dbResultList = CSaleAffiliatePlan::GetList(array($by => $order), $arFilter, false, false, array("ID", "SITE_ID", "NAME", "DESCRIPTION", "TIMESTAMP_X", "ACTIVE", "BASE_RATE", "BASE_RATE_TYPE", "BASE_RATE_CURRENCY", "MIN_PAY", "MIN_PLAN_VALUE")); $dbResultList = new CAdminResult($dbResultList, $sTableID); $dbResultList->NavStart(); $lAdmin->NavText($dbResultList->GetNavPrint(GetMessage("SAP1_PLANS"))); $lAdmin->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => true), array("id" => "SITE_ID", "content" => GetMessage("SAP1_SITE"), "sort" => "SITE_ID", "default" => true), array("id" => "ACTIVE", "content" => GetMessage("SAP1_ACTIVE"), "sort" => "ACTIVE", "default" => true), array("id" => "NAME", "content" => GetMessage("SAP1_NAME"), "sort" => "NAME", "default" => true), array("id" => "RATE", "content" => GetMessage("SAP1_RATE"), "sort" => "", "default" => true), array("id" => "MIN_PLAN_VALUE", "content" => GetMessage("SAP1_NOT_LESS"), "sort" => "MIN_PLAN_VALUE", "default" => true))); $arVisibleColumns = $lAdmin->GetVisibleHeaderColumns(); $arSites = array(); $dbSiteList = CSite::GetList($b = "sort", $o = "asc"); while ($arSite = $dbSiteList->Fetch()) { $arSites[$arSite["LID"]] = "[" . $arSite["LID"] . "] " . $arSite["NAME"]; } $arCurrencies = array("P" => "%"); $dbCurrencyList = CCurrency::GetList($b = "currency", $o = "asc"); while ($arCurrency = $dbCurrencyList->Fetch()) { $arCurrencies[$arCurrency["CURRENCY"]] = "[" . $arCurrency["CURRENCY"] . "] " . $arCurrency["FULL_NAME"]; } $affiliatePlanType = COption::GetOptionString("sale", "affiliate_plan_type", "N"); $arBaseLangCurrencies = array(); while ($arPlan = $dbResultList->NavNext(true, "f_")) { $row =& $lAdmin->AddRow($f_ID, $arPlan, "sale_affiliate_plan_edit.php?ID=" . $f_ID . "&lang=" . LANG . GetFilterParams("filter_"), GetMessage("SAP1_UPDATE_PLAN")); $row->AddField("ID", $f_ID); $row->AddSelectField("SITE_ID", $arSites, array()); $row->AddCheckField("ACTIVE"); $row->AddInputField("NAME", array("size" => "20")); if ($f_BASE_RATE_TYPE == "P") { $fieldValue = $f_BASE_RATE . "%"; } else { $fieldValue = SaleFormatCurrency($f_BASE_RATE, $f_BASE_RATE_CURRENCY);
<?php if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) { die; } $arCurrencyTypes = array('' => GetMessage('SPT_ALLOWED_CURRENCY_ALL')); if (CModule::IncludeModule('currency')) { $rsCurrency = CCurrency::GetList($by = 'name', $order = 'desc', LANGUAGE_ID); while ($arCurrency = $rsCurrency->Fetch()) { $arCurrencyTypes[$arCurrency['CURRENCY']] = $arCurrency['FULL_NAME']; } } $arComponentParameters = array('PARAMETERS' => array('ALLOWED_CURRENCY' => array('PARENT' => 'BASE', 'NAME' => GetMessage('SPT_ALLOWED_CURRENCY'), 'TYPE' => 'LIST', 'MULTIPLE' => 'Y', 'VALUES' => $arCurrencyTypes), 'DEFAULT_CURRENCY' => array('PARENT' => 'BASE', 'NAME' => GetMessage('SPT_DEFAULT_CURRENCY'), 'TYPE' => 'LIST', 'VALUES' => $arCurrencyTypes), 'COMISSION' => array('PARENT' => 'BASE', 'NAME' => GetMessage('SPT_COMISSION'), 'TYPE' => 'STRING', 'DEFAULT' => '0', 'COLS' => '5'), 'PATH_TO_USER' => array('PARENT' => 'BASE', 'NAME' => GetMessage('SPT_PATH_TO_USER'), 'TYPE' => 'STRING', 'DEFAULT' => ''), 'SET_TITLE' => array())); if (IsModuleInstalled('socialnetwork')) { $arComponentParameters['PARAMETERS']['NOTIFY_USER'] = array('PARENT' => 'BASE', 'NAME' => GetMessage('SPT_NOTIFY_USER'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'Y'); }
$arCurrency = array("CURRENCY" => $arOneCBVal["#"]["CharCode"][0]["#"], "RATE_CNT" => intval($arOneCBVal["#"]["Nominal"][0]["#"]), "RATE" => doubleval(str_replace(",", ".", $arOneCBVal["#"]["Value"][0]["#"]))); $arResult["CURRENCY_CBRF"][] = array("FROM" => CurrencyFormat($arCurrency["RATE_CNT"], $arCurrency["CURRENCY"]), "BASE" => CurrencyFormat($arCurrency["RATE"], $arParams["CURRENCY_BASE"])); } } if (isset($arOneCBVal)) { unset($arOneCBVal); } } } } } } } $arCurrencyList = array(); $arDBCurrencies = array(); $dbCurrencyList = CCurrency::GetList($b = "", $o = ""); while ($arCurrency = $dbCurrencyList->Fetch()) { $arDBCurrencies[$arCurrency["CURRENCY"]] = $arCurrency["AMOUNT_CNT"]; } foreach ($arParams["arrCURRENCY_FROM"] as &$strCurrencyCode) { if (array_key_exists($strCurrencyCode, $arDBCurrencies)) { $arCurrencyList[] = $strCurrencyCode; $rate = CCurrencyRates::ConvertCurrency($arDBCurrencies[$strCurrencyCode], $strCurrencyCode, $arParams["CURRENCY_BASE"], $arParams["RATE_DAY"]); $arResult["CURRENCY"][] = array('FROM' => CurrencyFormat($arDBCurrencies[$strCurrencyCode], $strCurrencyCode), 'BASE' => CurrencyFormat($rate, $arParams["CURRENCY_BASE"])); } } if (isset($strCurrencyCode)) { unset($strCurrencyCode); } if (!empty($arCurrencyList)) { if (defined("BX_COMP_MANAGED_CACHE")) {
public static function getCurrenciesNames($arCurIds = array()) { if (!CModule::IncludeModule('catalog') || !CModule::IncludeModule('currency')) { return array(); } static $arCurrCache = false; if ($arCurrCache === false) { $arCurrCache = array(); $dbCurr = CCurrency::GetList($by = "sort", $order = "asc"); while ($arCurr = $dbCurr->Fetch()) { $arCurrCache[$arCurr["CURRENCY"]] = $arCurr["FULL_NAME"]; } } $arRetSite = array(); if (!empty($arCurIds)) { foreach ($arCurIds as $currId) { if (isset($arCurrCache[$currId])) { $arRetCur[$currId] = $arCurrCache[$currId]; } } } else { $arRetCur = $arCurrCache; } return $arRetCur; }
if (strlen($strExportErrorMessage)<=0) { @fwrite($fp, '<? header("Content-Type: text/xml; charset=windows-1251");?>'); @fwrite($fp, '<? echo "<"."?xml version=\"1.0\" encoding=\"windows-1251\"?".">"?>'); @fwrite($fp, "\n<!DOCTYPE yml_catalog SYSTEM \"shops.dtd\">\n"); @fwrite($fp, "<yml_catalog date=\"".Date("Y-m-d H:i")."\">\n"); @fwrite($fp, "<shop>\n"); @fwrite($fp, "<name>".$APPLICATION->ConvertCharset(htmlspecialcharsbx(COption::GetOptionString("main", "site_name", "")), LANG_CHARSET, 'windows-1251')."</name>\n"); @fwrite($fp, "<company>".$APPLICATION->ConvertCharset(htmlspecialcharsbx(COption::GetOptionString("main", "site_name", "")), LANG_CHARSET, 'windows-1251')."</company>\n"); @fwrite($fp, "<url>http://".htmlspecialcharsbx(strlen($SETUP_SERVER_NAME) > 0 ? $SETUP_SERVER_NAME : COption::GetOptionString("main", "server_name", ""))."</url>\n"); @fwrite($fp, "<platform>1C-Bitrix</platform>\n"); $by="sort"; $order="asc"; $db_acc = CCurrency::GetList($by, $order); $strTmp = "<currencies>\n"; $arCurrencyAllowed = array('RUR', 'RUB', 'USD', 'EUR', 'UAH', 'BYR', 'KZT'); while ($arAcc = $db_acc->Fetch()) { if (in_array($arAcc['CURRENCY'], $arCurrencyAllowed)) $strTmp.= "<currency id=\"".$arAcc["CURRENCY"]."\" rate=\"".(CCurrencyRates::ConvertCurrency(1, $arAcc["CURRENCY"], "RUR"))."\"/>\n"; } $strTmp.= "</currencies>\n"; @fwrite($fp, $strTmp); //*****************************************// $arSelect = array("ID", "LID", "IBLOCK_ID", "IBLOCK_SECTION_ID", "ACTIVE", "ACTIVE_FROM", "ACTIVE_TO", "NAME", "PREVIEW_PICTURE", "PREVIEW_TEXT", "PREVIEW_TEXT_TYPE", "DETAIL_PICTURE", "LANG_DIR", "DETAIL_PAGE_URL"); $db_res = CCatalogGroup::GetGroupsList(array("GROUP_ID"=>2));
public static function init() { IncludeModuleLangFile(__FILE__); if (!self::$fInit) { self::$fInit = true; self::$siteCookieId = md5('SALE_REPORT_SITE_ID'); // Initializing list of sites. $result = Bitrix\Main\SiteTable::getList(array('select' => array('LID', 'DEF', 'NAME'))); $i = 0; while ($row = $result->fetch()) { self::$sitelist[$row['LID']] = $row['NAME']; if (++$i === 1) { self::$defaultSiteId = $row['LID']; } else { if ($row['DEF'] === 'Y') { self::$defaultSiteId = $row['LID']; } } self::$weightOptions[$row['LID']] = array('unit' => COption::GetOptionString('sale', 'weight_unit', null, $row['LID']), 'koef' => COption::GetOptionInt('sale', 'weight_koef', null, $row['LID'])); } unset($i, $row, $result); // hack, add virtual ID field into StatusLang entity for filtering $statusEntity = Entity\Base::getInstance('\\Bitrix\\Sale\\Internals\\StatusLang'); if ($statusEntity instanceof \Bitrix\Main\Entity\Base) { $statusEntity->addField(array('data_type' => 'string', 'expression' => array('%s', 'STATUS_ID')), 'ID'); } unset($statusEntity); // hack, add virtual REPS_ORDER field into Shipment entity for filtering system records $shipmentEntity = Entity\Base::getInstance('\\Bitrix\\Sale\\Internals\\Shipment'); if ($shipmentEntity instanceof \Bitrix\Main\Entity\Base) { $shipmentEntity->addField(array('data_type' => 'Order', 'reference' => array('=ref.ID' => 'this.ORDER_ID', '!=this.SYSTEM' => array('?', 'Y'))), 'REPS_ORDER'); } unset($shipmentEntity); // Initializing list of statuses of orders. $result = Bitrix\Sale\Internals\StatusLangTable::getList(array('select' => array('STATUS_ID', 'NAME'), 'filter' => array('=LID' => LANGUAGE_ID))); while ($row = $result->fetch()) { self::$statuslist[$row['STATUS_ID']] = $row['NAME']; } unset($row, $result); self::$genders = array('M' => GetMessage('USER_MALE'), 'F' => GetMessage('USER_FEMALE')); // Initializing list of person types. $result = Bitrix\Sale\Internals\PersonTypeTable::getList(array('select' => array('ID', 'LID', 'NAME'))); while ($row = $result->fetch()) { self::$personTypes[$row['ID']] = array('LID' => $row['LID'], 'NAME' => $row['NAME']); } unset($row, $result); // Initializing list of pay systems of orders. $result = Bitrix\Sale\PaySystemTable::getList(array('select' => array('ID', 'LID', 'NAME'))); while ($row = $result->fetch()) { self::$paySystemList[$row['ID']] = array('value' => $row['NAME'], 'site_id' => $row['LID']); } unset($row, $result); // Initializing list of services and methods of delivery. $result = \Bitrix\Sale\Delivery\Services\Table::getList(array('select' => array('ID', 'NAME'))); while ($row = $result->fetch()) { self::$deliveryList[$row['ID']] = array('value' => $row['NAME'], 'site_id' => ''); } unset($row, $result); // Obtaining table of correspondences of iblocks to sites. $result = Bitrix\Iblock\IblockSiteTable::getList(); while ($row = $result->fetch()) { self::$iblockSite[$row['SITE_ID']][] = $row['IBLOCK_ID']; } unset($row, $result); // Obtaining the list of iblocks which are directories and filling // a property $catalogSections with sections of these units. $ent = new CCatalog(); $result = $ent->GetList(); while ($ibRow = $result->Fetch()) { // Obtaining list of sections of the catalog. self::$catalogs[] = $ibRow; $path = array(); $curLevel = $prevLevel = 0; $sections = CIBlockSection::GetTreeList(array('=IBLOCK_ID' => $ibRow['IBLOCK_ID'])); $row = null; while ($row = $sections->GetNext()) { // Formation of an array of identifiers of current and parent sections. $curLevel = $row['DEPTH_LEVEL']; for ($i = 0; $i <= $prevLevel - $curLevel; $i++) { array_pop($path); } array_push($path, $row['ID']); $prevLevel = $curLevel; self::$catalogSections[$row['ID']] = array('name' => ltrim(str_repeat(' . ', $curLevel) . $row['NAME']), 'path' => $path, 'catalog' => array('ID' => $ibRow['ID'], 'NAME' => $ibRow['NAME'])); } } unset($ent, $ibRow, $row, $sections, $result); // Initialization of the list of warehouses. $result = Bitrix\Catalog\StoreTable::getList(array('select' => array('ID', 'TITLE'))); while ($row = $result->fetch()) { self::$productStores[$row['ID']] = $row['TITLE']; } unset($row, $result); // Getting currencies $obj = new CCurrency(); $by = ''; $order = ''; $result = $obj->GetList($by, $order, LANGUAGE_ID); while ($row = $result->Fetch()) { self::$currencies[$row['CURRENCY']] = array('name' => $row['FULL_NAME']); } unset($row, $result, $obj, $by, $order); // Getting types of prices $obj = new CCatalogGroup(); $result = $obj->GetListEx(array('SORT'), array(), false, false, array('ID', 'NAME', 'BASE', 'NAME_LANG')); while ($row = $result->Fetch()) { self::$priceTypes[$row['ID']] = array('name' => empty($row['NAME_LANG']) ? $row['NAME'] : $row['NAME_LANG'], 'base' => $row['BASE'] === 'Y' ? true : false); } unset($row, $result, $obj); // Getting option, which means, it is necessary to display a fractional quantity of goods of no. self::$fDecimalQuant = COption::GetOptionString('sale', 'QUANTITY_FACTORIAL') == 'Y'; self::initOwners(); } }
} } } } else { $rsPrice = CCatalogGroup::GetList($v1 = "sort", $v2 = "asc"); while($arr = $rsPrice->Fetch()) { $arPrice[$arr["NAME"]] = "[".$arr["NAME"]."] ".$arr["NAME_LANG"]; } } if(CModule::IncludeModule("currency")) { $rsCur = CCurrency::GetList(($by = "name"), ($order1 = "asc"), LANGUAGE_ID); while($arCur = $rsCur->Fetch()) { $arCurrencies[$arCur["CURRENCY"]] = $arCur["CURRENCY"]; } } $arTemplateParameters = array( "INCLUDE_JQUERY" => Array( "PARENT" => "WF_FILTER_RUB", "NAME" => GetMessage("INCLUDE_JQUERY"), "TYPE" => "CHECKBOX", "DEFAULT" => 'Y' ), "VIEW_HIT" => array( "PARENT" => "WF_FILTER_RUB",
switch ($_REQUEST['action']) { case "delete": if ($CURRENCY_RIGHT == "W") { if (!CCurrency::Delete($ID)) { if ($ex = $APPLICATION->GetException()) { $lAdmin->AddGroupError($ex->GetString(), $ID); } else { $lAdmin->AddGroupError(GetMessage("currency_err1"), $ID); } } } break; } } } $rsData = CCurrency::GetList($by, $order); $rsData = new CAdminResult($rsData, $sTableID); $rsData->NavStart(); $lAdmin->NavText($rsData->GetNavPrint(GetMessage("CURRENCY_TITLE"))); $arHeaders = array(); $arHeaders[] = array("id" => "CURRENCY", "content" => GetMessage('currency_curr'), "sort" => "CURRENCY", "default" => true); $arHeaders[] = array("id" => "FULL_NAME", "content" => GetMessage('CURRENCY_FULL_NAME'), "sort" => "name", "default" => true); $arHeaders[] = array("id" => "SORT", "content" => GetMessage('currency_sort'), "sort" => "sort", "default" => true); $arHeaders[] = array("id" => "AMOUNT_CNT", "content" => GetMessage('currency_rate_cnt'), "default" => true); $arHeaders[] = array("id" => "AMOUNT", "content" => GetMessage('currency_rate'), "default" => true); $lAdmin->AddHeaders($arHeaders); while ($arRes = $rsData->NavNext(true, "f_")) { $row =& $lAdmin->AddRow($f_CURRENCY, $arRes, "/bitrix/admin/currency_edit.php?ID=" . $f_CURRENCY . "&lang=" . LANGUAGE_ID, GetMessage('CURRENCY_A_EDIT')); $row->AddViewField("CURRENCY", '<a href="/bitrix/admin/currency_edit.php?ID=' . $f_CURRENCY . '&lang=' . LANGUAGE_ID . '" title="' . GetMessage('CURRENCY_A_EDIT_TITLE') . '">' . $f_CURRENCY . '</a>'); $row->AddInputField("SORT", array("size" => "3")); $row->AddViewField("FULL_NAME", $f_FULL_NAME);
'CODE' => $arOneCatalogAvailQuantityFields['value'], 'ID' => $intCount, 'SORT' => (!empty($field_num[$mxSelKey]) && 0 < intval($field_num[$mxSelKey]) ? intval($field_num[$mxSelKey]) : ($intCount+1)*10), ); $bNeedCounts = true; $arCountFields[] = $arOneCatalogAvailQuantityFields['value']; } $intCount++; } } if (isset($arOneCatalogAvailQuantityFields)) unset($arOneCatalogAvailQuantityFields); $strVal = COption::GetOptionString("catalog", "allowed_currencies", $defCatalogAvailCurrencies); $arVal = explode(",", $strVal); $lcur = CCurrency::GetList(($by1="sort"), ($order1="asc")); $arCurList = array(); while ($lcur_res = $lcur->Fetch()) { if (in_array($lcur_res["CURRENCY"], $arVal)) { $arCurList[] = $lcur_res["CURRENCY"]; } } $arPriceList = array(); if (!empty($arCurList)) { foreach ($field_code as $mxSelKey => $strOneFieldsCode) { if (0 == strncmp($strOneFieldsCode, "CR_PRICE_", 9))
$bVarsFromForm = true; } } $dbUserCards = CSaleUserCards::GetList(array("DATE_UPDATE" => "DESC"), array("ID" => $ID, "USER_ID" => IntVal($GLOBALS["USER"]->GetID())), false, false, array("ID", "USER_ID", "ACTIVE", "SORT", "PAY_SYSTEM_ACTION_ID", "CURRENCY", "CARD_TYPE", "CARD_NUM", "CARD_CODE", "CARD_EXP_MONTH", "CARD_EXP_YEAR", "DESCRIPTION", "SUM_MIN", "SUM_MAX", "SUM_CURRENCY", "TIMESTAMP_X", "LAST_STATUS", "LAST_STATUS_CODE", "LAST_STATUS_DESCRIPTION", "LAST_STATUS_MESSAGE", "LAST_SUM", "LAST_CURRENCY", "LAST_DATE")); if ($arUserCards = $dbUserCards->GetNext()) { $arResult = $arUserCards; $arResult["CARD_NUM"] = CSaleUserCards::CryptData($arResult["CARD_NUM"], "D"); } else { $arResult["ID"] = 0; $arResult["ACTIVE"] = "Y"; $arResult["SORT"] = 100; } if ($bVarsFromForm) { foreach ($_POST as $k => $v) { $arResult[$k] = htmlspecialcharsex($v); $arResult['~' . $k] = $v; } } $arResult["ERROR_MESSAGE"] = $errorMessage; $dbPaySysActions = CSalePaySystemAction::GetList(array("PERSON_TYPE_ID" => "ASC", "NAME" => "ASC", "PT_NAME" => "ASC", "PS_NAME" => "ASC"), array("PS_LID" => SITE_ID, "HAVE_ACTION" => "Y"), false, false, array("*")); $arResult["PAY_SYSTEM"] = array(); while ($arPaySysActions = $dbPaySysActions->GetNext()) { $arResult["PAY_SYSTEM"][] = $arPaySysActions; } $dbCurrency = CCurrency::GetList($by = "sort", $order = "asc"); $arResult["CURRENCY_INFO"] = array(); while ($arCurrency = $dbCurrency->GetNext()) { $arResult["CURRENCY_INFO"][] = $arCurrency; } $arResult["CARD_TYPE_INFO"] = array("VISA" => "Visa", "MASTERCARD" => "MasterCard", "AMEX" => "Amex", "DINERS" => "Diners", "DISCOVER" => "Discover", "JCB" => "JCB", "ENROUTE" => "Enroute"); $this->IncludeComponentTemplate();
} } else { if ($a[$by] == $b[$by]) { return 0; } elseif ($a[$by] > $b[$by]) { return $order == "DESC" ? -1 : 1; } else { return $order == "DESC" ? 1 : -1; } } } } uasort($arResult, "bxStatSort"); $arHeaders = array(array("id" => "PRODUCT_ID", "content" => GetMessage("SALE_PRODUCT_ID"), "sort" => "PRODUCT_ID", "default" => true), array("id" => "NAME", "content" => GetMessage("SALE_NAME"), "sort" => "NAME", "default" => true), array("id" => "QUANTITY", "content" => GetMessage("SALE_QUANTITY"), "sort" => "QUANTITY", "default" => true, "align" => "right"), array("id" => "COUNT", "content" => GetMessage("SALE_COUNT"), "sort" => "COUNT", "default" => true, "align" => "right"), array("id" => "ORDER_QUANTITY", "content" => GetMessage("SALE_ORDER_QUANTITY"), "sort" => "ORDER_QUANTITY", "default" => true, "align" => "right"), array("id" => "ORDER_COUNT", "content" => GetMessage("SALE_ORDER_COUNT"), "sort" => "ORDER_COUNT", "default" => true, "align" => "right"), array("id" => "PAYED", "content" => GetMessage("SALE_PAYED"), "sort" => "PAYED", "default" => true, "align" => "right"), array("id" => "PAYED_PROC", "content" => GetMessage("SALE_PAYED_PROC"), "sort" => "PAYED_PROC", "default" => true, "align" => "right"), array("id" => "ALLOW_DELIVERY", "content" => GetMessage("SALE_ALLOW_DELIVERY"), "sort" => "ALLOW_DELIVERY", "default" => true, "align" => "right"), array("id" => "ALLOW_DELIVERY_PROC", "content" => GetMessage("SALE_ALLOW_DELIVERY_PROC"), "sort" => "ALLOW_DELIVERY_PROC", "default" => true, "align" => "right"), array("id" => "DELAY", "content" => GetMessage("SALE_DELAY"), "sort" => "DELAY", "default" => true, "align" => "right"), array("id" => "BASKET_QUANTITY", "content" => GetMessage("SALE_BASKET_QUANTITY"), "sort" => "BASKET_QUANTITY", "default" => true, "align" => "right")); $arCurrency = array(); $dbCur = CCurrency::GetList($b1 = "name", $order1 = "asc", LANGUAGE_ID); while ($arCur = $dbCur->Fetch()) { $arCurrency[$arCur["CURRENCY"]] = htmlspecialcharsEx($arCur["FULL_NAME"]); if (in_array($arCur["CURRENCY"], $arCurUsed)) { foreach ($arPrices as $v) { $arHeaders[] = array("id" => $v . "_" . $arCur["CURRENCY"], "content" => GetMessage("SALE_" . $v, array("#CURRENCY#" => htmlspecialcharsEx($arCur["FULL_NAME"]))), "sort" => $v . "_" . $arCur["CURRENCY"], "default" => true, "align" => "right"); } } } $lAdmin->AddHeaders($arHeaders); $arVisibleColumns = $lAdmin->GetVisibleHeaderColumns(); $dbResult = new CDBResult(); $dbResult->InitFromArray($arResult); $dbResult = new CAdminResult($dbResult, $sTableID); $dbResult->NavStart(); $lAdmin->NavText($dbResult->GetNavPrint(""));
if ($arCurrentValues['USE_MIN_AMOUNT'] != "N") { $arComponentParameters["PARAMETERS"]["MIN_AMOUNT"] = array("PARENT" => "STORE_SETTINGS", "NAME" => GetMessage("MIN_AMOUNT"), "TYPE" => "STRING", "DEFAULT" => 10); } $arComponentParameters["PARAMETERS"]['STORE_PATH'] = array('PARENT' => 'STORE_SETTINGS', 'NAME' => GetMessage('STORE_PATH'), "TYPE" => "STRING", "DEFAULT" => "/store/#store_id#"); $arComponentParameters["PARAMETERS"]['MAIN_TITLE'] = array('PARENT' => 'STORE_SETTINGS', 'NAME' => GetMessage('MAIN_TITLE'), "TYPE" => "STRING", "DEFAULT" => GetMessage('MAIN_TITLE_VALUE')); } if (!IsModuleInstalled("sale")) { unset($arComponentParameters["PARAMETERS"]["USE_ALSO_BUY"]); unset($arComponentParameters["GROUPS"]["ALSO_BUY_SETTINGS"]); } elseif ($arCurrentValues["USE_ALSO_BUY"] == "Y") { $arComponentParameters["PARAMETERS"]["ALSO_BUY_ELEMENT_COUNT"] = array("PARENT" => "ALSO_BUY_SETTINGS", "NAME" => GetMessage("T_IBLOCK_DESC_ALSO_BUY_ELEMENT_COUNT"), "TYPE" => "STRING", "DEFAULT" => 5); $arComponentParameters["PARAMETERS"]["ALSO_BUY_MIN_BUYES"] = array("PARENT" => "ALSO_BUY_SETTINGS", "NAME" => GetMessage("T_IBLOCK_DESC_ALSO_BUY_MIN_BUYES"), "TYPE" => "STRING", "DEFAULT" => 2); } if (CModule::IncludeModule('catalog') && CModule::IncludeModule('currency')) { $arComponentParameters["PARAMETERS"]['CONVERT_CURRENCY'] = array('PARENT' => 'PRICES', 'NAME' => GetMessage('CP_BC_CONVERT_CURRENCY'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N', 'REFRESH' => 'Y'); if (isset($arCurrentValues['CONVERT_CURRENCY']) && 'Y' == $arCurrentValues['CONVERT_CURRENCY']) { $arCurrencyList = array(); $rsCurrencies = CCurrency::GetList($by = 'SORT', $order = 'ASC'); while ($arCurrency = $rsCurrencies->Fetch()) { $arCurrencyList[$arCurrency['CURRENCY']] = $arCurrency['CURRENCY']; } $arComponentParameters['PARAMETERS']['CURRENCY_ID'] = array('PARENT' => 'PRICES', 'NAME' => GetMessage('CP_BC_CURRENCY_ID'), 'TYPE' => 'LIST', 'VALUES' => $arCurrencyList, 'DEFAULT' => CCurrency::GetBaseCurrency(), "ADDITIONAL_VALUES" => "Y"); } } if (!$OFFERS_IBLOCK_ID) { unset($arComponentParameters["GROUPS"]["OFFERS_SETTINGS"]); } else { $arComponentParameters["PARAMETERS"]["OFFERS_CART_PROPERTIES"] = array("PARENT" => "PRICES", "NAME" => GetMessage("CP_BC_OFFERS_CART_PROPERTIES"), "TYPE" => "LIST", "MULTIPLE" => "Y", "VALUES" => $arProperty_Offers); $arComponentParameters["PARAMETERS"]["OFFERS_SORT_FIELD"] = array("PARENT" => "OFFERS_SETTINGS", "NAME" => GetMessage("CP_BC_OFFERS_SORT_FIELD"), "TYPE" => "LIST", "VALUES" => array("shows" => GetMessage("IBLOCK_SORT_SHOWS"), "sort" => GetMessage("IBLOCK_SORT_SORT"), "timestamp_x" => GetMessage("IBLOCK_SORT_TIMESTAMP"), "name" => GetMessage("IBLOCK_SORT_NAME"), "id" => GetMessage("IBLOCK_SORT_ID"), "active_from" => GetMessage("IBLOCK_SORT_ACTIVE_FROM"), "active_to" => GetMessage("IBLOCK_SORT_ACTIVE_TO")), "ADDITIONAL_VALUES" => "Y", "DEFAULT" => "sort"); $arComponentParameters["PARAMETERS"]["OFFERS_SORT_ORDER"] = array("PARENT" => "OFFERS_SETTINGS", "NAME" => GetMessage("CP_BC_OFFERS_SORT_ORDER"), "TYPE" => "LIST", "VALUES" => $arAscDesc, "DEFAULT" => "asc", "ADDITIONAL_VALUES" => "Y"); }
<input type="text" <?php if ($bReadOnly) { echo "disabled readonly"; } ?> id="CAT_BASE_PRICE_<?php echo $ind; ?> " name="CAT_BASE_PRICE_<?php echo $ind; ?> " value="" size="15" OnBlur="ChangeBasePriceEx(this)"> </td> <td valign="top" align="center"> <?php $db_curr = CCurrency::GetList($by1 = "sort", $order1 = "asc"); ?> <select id="CAT_BASE_CURRENCY_<?php echo $ind; ?> " name="CAT_BASE_CURRENCY_<?php echo $ind; ?> " <?php if ($bReadOnly) { echo "disabled readonly"; } ?> OnChange="ChangeBaseCurrencyEx(this)"> <?php while ($curr = $db_curr->Fetch()) {