本文整理汇总了PHP中ilFormat::_getLocalMoneyFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP ilFormat::_getLocalMoneyFormat方法的具体用法?PHP ilFormat::_getLocalMoneyFormat怎么用?PHP ilFormat::_getLocalMoneyFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilFormat
的用法示例。
在下文中一共展示了ilFormat::_getLocalMoneyFormat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editPricesObject
public function editPricesObject($a_show_delete = false)
{
/**
* @var $ilToolbar ilToolbarGUI
* */
global $ilToolbar;
if ($a_show_delete == false) {
unset($_SESSION['price_ids']);
}
$_SESSION['price_ids'] = $_SESSION['price_ids'] ? $_SESSION['price_ids'] : array();
if (!$_GET['pobject_id']) {
ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
$this->objectsObject();
return true;
}
$this->ctrl->setParameter($this, 'pobject_id', (int) $_GET['pobject_id']);
$ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'objects'));
$ilToolbar->addButton($this->lng->txt('paya_edit_details'), $this->ctrl->getLinkTarget($this, 'editDetails'));
$ilToolbar->addButton($this->lng->txt('paya_edit_prices'), $this->ctrl->getLinkTarget($this, 'editPrices'));
$ilToolbar->addButton($this->lng->txt('pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array('ilshoppagegui'), 'edit'));
$this->__initPaymentObject((int) $_GET['pobject_id']);
$this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
$price_obj = new ilPaymentPrices((int) $_GET['pobject_id']);
$standard_prices = array();
$extension_prices = array();
$standard_prices = $price_obj->getPrices();
$extension_prices = $price_obj->getExtensionPrices();
$prices = array_merge($standard_prices, $extension_prices);
// No prices created
if (!count($prices)) {
ilUtil::sendInfo($this->lng->txt('paya_no_price_available'));
$ilToolbar->addButton($this->lng->txt('paya_add_price'), $this->ctrl->getLinkTarget($this, 'addPrice'));
return true;
}
// Show confirm delete
if ($a_show_delete) {
$oConfirmationGUI = new ilConfirmationGUI();
// set confirm/cancel commands
$oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this, "performDeletePrice"));
$oConfirmationGUI->setHeaderText($this->lng->txt("paya_sure_delete_selected_prices"));
$oConfirmationGUI->setCancel($this->lng->txt("cancel"), "editPrices");
$oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performDeletePrice");
foreach ($prices as $price) {
$delete_row = '';
$tmp_price = '';
if (in_array($price['price_id'], $_SESSION['price_ids'])) {
switch ($price['price_type']) {
case ilPaymentPrices::TYPE_DURATION_DATE:
include_once './Services/Calendar/classes/class.ilDatePresentation.php';
$tmp_price = ilDatePresentation::formatDate(new ilDate($price['duration_from'], IL_CAL_DATE)) . ' - ' . ilDatePresentation::formatDate(new ilDate($price['duration_until'], IL_CAL_DATE));
break;
case ilPaymentPrices::TYPE_DURATION_MONTH:
$tmp_price = $price['duration'] . ' ' . $this->lng->txt('paya_months');
break;
case ilPaymentPrices::TYPE_UNLIMITED_DURATION:
$tmp_price = $this->lng->txt('unlimited_duration');
break;
}
$delete_row .= '' . $tmp_price . ' -> ' . ilFormat::_getLocalMoneyFormat($price['price']) . ' ' . $this->genSetData->get('currency_unit');
$oConfirmationGUI->addItem('', $delete_row, $delete_row);
}
}
$this->tpl->setVariable('CONFIRMATION', $oConfirmationGUI->getHTML());
return true;
}
// Fill table cells
/**
* @var object $tpl ilTemplate
*/
$tpl = new ilTemplate('tpl.table.html', true, true);
// set table header
$tpl->setCurrentBlock('tbl_form_header');
$tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));
$tpl->parseCurrentBlock();
$counter = 0;
$data = array();
foreach ($prices as $price) {
$data[$counter]['price_id'] = ilUtil::formCheckBox(in_array($price['price_id'], $_SESSION['price_ids']) ? 1 : 0, 'price_ids[]', $price['price_id']);
switch ($price['price_type']) {
case ilPaymentPrices::TYPE_DURATION_MONTH:
$data[$counter]['duration'] = $price['duration'] . ' ' . $this->lng->txt('paya_months');
break;
case ilPaymentPrices::TYPE_DURATION_DATE:
$data[$counter]['duration'] = ilDatePresentation::formatDate(new ilDate($price['duration_from'], IL_CAL_DATE)) . ' - ' . ilDatePresentation::formatDate(new ilDate($price['duration_until'], IL_CAL_DATE));
break;
case ilPaymentPrices::TYPE_UNLIMITED_DURATION:
$data[$counter]['duration'] = $this->lng->txt('unlimited_duration');
break;
}
$data[$counter]['price'] = ilFormat::_getLocalMoneyFormat($price['price']);
$data[$counter]['currency_unit'] = $this->genSetData->get('currency_unit');
$data[$counter]['extension'] = ilUtil::formCheckBox($price['extension'] ? 1 : 0, 'extension_ids[]', (int) $price['price_id'], true);
$this->ctrl->setParameter($this, "price_id", $price['price_id']);
$data[$counter]['edit'] = "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"" . $this->ctrl->getLinkTarget($this, "editPrice") . "\">" . $this->lng->txt("edit") . "</a></div>";
++$counter;
}
$this->__editPricesTable($data);
return true;
}
示例2: showStatistics
//.........这里部分代码省略.........
}
$o_until_check->addSubItem($o_date_until);
$o_hide_check->addSubItem($o_until_check);
// title filter
$this->__initBookingObject();
$title_options['all'] = $this->lng->txt('pay_all');
$unique_titles = $this->booking_obj->getUniqueTitles();
if (is_array($unique_titles) && count($unique_titles)) {
foreach ($unique_titles as $ref_id) {
$title_options[$ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($ref_id));
}
}
$o_object_title = new ilSelectInputGUI();
$o_object_title->setTitle($this->lng->txt('title'));
$o_object_title->setOptions($title_options);
$o_object_title->setValue($_SESSION["pay_statistics"]["filter_title_id"]);
$o_object_title->setPostVar('filter_title_id');
$o_hide_check->addSubItem($o_object_title);
$o_payed = new ilSelectInputGUI();
$payed_option = array('all' => $this->lng->txt('pay_all'), '1' => $this->lng->txt('yes'), '0' => $this->lng->txt('no'));
$o_payed->setTitle($this->lng->txt('paya_payed'));
$o_payed->setOptions($payed_option);
$o_payed->setValue($_SESSION['pay_statistics']['payed']);
$o_payed->setPostVar('payed');
$o_hide_check->addSubItem($o_payed);
$o_access = new ilSelectInputGUI();
$access_option = array('all' => $this->lng->txt('pay_all'), '1' => $this->lng->txt('yes'), '0' => $this->lng->txt('no'));
$o_access->setTitle($this->lng->txt('paya_access'));
$o_access->setOptions($access_option);
$o_access->setValue($_SESSION['pay_statistics']['access']);
$o_access->setPostVar('access');
$o_hide_check->addSubItem($o_access);
$o_paymethod = new ilSelectInputGUI();
$o_paymethod->setTitle($this->lng->txt('payment_system'));
$o_paymethod->setOptions(ilPayMethods::getPayMethodsOptions('all'));
$o_paymethod->setValue($_SESSION['pay_statistics']['pay_method']);
$o_paymethod->setPostVar('pay_method');
$o_hide_check->addSubItem($o_paymethod);
$filter_form->addCommandButton('showStatistics', $this->lng->txt('pay_update_view'));
$filter_form->addCommandButton('resetFilter', $this->lng->txt('pay_reset_filter'));
$filter_form->addItem($o_hide_check);
$this->tpl->setVariable('FORM', $filter_form->getHTML());
// STATISTICS TABLE
$this->__initBookingObject();
if (!count($bookings = $this->booking_obj->getBookings())) {
ilUtil::sendInfo($this->lng->txt('paya_no_bookings'));
return true;
}
# $this->__showButton('excelExport',$this->lng->txt('excel_export'));
include_once 'Services/User/classes/class.ilObjUser.php';
$object_title_cache = array();
$user_title_cache = array();
$counter = 0;
foreach ($bookings as $booking) {
if (array_key_exists($booking['ref_id'], $object_title_cache)) {
$tmp_obj = $object_title_cache[$booking['ref_id']];
} else {
$tmp_obj = ilObject::_lookupTitle(ilObject::_lookupObjId($booking['ref_id']));
$object_title_cache[$booking['ref_id']] = $tmp_obj;
}
if (array_key_exists($booking['b_vendor_id'], $user_title_cache)) {
$tmp_vendor = $user_title_cache[$booking['b_vendor_id']];
} else {
$tmp_vendor = ilObjUser::_lookupLogin($booking['b_vendor_id']);
$user_title_cache[$booking['b_vendor_id']] = $tmp_vendor;
}
if (array_key_exists($booking['customer_id'], $user_title_cache)) {
$tmp_purchaser = $user_title_cache[$booking['customer_id']];
} else {
$tmp_purchaser = ilObjUser::_lookupLogin($booking['customer_id']);
$user_title_cache[$booking['customer_id']] = $tmp_purchaser;
}
$transaction = $booking['transaction_extern'];
$str_paymethod = ilPayMethods::getStringByPaymethod($booking['b_pay_method']);
$transaction .= " (" . $str_paymethod . ")";
$f_result[$counter]['transaction'] = $transaction;
$f_result[$counter]['object_title'] = $tmp_obj != '' ? $tmp_obj : $this->lng->txt('object_deleted');
$f_result[$counter]['vendor'] = $tmp_vendor != '' ? '[' . $tmp_vendor . ']' : $this->lng->txt('user_deleted');
$f_result[$counter]['customer'] = $tmp_purchaser != '' ? '[' . $tmp_purchaser . ']' : $this->lng->txt('user_deleted');
$f_result[$counter]['order_date'] = ilDatePresentation::formatDate(new ilDateTime($booking['order_date'], IL_CAL_UNIX));
if ($booking['duration'] == 0) {
$booking['duration'] = $this->lng->txt('unlimited_duration');
}
$f_result[$counter]['duration'] = $booking['duration'];
$f_result[$counter]['price'] = ilFormat::_getLocalMoneyFormat($booking['price']) . ' ' . $booking['currency_unit'];
$f_result[$counter]['discount'] = $booking['discount'] . ' ' . $booking['currency_unit'];
$payed_access = $booking['payed'] ? $this->lng->txt('yes') : $this->lng->txt('no');
$payed_access .= '/';
$payed_access .= $booking['access_granted'] ? $this->lng->txt('yes') : $this->lng->txt('no');
$f_result[$counter]['payed_access'] = $payed_access;
$this->ctrl->setParameter($this, "booking_id", $booking['booking_id']);
$link_change = "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"" . $this->ctrl->getLinkTarget($this, "editStatistic") . "\">" . $this->lng->txt("edit") . "</a></div>";
$f_result[$counter]['edit'] = $link_change;
unset($tmp_obj);
unset($tmp_vendor);
unset($tmp_purchaser);
++$counter;
}
return $this->__showStatisticTable($f_result);
}