<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Cetak Order</title>
</head>
<body onload="window.print()">


	<h1 align="center">Cetak Order</h1>
	<hr>

	<table border="1" width="100%" align="center" style="border-collapse: collapse;">
          <thead>
            <tr>
              <th>No</th>
              <th>Username</th>
              <th>Keterangan</th>
              <th>Jumlah</th>
              <th>Harga</th>
              <th>Subtotal</th>
              <th>Status</th>
              <th>Created At</th>
            </tr>
          </thead>
          <tbody>
            <?php
            $no = 1;
            $total = 0;
            foreach ($orders as $data) {
            ?>
            <tr>
              <td><?php echo $no; ?></td>
              <td><?php echo $data->username; ?></td>
              <td><?php echo $data->username; ?></td>
              <td><?php echo $data->jumlah; ?></td>
              <td>
                <?php var_dump($data); echo $data->price; ?>
              </td>
              <td align="right">
                <?= number_format($data->price); ?>
              </td>
              <td>
                <?php echo $data->status; ?>
              </td>
              <td><?php echo date('d-m-Y H:i:s',strtotime($data->created_at)); ?></td>
            </tr>
            <?php } ?>
            <tr>
              <td colspan="5" align="right"><b>Jumlah</b></td>
              <td align="right"><b><?= number_format($price) ?></b></td>
            </tr>
          </form>
        </table>

        <table align="right" style="margin-top: 20px;">
        	<tr>
        		<td align="center"><?= date('d-m-Y') ?></td>
        	</tr>
        	<tr>
        		<td height="40px"></td>
        	</tr>
        	<tr>
        		<td align="center">.....................</td>
        	</tr>
        </table>

</body>
</html>