当前位置: 首页>>代码示例>>PHP>>正文


PHP BFCHelper::convertTotal方法代码示例

本文整理汇总了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;
开发者ID:Bookingfor,项目名称:joomla-extension-v-2,代码行数:31,代码来源:ratings.php

示例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();
 }
开发者ID:Bookingfor,项目名称:joomla-extension,代码行数:19,代码来源:controller.php


注:本文中的BFCHelper::convertTotal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。