本文整理汇总了PHP中format::dollar方法的典型用法代码示例。如果您正苦于以下问题:PHP format::dollar方法的具体用法?PHP format::dollar怎么用?PHP format::dollar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类format
的用法示例。
在下文中一共展示了format::dollar方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendConfirmation
public function sendConfirmation($orderId)
{
$order = ORM::factory('order', $orderId);
$db = new Database();
$res = $db->query('SELECT oa.* FROM orders_addresses oa JOIN orders o ON (oa.id = o.orders_address_id) WHERE o.id="' . $orderId . '"');
// call autoresponder handlers
$shippingInfo = $res[0]->shipping_first_name . ' ' . $res[0]->shipping_last_name . '<br/>' . $res[0]->shipping_address1 . '<br/>' . $res[0]->shipping_address2 . '<br/>' . $res[0]->shipping_city . ' ' . $res[0]->shipping_state . '<br/>' . $res[0]->shipping_zip . '<br/>' . $res[0]->shipping_country;
$billingInfo = $res[0]->billing_first_name . ' ' . $res[0]->billing_last_name . '<br/>' . $res[0]->billing_address1 . '<br/>' . $res[0]->billing_address2 . '<br/>' . $res[0]->billing_city . ' ' . $res[0]->billing_state . '<br/>' . $res[0]->billing_zip . '<br/>' . $res[0]->billing_country;
$dateTime = date('Y-m-d H:i:s');
$res = $db->query('SELECT p.name, ob.qty, ob.subtotal FROM products p JOIN orders_baskets ob ON (ob.product_id=p.id) WHERE ob.order_id="' . $orderId . '"');
$order_basket = new Orders_basket_Model();
$description = '';
$subtotal = 0;
foreach ($res as $item) {
$description .= $item->name . ' ' . $item->qty . ' x ' . format::dollar($item->subtotal) . '<br/>';
$subtotal += $item->subtotal;
}
if (!empty($order->comment)) {
$description .= 'Comment:' . $order->comment . '<br/>';
}
$total = 'Subtotal: ' . format::dollar($subtotal) . '<br/>Shipping:' . format::dollar($order->shipping_total);
$total .= '<br/>Total:' . format::dollar($order->payment_total);
Autoresponder::sendEmail('order.confirmation', $order->email, $order, array('shipping_info' => $shippingInfo, 'billing_info' => $billingInfo, 'date_time' => $dateTime, 'description' => $description, 'total' => $total));
}
示例2:
<tr>
<td colspan="2"><strong>Taxes:</strong></td>
<td align="right">TBD</td>
</tr>
<tr>
<td colspan="2"><strong>Shipping Cost:</strong></td>
<td align="right">TBD</td>
</tr>
<tr>
<td colspan="2"><strong>Order Total:</strong></td>
<td align="right"><?php
echo format::dollar($cart->subtotal() - $amount['total']);
?>
</td>
</tr>
<tr>
<td colspan="3" class="button"><a href="/cart"><img src="/env/images/back_to_order.jpg" alt="" /></a></td>
</tr>
</table>
<?php
}
?>
</div>
示例3:
</td>
</tr>
<?php
/*if (($discount = $order_subtotal + $order->shipping_total - $order->order_total) > 0){
?>
<tr>
<td colspan="4" align="right">Discount: </td>
<td align="right"><?php echo format::dollar($discount) ?></td>
</tr>
<?php
}*/
?>
<tr>
<td colspan="4" align="right">Total: </td>
<td align="right"><?php
echo format::dollar($_order->order_total);
?>
</td>
</tr>
</table>
</div> <!-- div id="tab_products" -->
<div id="tab_shipping_address">
<table class="form">
<tr>
<td>First Name:</td>
<td id='shipping_firstname'><?php
echo $shipping->firstname;
示例4: test
public function test()
{
$id = $this->uri->segment(3);
$order = ORM::factory('order')->find($id);
// call autoresponder handler
$order_address = ORM::factory('orders_address')->find($order->orders_address_id);
$shippingInfo = $order_address->shipping_first_name . ' ' . $order_address->shipping_last_name . '<br/>' . $order_address->shipping_address1 . '<br/>' . $order_address->shipping_city . ' ' . $order_address->shipping_state . '<br/>' . $order_address->shipping_zip . '<br/>' . $order_address->shipping_country;
$billingInfo = $order_address->billing_first_name . ' ' . $order_address->billing_last_name . '<br/>' . $order_address->billing_address1 . '<br/>' . $order_address->billing_city . ' ' . $order_address->billing_state . '<br/>' . $order_address->billing_zip . '<br/>' . $order_address->billing_country;
$dateTime = date('Y-m-d H:i:s');
$db = new Database();
$res = $db->query('SELECT p.name, ob.qty FROM products p JOIN orders_baskets ob ON (ob.product_id=p.id) WHERE ob.order_id="' . $order->id . '"');
$order_basket = new Orders_basket_Model();
$description = '';
foreach ($res as $item) {
$description .= $item->name . ' x ' . $item->qty . '<br/>';
}
Autoresponder::sendEmail('order.status.changed', 'erlan@polardesign.com', $order, array('shipping_info' => $shippingInfo, 'billing_info' => $billingInfo, 'date_time' => $dateTime, 'description' => $description, 'total' => format::dollar($order->payment_total)));
}