本文整理匯總了PHP中CCurrencyLang::getCurrencyFormat方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCurrencyLang::getCurrencyFormat方法的具體用法?PHP CCurrencyLang::getCurrencyFormat怎麽用?PHP CCurrencyLang::getCurrencyFormat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CCurrencyLang
的用法示例。
在下文中一共展示了CCurrencyLang::getCurrencyFormat方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getScripts
/**
* @param Order $order
* @param $formId
* @return string
*/
public static function getScripts(Order $order, $formId)
{
Asset::getInstance()->addJs("/bitrix/js/sale/admin/order_edit.js");
Asset::getInstance()->addJs("/bitrix/js/sale/admin/order_ajaxer.js");
$currencyId = $order->getCurrency();
$currencies = array();
if (Loader::includeModule('currency')) {
\CJSCore::Init(array('currency'));
$currencyFormat = \CCurrencyLang::getFormatDescription($currencyId);
$currencies = array(array('CURRENCY' => $currencyId, 'FORMAT' => array('FORMAT_STRING' => $currencyFormat['FORMAT_STRING'], 'DEC_POINT' => $currencyFormat['DEC_POINT'], 'THOUSANDS_SEP' => $currencyFormat['THOUSANDS_SEP'], 'DECIMALS' => $currencyFormat['DECIMALS'], 'THOUSANDS_VARIANT' => $currencyFormat['THOUSANDS_VARIANT'], 'HIDE_ZERO' => "N")));
}
$curFormat = \CCurrencyLang::getCurrencyFormat($currencyId);
$currencyLang = trim(str_replace("#", '', $curFormat["FORMAT_STRING"]));
$langPhrases = array("SALE_ORDEREDIT_DISCOUNT_UNKNOWN", "SALE_ORDEREDIT_REFRESHING_DATA", "SALE_ORDEREDIT_FIX", "SALE_ORDEREDIT_UNFIX");
$result = '
<script type="text/javascript">
BX.ready(function(){
BX.Sale.Admin.OrderEditPage.orderId = "' . $order->getId() . '";
BX.Sale.Admin.OrderEditPage.siteId = "' . $order->getSiteId() . '";
BX.Sale.Admin.OrderEditPage.languageId = "' . LANGUAGE_ID . '";
BX.Sale.Admin.OrderEditPage.formId = "' . $formId . '_form";
BX.Sale.Admin.OrderEditPage.adminTabControlId = "' . $formId . '";
' . (!empty($currencies) ? 'BX.Currency.setCurrencies(' . \CUtil::PhpToJSObject($currencies, false, true, true) . ');' : '') . 'BX.Sale.Admin.OrderEditPage.currency = "' . $currencyId . '";
BX.Sale.Admin.OrderEditPage.currencyLang = "' . \CUtil::JSEscape($currencyLang) . '";';
if ($formId == "sale_order_create") {
$result .= '
BX.Sale.Admin.OrderEditPage.registerFieldsUpdaters(BX.Sale.Admin.OrderPayment.prototype.getCreateOrderFieldsUpdaters());';
}
foreach ($langPhrases as $phrase) {
$result .= ' BX.message({' . $phrase . ': "' . \CUtil::JSEscape(Loc::getMessage($phrase)) . '"});';
}
$result .= '});
</script>
';
return $result;
}
示例2: getEditTemplate
private static function getEditTemplate($data, $index, $post = array())
{
$paid = $post ? $post['PAID'] : $data['PAID'];
$id = $post ? $post['PAYMENT_ID'] : $data['ID'];
$paidString = $paid == 'Y' ? 'YES' : 'NO';
if (!$post) {
if ($data['SUM'] > 0) {
$sum = $data['SUM'];
} else {
$sum = $data['ORDER_PRICE'] - $data['ORDER_PAYMENT_SUM'] <= 0 ? 0 : $data['ORDER_PRICE'] - $data['ORDER_PAYMENT_SUM'];
}
} else {
$sum = $post['SUM'];
}
$psData = self::getPaySystemParams(isset($post['PAY_SYSTEM_ID']) ? $post['PAY_SYSTEM_ID'] : $data['PAY_SYSTEM_ID'], $data['PERSON_TYPE_ID']);
if (isset($psData["LOGOTIP_PATH"])) {
$data['PAY_SYSTEM_LOGOTIP'] = $psData["LOGOTIP_PATH"];
}
$paymentStatus = '<span><span id="BUTTON_PAID_' . $index . '" ' . ($paid != 'Y' ? 'class="notpay"' : '') . '>' . Loc::getMessage('SALE_ORDER_PAYMENT_STATUS_' . $paidString) . '</span><span class="triangle"> ▾</span></span>';
$note = BeginNote();
$note .= Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_ALERT');
$note .= EndNote();
$hiddenPaySystemInnerId = '';
if ($index == 1) {
$hiddenPaySystemInnerId = '<input type="hidden" value="' . PaySystemInner::getId() . '" id="PAYMENT_INNER_BUDGET_ID">';
}
$notPaidBlock = $paid == 'N' && !empty($data['EMP_PAID_ID']) ? '' : 'style="display:none;"';
$return = $post['IS_RETURN'] == 'Y' ? '' : 'style="display:none;"';
$returnInformation = '
<tr ' . $return . ' class="return">
<td class="adm-detail-content-cell-l fwb">' . Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_TO') . ':</td>
<td class="adm-detail-content-cell-r">
<select name="PAYMENT[' . $index . '][OPERATION_ID]" id="OPERATION_ID_' . $index . '" class="adm-bus-select">
<option value="RETURN">' . Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_ACCOUNT') . '</option>
</select>
</td>
</tr>
<tr ' . $return . ' class="return">
<td colspan="2" style="text-align: center">' . $note . '</td>
</tr>
<tr ' . $notPaidBlock . ' class="not_paid">
<td class="adm-detail-content-cell-l" width="40%"><br>' . Loc::getMessage('SALE_ORDER_PAYMENT_PAY_RETURN_NUM') . ':</td>
<td class="adm-detail-content-cell-r tal">
<br>
<input type="text" class="adm-bus-input" name="PAYMENT[' . $index . '][PAY_RETURN_NUM]" id="PAYMENT_RETURN_NUM_' . $index . '" value="' . htmlspecialcharsbx($post['PAY_RETURN_NUM'] ? $post['PAY_RETURN_NUM'] : $data['PAY_RETURN_NUM']) . '" maxlength="20">
</td>
</tr>
<tr ' . $notPaidBlock . ' class="not_paid">
<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PAY_RETURN_DATE') . ':</td>
<td class="adm-detail-content-cell-r tal">
<div class="adm-input-wrap adm-calendar-second" style="display: inline-block;">
<input type="text" class="adm-input adm-calendar-to" name="PAYMENT[' . $index . '][PAY_RETURN_DATE]" id="PAYMENT_RETURN_DATE_' . $index . '" size="15" value="' . htmlspecialcharsbx($post['PAY_RETURN_DATE'] ? $post['PAY_RETURN_DATE'] : $data['PAY_RETURN_DATE']) . '">
<span class="adm-calendar-icon" title="' . Loc::getMessage('SALE_ORDER_PAYMENT_CHOOSE_DATE') . '" onclick="BX.calendar({node:this, field:\'PAYMENT_RETURN_DATE_' . $index . '\', form: \'\', bTime: false, bHideTime: false});"></span>
</div>
</td>
</tr>
<tr ' . $notPaidBlock . ' class="not_paid">
<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_COMMENT') . ':</td>
<td class="adm-detail-content-cell-r tal">
<div class="adm-input-wrap adm-calendar-second" style="display: inline-block;">
<textarea name="PAYMENT[' . $index . '][PAY_RETURN_COMMENT]" id="PAYMENT_RETURN_COMMENTS_' . $index . '">' . htmlspecialcharsbx(isset($post['PAY_RETURN_COMMENT']) ? $post['PAY_RETURN_COMMENT'] : $data['PAY_RETURN_COMMENT']) . '</textarea>
</div>
</td>
</tr>';
$lang = Main\Application::getInstance()->getContext()->getLanguage();
$title = $id > 0 ? Loc::getMessage('SALE_ORDER_PAYMENT_BLOCK_EDIT_PAYMENT_TITLE') . '#' . $id : Loc::getMessage('SALE_ORDER_PAYMENT_BLOCK_NEW_PAYMENT_TITLE') . '#' . $index;
$curFormat = \CCurrencyLang::getCurrencyFormat($data['CURRENCY']);
$currencyLang = trim(str_replace("#", '', $curFormat["FORMAT_STRING"]));
$disabled = $data['PAID'] == 'Y' ? 'readonly' : '';
$companyList = OrderEdit::getCompanyList();
if (!empty($companyList)) {
$companies = \Bitrix\Sale\Helpers\Admin\OrderEdit::makeSelectHtml('PAYMENT[' . $index . '][COMPANY_ID]', $companyList, isset($post["COMPANY_ID"]) ? $post["COMPANY_ID"] : $data["COMPANY_ID"], true, array("class" => "adm-bus-select", "id" => "COMPANY_ID"));
} else {
$companies = str_replace("#URL#", "/bitrix/admin/sale_company_edit.php?lang=" . $lang, Loc::getMessage('SALE_ORDER_PAYMENT_ADD_COMPANY'));
}
$result = '<div>
<div class="adm-bus-pay" id="payment_container_' . $index . '">
<input type="hidden" name="PAYMENT[' . $index . '][PAYMENT_ID]" id="payment_id_' . $index . '" value="' . $id . '">
<input type="hidden" name="PAYMENT[' . $index . '][INDEX]" value="' . $index . '" class="index">
<input type="hidden" name="PAYMENT[' . $index . '][PAID]" id="PAYMENT_PAID_' . $index . '" value="' . (empty($paid) ? 'N' : $paid) . '">
<input type="hidden" name="PAYMENT[' . $index . '][IS_RETURN]" id="PAYMENT_IS_RETURN_' . $index . '" value="' . ($post['IS_RETURN'] ? $post['IS_RETURN'] : 'N') . '">
' . $hiddenPaySystemInnerId . '
<div class="adm-bus-component-content-container">
<div class="adm-bus-pay-section">
<div class="adm-bus-pay-section-title-container">
<div class="adm-bus-pay-section-title">' . $title . '</div>
<div class="adm-bus-pay-section-action-block">' . (!isset($data['ID']) || $data['ID'] <= 0 ? '<div class="adm-bus-pay-section-action" id="SECTION_' . $index . '_DELETE">' . Loc::getMessage('SALE_ORDER_PAYMENT_DELETE') . '</div>' : '') . '</div>
</div>
<div class="adm-bus-pay-section-content" id="SECTION_' . $index . '">
<div class="adm-bus-pay-section-sidebar">
<div class="adm-bus-pay-section-sidebar-service-logo">
<img id="LOGOTIP_' . $index . '" src="' . $data['PAY_SYSTEM_LOGOTIP'] . '" alt="">
</div>
</div>
<div class="adm-bus-pay-section-right">
<div class="adm-bus-table-container caption border">
<div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_PAYMENT_METHOD') . '</div>
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table ">
<tbody>
<tr>
//.........這裏部分代碼省略.........
示例3: elseif
$DELIVERY_ID = $fields["DELIVERY_ID"];
} elseif (isset($_REQUEST["DELIVERY_ID"])) {
$DELIVERY_ID = $_REQUEST["DELIVERY_ID"];
} else {
$DELIVERY_ID = 0;
}
$DELIVERY_ID = intval($DELIVERY_ID);
if ($DELIVERY_ID <= 0) {
$strError .= Loc::getMessage("SALE_ESDE_ERROR_ID");
}
$currencyLang = "";
$deliveryService = null;
if ($DELIVERY_ID > 0) {
$deliveryService = \Bitrix\Sale\Delivery\Services\Manager::getService($DELIVERY_ID);
if ($deliveryService && \Bitrix\Main\Loader::includeModule('currency')) {
$curFormat = \CCurrencyLang::getCurrencyFormat($deliveryService->getCurrency());
$currencyLang = trim(str_replace("#", '', $curFormat["FORMAT_STRING"]));
} else {
$currencyLang = $deliveryService->getCurrency();
}
}
if ($deliveryService && $ID <= 0 && isset($_GET["ES_CODE"]) && strlen($_GET["ES_CODE"]) > 0) {
$embeddedList = $deliveryService->getEmbeddedExtraServicesList();
if (isset($embeddedList[$_GET["ES_CODE"]])) {
$fields = $embeddedList[$_GET["ES_CODE"]];
$fields["CODE"] = $_GET["ES_CODE"];
$fields["ID"] = strval(mktime());
}
}
$aTabs = array(array("DIV" => "edit_main", "TAB" => Loc::getMessage("SALE_ESDE_TAB_GENERAL"), "ICON" => "sale", "TITLE" => Loc::getMessage("SALE_ESDE_TAB_GENERAL_TITLE")));
$tabControl = new CAdminTabControl("tabControl", $aTabs);
示例4: getExtraServiceEditControl
public static function getExtraServiceEditControl($extraService, $index, $view = false)
{
ob_start();
echo '<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table" id="BLOCK_EXTRA_SERVICE_' . $index . '">';
echo '<tbody>';
foreach ($extraService as $itemId => $item) {
echo '<tr><td class="adm-detail-content-cell-l" width="40%">' . htmlspecialcharsbx($item->getName()) . ':</td>';
echo '<td class="adm-detail-content-cell-r tal">';
if ($view) {
echo $item->getViewControl();
} else {
echo $item->getEditControl('SHIPMENT[' . $index . '][EXTRA_SERVICES][' . $itemId . ']');
}
$order = self::$shipment->getCollection()->getOrder();
$currency = $order->getCurrency();
$price = $item->getPrice();
$curFormat = \CCurrencyLang::getCurrencyFormat($currency);
$currencyLang = trim(str_replace("#", '', $curFormat["FORMAT_STRING"]));
if ($price !== false) {
echo ' (' . SaleFormatCurrency($price, $currency) . ')';
} else {
echo ' (' . $currencyLang . ')';
}
echo '</td></tr>';
}
echo '</tbody></table>';
$result = ob_get_contents();
ob_end_clean();
return $result;
}