<page backtop="0mm" backbottom="0mm" backleft="0mm" backright="0mm">
  <div style="font-size: 10px;">
    <div style="line-height: 15px;">
      <table style="width:100%;">
        <tr>
          <td style="width:40%; text-align:center; padding-top:50px;padding:10px;">
            <img src="<?php echo base_url('assets/images/bml.png'); ?>" style="width: 20%;">
          </td>
          <td style="width:40%; text-align:left;">
            <h5>REKAPITULASI ANGKUTAN BATUBARA<br />
              DARI STOCKPILE KE JETTY
            </h5>
            PERIODE <?php echo tgl_indo($tanggal_awal); ?> - <?php echo tgl_indo($tanggal_akhir); ?>
          </td>
          <td style="width:30%;"></td>
        </tr>
      </table>

      <br />
      <table style="width:100%; border-collapse: collapse;">
        <tr>
          <th style="border:black solid 1px; padding:5px; text-align:center;">NO</th>
          <th style="border:black solid 1px; padding:5px; text-align:center;">TANGGAL</th>
          <th style="border:black solid 1px; padding:5px; text-align:center;">NO SJ</th>
          <th style="border:black solid 1px; padding:5px; text-align:center;">NO DT</th>
          <th style="border:black solid 1px; padding:5px; text-align:center;">KODE</th>
          <th style="border:black solid 1px; padding:5px; text-align:center;">DARI</th>
          <th style="border:black solid 1px; padding:5px; text-align:center;">TUJUAN</th>
          <th style="border:black solid 1px; padding:5px; text-align:center;">MUATAN</th>
          <th style="border:black solid 1px; padding:5px; text-align:center;">KOSONG</th>
          <th style="border:black solid 1px; padding:5px; text-align:center;">VOLUME</th>
          <th style="border:black solid 1px; padding:5px; text-align:center;">KETERANGAN</th>
        </tr>
        <?php
        $no = 1;
        $total_bruto = 0;
        $total_netto = 0;
        $total_tarra = 0;
        foreach ($form_batubara_kirim as $form_batubara_kirim) {
        ?>
          <tr>
            <td style="border:black solid 1px; padding:5px;text-align:right;"><?php echo $form_batubara_kirim->nomor_batubara_baru; ?></td>
            <td style="border:black solid 1px; padding:5px;"><?php echo date('d/m/Y', strtotime($form_batubara_kirim->tanggal_batubara_kirim)); ?></td>
            <td style="border:black solid 1px; padding:5px; text-align:center;"><?php echo $form_batubara_kirim->nomor_sj_batubara_kirim; ?></td>
            <td style="border:black solid 1px; padding:5px;text-align:center;"><?php echo $form_batubara_kirim->unit_batubara_kirim; ?></td>
            <td style="border:black solid 1px; padding:5px;"><?php echo $form_batubara_kirim->nama_kode_batubara_kirim; ?></td>
            <td style="border:black solid 1px; padding:5px;"><?php echo $form_batubara_kirim->nama_stockpile_batubara_masuk; ?></td>
            <td style="border:black solid 1px; padding:5px;"><?php echo $form_batubara_kirim->nama_tujuan_batubara_kirim; ?></td>
            <td style="border:black solid 1px; padding:5px; text-align:right;"><?php echo round($form_batubara_kirim->bruto_batubara_kirim,3); ?></td>
            <td style="border:black solid 1px; padding:5px; text-align:right;"><?php echo round($form_batubara_kirim->tarra_batubara_kirim,3); ?></td>
            <td style="border:black solid 1px; padding:5px; text-align:right;"><?php echo round($form_batubara_kirim->bruto_batubara_kirim - $form_batubara_kirim->tarra_batubara_kirim,3); ?></td>
            <td style="border:black solid 1px; padding:5px;"><?php echo $form_batubara_kirim->keterangan_batubara_kirim; ?></td>
          </tr>
        <?php
          $no++;
          $total_bruto = $total_bruto + $form_batubara_kirim->bruto_batubara_kirim;
          $total_tarra = $total_tarra + $form_batubara_kirim->tarra_batubara_kirim;
          $total_netto = $total_netto + $form_batubara_kirim->bruto_batubara_kirim - $form_batubara_kirim->tarra_batubara_kirim;
        }
        ?>
        <tr>
          <td style="border:black solid 1px; padding:5px; text-align:center;" colspan="7"><b>TOTAL</b></td>
          <td style="border:black solid 1px; padding:5px; text-align:right;"><b><?php echo number_format($total_bruto,3) ?></b></td>
          <td style="border:black solid 1px; padding:5px; text-align:right;"><b><?php echo number_format($total_tarra,3) ?></b></td>
          <td style="border:black solid 1px; padding:5px; text-align:right;"><b><?php echo number_format($total_netto,3) ?></b></td>
          <td style="border:black solid 1px; padding:5px; text-align:right;"></td>

        </tr>
      </table>
      <br />
      <br />
      <br />
      
    </div>
  </div>
</page>