本文整理汇总了PHP中BFCHelper::convertTotal方法的典型用法代码示例。如果您正苦于以下问题:PHP BFCHelper::convertTotal方法的具体用法?PHP BFCHelper::convertTotal怎么用?PHP BFCHelper::convertTotal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BFCHelper
的用法示例。
在下文中一共展示了BFCHelper::convertTotal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sprintf
$creationDateLabel = sprintf(JTEXT::_('COM_BOOKINGFORCONNECTOR_MERCHANTS_VIEW_MERCHANTDETAILS_RATING_DATE_LABEL'), $jdate->format('d/m/Y'));
}
$checkInDateLabel = "";
if (isset($rating->CheckInDate)) {
$checkInDate = BFCHelper::parseJsonDate($rating->CheckInDate, 'Y-m-d');
//$creationDate = DateTime::createFromFormat($formatDate,BFCHelper::parseJsonDate($rating->CreationDate,$formatDate));
$jdate = new JDate($checkInDate);
// 3:20 PM, December 1st, 2012
$checkInDateLabel = sprintf(JTEXT::_('COM_BOOKINGFORCONNECTOR_MERCHANTS_VIEW_MERCHANTDETAILS_RATING_CHECKINDATE_LABEL'), $jdate->format('F Y'));
}
$location = "";
if ($rating->City != "") {
$location .= $rating->City . ", ";
}
$location .= $rating->Nation;
$t = BFCHelper::convertTotal($rating->Total);
//Reply=<risposte><risposta><![CDATA[Test risposta]]></risposta></risposte>
$reply = "";
$replydateLabel = "";
if (!empty($rating->Reply)) {
if (strpos($rating->Reply, '<replies>') !== false) {
$replies = simpledom_load_string($rating->Reply);
$reply = $replies->reply[0];
$replydate = $replies->reply[0]["date"];
if (!empty($replydate)) {
// $jdatereply = new JDate(strtotime($replydate),2); // 3:20 PM, December 1st, 2012
$jdatereply = DateTime::createFromFormat('Ymd', $replydate);
$replydateLabel = sprintf(JTEXT::_('COM_BOOKINGFORCONNECTOR_MERCHANTS_VIEW_MERCHANTDETAILS_RATING_DATEREPLY_LABEL'), $jdatereply->format('d/m/Y'));
}
} else {
$reply = $rating->Reply;
示例2: getResourceRatingAverage
function getResourceRatingAverage()
{
$language = JRequest::getVar('language');
$resourceId = JRequest::getVar('resourceId');
$merchantId = JRequest::getVar('merchantId');
$return = null;
// $return = $language.$resourceId.$merchantId;
$summaryRatings = BFCHelper::getResourceRatingAverage($merchantId, $resourceId);
if (!empty($summaryRatings)) {
$total = number_format((double) $summaryRatings->Average, 1, '.', '');
$totalInt = BFCHelper::convertTotal($total);
$text = JText::_('COM_BOOKINGFORCONNECTOR_MERCHANTS_VIEW_MERCHANTDETAILS_RATING_VALUATION_' . $totalInt);
$return = json_encode(array($total, $text));
// $return = $total . "|" . $text ;
}
echo $return;
$app = JFactory::getApplication();
$app->close();
}