本文整理汇总了PHP中CCurrencyRates::GetList方法的典型用法代码示例。如果您正苦于以下问题:PHP CCurrencyRates::GetList方法的具体用法?PHP CCurrencyRates::GetList怎么用?PHP CCurrencyRates::GetList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCurrencyRates
的用法示例。
在下文中一共展示了CCurrencyRates::GetList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCurrencyRateToday
/**
* Метод вернет последнее имеющееся значение курса валюты
*
* @param string $currency
*
* @return float|int
*/
private static function getCurrencyRateToday($currency = 'USD')
{
$currencyRateValue = 0;
$paramSelection = array('ORDER' => array('BY' => 'data', 'TYPE' => 'desc'), 'FILTER' => array('CURRENCY' => $currency));
$dbCurrencyRates = CCurrencyRates::GetList($paramSelection['ORDER']['BY'], $paramSelection['ORDER']['TYPE'], $paramSelection['FILTER']);
if ($curencyRates = $dbCurrencyRates->Fetch()) {
$currencyRateValue = floatval($curencyRates['RATE']);
}
return $currencyRateValue;
}
示例2: foreach
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
$ID = (int) $ID;
if ($ID <= 0) {
continue;
}
switch ($_REQUEST['action']) {
case "delete":
CCurrencyRates::Delete($ID);
break;
}
}
}
$rsData = CCurrencyRates::GetList($by, $order, $arFilter);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("curr_rates_nav")));
$arHeaders = array();
$arHeaders[] = array("id" => "ID", "content" => "ID", "default" => false);
$arHeaders[] = array("id" => "CURRENCY", "content" => GetMessage('curr_rates_curr1'), "sort" => "curr", "default" => true);
$arHeaders[] = array("id" => "DATE_RATE", "content" => GetMessage('curr_rates_date1'), "sort" => "date", "default" => true);
$arHeaders[] = array("id" => "RATE_CNT", "content" => GetMessage('curr_rates_rate_cnt'), "default" => true);
$arHeaders[] = array("id" => "RATE", "content" => GetMessage('curr_rates_rate'), "sort" => "rate", "default" => true);
$lAdmin->AddHeaders($arHeaders);
while ($arRes = $rsData->NavNext(true, "f_")) {
$row =& $lAdmin->AddRow($f_ID, $arRes, "/bitrix/admin/currency_rate_edit.php?ID=" . $f_ID . "&lang=" . LANGUAGE_ID . GetFilterParams("filter_"), GetMessage('CURRENCY_RATES_A_EDIT'));
$row->AddViewField('ID', '<a href="/bitrix/admin/currency_rate_edit.php?ID=' . $f_ID . '&lang=' . LANGUAGE_ID . GetFilterParams("filter_") . '" title="' . GetMessage('CURRENCY_RATES_A_EDIT_TITLE') . '">' . $f_ID . '</a>');
$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->AddCalendarField('DATE_RATE');
示例3: Array
$str_CURRENCY = $result["CURRENCY"];
$str_RATE_CNT = $result["RATE_CNT"];
$str_RATE = $result["RATE"];
}
if ($bVarsFromForm) {
$DB->InitTableVarsForEdit("b_catalog_currency_rate", "", "str_");
}
?>
<script type="text/javascript">
var arCurrencies = new Array();
var arCurrenciesNom = new Array();
<?php
$db_curr = CCurrency::GetList($by1 = "sort", $order1 = "asc");
$num_currencies = 0;
while ($curr = $db_curr->Fetch()) {
$db_currate = CCurrencyRates::GetList($by5 = "DATE_RATE", $order5 = "DESC", array("CURRENCY" => $curr["CURRENCY"]));
if ($currate = $db_currate->Fetch()) {
echo "arCurrenciesNom[" . $num_currencies . "]=" . $currate["RATE_CNT"] . ";";
} else {
echo "arCurrenciesNom[" . $num_currencies . "]=" . $curr["AMOUNT_CNT"] . ";";
}
$num_currencies++;
}
?>
function ChangeCurr()
{
CUR_SELECT_BOX = document.forms['form1'].elements['CURRENCY'].selectedIndex;
CUR_RATE_CNT = document.forms['form1'].elements['RATE_CNT'];
CUR_RATE_CNT.value = arCurrenciesNom[CUR_SELECT_BOX];
}