<?php echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $direction; ?>" lang="<?php echo $language; ?>" xml:lang="<?php echo $language; ?>">
<head>
<title><?php echo $title; ?></title>
<base href="<?php echo $base; ?>" />
<link rel="stylesheet" type="text/css" href="view/stylesheet/invoice.css" />
<link media="screen" href="invoice.css" type="text/css">
</head>
<body>
<table width="800" height="1180" border="0" align="center" cellpadding="0" cellspacing="0" page-break-inside="avoid">
  <tr>
    <td valign="top"><?php foreach ($orders as $order) { ?>
      <div style="page-break-after: always;">
        <!--<div align="center" <img src="http://rosaceacare.biz/image/data/logo-RC-sm.jpg" alt="Rosacea Care UK" /></div>-->
        <div id="welcome"><img align="left" src="/image/data/logo-RC-sm.jpg" alt="Rosacea Care UK" /></div>
        <h1><?php echo $text_invoice; ?></h1>
        <table class="store">
          <tr>
            <td><?php echo $order['store_name']; ?><br />
              <?php echo $order['store_address']; ?><br />
              <?php echo $text_telephone; ?> <?php echo $order['store_telephone']; ?><br />
              <?php if ($order['store_fax']) { ?>
              <?php echo $text_fax; ?> <?php echo $order['store_fax']; ?><br />
              <?php } ?>
              <?php echo $order['store_email']; ?><br />
              <?php echo $order['store_url']; ?></td>
            <td align="right" valign="top"><table>
              <tr>
                <td><b><?php echo $text_date_added; ?></b></td>
                <td><?php echo $order['date_added']; ?></td>
              </tr>
              <?php if ($order['invoice_no']) { ?>
              <tr>
                <td><b><?php echo $text_invoice_no; ?></b></td>
                <td><?php echo $order['invoice_no']; ?></td>
              </tr>
              <?php } ?>
              <tr>
                <td><b><?php echo $text_order_id; ?></b></td>
                <td><?php echo $order['order_id']; ?></td>
              </tr>
              <tr>
                <td><b><?php echo $text_payment_method; ?></b></td>
                <td><?php echo $order['payment_method']; ?></td>
              </tr>
              <?php if ($order['shipping_method']) { ?>
              <tr>
                <td><b><?php echo $text_shipping_method; ?></b></td>
                <td><?php echo $order['shipping_method']; ?></td>
              </tr>
              <?php } ?>
            </table></td>
          </tr>
        </table>
        <table class="address">
          <tr class="heading">
            <td><b><?php echo $text_to; ?></b></td>
            <td><b><?php echo $text_ship_to; ?></b></td>
          </tr>
          <tr>
            <td><?php echo $order['payment_address']; ?><br/>
              <?php echo $order['email']; ?><br/>
              <?php echo $order['telephone']; ?>
              <?php if ($order['payment_company_id']) { ?>
              <br/>
              <br/>
              <?php echo $text_company_id; ?> <?php echo $order['payment_company_id']; ?>
              <?php } ?>
              <?php if ($order['payment_tax_id']) { ?>
              <br/>
              <?php echo $text_tax_id; ?> <?php echo $order['payment_tax_id']; ?>
              <?php } ?></td>
            <td><?php echo $order['shipping_address']; ?></td>
          </tr>
        </table>
        <table class="product">
          <tr class="heading">
            <td><b><?php echo $column_product; ?></b></td>
            <td><b><?php echo $column_model; ?></b></td>
            <td align="right"><b><?php echo $column_quantity; ?></b></td>
            <td align="right"><b><?php echo $column_price; ?></b></td>
            <td align="right"><b><?php echo $column_total; ?></b></td>
          </tr>
          <?php foreach ($order['product'] as $product) { ?>
          <tr>
            <td><?php echo $product['name']; ?>
              <?php foreach ($product['option'] as $option) { ?>
              <br />
              &nbsp;<small> - <?php echo $option['name']; ?>: <?php echo $option['value']; ?></small>
              <?php } ?></td>
            <td><?php echo $product['model']; ?></td>
            <td align="right"><?php echo $product['quantity']; ?></td>
            <td align="right"><?php echo $product['price']; ?></td>
            <td align="right"><?php echo $product['total']; ?></td>
          </tr>
          <?php } ?>
          <?php foreach ($order['voucher'] as $voucher) { ?>
          <tr>
            <td align="left"><?php echo $voucher['description']; ?></td>
            <td align="left"></td>
            <td align="right">1</td>
            <td align="right"><?php echo $voucher['amount']; ?></td>
            <td align="right"><?php echo $voucher['amount']; ?></td>
          </tr>
          <?php } ?>
          <?php foreach ($order['total'] as $total) { ?>
          <tr>
            <td align="right" colspan="4"><b><?php echo $total['title']; ?>:</b></td>
            <td align="right"><?php echo $total['text']; ?></td>
          </tr>
          <?php } ?>
        </table>
        <?php if ($order['comment']) { ?>
        <table class="comment">
          <tr class="heading">
            <td><b><?php echo $column_comment; ?></b></td>
          </tr>
          <tr>
            <td><?php echo $order['comment']; ?></td>
          </tr>
        </table>
        <?php } ?>
      </div>
    <?php } ?></td>
  </tr>
  
 <tr valign="bottom">
    <td><table width="100%" align="center" class=".bottom">
      <tr class="heading">
        <td width="9%">&nbsp;</td>
        <td width="36%"><b><?php echo $text_to; ?></b></td>
        <td width="10%">&nbsp;</td>
        <td width="39%"><b><?php echo $text_ship_to; ?></b></td>
        <td width="6%">&nbsp;</td>
      </tr>
      <tr valign="top">
        <td>&nbsp;</td>
        <td style="font-size:18px"><?php echo $order['payment_address']; ?><br/>
          <!--<?php echo $order['email']; ?><br/>
          <?php echo $order['telephone']; ?>-->
         <!-- <?php if ($order['payment_company_id']) { ?>
          <br/>
          <br/>
          <?php echo $text_company_id; ?> <?php echo $order['payment_company_id']; ?>
          <?php } ?>
          <?php if ($order['payment_tax_id']) { ?>
          <br/>
          <?php echo $text_tax_id; ?> <?php echo $order['payment_tax_id']; ?>
          <?php } ?>--></td>
        <td>&nbsp;</td>
        <td style="font-size:18px"><?php echo $order['shipping_address']; ?></td>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  
  
</table>

</body>
</html>