Skip to content

Instantly share code, notes, and snippets.

@NickToye
Created April 9, 2012 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NickToye/2342903 to your computer and use it in GitHub Desktop.
Save NickToye/2342903 to your computer and use it in GitHub Desktop.
block_view_orders.htm
<div id="view_orders" class="accounts col span_8">
<?= open_form() ?>
<? if(!$orders->count): ?>
<p>No orders yet.</p>
<? else: ?>
<p>Click an order for details.</p>
<table>
<thead>
<tr>
<th class="first"></th>
<th>#</th>
<th>Date</th>
<th>Status</th>
<th class="text-right last">Total</th>
</tr>
</thead>
<tbody>
<? foreach($orders as $order): ?>
<?
$url = root_url('/') . 'account/order/' . $order->id;
?>
<tr class="<?= zebra('order') ?>">
<td>
<span title="<?= h($order->status->name) ?>" style="background-color: <?= $order->color ?>">&nbsp;</span>
</td>
<td><a href="<?= $url ?>"><?= $order->id ?></a></td>
<td><a href="<?= $url ?>"><?= $order->order_datetime->format('%x') ?></a></td>
<td><a href="<?= $url ?>"><strong><?= h($order->status->name) ?></strong> since <?= $order->status_update_datetime->format('%x') ?></a></td>
<td class="text-right last"><a href="<?= $url ?>"><?= format_currency($order->total) ?></a></th>
</tr>
<? endforeach ?>
</tbody>
</table>
<? endif ?>
<?= close_form() ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment