<form action="inv_paid.php" method="get">
<table cellpadding="4" cellspacing="0" border="0" align="center" width="100%">
<tr>
  <td>
    <p>Sort by
    <select name="order_by">
      <option value="invoice_date">Date</option>
      <option value="invoiced_to">Invoiced To</option>
      <option value="total">Total</option>
      <option value="due_date">Due Date</option>
    </select>
    <select name="asc">
      <option value="1">Ascending</option>
      <option value="0">Descending</option>
    </select>
    <input type="submit" class="button">
  </td>
</tr>
</table>
</form>
<table cellpadding="1" cellspacing="0" border="0" align="center" width="100%" class="tbl_border">
<tr>
  <td>
    <table cellpadding="4" cellspacing="0" border="0" width="100%">
      <tr>
        <td class="tbl_caption" colspan="2">
          View Paid Invoice
        </td>
      </tr>
    </table>
    <table cellpadding="5" cellspacing="0" border="0" width="100%">
      <tr class="tbl_subcaption">
        <td align="center" nowrap>Date</td>
        <td align="center" nowrap>Invoice #</td>
        <td align="center" nowrap>Invoiced To</td>
        <td align="center" nowrap>Total</td>
        <td align="center" nowrap>Due Date</td>
        <td align="center" nowrap>Operation</td>
      </tr>
      <%section name="i" loop=$invoice%>
      <%if $smarty.section.i.rownum is odd%>
        <%assign var="alt" value="tbl_light2"%>
      <%else%>
        <%assign var="alt" value="tbl_light"%>
      <%/if%>
      <tr class=<%$alt%>>
        <td valign="top"><%$invoice[i].invoice_date|date_format:"%m/%d/%Y"%></td>
        <td valign="top"><a href="../invoice.php?id=<%$invoice[i].invoice_id%>" target="inv"><b><%$invoice[i].invoice_id%></b></a></td>
        <td valign="top"><%$invoice[i].invoiced_to|nl2br%></td>
        <td valign="top"><%$currency%> <%$invoice[i].total%></td>
        <td valign="top"><%$invoice[i].due_date|date_format:"%m/%d/%Y"%></td>
        <td valign="top" align="center" nowrap>
          <a href="inv_markunpaid.php?id=<%$invoice[i].invoice_id%>" onclick="if(!confirm('Are you sure want to mark as unpaid this invoice?')) return false">Mark as unpaid</a> | 
          <a href="inv_delete.php?id=<%$invoice[i].invoice_id%>" onclick="if(!confirm('Are you sure want to delete this invoice?')) return false">Delete</a>
        </td>
      </tr>
      <%sectionelse%>
      <tr>
        <td class="tbl_light" colspan="6">
          Currently there's no paid invoice.
        </td>
      </tr>
      <%/section%>
      <tr>
        <td class="tbl_light" colspan="6" align="center">
          <%$pagination%>
        </td>
      </tr>
    </table>
  </td>
</tr>
</table>