<page backtop="0mm" backbottom="0mm" backleft="0mm" backright="0mm">
  <div style="font-size: 9px;">
    <div style="line-height: 15px;">
      <table style="width:100%;">
        <tr>
          <td style="width:20%; padding-top:20px;"><img src="<?php echo base_url('assets/images/bml.png'); ?>" style="width: 35%;"></td>
          <td style="width:20%; text-align:center; vertical-align:top;" valign="top">
            <h4>LAPORAN BATUBARA MASUK<br />&nbsp;</h4>
          </td>
          <td style="width:30%; padding-top:20px;">
            Tanggal : <?php echo date('d/m/Y', strtotime($tanggal_report_awal)); ?> - <?php echo date('d/m/Y', strtotime($tanggal_report_akhir)); ?><br />
            Shift &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : SIANG / MALAM
          </td>
        </tr>
      </table>
      <br />
      <table style="width:100%; border-collapse: collapse;">
        <tr>
          <th style="border:black solid 1px; padding:5px; text-align:center; vertical-align:middle;" rowspan="2">NO</th>
          <th style="border:black solid 1px; padding:5px; text-align:center;">WAKTU</th>
          <th style="border:black solid 1px; padding:5px; text-align:center; vertical-align:middle;" rowspan="2">NO<br />(DT)</th>
          <th style="border:black solid 1px; padding:5px; text-align:center;" colspan="3">TIMBANGAN</th>
          <th style="border:black solid 1px; padding:5px; text-align:center; vertical-align:middle;" rowspan="2">KODE KIRIM <br />BATU MASUK</th>
          <!-- <th style="border:black solid 1px; padding:5px; text-align:center; vertical-align:middle;" rowspan="2">SEAM</th> -->
          <!-- <th style="border:black solid 1px; padding:5px; text-align:center; vertical-align:middle;" rowspan="2">BLOK</th> -->
          <th style="border:black solid 1px; padding:5px; text-align:center; vertical-align:middle;" rowspan="2">ASAL BATUBARA</th>
          <th style="border:black solid 1px; padding:5px; text-align:center; vertical-align:middle;" rowspan="2">NAMA STOCKPILE</th>
          <th style="border:black solid 1px; padding:5px; text-align:center; vertical-align:middle;" rowspan="2">NAMA EDP SP</th>
          <th style="border:black solid 1px; padding:5px; text-align:center; vertical-align:middle;" rowspan="2">KETERANGAN</th>
        </tr>
        <tr>
          <th style="border:black solid 1px; padding:5px; text-align:center;">JAM</th>
          <th style="border:black solid 1px; padding:5px; text-align:center;">BRUTO</th>
          <th style="border:black solid 1px; padding:5px; text-align:center;">TARRA</th>
          <th style="border:black solid 1px; padding:5px; text-align:center;">NETTO</th>
        </tr>
        <?php
        $no = 1;
        $total_bruto = 0;
        $total_tarra = 0;
        $total_netto = 0;
        foreach ($form_batubara_masuk as $form_batubara_masuk) {
        ?>
          <tr>
            <td style="border:black solid 1px; padding:5px; text-align:right;"><?php echo $no; ?></td>
            <td style="border:black solid 1px; padding:5px; text-align:center;"><?php echo substr($form_batubara_masuk->jam_batubara_masuk, 0, 5); ?></td>
            <td style="border:black solid 1px; padding:5px; text-align:center;"><?php echo $form_batubara_masuk->nomor_unit_batubara_masuk; ?></td>
            <td style="border:black solid 1px; padding:5px; text-align:right;"><?php echo round($form_batubara_masuk->bruto_batubara_masuk,3); ?></td>
            <td style="border:black solid 1px; padding:5px; text-align:right;"><?php echo round($form_batubara_masuk->tarra_batubara_masuk,3); ?></td>
            <td style="border:black solid 1px; padding:5px; text-align:right;"><?php echo round($form_batubara_masuk->bruto_batubara_masuk - $form_batubara_masuk->tarra_batubara_masuk,3); ?></td>
            <td style="border:black solid 1px; padding:5px; text-align:center;"><?php echo $form_batubara_masuk->nama_kode_batubara_masuk; ?></td>
            <td style="border:black solid 1px; padding:5px; text-align:center;"><?php echo $form_batubara_masuk->nama_asal_batubara_masuk; ?></td>
            <td style="border:black solid 1px; padding:5px; text-align:center;"><?php echo $form_batubara_masuk->nama_stockpile_batubara_masuk; ?></td>
            <td style="border:black solid 1px; padding:5px; text-align:center;"><?php echo $form_batubara_masuk->nama_checker; ?></td>
            <td style="border:black solid 1px; padding:5px;"><?php echo $form_batubara_masuk->keterangan_batubara_masuk; ?></td>
          </tr>
        <?php
          $no++;
          $total_bruto = $total_bruto + $form_batubara_masuk->bruto_batubara_masuk;
          $total_tarra = $total_tarra + $form_batubara_masuk->tarra_batubara_masuk;
          $total_netto = $total_netto + $form_batubara_masuk->bruto_batubara_masuk - $form_batubara_masuk->tarra_batubara_masuk;
        }
        ?>
        <tr>
          <td style="border:black solid 1px; padding:5px; text-align:center;" colspan="3"><b>SUBTOTAL</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;" colspan="5"></td>

        </tr>
      </table>
      <br><br>
      <p style="text-align:center;"><i>print generated from :</i> https://tracking.berkatmandirilestari.my.id/</p>




    </div>
  </div>
</page>