本文整理汇总了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;
}
示例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));