<?
    global $vis_language;
    $invoice_status = array( 0 => $vis_language['TXTUNPAID'], 1 => $vis_language['TXTPAID'], 2 => $vis_language['TXTCANCELED'], 3 => $vis_language['TXTINPROCESS'] );
?>
<div class="m-r-n m-l-n">
  <table class="table table-hover m-b-none" data-ride="datatables">
	<thead class="table_head">
		<th class="txt_nowrap">#<? echo $vis_language['TXTINVOICE']; ?></th>
		<th class="txt_nowrap"><? echo $vis_language['TXTCREATEDATE']; ?></th>
		<th class="txt_nowrap"><? echo $vis_language['TXTDUEDATE']; ?></th>
		<th class="txt_nowrap"><? echo $vis_language['TXTPAIDDATE']; ?></th>
		<th class="txt_nowrap"><? echo $vis_language['TXTTOTAL'].' ('.VIS_DOMAIN_CURRENCY.')'; ?></th>
		<th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
	</thead>
	<tbody>	
		<? if($invoices!=-1) for($i=0;$i<count($invoices);$i++) { ?>
		<tr>
			<td><a href="?/billing/edit-invoice/<?= $invoices[$i]['invoice_hash'].'/'.$invoices[$i]['invoice_id']; ?>" class="btn btn-sm"><?= $invoices[$i]['invoice_hash']; ?></a></td>
			<td><?= format_datetime($invoices[$i]['entry_date']); ?></td>
			<td><?= format_datetime($invoices[$i]['due_date']); ?></td>
			<td><?= format_datetime($invoices[$i]['paid_date']); ?></td>
			<td><?= $invoices[$i]['total']; ?></td>
			<? /* ?><td><span class="badge <?= ($invoices[$i]['invoice_status']==0)?'vh-red-bg':(($invoices[$i]['invoice_status']==1)?'vh-green-bg':''); ?>"><?= $invoice_status[$invoices[$i]['invoice_status']]; ?></span></td><? */ ?>
			<td><span class="<?= ($invoices[$i]['invoice_status']==0)?'label vh-danger-bg':(($invoices[$i]['invoice_status']==1)?'label vh-green-bg':'label label-default'); ?>"><?= $invoice_status[$invoices[$i]['invoice_status']]; ?></span></td>
		</tr>
		<? } ?>
	</tbody>
  </table>
</div> 
<script> $(document).ready(function() { $(".selectpicker").selectpicker(); });</script>