本文整理汇总了PHP中CostbenefitprojectionHelper::calculate方法的典型用法代码示例。如果您正苦于以下问题:PHP CostbenefitprojectionHelper::calculate方法的具体用法?PHP CostbenefitprojectionHelper::calculate怎么用?PHP CostbenefitprojectionHelper::calculate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CostbenefitprojectionHelper
的用法示例。
在下文中一共展示了CostbenefitprojectionHelper::calculate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
// get combined params of both component and menu
$this->app = JFactory::getApplication();
$this->params = $this->app->getParams();
$this->menu = $this->app->getMenu()->getActive();
// get the user object
$this->user = JFactory::getUser();
// Initialise variables.
$this->item = $this->get('Item');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
// check if the data was returned
if ($this->item) {
// get results
$data = base64_encode(serialize($this->item));
$this->results = CostbenefitprojectionHelper::calculate($this->item->id, $data);
} else {
// int all as false
$this->results = false;
}
// Set the toolbar
$this->addToolBar();
// set the document
$this->_prepareDocument();
parent::display($tpl);
}
示例2: setCompaniesInfo
protected function setCompaniesInfo(&$items)
{
if (CostbenefitprojectionHelper::checkArray($items)) {
// we must check the currency
$currency = array('currency_id', 'currency_name', 'currency_codethree', 'currency_numericcode', 'currency_symbol', 'currency_thousands', 'currency_decimalplace', 'currency_decimalsymbol', 'currency_positivestyle', 'currency_negativestyle');
$names = array();
$namesnot = array();
foreach ($items as $nr => &$item) {
if (!isset($this->currencyDetails->currency_id)) {
$this->currencyDetails = new stdClass();
foreach ($currency as $key) {
$this->currencyDetails->{$key} = $item->{$key};
}
} elseif ($item->currency_id !== $this->currencyDetails->currency_id) {
$namesnot[] = $item->name;
continue;
}
$data = base64_encode(serialize($item));
$this->datasets[] = CostbenefitprojectionHelper::calculate($item->id, $data);
// set some defaults
$names[] = $item->name;
}
if (CostbenefitprojectionHelper::checkArray($namesnot)) {
$companiesNamesNot = '<b>' . implode(', ', $namesnot) . '</b>';
JError::raiseWarning(500, JText::_('Currency mismatch! These were excluded from results: ') . $companiesNamesNot);
}
if (CostbenefitprojectionHelper::checkArray($names)) {
$this->companiesNames = implode(', ', $names);
return true;
}
}
}
示例3: display
function display($tpl = null)
{
// get component params
$this->params = JComponentHelper::getParams('com_costbenefitprojection');
// get the application
$this->app = JFactory::getApplication();
// get the user object
$this->user = JFactory::getUser();
// get global action permissions
$this->canDo = CostbenefitprojectionHelper::getActions('companyresults');
// Initialise variables.
$this->item = $this->get('Item');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
// check if the data was returned
if ($this->item) {
// get results
$data = base64_encode(serialize($this->item));
$this->results = CostbenefitprojectionHelper::calculate($this->item->id, $data);
// set the tab details
$this->chart_tabs = $this->getChartTabs();
$this->table_tabs = $this->getTableTabs();
} else {
// int all as false
$this->results = false;
// set the tab details
$this->chart_tabs = false;
$this->table_tabs = false;
}
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') {
// add the tool bar
$this->addToolBar();
}
// set the document
$this->setDocument();
parent::display($tpl);
}
示例4: getCalculatedResult
public function getCalculatedResult($id, $data)
{
return CostbenefitprojectionHelper::calculate($id, $data);
}