<?php
 
header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=TRACING_PERDOKUMEN_PEMASUKAN.xls");
?>
<h3 colspan="23">LAPORAN TRACING BARANG PER DOKUMEN PEMASUKAN</h3>
<h3 colspan="23">PERIODE</h3>
<table border="1" cellpadding="2">
  	<tr>
    	<th colspan="3">DOKUMEN PABEAN</th>
        <th colspan="2">BUKTI PENERIMAAN BARANG</th>
        <th rowspan="2">SUPPLIER</th>
        <th rowspan="2">KODE BARANG</th>
        <th rowspan="2">URAIAN</th>
        <th rowspan="2">SAT</th>
        <th rowspan="2">JUMLAH</th>
        <th colspan="4">RINCIAN</th>
        <th rowspan="2">SISA</th>
        <th rowspan="2">SAT</th>
        <th colspan="4">HASIL</th>
        <tr>
			<th colspan="1">JENIS</th>
			<th colspan="1">NOMOR</th>
			<th rowspan="1">TANGGAL</th>	
			<th colspan="1">NOMOR</th>
			<th rowspan="1">TANGGAL</th>	
 
			<th colspan="1">NOMOR</th>
			<th rowspan="1">TANGGAL</th>	
			<th colspan="1">JUMLAH</th>
			<th rowspan="1">SATUAN</th>	

            <th colspan="1">KODE FG</th>
			<th rowspan="1">NAMA FG</th>	
			<th colspan="1">JUMLAH FG</th>
			<th rowspan="1">SAT FG</th>	

  <!--          <th colspan="1">DOKUMEN PENGELUARAN</th>
			<th rowspan="1">TOTAL PENGELUARAN</th>	
			<th colspan="1">SISA</th>
 -->
		</tr>


		   
		 </tr>  
  	</tr> 	
 

      <?php
  
    $this->db = $this->load->database('pasi', TRUE);
    $userid = $this->session->userdata('DX_user_id');
    $query = $this->db->query("SELECT * FROM tdumptracein where userid like '$userid'");
    foreach ($query->result() as $row)
    {
        echo "<tr>";
        echo "<td>".$row->typebc."</td>";
        echo "<td>".$row->nodaftar."</td>";
        echo "<td>".$row->tgldaftar."</td>";
        echo "<td>".$row->noreceive."</td>";
        echo "<td>".$row->tglreceive."</td>";
        echo "<td>".$row->namapemasok."</td>";
        echo "<td>".$row->kodebarang."</td>";
        echo "<td>".$row->namabarang."</td>";
        echo "<td>".$row->kodesatuan."</td>";
        echo "<td>".$row->jumlahsatuan."</td>";
        echo "<td>".$row->noproduksi."</td>";
        echo "<td>".$row->tglproduksi."</td>";
        echo "<td>".$row->jumlahproduksi."</td>";
        echo "<td>".$row->satuanproduksi."</td>";
        echo "<td>".$row->sisabahan."</td>";
        echo "<td>".$row->satuanbahan."</td>";
        echo "<td>".$row->kodefg."</td>";
        echo "<td>".$row->namafg."</td>";
        echo "<td>".$row->jumlahfg."</td>";
        echo "<td>".$row->satuanfg."</td>";
 //       echo "<td>".$row->nodokkeluar."</td>";
 //       echo "<td>".$row->tgldokkeluar."</td>";
 //       echo "<td>".$row->sisafg."</td>";


    }

    //  $query = $this->db->query("SELECT * FROM vwx_tracert_document_in");
     // $query = "SELECT * FROM vwx_tracert_document_in";
     // $result = $pdo->query($query);
     // $result->setFetchMode(PDO::FETCH_CLASS,'data');

 //     $no = 1;  
  //    while($data = $result->fetch()){  
  //      echo "<tr>";
  //      echo "<td>".$no."</td>";
  //      echo "<td>".$data['provinsi']."</td>";
  //      echo "<td>".$data['penyusun']."</td>";
  //      echo "<td>".$data['tglkonfirmasi']."</td>";
  //      echo "<td>".$data['tglreaksi']."</td>";
  //      echo "<td>".$data['root']."</td>";
  //      echo "<td>".$data['koreksi']."</td>";
    
  //     echo "</tr>";
        
   //..     $no++;  
   //   }






      ?>

</table>     