<?php 
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=".$namafile.".xls");
header("Pragma: no-cache");
header("Expires: 0");
?>
<!DOCTYPE html>
<html>
<head>
	<title>BA TOLAK</title>
	<meta charset="UTF-8">
</head>
<body>
	<table border="1">
		<thead>
			<tr>
			 <th>Berita Acara</th>
			 <th>Tanggal</th>
			 <th>Sample</th>
			 <th>Pengirim</th>
			 <th>Manifest</th>
			 <th>Surat Jalan</th>
			 <th>PPIC</th>
			 <th>LAB</th>
			 <th>Analis</th>
			 <th>Air</th>
			 <th>Bahan Bakar</th>
			 <th>Residu</th>
			 <th>Sedimen</th>
			 <th>Viscositas</th>
			 <th>Berat Jenis</th>
			 <th>kg/I</th>
			 <th>Volume Kirim</th>
			</tr>
		</thead>
		<tbody>
	<?php foreach($all_data as $row) {
	 $this->db2 = $this->load->database('default2', TRUE);
	 $rowCIS = $this->db2->get_where('berita_acara', array('id_ba' => $row->idba))->row();
	 $rowRLIS = $this->db->get_where('berita_acara', array('id_ba' => $row->idba))->row(); 
	?>
			 <tr>
			 	<td><?php echo $row->idba ?></td>
			 	<td><?php echo $this->fungsi->formatTanggal($row->adddate) ?></td>
			 	<td><?php echo $row->id_sample ?></td>
			 	<td><?php echo $rowCIS->nama_sup ?></td>
			 	<td><?php echo $rowCIS->no_manifest ?></td>
			 	<td><?php echo $rowRLIS->no_sj ?></td>
			 	<td><?php echo $row->id_sample_ppic ?></td>
			 	<td><?php echo $row->id_sample_lab ?></td>
			 	<td><?php echo $row->checkby ?></td>
			 	<td><?php echo $row->qcair ?></td>
			 	<td><?php echo $row->qcbakar ?></td>
			 	<td><?php echo $row->qcresidu ?></td>
			 	<td><?php echo $row->qcresidub ?></td>
			 	<td><?php echo $row->qcvisco ?></td>
			 	<td><?php echo $row->qckg ?></td>
			 	<td><?php echo $row->qckg2 ?></td>
			 	<td><?php echo $rowCIS->vol_coll ?></td>
			 </tr>
			<?php } ?>
		</tbody>
	</table>
</body>
</html>