<?php 
ob_start();
include "../../include/config.php"; 
$doch_id = $_REQUEST['doch_id'];
$prof  = mysql_fetch_array(mysql_query("SELECT * FROM profil"));
$to    = mysql_fetch_array(mysql_query("SELECT a.*, b.*, c.pay_type, d.ttd_name, e.jab_name from document a
         INNER JOIN customer b ON b.id=a.doch_custid 
		 INNER JOIN payment_type c ON c.id=a.doch_idpayment 
		 INNER JOIN tandatangan d ON d.id=a.doch_idttd
		 INNER JOIN jabatan e ON e.id=a.doch_idjabatan
		 WHERE a.id='$doch_id' "));
?>
<html>
<head>
<link rel='stylesheet' type='text/css' href="../../include/css/printdoc_styles.css" />	
</head>
<body>
<br>
<div align="center"><img src="../../images/logo_inv.png" width="180" height="110"></div>
<div class="profil"><?=$prof['prof_name'];?></div>
<div class="title_pl">INVOICE</div>
<div class="box200">No : <?=$to['doch_invno'];?></div>
<div class="box201">Date : <?=date("d M Y",strtotime($to['doch_docdate']));?></div>
<div class="box21">
	<b>&nbsp;</b><br>
	<b><?=strtoupper($to['cust_name']);?></b><br>
	<?=$to['cust_address'];?><br>
	<?=$to['cust_city'];?>&nbsp;<?=strtoupper($to['cust_country']);?><br>
	Telp. <?=$to['cust_telp'];?> Fax. <?=$to['cust_fax'];?><br><br>
	Attn : <?=$to['doch_attn'];?>
</div>
<div class="box22">
	Payment Date : <br><br>
	<?=$to['pay_type'];?>
</div>
<br>
<table style="width:725px;" class="tables_inv">
	<tr>
		<th style="width:40px;">NO</th>
		<th style="width:100px;">PO NUMBER</th>
		<th style="width:270px;">PART NUMBER / PART NAME</th>
		<th style="width:100px%">QTY</th>
		<th style="width:113px;%">UNIT PRICE</th>
		<th style="width:112px;">AMOUNT</th>
	</tr>	
	<?php
		$no=1; $tno=""; $tbuyerpo=""; $tprodcode=""; $tprodname=""; $tqty=""; $tsat=""; $tprice="";	$tcurr=""; $tamount=""; $jstotal=0;
		$qd=mysql_query("SELECT a.*, b.* FROM document_detail a INNER JOIN product b ON b.id=a.docd_prodid WHERE a.docd_hid='$doch_id'");
		$nums = mysql_num_rows($qd);
		while($dd=mysql_fetch_array($qd)){
			$tno = $tno ."".$no."XX";
			$tbuyerpo = $tbuyerpo ."".$dd['docd_buyerpo']."XX";
			$tprodcode = $tprodcode ."".$dd['prod_code']."XX";
			$tprodname = $tprodname ."".$dd['prod_name']."XX";
			$tqty = $tqty ."".$dd['docd_qty']."XX";
			$tsat = $tsat ."".$dd['prod_sat']."XX";
			$tprice = $tprice ."".$dd['docd_price']."XX";
			$tcurr = $tcurr ."".$dd['docd_currency']."XX";
			$tamount = $tamount ."".$dd['docd_total']."XX";
			$jstotal = $jstotal + $dd['docd_total'];
			$no++;
		}
		$tno = substr($tno, 0,-2);
		$ptno = explode("XX",$tno);
		$tbuyerpo = substr($tbuyerpo, 0,-2);
		$ptbuyerpo = explode("XX",$tbuyerpo);
		$tprodcode = substr($tprodcode, 0,-2);
		$ptprodcode = explode("XX",$tprodcode);
		$tprodname = substr($tprodname, 0,-2);
		$ptprodname = explode("XX",$tprodname);
		$tqty = substr($tqty, 0,-2);
		$ptqty = explode("XX",$tqty);
		$tsat = substr($tsat, 0,-2);
		$ptsat = explode("XX",$tsat);
		$tprice = substr($tprice, 0,-2);
		$ptprice = explode("XX",$tprice);
		$tcurr = substr($tcurr, 0,-2);
		$ptcurr = explode("XX",$tcurr);
		$tamount = substr($tamount, 0,-2);
		$ptamount = explode("XX",$tamount);
		if($nums==1 || $nums==2 || $nums==3 || $nums==4 || $nums==5 || $nums==6 || $nums==7 || $nums==8 || $nums==9 || $nums==10){
			#validasi panjang karakter prod name
			$lenpn0 = strlen($ptprodname[0]); #Array Prod Name [0]
			if($lenpn0<=35){
				$br0 = "<br>";
				$tprodname01 = substr($ptprodname[0],0,35);
				$dtprodname0 = "$tprodname01<br>";
			}elseif($lenpn0<=70){
				$br0 = "<br><br>";
				$tprodname01 = substr($ptprodname[0],0,35);  $tprodname02 = substr($ptprodname[0],35,35); 
				$dtprodname0 = "$tprodname01<br>$tprodname02<br>";
			}elseif($lenpn0<=105){
				$br0 = "<br><br><br>";
				$tprodname01 = substr($ptprodname[0],0,35);  $tprodname02 = substr($ptprodname[0],35,35); $tprodname03 = substr($ptprodname[0],70,35);
				$dtprodname0 = "$tprodname01<br>$tprodname02<br>$tprodname03<br>";
			}elseif($lenpn0<=125){
				$br0 = "<br><br><br><br>";
				$tprodname01 = substr($ptprodname[0],0,35);  $tprodname02 = substr($ptprodname[0],35,35); $tprodname03 = substr($ptprodname[0],70,35);
				$tprodname04 = substr($ptprodname[0],105,35);
				$dtprodname0 = "$tprodname01<br>$tprodname02<br>$tprodname03<br>$tprodname04<br>";
			}		
		}if($nums==2 || $nums==3 || $nums==4 || $nums==5 || $nums==6 || $nums==7 || $nums==8 || $nums==9 || $nums==10){
			#validasi panjang karakter prod name
			$lenpn1 = strlen($ptprodname[1]); #Array Prod Name [1]
			if($lenpn1<=35){
				$br1 = "<br>";
				$tprodname11 = substr($ptprodname[1],0,35);
				$dtprodname1 = "$tprodname11<br>";
			}elseif($lenpn1<=70){
				$br1 = "<br><br>";
				$tprodname11 = substr($ptprodname[1],0,35);  $tprodname12 = substr($ptprodname[1],35,35); 
				$dtprodname1 = "$tprodname11<br>$tprodname12<br>";
			}elseif($lenpn1<=105){
				$br1 = "<br><br><br>";
				$tprodname11 = substr($ptprodname[1],0,35);  $tprodname12 = substr($ptprodname[1],35,35); $tprodname13 = substr($ptprodname[1],70,35);
				$dtprodname1 = "$tprodname11<br>$tprodname12<br>$tprodname13<br>";
			}elseif($lenpn1<=125){
				$br1 = "<br><br><br><br>";
				$tprodname11 = substr($ptprodname[1],0,35);  $tprodname12 = substr($ptprodname[1],35,35); $tprodname13 = substr($ptprodname[1],70,35);
				$tprodname14 = substr($ptprodname[1],105,35);
				$dtprodname1 = "$tprodname11<br>$tprodname12<br>$tprodname13<br>$tprodname14<br>";
			}		
		}if($nums==3 || $nums==4 || $nums==5 || $nums==6 || $nums==7 || $nums==8 || $nums==9 || $nums==10){
			#validasi panjang karakter prod name
			$lenpn2 = strlen($ptprodname[2]); #Array Prod Name [2]
			if($lenpn2<=35){
				$br2 = "<br>";
				$tprodname21 = substr($ptprodname[2],0,35);
				$dtprodname2 = "$tprodname21<br>";
			}elseif($lenpn2<=70){
				$br2 = "<br><br>";
				$tprodname21 = substr($ptprodname[2],0,35);  $tprodname22 = substr($ptprodname[2],35,35); 
				$dtprodname2 = "$tprodname21<br>$tprodname22<br>";
			}elseif($lenpn2<=105){
				$br2 = "<br><br><br>";
				$tprodname21 = substr($ptprodname[2],0,35);  $tprodname22 = substr($ptprodname[2],35,35); $tprodname23 = substr($ptprodname[2],70,35);
				$dtprodname2 = "$tprodname21<br>$tprodname22<br>$tprodname23<br>";
			}elseif($lenpn2<=125){
				$br2 = "<br><br><br><br>";
				$tprodname21 = substr($ptprodname[2],0,35);  $tprodname22 = substr($ptprodname[2],35,35); $tprodname23 = substr($ptprodname[2],70,35);
				$tprodname24 = substr($ptprodname[2],105,35);
				$dtprodname2 = "$tprodname21<br>$tprodname22<br>$tprodname23<br>$tprodname24<br>";
			}		
		}if($nums==4 || $nums==5 || $nums==6 || $nums==7 || $nums==8 || $nums==9 || $nums==10){
			#validasi panjang karakter prod name
			$lenpn3 = strlen($ptprodname[3]); #Array Prod Name [3]
			if($lenpn3<=35){
				$br3 = "<br>";
				$tprodname31 = substr($ptprodname[3],0,35);
				$dtprodname3 = "$tprodname31<br>";
			}elseif($lenpn3<=70){
				$br3 = "<br><br>";
				$tprodname31 = substr($ptprodname[3],0,35);  $tprodname32 = substr($ptprodname[3],35,35); 
				$dtprodname3 = "$tprodname31<br>$tprodname32<br>";
			}elseif($lenpn3<=105){
				$br3 = "<br><br><br>";
				$tprodname31 = substr($ptprodname[3],0,35);  $tprodname32 = substr($ptprodname[3],35,35); $tprodname33 = substr($ptprodname[3],70,35);
				$dtprodname3 = "$tprodname31<br>$tprodname32<br>$tprodname33<br>";
			}elseif($lenpn3<=125){
				$br3 = "<br><br><br><br>";
				$tprodname31 = substr($ptprodname[3],0,35);  $tprodname32 = substr($ptprodname[3],35,35); $tprodname33 = substr($ptprodname[3],70,35);
				$tprodname34 = substr($ptprodname[3],105,35);
				$dtprodname3 = "$tprodname31<br>$tprodname32<br>$tprodname33<br>$tprodname34<br>";
			}		
		}if($nums==5 || $nums==6 || $nums==7 || $nums==8 || $nums==9 || $nums==10){
			#validasi panjang karakter prod name
			$lenpn4 = strlen($ptprodname[4]); #Array Prod Name [4]
			if($lenpn4<=35){
				$br4 = "<br>";
				$tprodname41 = substr($ptprodname[4],0,35);
				$dtprodname4 = "$tprodname41<br>";
			}elseif($lenpn4<=70){
				$br4 = "<br><br>";
				$tprodname41 = substr($ptprodname[4],0,35);  $tprodname42 = substr($ptprodname[4],35,35); 
				$dtprodname4 = "$tprodname41<br>$tprodname42<br>";
			}elseif($lenpn4<=105){
				$br4 = "<br><br><br>";
				$tprodname41 = substr($ptprodname[4],0,35);  $tprodname42 = substr($ptprodname[4],35,35); $tprodname43 = substr($ptprodname[4],70,35);
				$dtprodname4 = "$tprodname41<br>$tprodname42<br>$tprodname43<br>";
			}elseif($lenpn4<=125){
				$br4 = "<br><br><br><br>";
				$tprodname41 = substr($ptprodname[4],0,35);  $tprodname42 = substr($ptprodname[4],35,35); $tprodname43 = substr($ptprodname[4],70,35);
				$tprodname44 = substr($ptprodname[4],105,35);
				$dtprodname4 = "$tprodname41<br>$tprodname42<br>$tprodname43<br>$tprodname44<br>";
			}		
		}if($nums==6 || $nums==7 || $nums==8 || $nums==9 || $nums==10){
			#validasi panjang karakter prod name
			$lenpn5 = strlen($ptprodname[5]); #Array Prod Name [5]
			if($lenpn5<=35){
				$br5 = "<br>";
				$tprodname51 = substr($ptprodname[5],0,35);
				$dtprodname5 = "$tprodname51<br>";
			}elseif($lenpn5<=70){
				$br5 = "<br><br>";
				$tprodname51 = substr($ptprodname[5],0,35);  $tprodname52 = substr($ptprodname[5],35,35); 
				$dtprodname5 = "$tprodname51<br>$tprodname52<br>";
			}elseif($lenpn5<=105){
				$br5 = "<br><br><br>";
				$tprodname51 = substr($ptprodname[5],0,35);  $tprodname52 = substr($ptprodname[5],35,35); $tprodname53 = substr($ptprodname[5],70,35);
				$dtprodname5 = "$tprodname51<br>$tprodname52<br>$tprodname53<br>";
			}elseif($lenpn5<=125){
				$br5 = "<br><br><br><br>";
				$tprodname51 = substr($ptprodname[5],0,35);  $tprodname52 = substr($ptprodname[5],35,35); $tprodname53 = substr($ptprodname[5],70,35);
				$tprodname54 = substr($ptprodname[5],105,35);
				$dtprodname5 = "$tprodname51<br>$tprodname52<br>$tprodname53<br>$tprodname54<br>";
			}		
		}if($nums==7 || $nums==8 || $nums==9 || $nums==10){
			#validasi panjang karakter prod name
			$lenpn6 = strlen($ptprodname[6]); #Array Prod Name [6]
			if($lenpn6<=35){
				$br6 = "<br>";
				$tprodname61 = substr($ptprodname[6],0,35);
				$dtprodname6 = "$tprodname61<br>";
			}elseif($lenpn6<=70){
				$br6 = "<br><br>";
				$tprodname61 = substr($ptprodname[6],0,35);  $tprodname62 = substr($ptprodname[6],35,35); 
				$dtprodname6 = "$tprodname61<br>$tprodname62<br>";
			}elseif($lenpn6<=105){
				$br6 = "<br><br><br>";
				$tprodname61 = substr($ptprodname[6],0,35);  $tprodname62 = substr($ptprodname[6],35,35); $tprodname63 = substr($ptprodname[6],70,35);
				$dtprodname6 = "$tprodname61<br>$tprodname62<br>$tprodname63<br>";
			}elseif($lenpn6<=125){
				$br6 = "<br><br><br><br>";
				$tprodname61 = substr($ptprodname[6],0,35);  $tprodname62 = substr($ptprodname[6],35,35); $tprodname63 = substr($ptprodname[6],70,35);
				$tprodname64 = substr($ptprodname[6],105,35);
				$dtprodname6 = "$tprodname61<br>$tprodname62<br>$tprodname63<br>$tprodname64<br>";
			}		
		}if($nums==8 || $nums==9 || $nums==10){
			#validasi panjang karakter prod name
			$lenpn7 = strlen($ptprodname[7]); #Array Prod Name [7]
			if($lenpn7<=35){
				$br7 = "<br>";
				$tprodname71 = substr($ptprodname[7],0,35);
				$dtprodname7 = "$tprodname71<br>";
			}elseif($lenpn7<=70){
				$br7 = "<br><br>";
				$tprodname71 = substr($ptprodname[7],0,35);  $tprodname72 = substr($ptprodname[7],35,35); 
				$dtprodname7 = "$tprodname71<br>$tprodname72<br>";
			}elseif($lenpn7<=105){
				$br7 = "<br><br><br>";
				$tprodname71 = substr($ptprodname[7],0,35);  $tprodname72 = substr($ptprodname[7],35,35); $tprodname73 = substr($ptprodname[7],70,35);
				$dtprodname7 = "$tprodname71<br>$tprodname72<br>$tprodname73<br>";
			}elseif($lenpn7<=125){
				$br7 = "<br><br><br><br>";
				$tprodname71 = substr($ptprodname[7],0,35);  $tprodname72 = substr($ptprodname[7],35,35); $tprodname73 = substr($ptprodname[7],70,35);
				$tprodname74 = substr($ptprodname[7],105,35);
				$dtprodname7 = "$tprodname71<br>$tprodname72<br>$tprodname73<br>$tprodname74<br>";
			}		
		}if($nums==9 || $nums==10){
			#validasi panjang karakter prod name
			$lenpn8 = strlen($ptprodname[8]); #Array Prod Name [8]
			if($lenpn8<=35){
				$br8 = "<br>";
				$tprodname81 = substr($ptprodname[8],0,35);
				$dtprodname8 = "$tprodname81<br>";
			}elseif($lenpn8<=70){
				$br8 = "<br><br>";
				$tprodname81 = substr($ptprodname[8],0,35);  $tprodname82 = substr($ptprodname[8],35,35); 
				$dtprodname8 = "$tprodname81<br>$tprodname82<br>";
			}elseif($lenpn8<=105){
				$br8 = "<br><br><br>";
				$tprodname81 = substr($ptprodname[8],0,35);  $tprodname82 = substr($ptprodname[8],35,35); $tprodname83 = substr($ptprodname[8],70,35);
				$dtprodname8 = "$tprodname81<br>$tprodname82<br>$tprodname83<br>";
			}elseif($lenpn8<=125){
				$br8 = "<br><br><br><br>";
				$tprodname81 = substr($ptprodname[8],0,35);  $tprodname82 = substr($ptprodname[8],35,35); $tprodname83 = substr($ptprodname[8],70,35);
				$tprodname84 = substr($ptprodname[8],105,35);
				$dtprodname8 = "$tprodname81<br>$tprodname82<br>$tprodname83<br>$tprodname84<br>";
			}		
		}if($nums==10){
			#validasi panjang karakter prod name
			$lenpn9 = strlen($ptprodname[9]); #Array Prod Name [9]
			if($lenpn9<=35){
				$br9 = "<br>";
				$tprodname91 = substr($ptprodname[9],0,35);
				$dtprodname9 = "$tprodname91<br>";
			}elseif($lenpn9<=70){
				$br9 = "<br><br>";
				$tprodname91 = substr($ptprodname[9],0,35);  $tprodname92 = substr($ptprodname[9],35,35); 
				$dtprodname9 = "$tprodname91<br>$tprodname92<br>";
			}elseif($lenpn9<=105){
				$br9 = "<br><br><br>";
				$tprodname91 = substr($ptprodname[9],0,35);  $tprodname92 = substr($ptprodname[9],35,35); $tprodname93 = substr($ptprodname[9],70,35);
				$dtprodname9 = "$tprodname91<br>$tprodname92<br>$tprodname93<br>";
			}elseif($lenpn9<=125){
				$br9 = "<br><br><br><br>";
				$tprodname91 = substr($ptprodname[9],0,35);  $tprodname92 = substr($ptprodname[9],35,35); $tprodname93 = substr($ptprodname[9],70,35);
				$tprodname94 = substr($ptprodname[9],105,35);
				$dtprodname9 = "$tprodname91<br>$tprodname92<br>$tprodname93<br>$tprodname94<br>";
			}		
		}
	if($nums==0){
	?>
	<tr>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		<td align="right">&nbsp;</td>
		<td align="center">&nbsp;</td>
		<td align="center">&nbsp;</td>
	</tr>	
	<?php } elseif($nums==1){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br> 
			<?=$dtprodname0;?>
		</td>
		<td align="right">
			<?=number_format($ptqty[0],2,'.',',');?> <?=$ptsat[0];?>
		</td>
		<td align="right">
			<?=number_format($ptprice[0],2,'.',',');?> <?=$ptcurr[0];?>
		</td>
		<td align="right">
			<?=number_format($ptamount[0],2,'.',',');?> <?=$ptcurr[0];?>
		</td>
	</tr>	
	<?php } elseif($nums==2){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br><?=$br0;?>
			<?=$ptno[1];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br><?=$br0;?>
			<?=$ptbuyerpo[1];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br><?=$dtprodname0;?>
			<?=$ptprodcode[1];?><br><?=$dtprodname1;?>
		</td>
		<td align="right">
			<?=number_format($ptqty[0],2,'.',',');?> <?=$ptsat[0];?><br><?=$br0;?>
			<?=number_format($ptqty[1],2,'.',',');?> <?=$ptsat[1];?>
		</td>
		<td align="right">
			<?=number_format($ptprice[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptprice[1],2,'.',',');?> <?=$ptcurr[1];?>
		</td>
		<td align="right">
			<?=number_format($ptamount[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptamount[1],2,'.',',');?> <?=$ptcurr[1];?>
		</td>
	</tr>	
	<?php } elseif($nums==3){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br><?=$br0;?>
			<?=$ptno[1];?><br><?=$br1;?>
			<?=$ptno[2];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br><?=$br0;?>
			<?=$ptbuyerpo[1];?><br><?=$br1;?>
			<?=$ptbuyerpo[2];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br><?=$dtprodname0;?>
			<?=$ptprodcode[1];?><br><?=$dtprodname1;?>
			<?=$ptprodcode[2];?><br><?=$dtprodname2;?>
		</td>
		<td align="right">
			<?=number_format($ptqty[0],2,'.',',');?> <?=$ptsat[0];?><br><?=$br0;?>
			<?=number_format($ptqty[1],2,'.',',');?> <?=$ptsat[1];?><br><?=$br1;?>
			<?=number_format($ptqty[2],2,'.',',');?> <?=$ptsat[2];?>
		</td>
		<td align="right">
			<?=number_format($ptprice[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptprice[1],2,'.',',');?> <?=$ptcurr[1];?><br><?=$br1;?>
			<?=number_format($ptprice[2],2,'.',',');?> <?=$ptcurr[2];?>
		</td>
		<td align="right">
			<?=number_format($ptamount[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptamount[1],2,'.',',');?> <?=$ptcurr[1];?><br><?=$br1;?>
			<?=number_format($ptamount[2],2,'.',',');?> <?=$ptcurr[2];?>			
		</td>
	</tr>
	<?php } elseif($nums==4){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br><?=$br0;?>
			<?=$ptno[1];?><br><?=$br1;?>
			<?=$ptno[2];?><br><?=$br2;?>
			<?=$ptno[3];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br><?=$br0;?>
			<?=$ptbuyerpo[1];?><br><?=$br1;?>
			<?=$ptbuyerpo[2];?><br><?=$br2;?>
			<?=$ptbuyerpo[3];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br><?=$dtprodname0;?>
			<?=$ptprodcode[1];?><br><?=$dtprodname1;?>
			<?=$ptprodcode[2];?><br><?=$dtprodname2;?>
			<?=$ptprodcode[3];?><br><?=$dtprodname3;?>
		</td>
		<td align="right">
			<?=number_format($ptqty[0],2,'.',',');?> <?=$ptsat[0];?><br><?=$br0;?>
			<?=number_format($ptqty[1],2,'.',',');?> <?=$ptsat[1];?><br><?=$br1;?>
			<?=number_format($ptqty[2],2,'.',',');?> <?=$ptsat[2];?><br><?=$br2;?>
			<?=number_format($ptqty[3],2,'.',',');?> <?=$ptsat[3];?>
		</td>
		<td align="right">
			<?=number_format($ptprice[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptprice[1],2,'.',',');?> <?=$ptcurr[1];?><br><?=$br1;?>
			<?=number_format($ptprice[2],2,'.',',');?> <?=$ptcurr[2];?><br><?=$br2;?>
			<?=number_format($ptprice[3],2,'.',',');?> <?=$ptcurr[3];?>
		</td>
		<td align="right">
			<?=number_format($ptamount[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptamount[1],2,'.',',');?> <?=$ptcurr[1];?><br><?=$br1;?>
			<?=number_format($ptamount[2],2,'.',',');?> <?=$ptcurr[2];?><br><?=$br2;?>
			<?=number_format($ptamount[3],2,'.',',');?> <?=$ptcurr[3];?>			
		</td>
	</tr>
	<?php } elseif($nums==5){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br><?=$br0;?>
			<?=$ptno[1];?><br><?=$br1;?>
			<?=$ptno[2];?><br><?=$br2;?>
			<?=$ptno[3];?><br><?=$br3;?>
			<?=$ptno[4];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br><?=$br0;?>
			<?=$ptbuyerpo[1];?><br><?=$br1;?>
			<?=$ptbuyerpo[2];?><br><?=$br2;?>
			<?=$ptbuyerpo[3];?><br><?=$br3;?>
			<?=$ptbuyerpo[4];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br><?=$dtprodname0;?>
			<?=$ptprodcode[1];?><br><?=$dtprodname1;?>
			<?=$ptprodcode[2];?><br><?=$dtprodname2;?>
			<?=$ptprodcode[3];?><br><?=$dtprodname3;?>
			<?=$ptprodcode[4];?><br><?=$dtprodname4;?>
		</td>
		<td align="right">
			<?=number_format($ptqty[0],2,'.',',');?> <?=$ptsat[0];?><br><?=$br0;?>
			<?=number_format($ptqty[1],2,'.',',');?> <?=$ptsat[1];?><br><?=$br1;?>
			<?=number_format($ptqty[2],2,'.',',');?> <?=$ptsat[2];?><br><?=$br2;?>
			<?=number_format($ptqty[3],2,'.',',');?> <?=$ptsat[3];?><br><?=$br3;?>
			<?=number_format($ptqty[4],2,'.',',');?> <?=$ptsat[4];?>
		</td>
		<td align="right">
			<?=number_format($ptprice[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptprice[1],2,'.',',');?> <?=$ptcurr[1];?><br><?=$br1;?>
			<?=number_format($ptprice[2],2,'.',',');?> <?=$ptcurr[2];?><br><?=$br2;?>
			<?=number_format($ptprice[3],2,'.',',');?> <?=$ptcurr[3];?><br><?=$br3;?>
			<?=number_format($ptprice[4],2,'.',',');?> <?=$ptcurr[4];?>
		</td>
		<td align="right">
			<?=number_format($ptamount[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptamount[1],2,'.',',');?> <?=$ptcurr[1];?><br><?=$br1;?>
			<?=number_format($ptamount[2],2,'.',',');?> <?=$ptcurr[2];?><br><?=$br2;?>
			<?=number_format($ptamount[3],2,'.',',');?> <?=$ptcurr[3];?><br><?=$br3;?>
			<?=number_format($ptamount[4],2,'.',',');?> <?=$ptcurr[4];?>			
		</td>
	</tr>
	<?php } elseif($nums==6){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br><?=$br0;?>
			<?=$ptno[1];?><br><?=$br1;?>
			<?=$ptno[2];?><br><?=$br2;?>
			<?=$ptno[3];?><br><?=$br3;?>
			<?=$ptno[4];?><br><?=$br4;?>
			<?=$ptno[5];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br><?=$br0;?>
			<?=$ptbuyerpo[1];?><br><?=$br1;?>
			<?=$ptbuyerpo[2];?><br><?=$br2;?>
			<?=$ptbuyerpo[3];?><br><?=$br3;?>
			<?=$ptbuyerpo[4];?><br><?=$br4;?>
			<?=$ptbuyerpo[5];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br><?=$dtprodname0;?>
			<?=$ptprodcode[1];?><br><?=$dtprodname1;?>
			<?=$ptprodcode[2];?><br><?=$dtprodname2;?>
			<?=$ptprodcode[3];?><br><?=$dtprodname3;?>
			<?=$ptprodcode[4];?><br><?=$dtprodname4;?>
			<?=$ptprodcode[5];?><br><?=$dtprodname5;?>
		</td>
		<td align="right">
			<?=number_format($ptqty[0],2,'.',',');?> <?=$ptsat[0];?><br><?=$br0;?>
			<?=number_format($ptqty[1],2,'.',',');?> <?=$ptsat[1];?><br><?=$br1;?>
			<?=number_format($ptqty[2],2,'.',',');?> <?=$ptsat[2];?><br><?=$br2;?>
			<?=number_format($ptqty[3],2,'.',',');?> <?=$ptsat[3];?><br><?=$br3;?>
			<?=number_format($ptqty[4],2,'.',',');?> <?=$ptsat[4];?><br><?=$br4;?>
			<?=number_format($ptqty[5],2,'.',',');?> <?=$ptsat[5];?>
		</td>
		<td align="right">
			<?=number_format($ptprice[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptprice[1],2,'.',',');?> <?=$ptcurr[1];?><br><?=$br1;?>
			<?=number_format($ptprice[2],2,'.',',');?> <?=$ptcurr[2];?><br><?=$br2;?>
			<?=number_format($ptprice[3],2,'.',',');?> <?=$ptcurr[3];?><br><?=$br3;?>
			<?=number_format($ptprice[4],2,'.',',');?> <?=$ptcurr[4];?><br><?=$br4;?>
			<?=number_format($ptprice[5],2,'.',',');?> <?=$ptcurr[5];?>
		</td>
		<td align="right">
			<?=number_format($ptamount[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptamount[1],2,'.',',');?> <?=$ptcurr[1];?><br><?=$br1;?>
			<?=number_format($ptamount[2],2,'.',',');?> <?=$ptcurr[2];?><br><?=$br2;?>
			<?=number_format($ptamount[3],2,'.',',');?> <?=$ptcurr[3];?><br><?=$br3;?>
			<?=number_format($ptamount[4],2,'.',',');?> <?=$ptcurr[4];?><br><?=$br4;?>
			<?=number_format($ptamount[5],2,'.',',');?> <?=$ptcurr[5];?>			
		</td>
	</tr>
	<?php } elseif($nums==7){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br><?=$br0;?>
			<?=$ptno[1];?><br><?=$br1;?>
			<?=$ptno[2];?><br><?=$br2;?>
			<?=$ptno[3];?><br><?=$br3;?>
			<?=$ptno[4];?><br><?=$br4;?>
			<?=$ptno[5];?><br><?=$br5;?>
			<?=$ptno[6];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br><?=$br0;?>
			<?=$ptbuyerpo[1];?><br><?=$br1;?>
			<?=$ptbuyerpo[2];?><br><?=$br2;?>
			<?=$ptbuyerpo[3];?><br><?=$br3;?>
			<?=$ptbuyerpo[4];?><br><?=$br4;?>
			<?=$ptbuyerpo[5];?><br><?=$br5;?>
			<?=$ptbuyerpo[6];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br><?=$dtprodname0;?>
			<?=$ptprodcode[1];?><br><?=$dtprodname1;?>
			<?=$ptprodcode[2];?><br><?=$dtprodname2;?>
			<?=$ptprodcode[3];?><br><?=$dtprodname3;?>
			<?=$ptprodcode[4];?><br><?=$dtprodname4;?>
			<?=$ptprodcode[5];?><br><?=$dtprodname5;?>
			<?=$ptprodcode[6];?><br><?=$dtprodname6;?>
		</td>
		<td align="right">
			<?=number_format($ptqty[0],2,'.',',');?> <?=$ptsat[0];?><br><?=$br0;?>
			<?=number_format($ptqty[1],2,'.',',');?> <?=$ptsat[1];?><br><?=$br1;?>
			<?=number_format($ptqty[2],2,'.',',');?> <?=$ptsat[2];?><br><?=$br2;?>
			<?=number_format($ptqty[3],2,'.',',');?> <?=$ptsat[3];?><br><?=$br3;?>
			<?=number_format($ptqty[4],2,'.',',');?> <?=$ptsat[4];?><br><?=$br4;?>
			<?=number_format($ptqty[5],2,'.',',');?> <?=$ptsat[5];?><br><?=$br5;?>
			<?=number_format($ptqty[6],2,'.',',');?> <?=$ptsat[6];?>
		</td>
		<td align="right">
			<?=number_format($ptprice[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptprice[1],2,'.',',');?> <?=$ptcurr[1];?><br><?=$br1;?>
			<?=number_format($ptprice[2],2,'.',',');?> <?=$ptcurr[2];?><br><?=$br2;?>
			<?=number_format($ptprice[3],2,'.',',');?> <?=$ptcurr[3];?><br><?=$br3;?>
			<?=number_format($ptprice[4],2,'.',',');?> <?=$ptcurr[4];?><br><?=$br4;?>
			<?=number_format($ptprice[5],2,'.',',');?> <?=$ptcurr[5];?><br><?=$br5;?>
			<?=number_format($ptprice[6],2,'.',',');?> <?=$ptcurr[6];?>
		</td>
		<td align="right">
			<?=number_format($ptamount[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptamount[1],2,'.',',');?> <?=$ptcurr[1];?><br><?=$br1;?>
			<?=number_format($ptamount[2],2,'.',',');?> <?=$ptcurr[2];?><br><?=$br2;?>
			<?=number_format($ptamount[3],2,'.',',');?> <?=$ptcurr[3];?><br><?=$br3;?>
			<?=number_format($ptamount[4],2,'.',',');?> <?=$ptcurr[4];?><br><?=$br4;?>
			<?=number_format($ptamount[5],2,'.',',');?> <?=$ptcurr[5];?><br><?=$br5;?>
			<?=number_format($ptamount[6],2,'.',',');?> <?=$ptcurr[6];?>			
		</td>
	</tr>
	<?php } elseif($nums==8){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br><?=$br0;?>
			<?=$ptno[1];?><br><?=$br1;?>
			<?=$ptno[2];?><br><?=$br2;?>
			<?=$ptno[3];?><br><?=$br3;?>
			<?=$ptno[4];?><br><?=$br4;?>
			<?=$ptno[5];?><br><?=$br5;?>
			<?=$ptno[6];?><br><?=$br6;?>
			<?=$ptno[7];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br><?=$br0;?>
			<?=$ptbuyerpo[1];?><br><?=$br1;?>
			<?=$ptbuyerpo[2];?><br><?=$br2;?>
			<?=$ptbuyerpo[3];?><br><?=$br3;?>
			<?=$ptbuyerpo[4];?><br><?=$br4;?>
			<?=$ptbuyerpo[5];?><br><?=$br5;?>
			<?=$ptbuyerpo[6];?><br><?=$br6;?>
			<?=$ptbuyerpo[7];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br><?=$dtprodname0;?>
			<?=$ptprodcode[1];?><br><?=$dtprodname1;?>
			<?=$ptprodcode[2];?><br><?=$dtprodname2;?>
			<?=$ptprodcode[3];?><br><?=$dtprodname3;?>
			<?=$ptprodcode[4];?><br><?=$dtprodname4;?>
			<?=$ptprodcode[5];?><br><?=$dtprodname5;?>
			<?=$ptprodcode[6];?><br><?=$dtprodname6;?>
			<?=$ptprodcode[7];?><br><?=$dtprodname7;?>
		</td>
		<td align="right">
			<?=number_format($ptqty[0],2,'.',',');?> <?=$ptsat[0];?><br><?=$br0;?>
			<?=number_format($ptqty[1],2,'.',',');?> <?=$ptsat[1];?><br><?=$br1;?>
			<?=number_format($ptqty[2],2,'.',',');?> <?=$ptsat[2];?><br><?=$br2;?>
			<?=number_format($ptqty[3],2,'.',',');?> <?=$ptsat[3];?><br><?=$br3;?>
			<?=number_format($ptqty[4],2,'.',',');?> <?=$ptsat[4];?><br><?=$br4;?>
			<?=number_format($ptqty[5],2,'.',',');?> <?=$ptsat[5];?><br><?=$br5;?>
			<?=number_format($ptqty[6],2,'.',',');?> <?=$ptsat[6];?><br><?=$br6;?>
			<?=number_format($ptqty[7],2,'.',',');?> <?=$ptsat[7];?>
		</td>
		<td align="right">
			<?=number_format($ptprice[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptprice[1],2,'.',',');?> <?=$ptcurr[1];?><br><?=$br1;?>
			<?=number_format($ptprice[2],2,'.',',');?> <?=$ptcurr[2];?><br><?=$br2;?>
			<?=number_format($ptprice[3],2,'.',',');?> <?=$ptcurr[3];?><br><?=$br3;?>
			<?=number_format($ptprice[4],2,'.',',');?> <?=$ptcurr[4];?><br><?=$br4;?>
			<?=number_format($ptprice[5],2,'.',',');?> <?=$ptcurr[5];?><br><?=$br5;?>
			<?=number_format($ptprice[6],2,'.',',');?> <?=$ptcurr[6];?><br><?=$br6;?>
			<?=number_format($ptprice[7],2,'.',',');?> <?=$ptcurr[7];?>
		</td>
		<td align="right">
			<?=number_format($ptamount[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptamount[1],2,'.',',');?> <?=$ptcurr[1];?><br><?=$br1;?>
			<?=number_format($ptamount[2],2,'.',',');?> <?=$ptcurr[2];?><br><?=$br2;?>
			<?=number_format($ptamount[3],2,'.',',');?> <?=$ptcurr[3];?><br><?=$br3;?>
			<?=number_format($ptamount[4],2,'.',',');?> <?=$ptcurr[4];?><br><?=$br4;?>
			<?=number_format($ptamount[5],2,'.',',');?> <?=$ptcurr[5];?><br><?=$br5;?>
			<?=number_format($ptamount[6],2,'.',',');?> <?=$ptcurr[6];?><br><?=$br6;?>
			<?=number_format($ptamount[7],2,'.',',');?> <?=$ptcurr[7];?>			
		</td>
	</tr>
	<?php } elseif($nums==9){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br><?=$br0;?>
			<?=$ptno[1];?><br><?=$br1;?>
			<?=$ptno[2];?><br><?=$br2;?>
			<?=$ptno[3];?><br><?=$br3;?>
			<?=$ptno[4];?><br><?=$br4;?>
			<?=$ptno[5];?><br><?=$br5;?>
			<?=$ptno[6];?><br><?=$br6;?>
			<?=$ptno[7];?><br><?=$br7;?>
			<?=$ptno[8];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br><?=$br0;?>
			<?=$ptbuyerpo[1];?><br><?=$br1;?>
			<?=$ptbuyerpo[2];?><br><?=$br2;?>
			<?=$ptbuyerpo[3];?><br><?=$br3;?>
			<?=$ptbuyerpo[4];?><br><?=$br4;?>
			<?=$ptbuyerpo[5];?><br><?=$br5;?>
			<?=$ptbuyerpo[6];?><br><?=$br6;?>
			<?=$ptbuyerpo[7];?><br><?=$br7;?>
			<?=$ptbuyerpo[8];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br><?=$dtprodname0;?>
			<?=$ptprodcode[1];?><br><?=$dtprodname1;?>
			<?=$ptprodcode[2];?><br><?=$dtprodname2;?>
			<?=$ptprodcode[3];?><br><?=$dtprodname3;?>
			<?=$ptprodcode[4];?><br><?=$dtprodname4;?>
			<?=$ptprodcode[5];?><br><?=$dtprodname5;?>
			<?=$ptprodcode[6];?><br><?=$dtprodname6;?>
			<?=$ptprodcode[7];?><br><?=$dtprodname7;?>
			<?=$ptprodcode[8];?><br><?=$dtprodname8;?>
		</td>
		<td align="right">
			<?=number_format($ptqty[0],2,'.',',');?> <?=$ptsat[0];?><br><?=$br0;?>
			<?=number_format($ptqty[1],2,'.',',');?> <?=$ptsat[1];?><br><?=$br1;?>
			<?=number_format($ptqty[2],2,'.',',');?> <?=$ptsat[2];?><br><?=$br2;?>
			<?=number_format($ptqty[3],2,'.',',');?> <?=$ptsat[3];?><br><?=$br3;?>
			<?=number_format($ptqty[4],2,'.',',');?> <?=$ptsat[4];?><br><?=$br4;?>
			<?=number_format($ptqty[5],2,'.',',');?> <?=$ptsat[5];?><br><?=$br5;?>
			<?=number_format($ptqty[6],2,'.',',');?> <?=$ptsat[6];?><br><?=$br6;?>
			<?=number_format($ptqty[7],2,'.',',');?> <?=$ptsat[7];?><br><?=$br7;?>
			<?=number_format($ptqty[8],2,'.',',');?> <?=$ptsat[8];?>
		</td>
		<td align="right">
			<?=number_format($ptprice[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptprice[1],2,'.',',');?> <?=$ptcurr[1];?><br><?=$br1;?>
			<?=number_format($ptprice[2],2,'.',',');?> <?=$ptcurr[2];?><br><?=$br2;?>
			<?=number_format($ptprice[3],2,'.',',');?> <?=$ptcurr[3];?><br><?=$br3;?>
			<?=number_format($ptprice[4],2,'.',',');?> <?=$ptcurr[4];?><br><?=$br4;?>
			<?=number_format($ptprice[5],2,'.',',');?> <?=$ptcurr[5];?><br><?=$br5;?>
			<?=number_format($ptprice[6],2,'.',',');?> <?=$ptcurr[6];?><br><?=$br6;?>
			<?=number_format($ptprice[7],2,'.',',');?> <?=$ptcurr[7];?><br><?=$br7;?>
			<?=number_format($ptprice[8],2,'.',',');?> <?=$ptcurr[8];?>
		</td>
		<td align="right">
			<?=number_format($ptamount[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptamount[1],2,'.',',');?> <?=$ptcurr[1];?><br><?=$br1;?>
			<?=number_format($ptamount[2],2,'.',',');?> <?=$ptcurr[2];?><br><?=$br2;?>
			<?=number_format($ptamount[3],2,'.',',');?> <?=$ptcurr[3];?><br><?=$br3;?>
			<?=number_format($ptamount[4],2,'.',',');?> <?=$ptcurr[4];?><br><?=$br4;?>
			<?=number_format($ptamount[5],2,'.',',');?> <?=$ptcurr[5];?><br><?=$br5;?>
			<?=number_format($ptamount[6],2,'.',',');?> <?=$ptcurr[6];?><br><?=$br6;?>
			<?=number_format($ptamount[7],2,'.',',');?> <?=$ptcurr[7];?><br><?=$br7;?>
			<?=number_format($ptamount[8],2,'.',',');?> <?=$ptcurr[8];?>			
		</td>
	</tr>
	<?php } else { ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br><?=$br0;?>
			<?=$ptno[1];?><br><?=$br1;?>
			<?=$ptno[2];?><br><?=$br2;?>
			<?=$ptno[3];?><br><?=$br3;?>
			<?=$ptno[4];?><br><?=$br4;?>
			<?=$ptno[5];?><br><?=$br5;?>
			<?=$ptno[6];?><br><?=$br6;?>
			<?=$ptno[7];?><br><?=$br7;?>
			<?=$ptno[8];?><br><?=$br8;?>
			<?=$ptno[9];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br><?=$br0;?>
			<?=$ptbuyerpo[1];?><br><?=$br1;?>
			<?=$ptbuyerpo[2];?><br><?=$br2;?>
			<?=$ptbuyerpo[3];?><br><?=$br3;?>
			<?=$ptbuyerpo[4];?><br><?=$br4;?>
			<?=$ptbuyerpo[5];?><br><?=$br5;?>
			<?=$ptbuyerpo[6];?><br><?=$br6;?>
			<?=$ptbuyerpo[7];?><br><?=$br7;?>
			<?=$ptbuyerpo[8];?><br><?=$br8;?>
			<?=$ptbuyerpo[9];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br><?=$dtprodname0;?>
			<?=$ptprodcode[1];?><br><?=$dtprodname1;?>
			<?=$ptprodcode[2];?><br><?=$dtprodname2;?>
			<?=$ptprodcode[3];?><br><?=$dtprodname3;?>
			<?=$ptprodcode[4];?><br><?=$dtprodname4;?>
			<?=$ptprodcode[5];?><br><?=$dtprodname5;?>
			<?=$ptprodcode[6];?><br><?=$dtprodname6;?>
			<?=$ptprodcode[7];?><br><?=$dtprodname7;?>
			<?=$ptprodcode[8];?><br><?=$dtprodname8;?>
			<?=$ptprodcode[9];?><br><?=$dtprodname9;?>
		</td>
		<td align="right">
			<?=number_format($ptqty[0],2,'.',',');?> <?=$ptsat[0];?><br><?=$br0;?>
			<?=number_format($ptqty[1],2,'.',',');?> <?=$ptsat[1];?><br><?=$br1;?>
			<?=number_format($ptqty[2],2,'.',',');?> <?=$ptsat[2];?><br><?=$br2;?>
			<?=number_format($ptqty[3],2,'.',',');?> <?=$ptsat[3];?><br><?=$br3;?>
			<?=number_format($ptqty[4],2,'.',',');?> <?=$ptsat[4];?><br><?=$br4;?>
			<?=number_format($ptqty[5],2,'.',',');?> <?=$ptsat[5];?><br><?=$br5;?>
			<?=number_format($ptqty[6],2,'.',',');?> <?=$ptsat[6];?><br><?=$br6;?>
			<?=number_format($ptqty[7],2,'.',',');?> <?=$ptsat[7];?><br><?=$br7;?>
			<?=number_format($ptqty[8],2,'.',',');?> <?=$ptsat[8];?><br><?=$br8;?>
			<?=number_format($ptqty[9],2,'.',',');?> <?=$ptsat[9];?>
		</td>
		<td align="right">
			<?=number_format($ptprice[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptprice[1],2,'.',',');?> <?=$ptcurr[1];?><br><?=$br1;?>
			<?=number_format($ptprice[2],2,'.',',');?> <?=$ptcurr[2];?><br><?=$br2;?>
			<?=number_format($ptprice[3],2,'.',',');?> <?=$ptcurr[3];?><br><?=$br3;?>
			<?=number_format($ptprice[4],2,'.',',');?> <?=$ptcurr[4];?><br><?=$br4;?>
			<?=number_format($ptprice[5],2,'.',',');?> <?=$ptcurr[5];?><br><?=$br5;?>
			<?=number_format($ptprice[6],2,'.',',');?> <?=$ptcurr[6];?><br><?=$br6;?>
			<?=number_format($ptprice[7],2,'.',',');?> <?=$ptcurr[7];?><br><?=$br7;?>
			<?=number_format($ptprice[8],2,'.',',');?> <?=$ptcurr[8];?><br><?=$br8;?>
			<?=number_format($ptprice[9],2,'.',',');?> <?=$ptcurr[9];?>
		</td>
		<td align="right">
			<?=number_format($ptamount[0],2,'.',',');?> <?=$ptcurr[0];?><br><?=$br0;?>
			<?=number_format($ptamount[1],2,'.',',');?> <?=$ptcurr[1];?><br><?=$br1;?>
			<?=number_format($ptamount[2],2,'.',',');?> <?=$ptcurr[2];?><br><?=$br2;?>
			<?=number_format($ptamount[3],2,'.',',');?> <?=$ptcurr[3];?><br><?=$br3;?>
			<?=number_format($ptamount[4],2,'.',',');?> <?=$ptcurr[4];?><br><?=$br4;?>
			<?=number_format($ptamount[5],2,'.',',');?> <?=$ptcurr[5];?><br><?=$br5;?>
			<?=number_format($ptamount[6],2,'.',',');?> <?=$ptcurr[6];?><br><?=$br6;?>
			<?=number_format($ptamount[7],2,'.',',');?> <?=$ptcurr[7];?><br><?=$br7;?>
			<?=number_format($ptamount[8],2,'.',',');?> <?=$ptcurr[8];?><br><?=$br8;?>
			<?=number_format($ptamount[9],2,'.',',');?> <?=$ptcurr[9];?>			
		</td>
	</tr>
	<?php } ?>
	<tr>
		<th>&nbsp;</th>
		<th colspan="4" style="text-align:left">
			&nbsp;&nbsp;SUB TOTAL<br><br>
			&nbsp;&nbsp;PPN<br><br>
			&nbsp;&nbsp;TOTAL</th>
		<th align="right">
			<?=number_format($jstotal,2,'.',',');?>&nbsp;<br><br>
			<?=number_format($to['doch_ppn'],2,'.',',');?>&nbsp;<br><br>
			<?=number_format($to['doch_grandtotal'],2,'.',',');?>&nbsp;
		</th>
	</tr>
</table>
<br>
<div class="trfdesc">
	Rekening SAI : <br><br>
	Bank Of Tokyo-Mitsubishi UFJ Jakarta Branch<br>
	Account Name :PT. Showa Autoparts Indonesia Bank Of<br>
	Tokyo-Mitsubishi UFJ Jakarta Branch<br>
	Account Name :PT. Showa Autoparts Indonesia<br>
	Account No : 665-193583(IDR)<br>
	Account No : 665-967809(USD)<br>
</div>
<div class="sign1"><?=$prof['prof_name'];?></div>
<div class="sign2"><?=$to['ttd_name'];?></div>
<div class="sign3">______________________________</div>
<div class="sign4"><?=$to['jab_name'];?></div>
<div class="footer1">&nbsp;</div>
<div class="footer2">Kawasan Industri Terpadu Indonesia China ( KITIC ) Ds. Nagasari Kec.Serang Baru Kab, Bekasi 17330 <br> 
Telp. 021 22157240, 021 22157241 Fax. 021 22157243</div>
</body>
</html>
<?php  
	 #PDF
	 $filename="invoice.pdf";   
	 $content = ob_get_clean();  
	 //$content = '<page style="font-family: Arial;">'.nl2br($content).'</page>';  
	 require_once('../../function/html2pdf/html2pdf.class.php');  
	 try  
	 {  
	  //$html2pdf = new HTML2PDF('P',array(240,280),'en', false, 'ISO-8859-15',array(0, 0, 0, 0));  
	  $html2pdf = new HTML2PDF('P','A4','en', false, 'ISO-8859-15',array(0, 0, 0, 0));
	  $html2pdf->setDefaultFont('Arial');  
	  $html2pdf->writeHTML($content, isset($_GET['vuehtml']));  
	  $html2pdf->Output($filename);  
	 }  
	 catch(HTML2PDF_exception $e) { echo $e; } 
?> 