<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:40%; text-align:center; padding-top:50px;padding:10px;">
            <img src="<?php echo base_url('assets/images/logo_surat.png'); ?>" style="width: 50%;">
          </td>
          <td style="width:40%; text-align:left;">
            <h5>REKAPITULASI PRODUKSI<br />
            </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;">FORM</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;">NAMA STOCKPILE</th>
         
          <th style="border:black solid 1px; padding:5px; text-align:center;">JUMLAH TONASE PRODUKSI</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;"><?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;"><?php echo $form_batubara_kirim->nama_stockpile_batubara_masuk; ?></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="1"><b>TOTAL</b></td>
          <td style="border:black solid 1px; padding:5px; text-align:right;"><b><?php echo round($total_bruto,3) ?></b></td>
          <td style="border:black solid 1px; padding:5px; text-align:right;"><b><?php echo round($total_tarra,3) ?></b></td>
          <td style="border:black solid 1px; padding:5px; text-align:right;"><b><?php echo round($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>