本文整理汇总了PHP中currencies::list_search_active方法的典型用法代码示例。如果您正苦于以下问题:PHP currencies::list_search_active方法的具体用法?PHP currencies::list_search_active怎么用?PHP currencies::list_search_active使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类currencies
的用法示例。
在下文中一共展示了currencies::list_search_active方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bill_total
function bill_total()
{
$output = '';
$total = 0;
$class = COLOR_TABLE_TOTAL;
$currencies = new currencies();
$curr_value = $currencies->list_search_active();
for (reset($_SESSION['separated']); list($key, $value) = each($_SESSION['separated']);) {
$total += $_SESSION['separated'][$key]['finalprice'];
}
$output .= '
<tr bgcolor=' . $class . '>
<td bgcolor=' . $class . '></td>
<td bgcolor=' . $class . '>' . ucfirst(phr('TOTAL')) . '</td>
<td bgcolor=' . $class . '></td>
<td bgcolor=' . $class . '>' . sprintf("%0.2f", $total) . '</td>
<td bgcolor=' . $class . '></td>
<td bgcolor=' . $class . '></td>
</tr>
';
if (SHOW_CHANGE == 1) {
//mizuko:needed to show exchange...
for ($i = 0; $i < count($curr_value); $i++) {
$output .= '
<tr bgcolor=' . $class . '>
<td bgcolor=' . $class . '></td>
<td bgcolor=' . $class . '>' . $curr_value[$i]['name'] . '</td>
<td bgcolor=' . $class . '></td>
<td bgcolor=' . $class . '>' . sprintf("%0.2f", $total / $curr_value[$i]['rate']) . '</td>
<td bgcolor=' . $class . '></td>
<td bgcolor=' . $class . '></td>
</tr>
';
}
}
if (!isset($_SESSION['discount']) || !isset($_SESSION['discount']['type']) || empty($_SESSION['discount']['type'])) {
return $output;
}
if ($_SESSION['discount']['type'] == "amount") {
$total_discounted = $total + $_SESSION['discount']['amount'];
$discount_label = "";
$discount_number = -$_SESSION['discount']['amount'];
} elseif ($_SESSION['discount']['type'] == "percent") {
$total_discounted = $total - $total / 100 * $_SESSION['discount']['percent'];
$discount_label = $_SESSION['discount']['percent'] . ' %';
$discount_number = $total / 100 * $_SESSION['discount']['percent'];
}
$output .= '
<tr bgcolor=' . $class . '>
<td bgcolor=' . $class . '></td>
<td bgcolor=' . $class . '> ' . ucphr('DISCOUNT') . ' ' . $discount_label . '</td>
<td bgcolor=' . $class . '></td>
<td bgcolor=' . $class . '>-' . sprintf("%0.2f", $discount_number) . '</td>
<td bgcolor=' . $class . '></td>
<td bgcolor=' . $class . '></td>
</tr>
<tr bgcolor=' . $class . '>
<td bgcolor=' . $class . '></td>
<td bgcolor=' . $class . '>' . ucphr('TOTAL') . '</td>
<td bgcolor=' . $class . '></td>
<td bgcolor=' . $class . '>' . sprintf("%0.2f", $total_discounted) . '</td>
<td bgcolor=' . $class . '></td>
<td bgcolor=' . $class . '></td>
</tr>
';
return $output;
}