<?php
include "../../include/config.php";
include "../../function/inc_function.php";
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="Data_pending_bc261_'.date('Y-m-d H:i:s').'.xls"');
header('Cache-Control: max-age=0');

?>
<table width="100%" border="0">
    <tr>
  		<td colspan="12" align="left"><strong>DATA YANG BELUM INTERFACE KE WEB BC</strong></td>
    </tr>
    <tr>
  		<td colspan="12" align="left"><strong>JENIS DOKUMEN : BC 2.6.1</strong></td>
    </tr>
</table>	
<table width="100%" border="1">	
  <tr>
    <th align="center" bgcolor="#D1D1D1">NO</th>
    <th align="center" bgcolor="#D1D1D1">NO AJU</th>
	<th align="center" bgcolor="#D1D1D1">TANGGAL AJU</th>
	<th align="center" bgcolor="#D1D1D1">NO URUT</th>
	<th align="center" bgcolor="#D1D1D1">NOMOR DOKUMEN</th>
	<th align="center" bgcolor="#D1D1D1">TANGGAL DOKUMEN</th>
	<th align="center" bgcolor="#D1D1D1">CUSTOMER</th>
	<th align="center" bgcolor="#D1D1D1">KODE BARANG</th>
	<th align="center" bgcolor="#D1D1D1">NAMA BARANG</th>
	<th align="center" bgcolor="#D1D1D1">JUMLAH</th>
	<th align="center" bgcolor="#D1D1D1">BULAN</th>
	<th align="center" bgcolor="#D1D1D1">TAHUN</th>
  </tr>
	<?php		
		$qd = mysql_query("SELECT no_aju, tgl_aju, no_urut, no_dokpab, tgl_dokpab, kode, nm_barang, jumlah, MONTH(tgl_dokpab) bulan, YEAR(tgl_dokpab) tahun, nm_penerima
		FROM log_outgoing WHERE log_status=1 AND jenis_dokpab='BC 2.6.1' ORDER BY no_aju, no_urut ASC");
		$no = 1;
		while($dd=mysql_fetch_object($qd)){		
			$bln = get_bulan($dd->bulan);
		?> 
		  <tr>
			<td align="center"><?=$no;?></td>
			<td align="center">'<?=$dd->no_aju;?></td>
			<td align="center"><?=$dd->tgl_aju;?></td>
			<td align="center"><?=$dd->no_urut;?></td>
			<td align="center">'<?=$dd->no_dokpab;?></td>
			<td align="center"><?=$dd->tgl_dokpab;?></td>
			<td align="left"><?=$dd->nm_penerima;?></td>
			<td align="left"><?=$dd->kode;?></td>			
			<td align="left"><?=$dd->nm_barang;?></td>
			<td align="right"><?=number_format($dd->jumlah,2,'.',',');?></td>
			<td align="left"><?=$bln;?></td>
			<td align="center"><?=$dd->tahun;?></td>
		  </tr>
      <?php $no++; }  ?>	
</table>