if (osC_Order::numberOfEntries() > 0) {
    $Qhistory = osC_Order::getListing(MAX_DISPLAY_ORDER_HISTORY);
    while ($Qhistory->next()) {
        if (!osc_empty($Qhistory->value('delivery_name'))) {
            $order_type = $osC_Language->get('order_shipped_to');
            $order_name = $Qhistory->value('delivery_name');
        } else {
            $order_type = $osC_Language->get('order_billed_to');
            $order_name = $Qhistory->value('billing_name');
        }
        ?>

<div class="moduleBox">

  <h6><span style="float: left;"><?php 
        echo $osC_Language->get('order_status') . ' ' . osC_Order::getLastPublicStatus($Qhistory->value('orders_id'));
        ?>
</span><?php 
        echo $osC_Language->get('order_number') . ' ' . $Qhistory->valueInt('orders_id');
        ?>
</h6>

  <div class="content">
    <table border="0" width="100%" cellspacing="2" cellpadding="4">
      <tr>
        <td valign="top"><?php 
        echo '<b>' . $osC_Language->get('order_date') . '</b> ' . osC_DateTime::getLong($Qhistory->value('date_purchased')) . '<br /><b>' . $order_type . '</b> ' . osc_output_string_protected($order_name);
        ?>
</td>
        <td width="150" valign="top"><?php 
        echo '<b>' . $osC_Language->get('order_products') . '</b> ' . osC_Order::numberOfProducts($Qhistory->valueInt('orders_id')) . '<br /><b>' . $osC_Language->get('order_cost') . '</b> ' . strip_tags($Qhistory->value('order_total'));