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


PHP TravelHelper::format_money_from_db方法代码示例

本文整理汇总了PHP中TravelHelper::format_money_from_db方法的典型用法代码示例。如果您正苦于以下问题:PHP TravelHelper::format_money_from_db方法的具体用法?PHP TravelHelper::format_money_from_db怎么用?PHP TravelHelper::format_money_from_db使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TravelHelper的用法示例。


在下文中一共展示了TravelHelper::format_money_from_db方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getRentalInfo

 static function getRentalInfo()
 {
     $rental_id = intval(STInput::request('rental_id', ''));
     $data = array('price' => '', 'extras' => 'None', 'adult_html' => '', 'child_html' => '');
     if ($rental_id <= 0 || get_post_type($rental_id) != 'st_rental') {
         echo json_encode($data);
     } else {
         $adult_number = intval(get_post_meta($rental_id, 'rental_max_adult', true));
         if ($adult_number <= 0) {
             $adult_number = 1;
         }
         $adult_html = '<select name="adult_number" class="form-control" style="width: 100px;">';
         for ($i = 1; $i <= $adult_number; $i++) {
             $adult_html .= '<option value="' . $i . '">' . $i . '</option>';
         }
         $adult_html .= '</select>';
         $child_number = intval(get_post_meta($rental_id, 'rental_max_children', true));
         if ($child_number <= 0) {
             $child_number = 0;
         }
         $child_html = '<select name="child_number" class="form-control" style="width: 100px;">';
         for ($i = 0; $i <= $child_number; $i++) {
             $child_html .= '<option value="' . $i . '">' . $i . '</option>';
         }
         $child_html .= '</select>';
         $html = '';
         $price = floatval(get_post_meta($rental_id, 'price', true));
         $extras = get_post_meta($rental_id, 'extra_price', true);
         if (is_array($extras) && count($extras)) {
             $html = '<table class="table">';
             foreach ($extras as $key => $val) {
                 $html .= '
             <tr>
                 <td width="80%">
                     <label for="' . $val['extra_name'] . '" class="ml20">' . $val['title'] . ' (' . TravelHelper::format_money($val['extra_price']) . ')' . '</label>
                     <input type="hidden" name="extra_price[price][' . $val['extra_name'] . ']" value="' . $val['extra_price'] . '">
                     <input type="hidden" name="extra_price[title][' . $val['extra_name'] . ']" value="' . $val['title'] . '">
                 </td>
                 <td width="20%">
                     <select style="width: 100px" class="form-control" name="extra_price[value][' . $val['extra_name'] . ']" id="">';
                 $max_item = intval($val['extra_max_number']);
                 if ($max_item <= 0) {
                     $max_item = 1;
                 }
                 for ($i = 0; $i <= $max_item; $i++) {
                     $html .= '<option value="' . $i . '">' . $i . '</option>';
                 }
                 $html .= '
                     </select>
                 </td>
             </tr>';
             }
             $html .= '</table>';
         }
         $data['price'] = TravelHelper::format_money_from_db($price, false);
         $data['extras'] = $html;
         $data['adult_html'] = $adult_html;
         $data['child_html'] = $child_html;
         echo json_encode($data);
     }
     die;
 }
开发者ID:DaddyFool,项目名称:travelTest,代码行数:62,代码来源:class.admin.rental.php

示例2: esc_attr

         if ($diff > 1) {
             $duration .= esc_attr($diff) . " " . __("days", ST_TEXTDOMAIN);
         } else {
             $duration .= esc_attr($diff) . " " . __("day", ST_TEXTDOMAIN);
         }
     }
     echo __("Duration", ST_TEXTDOMAIN) . ": " . $duration;
 }
 ?>
                     </td>
                     <td class="post-title page-title column-title">
                        <?php 
 $price = get_post_meta($post_id, 'total_price', true);
 $currency = get_post_meta($post_id, 'currency', true);
 $rate = floatval(get_post_meta($post_id, 'currency_rate', true));
 echo TravelHelper::format_money_from_db($price, $currency, $rate);
 ?>
                     </td>
                     <td class="post-title page-title column-title">
                         <?php 
 echo date(TravelHelper::getDateFormat(), strtotime($value->post_date));
 ?>
                     </td>
                     <td class="post-title page-title column-title">
                         <?php 
 echo get_post_meta($order_id, 'status', true);
 ?>
                     </td>
                     <td class="post-title page-title column-title">
                         <?php 
 echo STPaymentGateways::get_gatewayname(get_post_meta($order_id, 'payment_method', true));
开发者ID:DaddyFool,项目名称:travelTest,代码行数:31,代码来源:booking_index.php


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