<?php
  $this->load->view('includes/header.php');
  echo '<font id="breadcrumb" class="title">'.$menu_path.'</font>';
  echo '<br>';
  /* Display system message */
  $this->fungsi->disp_sys_msg();
  echo validation_errors('<p class="field_error">', '</p>');
?>
<script type="text/javascript">
  window.print();
</script>
<?php
  $pengirim = $this->db2->get_where('berita_acara', array('id_ba' => $data_analisis->idba))->row('pengirim');
?>
<table width="100%" style="margin-top: 20px">
	<!--
	<tr align="right">
		<td>
			Tanggal : <?php echo date('d M Y', strtotime($data_analisis->adddate)); ?><br>
     	 	No. Doc : 548756213<br>
     	 	No. Sertifikat : <?php echo $nomor_sample ?>
		</td>
	</tr>
	-->
	<table align="right">
		<tr align="right">
			<td>Tanggal</td>
			<td>:</td>
			<td><?php echo date('d M Y', strtotime($data_analisis->adddate)); ?></td>
		</tr>
		<tr align="right">
			<td>No. Slip</td>
			<td>:</td>
			<td><input size="6" readonly></td>
		</tr>
		<tr align="right">
			<td>No. Berita Acara</td>
			<td>:</td>
			<td><?php echo $data_analisis->idba ?></td>
		</tr>
    <tr align="right">
      <td>No. Sample</td>
      <td>:</td>
      <td><?php echo $data_analisis->id_sample ?></td>
    </tr>
	</table>
</table>
<table width="100%" style="margin-top: 80px">
  <!--
  <tr>
    <td colspan="4" rowspan="2"><img src="<?php echo base_url('etc/images/logowgikecil.png') ?>"></td>
    <td colspan="4" rowspan="2">
      <b>PT WIRASWASTA GEMILANG INDONESIA</b><br><br>
      <b>Sertifikat Hasil Analisa Pelumas Bekas External</b><br><br>
      No. Sertifikat : <b><?php echo $nomor_sample ?></b>
    </td>
    <td colspan="4">
      <b>FR - PPIC - 033/0-00</b>
    </td>
  </tr>
  <tr>
    <td colspan="4">
      Tanggal : <?php echo date('d M Y', strtotime($data_analisis->adddate)); ?><br><br>
      No. Doc : 
    </td>
  </tr>
  -->
  <tr>
    <td colspan="12">
      <table>
        <tr>
          <td><b>I. Keterangan</b></td>
        </tr>
        <tr>
          <td>&emsp;&emsp;Nama Pengirim</td>
          <td> : <?php echo $keterangan->nama_sup ?></td>
        </tr>
        <tr>
          <td>&emsp;&emsp;Tanggal Kirim</td>
          <td> : <?php echo date('d M Y', strtotime($security->jam_input_security)) ?></td>
        </tr>
        <tr>
          <td>&emsp;&emsp;Nomor Polisi</td>
          <td> : <?php echo $security->no_pol ?></td>
        </tr>
        <tr>
          <td>&emsp;&emsp;Volume Total</td>
          <td> : <?php echo number_format($security->vol_security) ?></td>
        </tr>
        <tr>
          <td>&emsp;&emsp;No. Surat Jalan</td>
          <td> : <?php echo $security->no_sj ?></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td colspan="12">
      <table width="100%">
        <tr>
          <td colspan="12"><b>II. Hasil Analisa</b></td>
        </tr>
        <tr>
          <td colspan="3">&emsp;&emsp;Waktu Mulai</td>
          <td colspan="4"> : <?php echo date('d F Y H:i', strtotime($data_analisis->adddate)) ?></td>
        </tr>
        <tr>
          <td colspan="3">&emsp;&emsp;Waktu Selesai</td>
          <td colspan="4"> : <?php echo date('d F Y H:i', strtotime($data_analisis->waktu_approve_qa)) ?></td>
        </tr>
        <tr>
          <td colspan="3">&emsp;&emsp;Test Bahan Kimia</td>
          <td colspan="2"> : <?php echo ($data_analisis->qctbk == 'NEGATIF' ? 'DITERIMA' : 'DITOLAK') ?></td>
        </tr>
        <tr>
          <td colspan="3">&emsp;&emsp;Kadar Pencemaran</td>
          <td colspan="2"> - Air </td>
          <td> : </td>
          <td><?php echo ($data_analisis->qcair > 8 ? '> 10 %' : '< 10 %') ?></td>
          <td>&emsp;&emsp;</td>
          <td> &emsp; </td>
        </tr>
        <tr>
        	<td colspan="3"></td>
        	<td colspan="2"> - B. Bakar</td>
        	<td> : </td>
        	<td><?php echo ($data_analisis->qcbakar > 5 ? '> 5 %' : '< 5 %') ?></td>
        	<td>&emsp;&emsp;</td>
        	<td> &emsp; </td>
        </tr>
        <tr>
        	<td colspan="3"></td>
        	<td colspan="2"> - Residu</td>
        	<td> : </td>
        	<td><?php echo ($data_analisis->qcresidu > 7 ? '> 7 %' : '< 7 %') ?></td>
        	<td>&emsp;&emsp;</td>
        	<td> &emsp; </td>
        </tr>
        <tr>
          <td colspan="3">&emsp;&emsp;Berat Jenis</td>
          <td colspan="3"> : <?php echo ($data_analisis->qckg > 0.885 ? '> 0.885' : $data_analisis->qckg) ?></td>
          <td>T: <?php echo $data_analisis->qct ?></td>
        </tr>
        <tr>
          <td colspan="3">&emsp;&emsp;kg/I</td>
          <td colspan="3"> : <?php echo ($data_analisis->qckg2 > 0.885 ? '> 0.885' : $data_analisis->qckg2) ?></td>
          <td>T: <?php echo $data_analisis->qct2 ?></td>       
        </tr>
      </table>
    </td>
  </tr>
  <tr>
  	<td colspan="12">
  		<table>
  			<tr>
  				<td><b>III. Komentar Hasil Analisa Pelumas Bekas</b></td>
  			</tr>
  			<tr>
  				<td><?php echo $data_analisis->inf ?></td>
  			</tr>
  		</table>
  	</td>
  </tr>
  <tr>
  	<td height="10"></td>
  </tr>
  <tr align="center">
  	<td colspan="5">
  		Supplier<br>
  		<b><?php echo $keterangan->nama_sup ?></b>
  	</td>
  	<td colspan="4">
  		Analis<br>
  		<b><?php echo $data_analisis->checkby ?></b>
  	</td>
  	<td colspan="3">
  		Diperiksa Oleh<br>
  		<b><?php echo $data_analisis->appby ?></b>
  	</td>
  </tr>
  <tr>
  	<td height="15"></td>
  </tr>
  <tr>
  	<td colspan="12">
  		<table width="100%">
  			<tr>
			  	<td>1.F&A Dept.<br><center>Asli Putih</center></td>
			  	<td>2.Geo Collect Dept.<br><center>Kuning</center></td>
			  	<td>3.PPIC Dept.<br><center>Biru</center></td>
			  	<td>4.QC Dept.<br><center>Merah</center></td>
			  	<td>5.Angkutan<br><center>Hijau</center></td>	
  			</tr>
  		</table>
  	</td>
  </tr>
</table>
<!-- START HERE
<center style="margin-top: 25px">
  <table style="outline-color: black;border: 1px; outline-style: solid;">
    <tr>
      <td colspan="3"><b>Nomor Sample : <?php echo $nomor_sample ?><b></td>
    </tr>
    <tr>
      <td>Waktu Pemeriksaan : <?php echo $data_analisis->adddate ?></td>
    </tr>
    <tr>
      <td>Status : <?php echo $data_analisis->status ?></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><b>Hasil Analisa</b></td>
    </tr>
    <tr>
      <td>Kadar Air</td>
      <td> : </td>
      <td><?php echo $data_analisis->qcair ?> %</td>
    </tr>
    <tr>
      <td>Chlorine / PCB</td>
      <td> : </td>
      <td><?php echo $data_analisis->qccl ?></td>
    </tr>
    <tr>
      <td>Berat Jenis</td>
      <td> : </td>
      <td><?php echo $data_analisis->qckg ?> (<?php echo $data_analisis->qct ?> C)</td>
    </tr>
    <tr>
      <td>Fatty Acid</td>
      <td> : </td>
      <td><?php echo $data_analisis->qctbk ?></td>
    </tr>
    <tr>
      <td>Kadar Bahan Bakar</td>
      <td> : </td>
      <td><?php echo $data_analisis->qcbakar ?> %</td>
    </tr>
    <tr>
      <td>Kadar Residu</td>
      <td> : </td>
      <td><?php echo $data_analisis->qcresidu ?> %</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><b>Informasi</b></td>
    </tr>
    <tr>
      <td><?php echo $data_analisis->inf ?></td>
    </tr>
  </table>

  <div style="margin: 20px 50px 10px 50px">
    <a id="buttonOne" onclick="window.print()" href="#"><button style="margin: 0px 25px">Print</button></a>
  </div>
</center>

END HERE -->
<?php
  if(!empty($link))
  {
  	echo '<p id="bottom_link">';
  	foreach($link as $links)
  	{
  		echo $links . ' ';
  	}
  	echo '</p>';
  }
  $this->load->view('includes/footer.php');
?>
<style type="text/css">
  @media print
  {
  	@page
	{
	  size: A5 portrait; 
	}
  }
</style>