<?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.* from document a
         INNER JOIN customer b ON b.id=a.doch_custid WHERE a.id='$doch_id' "));
?>
<html>
<head>
<link rel='stylesheet' type='text/css' href="../../include/css/printdoc_styles.css" />	
</head>
<body>
<!--<br><br><br><br><br><br><br>-->
<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">DELIVERY ORDER</div>
<div class="box1">
	<b>DELIVERY TO</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>
	Attn : <?=$to['doch_attn'];?>
</div>
<div class="box2">
	No :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Date : <br>
	<?=$to['doch_dono'];?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<?=date("d M Y",strtotime($to['doch_docdate']));?>
	
</div>
<br><br>
<table style="width:700px;" class="tables">
	<tr>
		<th style="width:40px;">NO</th>
		<th style="width:100px;">PO NUMBER</th>
		<th style="width:120px;">PART CODE</th>
		<th style="width:180px;">PART NAME</th>
		<th style="width:80px;">QTY</th>
		<th style="width:50px;">BOX</th>
		<th style="width:50px;">PALLET</th>
		<th style="width:80px;">REMARK</th>
	</tr>	
	<?php
		$no=1; $tno=""; $tbuyerpo=""; $tprodcode=""; $tprodname=""; $tqty=""; $tsat="";	$tbox=""; $tpallet=""; $jqty=0; $jbox=0; $jpallet=0;
		$qd=mysql_query("SELECT a.docd_prodid, a.docd_qty, round(a.docd_weight,0) docd_weight, round(a.docd_gross,0) docd_gross, round(a.docd_box,0) docd_box,
						 round(a.docd_pallet) docd_pallet, a.docd_upallet, a.docd_buyerpo, 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";
			$tbox = $tbox ."".$dd['docd_box']."XX";
			$tpallet = $tpallet ."".$dd['docd_pallet']."XX";
			$jqty = $jqty + $dd['docd_qty'];
			$jbox = $jbox + $dd['docd_box'];
			$jpallet = $jpallet + $dd['docd_pallet'];
			$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);
		$tbox = substr($tbox, 0,-2);
		$ptbox = explode("XX",$tbox);
		$tpallet = substr($tpallet, 0,-2);
		$ptpallet = explode("XX",$tpallet);
		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<=22){
				$br0 = "<br>";
				$tprodname01 = substr($ptprodname[0],0,22);
				$dtprodname0 = "$tprodname01<br>";
			}elseif($lenpn0<=44){
				$br0 = "<br><br>";
				$tprodname01 = substr($ptprodname[0],0,22);  $tprodname02 = substr($ptprodname[0],22,22); 
				$dtprodname0 = "$tprodname01<br>$tprodname02<br>";
			}elseif($lenpn0<=66){
				$br0 = "<br><br><br>";
				$tprodname01 = substr($ptprodname[0],0,22);  $tprodname02 = substr($ptprodname[0],22,22); $tprodname03 = substr($ptprodname[0],44,22);
				$dtprodname0 = "$tprodname01<br>$tprodname02<br>$tprodname03<br>";
			}elseif($lenpn0<=88){
				$br0 = "<br><br><br><br>";
				$tprodname01 = substr($ptprodname[0],0,22);  $tprodname02 = substr($ptprodname[0],22,22); $tprodname03 = substr($ptprodname[0],44,22);
				$tprodname04 = substr($ptprodname[0],66,22);
				$dtprodname0 = "$tprodname01<br>$tprodname02<br>$tprodname03<br>$tprodname04<br>";
			}elseif($lenpn0<=110){
				$br0 = "<br><br><br><br><br>";
				$tprodname01 = substr($ptprodname[0],0,22);  $tprodname02 = substr($ptprodname[0],22,22); $tprodname03 = substr($ptprodname[0],44,22);
				$tprodname04 = substr($ptprodname[0],66,22); $tprodname05 = substr($ptprodname[0],88,22);
				$dtprodname0 = "$tprodname01<br>$tprodname02<br>$tprodname03<br>$tprodname04<br>$tprodname05<br>";
			}
			#validasi panjang karakter prod code
			$lenpc0 = strlen($ptprodcode[0]); #Array Prod Code [0]
			if($lenpc0<=15){
				$brpc0 = $br0; 
				$tprodcode01 = substr($ptprodcode[0],0,15); 
				$dtprodcode0 = "$tprodcode01";
			}else{
				$tprodcode01 = substr($ptprodcode[0],0,15); $tprodcode02 = substr($ptprodcode[0],15,15); 
				$dtprodcode0 = "$tprodcode01<br>$tprodcode02";
				if($lenpn0<=22){
					$brpc0 = "";
				}elseif($lenpn0<=44){
					$brpc0 = "<br>";
				}elseif($lenpn0<=66){
					$brpc0 = "<br><br>";
				}elseif($lenpn0<=88){
					$brpc0 = "<br><br><br>";
				}elseif($lenpn0<=110){
					$brpc0 = "<br><br><br><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<=22){
				$br1 = "<br>";
				$tprodname11 = substr($ptprodname[1],0,22);
				$dtprodname1 = "$tprodname11<br>";
			}elseif($lenpn1<=44){
				$br1 = "<br><br>";
				$tprodname11 = substr($ptprodname[1],0,22);  $tprodname12 = substr($ptprodname[1],22,22); 
				$dtprodname1 = "$tprodname11<br>$tprodname12<br>";
			}elseif($lenpn1<=66){
				$br1 = "<br><br><br>";
				$tprodname11 = substr($ptprodname[1],0,22);  $tprodname12 = substr($ptprodname[1],22,22); $tprodname13 = substr($ptprodname[1],44,22);
				$dtprodname1 = "$tprodname11<br>$tprodname12<br>$tprodname13<br>";
			}elseif($lenpn1<=88){
				$br1 = "<br><br><br><br>";
				$tprodname11 = substr($ptprodname[1],0,22);  $tprodname12 = substr($ptprodname[1],22,22); $tprodname13 = substr($ptprodname[1],44,22);
				$tprodname14 = substr($ptprodname[1],66,22);
				$dtprodname1 = "$tprodname11<br>$tprodname12<br>$tprodname13<br>$tprodname14<br>";
			}elseif($lenpn1<=110){
				$br1 = "<br><br><br><br><br>";
				$tprodname11 = substr($ptprodname[1],0,22);  $tprodname12 = substr($ptprodname[1],22,22); $tprodname13 = substr($ptprodname[1],44,22);
				$tprodname14 = substr($ptprodname[1],66,22); $tprodname15 = substr($ptprodname[1],88,22);
				$dtprodname1 = "$tprodname11<br>$tprodname12<br>$tprodname13<br>$tprodname14<br>$tprodname15<br>";
			}
			#validasi panjang karakter prod code
			$lenpc1 = strlen($ptprodcode[1]); #Array Prod Code [1]
			if($lenpc1<=15){
				$brpc1 = $br1; 
				$tprodcode11 = substr($ptprodcode[1],0,15); 
				$dtprodcode1 = "$tprodcode11";
			}else{
				$tprodcode11 = substr($ptprodcode[1],0,15); $tprodcode12 = substr($ptprodcode[1],15,15); 
				$dtprodcode1 = "$tprodcode11<br>$tprodcode12";
				if($lenpn1<=22){
					$brpc1 = "";
				}elseif($lenpn1<=44){
					$brpc1 = "<br>";
				}elseif($lenpn1<=66){
					$brpc1 = "<br><br>";
				}elseif($lenpn1<=88){
					$brpc1 = "<br><br><br>";
				}elseif($lenpn1<=110){
					$brpc1 = "<br><br><br><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<=22){
				$br2 = "<br>";
				$tprodname21 = substr($ptprodname[2],0,22);
				$dtprodname2 = "$tprodname21<br>";
			}elseif($lenpn2<=44){
				$br2 = "<br><br>";
				$tprodname21 = substr($ptprodname[2],0,22);  $tprodname22 = substr($ptprodname[2],22,22); 
				$dtprodname2 = "$tprodname21<br>$tprodname22<br>";
			}elseif($lenpn2<=66){
				$br2 = "<br><br><br>";
				$tprodname21 = substr($ptprodname[2],0,22);  $tprodname22 = substr($ptprodname[2],22,22); $tprodname23 = substr($ptprodname[2],44,22);
				$dtprodname2 = "$tprodname21<br>$tprodname22<br>$tprodname23<br>";
			}elseif($lenpn2<=88){
				$br2 = "<br><br><br><br>";
				$tprodname21 = substr($ptprodname[2],0,22);  $tprodname22 = substr($ptprodname[2],22,22); $tprodname23 = substr($ptprodname[2],44,22);
				$tprodname24 = substr($ptprodname[2],66,22);
				$dtprodname2 = "$tprodname21<br>$tprodname22<br>$tprodname23<br>$tprodname24<br>";
			}elseif($lenpn2<=110){
				$br2 = "<br><br><br><br><br>";
				$tprodname21 = substr($ptprodname[2],0,22);  $tprodname22 = substr($ptprodname[2],22,22); $tprodname23 = substr($ptprodname[2],44,22);
				$tprodname24 = substr($ptprodname[2],66,22); $tprodname25 = substr($ptprodname[2],88,22);
				$dtprodname2 = "$tprodname21<br>$tprodname22<br>$tprodname23<br>$tprodname24<br>$tprodname25<br>";
			}
			#validasi panjang karakter prod code
			$lenpc2 = strlen($ptprodcode[2]); #Array Prod Code [2]
			if($lenpc2<=15){
				$brpc2 = $br2; 
				$tprodcode21 = substr($ptprodcode[2],0,15); 
				$dtprodcode2 = "$tprodcode21";
			}else{
				$tprodcode21 = substr($ptprodcode[2],0,15); $tprodcode22 = substr($ptprodcode[2],15,15); 
				$dtprodcode2 = "$tprodcode21<br>$tprodcode22";
				if($lenpn2<=22){
					$brpc2 = "";
				}elseif($lenpn2<=44){
					$brpc2 = "<br>";
				}elseif($lenpn2<=66){
					$brpc2 = "<br><br>";
				}elseif($lenpn2<=88){
					$brpc2 = "<br><br><br>";
				}elseif($lenpn2<=110){
					$brpc2 = "<br><br><br><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<=22){
				$br3 = "<br>";
				$tprodname31 = substr($ptprodname[3],0,22);
				$dtprodname3 = "$tprodname31<br>";
			}elseif($lenpn3<=44){
				$br3 = "<br><br>";
				$tprodname31 = substr($ptprodname[3],0,22);  $tprodname32 = substr($ptprodname[3],22,22); 
				$dtprodname3 = "$tprodname31<br>$tprodname32<br>";
			}elseif($lenpn3<=66){
				$br3 = "<br><br><br>";
				$tprodname31 = substr($ptprodname[3],0,22);  $tprodname32 = substr($ptprodname[3],22,22); $tprodname33 = substr($ptprodname[3],44,22);
				$dtprodname3 = "$tprodname31<br>$tprodname32<br>$tprodname33<br>";
			}elseif($lenpn3<=88){
				$br3 = "<br><br><br><br>";
				$tprodname31 = substr($ptprodname[3],0,22);  $tprodname32 = substr($ptprodname[3],22,22); $tprodname33 = substr($ptprodname[3],44,22);
				$tprodname34 = substr($ptprodname[3],66,22);
				$dtprodname3 = "$tprodname31<br>$tprodname32<br>$tprodname33<br>$tprodname34<br>";
			}elseif($lenpn3<=110){
				$br3 = "<br><br><br><br><br>";
				$tprodname31 = substr($ptprodname[3],0,22);  $tprodname32 = substr($ptprodname[3],22,22); $tprodname33 = substr($ptprodname[3],44,22);
				$tprodname34 = substr($ptprodname[3],66,22); $tprodname35 = substr($ptprodname[3],88,22);
				$dtprodname3 = "$tprodname31<br>$tprodname32<br>$tprodname33<br>$tprodname34<br>$tprodname35<br>";
			}
			#validasi panjang karakter prod code
			$lenpc3 = strlen($ptprodcode[3]); #Array Prod Code [3]
			if($lenpc3<=15){
				$brpc3 = $br3; 
				$tprodcode31 = substr($ptprodcode[3],0,15); 
				$dtprodcode3 = "$tprodcode31";
			}else{
				$tprodcode31 = substr($ptprodcode[3],0,15); $tprodcode32 = substr($ptprodcode[3],15,15); 
				$dtprodcode3 = "$tprodcode31<br>$tprodcode32";
				if($lenpn3<=22){
					$brpc3 = "";
				}elseif($lenpn3<=44){
					$brpc3 = "<br>";
				}elseif($lenpn3<=66){
					$brpc3 = "<br><br>";
				}elseif($lenpn3<=88){
					$brpc3 = "<br><br><br>";
				}elseif($lenpn3<=110){
					$brpc3 = "<br><br><br><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<=22){
				$br4 = "<br>";
				$tprodname41 = substr($ptprodname[4],0,22);
				$dtprodname4 = "$tprodname41<br>";
			}elseif($lenpn4<=44){
				$br4 = "<br><br>";
				$tprodname41 = substr($ptprodname[4],0,22);  $tprodname42 = substr($ptprodname[4],22,22); 
				$dtprodname4 = "$tprodname41<br>$tprodname42<br>";
			}elseif($lenpn4<=66){
				$br4 = "<br><br><br>";
				$tprodname41 = substr($ptprodname[4],0,22);  $tprodname42 = substr($ptprodname[4],22,22); $tprodname43 = substr($ptprodname[4],44,22);
				$dtprodname4 = "$tprodname41<br>$tprodname42<br>$tprodname43<br>";
			}elseif($lenpn4<=88){
				$br4 = "<br><br><br><br>";
				$tprodname41 = substr($ptprodname[4],0,22);  $tprodname42 = substr($ptprodname[4],22,22); $tprodname43 = substr($ptprodname[4],44,22);
				$tprodname44 = substr($ptprodname[4],66,22);
				$dtprodname4 = "$tprodname41<br>$tprodname42<br>$tprodname43<br>$tprodname44<br>";
			}elseif($lenpn4<=110){
				$br4 = "<br><br><br><br><br>";
				$tprodname41 = substr($ptprodname[4],0,22);  $tprodname42 = substr($ptprodname[4],22,22); $tprodname43 = substr($ptprodname[4],44,22);
				$tprodname44 = substr($ptprodname[4],66,22); $tprodname45 = substr($ptprodname[4],88,22);
				$dtprodname4 = "$tprodname41<br>$tprodname42<br>$tprodname43<br>$tprodname44<br>$tprodname45<br>";
			}
			#validasi panjang karakter prod code
			$lenpc4 = strlen($ptprodcode[4]); #Array Prod Code [4]
			if($lenpc4<=15){
				$brpc4 = $br4; 
				$tprodcode41 = substr($ptprodcode[4],0,15); 
				$dtprodcode4 = "$tprodcode41";
			}else{
				$tprodcode41 = substr($ptprodcode[4],0,15); $tprodcode42 = substr($ptprodcode[4],15,15); 
				$dtprodcode4 = "$tprodcode41<br>$tprodcode42";
				if($lenpn4<=22){
					$brpc4 = "";
				}elseif($lenpn4<=44){
					$brpc4 = "<br>";
				}elseif($lenpn4<=66){
					$brpc4 = "<br><br>";
				}elseif($lenpn4<=88){
					$brpc4 = "<br><br><br>";
				}elseif($lenpn4<=110){
					$brpc4 = "<br><br><br><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<=22){
				$br5 = "<br>";
				$tprodname51 = substr($ptprodname[5],0,22);
				$dtprodname5 = "$tprodname51<br>";
			}elseif($lenpn5<=44){
				$br5 = "<br><br>";
				$tprodname51 = substr($ptprodname[5],0,22);  $tprodname52 = substr($ptprodname[5],22,22); 
				$dtprodname5 = "$tprodname51<br>$tprodname52<br>";
			}elseif($lenpn5<=66){
				$br5 = "<br><br><br>";
				$tprodname51 = substr($ptprodname[5],0,22);  $tprodname52 = substr($ptprodname[5],22,22); $tprodname53 = substr($ptprodname[5],44,22);
				$dtprodname5 = "$tprodname51<br>$tprodname52<br>$tprodname53<br>";
			}elseif($lenpn5<=88){
				$br5 = "<br><br><br><br>";
				$tprodname51 = substr($ptprodname[5],0,22);  $tprodname52 = substr($ptprodname[5],22,22); $tprodname53 = substr($ptprodname[5],44,22);
				$tprodname54 = substr($ptprodname[5],66,22);
				$dtprodname5 = "$tprodname51<br>$tprodname52<br>$tprodname53<br>$tprodname54<br>";
			}elseif($lenpn5<=110){
				$br5 = "<br><br><br><br><br>";
				$tprodname51 = substr($ptprodname[5],0,22);  $tprodname52 = substr($ptprodname[5],22,22); $tprodname53 = substr($ptprodname[5],44,22);
				$tprodname54 = substr($ptprodname[5],66,22); $tprodname55 = substr($ptprodname[5],88,22);
				$dtprodname5 = "$tprodname51<br>$tprodname52<br>$tprodname53<br>$tprodname54<br>$tprodname55<br>";
			}
			#validasi panjang karakter prod code
			$lenpc5 = strlen($ptprodcode[5]); #Array Prod Code [5]
			if($lenpc5<=15){
				$brpc5 = $br5; 
				$tprodcode51 = substr($ptprodcode[5],0,15); 
				$dtprodcode5 = "$tprodcode51";
			}else{
				$tprodcode51 = substr($ptprodcode[5],0,15); $tprodcode52 = substr($ptprodcode[5],15,15); 
				$dtprodcode5 = "$tprodcode51<br>$tprodcode52";
				if($lenpn5<=22){
					$brpc5 = "";
				}elseif($lenpn5<=44){
					$brpc5 = "<br>";
				}elseif($lenpn5<=66){
					$brpc5 = "<br><br>";
				}elseif($lenpn5<=88){
					$brpc5 = "<br><br><br>";
				}elseif($lenpn5<=110){
					$brpc5 = "<br><br><br><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<=22){
				$br6 = "<br>";
				$tprodname61 = substr($ptprodname[6],0,22);
				$dtprodname6 = "$tprodname61<br>";
			}elseif($lenpn6<=44){
				$br6 = "<br><br>";
				$tprodname61 = substr($ptprodname[6],0,22);  $tprodname62 = substr($ptprodname[6],22,22); 
				$dtprodname6 = "$tprodname61<br>$tprodname62<br>";
			}elseif($lenpn6<=66){
				$br6 = "<br><br><br>";
				$tprodname61 = substr($ptprodname[6],0,22);  $tprodname62 = substr($ptprodname[6],22,22); $tprodname63 = substr($ptprodname[6],44,22);
				$dtprodname6 = "$tprodname61<br>$tprodname62<br>$tprodname63<br>";
			}elseif($lenpn6<=88){
				$br6 = "<br><br><br><br>";
				$tprodname61 = substr($ptprodname[6],0,22);  $tprodname62 = substr($ptprodname[6],22,22); $tprodname63 = substr($ptprodname[6],44,22);
				$tprodname64 = substr($ptprodname[6],66,22);
				$dtprodname6 = "$tprodname61<br>$tprodname62<br>$tprodname63<br>$tprodname64<br>";
			}elseif($lenpn6<=110){
				$br6 = "<br><br><br><br><br>";
				$tprodname61 = substr($ptprodname[6],0,22);  $tprodname62 = substr($ptprodname[6],22,22); $tprodname63 = substr($ptprodname[6],44,22);
				$tprodname64 = substr($ptprodname[6],66,22); $tprodname65 = substr($ptprodname[6],88,22);
				$dtprodname6 = "$tprodname61<br>$tprodname62<br>$tprodname63<br>$tprodname64<br>$tprodname65<br>";
			}
			#validasi panjang karakter prod code
			$lenpc6 = strlen($ptprodcode[6]); #Array Prod Code [6]
			if($lenpc6<=15){
				$brpc6 = $br6; 
				$tprodcode61 = substr($ptprodcode[6],0,15); 
				$dtprodcode6 = "$tprodcode61";
			}else{
				$tprodcode61 = substr($ptprodcode[6],0,15); $tprodcode62 = substr($ptprodcode[6],15,15); 
				$dtprodcode6 = "$tprodcode61<br>$tprodcode62";
				if($lenpn6<=22){
					$brpc6 = "";
				}elseif($lenpn6<=44){
					$brpc6 = "<br>";
				}elseif($lenpn6<=66){
					$brpc6 = "<br><br>";
				}elseif($lenpn6<=88){
					$brpc6 = "<br><br><br>";
				}elseif($lenpn6<=110){
					$brpc6 = "<br><br><br><br>";
				}
			}
		}if($nums==8 || $nums==9 || $nums==10){
			#validasi panjang karakter prod name
			$lenpn7 = strlen($ptprodname[7]); #Array Prod Name [7]
			if($lenpn7<=22){
				$br7 = "<br>";
				$tprodname71 = substr($ptprodname[7],0,22);
				$dtprodname7 = "$tprodname71<br>";
			}elseif($lenpn7<=44){
				$br7 = "<br><br>";
				$tprodname71 = substr($ptprodname[7],0,22);  $tprodname72 = substr($ptprodname[7],22,22); 
				$dtprodname7 = "$tprodname71<br>$tprodname72<br>";
			}elseif($lenpn7<=66){
				$br7 = "<br><br><br>";
				$tprodname71 = substr($ptprodname[7],0,22);  $tprodname72 = substr($ptprodname[7],22,22); $tprodname73 = substr($ptprodname[7],44,22);
				$dtprodname7 = "$tprodname71<br>$tprodname72<br>$tprodname73<br>";
			}elseif($lenpn7<=88){
				$br7 = "<br><br><br><br>";
				$tprodname71 = substr($ptprodname[7],0,22);  $tprodname72 = substr($ptprodname[7],22,22); $tprodname73 = substr($ptprodname[7],44,22);
				$tprodname74 = substr($ptprodname[7],66,22);
				$dtprodname7 = "$tprodname71<br>$tprodname72<br>$tprodname73<br>$tprodname74<br>";
			}elseif($lenpn7<=110){
				$br7 = "<br><br><br><br><br>";
				$tprodname71 = substr($ptprodname[7],0,22);  $tprodname72 = substr($ptprodname[7],22,22); $tprodname73 = substr($ptprodname[7],44,22);
				$tprodname74 = substr($ptprodname[7],66,22); $tprodname75 = substr($ptprodname[7],88,22);
				$dtprodname7 = "$tprodname71<br>$tprodname72<br>$tprodname73<br>$tprodname74<br>$tprodname75<br>";
			}
			#validasi panjang karakter prod code
			$lenpc7 = strlen($ptprodcode[7]); #Array Prod Code [7]
			if($lenpc7<=15){
				$brpc7 = $br7; 
				$tprodcode71 = substr($ptprodcode[7],0,15); 
				$dtprodcode7 = "$tprodcode71";
			}else{
				$tprodcode71 = substr($ptprodcode[7],0,15); $tprodcode72 = substr($ptprodcode[7],15,15); 
				$dtprodcode7 = "$tprodcode71<br>$tprodcode72";
				if($lenpn7<=22){
					$brpc7 = "";
				}elseif($lenpn7<=44){
					$brpc7 = "<br>";
				}elseif($lenpn7<=66){
					$brpc7 = "<br><br>";
				}elseif($lenpn7<=88){
					$brpc7 = "<br><br><br>";
				}elseif($lenpn7<=110){
					$brpc7 = "<br><br><br><br>";
				}
			}
		}if($nums==9 || $nums==10){
			#validasi panjang karakter prod name
			$lenpn8 = strlen($ptprodname[8]); #Array Prod Name [8]
			if($lenpn8<=22){
				$br8 = "<br>";
				$tprodname81 = substr($ptprodname[8],0,22);
				$dtprodname8 = "$tprodname81<br>";
			}elseif($lenpn8<=44){
				$br8 = "<br><br>";
				$tprodname81 = substr($ptprodname[8],0,22);  $tprodname82 = substr($ptprodname[8],22,22); 
				$dtprodname8 = "$tprodname81<br>$tprodname82<br>";
			}elseif($lenpn8<=66){
				$br8 = "<br><br><br>";
				$tprodname81 = substr($ptprodname[8],0,22);  $tprodname82 = substr($ptprodname[8],22,22); $tprodname83 = substr($ptprodname[8],44,22);
				$dtprodname8 = "$tprodname81<br>$tprodname82<br>$tprodname83<br>";
			}elseif($lenpn8<=88){
				$br8 = "<br><br><br><br>";
				$tprodname81 = substr($ptprodname[8],0,22);  $tprodname82 = substr($ptprodname[8],22,22); $tprodname83 = substr($ptprodname[8],44,22);
				$tprodname84 = substr($ptprodname[8],66,22);
				$dtprodname8 = "$tprodname81<br>$tprodname82<br>$tprodname83<br>$tprodname84<br>";
			}elseif($lenpn8<=110){
				$br8 = "<br><br><br><br><br>";
				$tprodname81 = substr($ptprodname[8],0,22);  $tprodname82 = substr($ptprodname[8],22,22); $tprodname83 = substr($ptprodname[8],44,22);
				$tprodname84 = substr($ptprodname[8],66,22); $tprodname85 = substr($ptprodname[8],88,22);
				$dtprodname8 = "$tprodname81<br>$tprodname82<br>$tprodname83<br>$tprodname84<br>$tprodname85<br>";
			}
			#validasi panjang karakter prod code
			$lenpc8 = strlen($ptprodcode[8]); #Array Prod Code [8]
			if($lenpc8<=15){
				$brpc8 = $br8; 
				$tprodcode81 = substr($ptprodcode[8],0,15); 
				$dtprodcode8 = "$tprodcode81";
			}else{
				$tprodcode81 = substr($ptprodcode[8],0,15); $tprodcode82 = substr($ptprodcode[8],15,15); 
				$dtprodcode8 = "$tprodcode81<br>$tprodcode82";
				if($lenpn8<=22){
					$brpc8 = "";
				}elseif($lenpn8<=44){
					$brpc8 = "<br>";
				}elseif($lenpn8<=66){
					$brpc8 = "<br><br>";
				}elseif($lenpn8<=88){
					$brpc8 = "<br><br><br>";
				}elseif($lenpn8<=110){
					$brpc8 = "<br><br><br><br>";
				}
			}
		}if($nums==10){
			#validasi panjang karakter prod name
			$lenpn9 = strlen($ptprodname[9]); #Array Prod Name [9]
			if($lenpn9<=22){
				$br9 = "<br>";
				$tprodname91 = substr($ptprodname[9],0,22);
				$dtprodname9 = "$tprodname91<br>";
			}elseif($lenpn9<=44){
				$br9 = "<br><br>";
				$tprodname91 = substr($ptprodname[9],0,22);  $tprodname92 = substr($ptprodname[9],22,22); 
				$dtprodname9 = "$tprodname91<br>$tprodname92<br>";
			}elseif($lenpn9<=66){
				$br9 = "<br><br><br>";
				$tprodname91 = substr($ptprodname[9],0,22);  $tprodname92 = substr($ptprodname[9],22,22); $tprodname93 = substr($ptprodname[9],44,22);
				$dtprodname9 = "$tprodname91<br>$tprodname92<br>$tprodname93<br>";
			}elseif($lenpn9<=88){
				$br9 = "<br><br><br><br>";
				$tprodname91 = substr($ptprodname[9],0,22);  $tprodname92 = substr($ptprodname[9],22,22); $tprodname93 = substr($ptprodname[9],44,22);
				$tprodname94 = substr($ptprodname[9],66,22);
				$dtprodname9 = "$tprodname91<br>$tprodname92<br>$tprodname93<br>$tprodname94<br>";
			}elseif($lenpn9<=110){
				$br9 = "<br><br><br><br><br>";
				$tprodname91 = substr($ptprodname[9],0,22);  $tprodname92 = substr($ptprodname[9],22,22); $tprodname93 = substr($ptprodname[9],44,22);
				$tprodname94 = substr($ptprodname[9],66,22); $tprodname95 = substr($ptprodname[9],88,22);
				$dtprodname9 = "$tprodname91<br>$tprodname92<br>$tprodname93<br>$tprodname94<br>$tprodname95<br>";
			}
			#validasi panjang karakter prod code
			$lenpc9 = strlen($ptprodcode[9]); #Array Prod Code [9]
			if($lenpc9<=15){
				$brpc9 = $br9; 
				$tprodcode91 = substr($ptprodcode[9],0,15); 
				$dtprodcode9 = "$tprodcode91";
			}else{
				$tprodcode91 = substr($ptprodcode[9],0,15); $tprodcode92 = substr($ptprodcode[9],15,15); 
				$dtprodcode9 = "$tprodcode91<br>$tprodcode92";
				if($lenpn9<=22){
					$brpc9 = "";
				}elseif($lenpn9<=44){
					$brpc9 = "<br>";
				}elseif($lenpn9<=66){
					$brpc9 = "<br><br>";
				}elseif($lenpn9<=88){
					$brpc9 = "<br><br><br>";
				}elseif($lenpn9<=110){
					$brpc9 = "<br><br><br><br>";
				}
			}
		}					
	if($nums==0){
	?>
	<tr>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		<td align="right">&nbsp;</td>
		<td align="center">&nbsp;</td>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
	</tr>	
	<?php } elseif($nums==1){ ?>
	<tr>
		<td align="center"><?=$ptno[0];?></td>
		<td><?=$ptbuyerpo[0];?></td>
		<td>
			<?=$dtprodcode0;?>
		</td>
		<td><?=$dtprodname0;?></td>
		<td align="right"><?=$ptqty[0];?> <?=$ptsat[0];?></td>
		<td align="center"><?=number_format($ptbox[0],0,'','');?></td>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
	</tr>	
	<?php } elseif($nums==2){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><?=$br0;?>
			<?=$ptno[1];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><?=$br0;?>
			<?=$ptbuyerpo[1];?>
		</td>
		<td>
			<?=$dtprodcode0;?><?=$brpc0;?>
			<?=$dtprodcode1;?>
		</td>
		<td>
			<?=$dtprodname0;?>
			<?=$dtprodname1;?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><?=$br0;?>
			<?=$ptqty[1];?> <?=$ptsat[1];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><?=$br0;?>
			<?=number_format($ptbox[1],0,'','');?>
		</td>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
	</tr>	
	<?php } elseif($nums==3){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><?=$br0;?>
			<?=$ptno[1];?><?=$br1;?>
			<?=$ptno[2];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><?=$br0;?>
			<?=$ptbuyerpo[1];?><?=$br1;?>
			<?=$ptbuyerpo[2];?>
		</td>
		<td>
			<?=$dtprodcode0;?><?=$brpc0;?>
			<?=$dtprodcode1;?><?=$brpc1;?>
			<?=$dtprodcode2;?>
		</td>
		<td>
			<?=$dtprodname0;?>
			<?=$dtprodname1;?>
			<?=$dtprodname2;?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><?=$br0;?>
			<?=$ptqty[1];?> <?=$ptsat[1];?><?=$br1;?>
			<?=$ptqty[2];?> <?=$ptsat[2];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><?=$br0;?>
			<?=number_format($ptbox[1],0,'','');?><?=$br1;?>
			<?=number_format($ptbox[2],0,'','');?>
		</td>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
	</tr>	
	<?php } elseif($nums==4){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><?=$br0;?>
			<?=$ptno[1];?><?=$br1;?>
			<?=$ptno[2];?><?=$br2;?>
			<?=$ptno[3];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><?=$br0;?>
			<?=$ptbuyerpo[1];?><?=$br1;?>
			<?=$ptbuyerpo[2];?><?=$br2;?>
			<?=$ptbuyerpo[3];?>
		</td>
		<td>
			<?=$dtprodcode0;?><?=$brpc0;?>
			<?=$dtprodcode1;?><?=$brpc1;?>
			<?=$dtprodcode2;?><?=$brpc2;?>
			<?=$dtprodcode3;?>
		</td>
		<td>
			<?=$dtprodname0;?>
			<?=$dtprodname1;?>
			<?=$dtprodname2;?>
			<?=$dtprodname3;?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><?=$br0;?>
			<?=$ptqty[1];?> <?=$ptsat[1];?><?=$br1;?>
			<?=$ptqty[2];?> <?=$ptsat[2];?><?=$br2;?>
			<?=$ptqty[3];?> <?=$ptsat[3];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><?=$br0;?>
			<?=number_format($ptbox[1],0,'','');?><?=$br1;?>
			<?=number_format($ptbox[2],0,'','');?><?=$br2;?>
			<?=number_format($ptbox[3],0,'','');?>
		</td>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
	<?php } elseif($nums==5){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><?=$br0;?>
			<?=$ptno[1];?><?=$br1;?>
			<?=$ptno[2];?><?=$br2;?>
			<?=$ptno[3];?><?=$br3;?>
			<?=$ptno[4];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><?=$br0;?>
			<?=$ptbuyerpo[1];?><?=$br1;?>
			<?=$ptbuyerpo[2];?><?=$br2;?>
			<?=$ptbuyerpo[3];?><?=$br3;?>
			<?=$ptbuyerpo[4];?>
		</td>
		<td>
			<?=$dtprodcode0;?><?=$brpc0;?>
			<?=$dtprodcode1;?><?=$brpc1;?>
			<?=$dtprodcode2;?><?=$brpc2;?>
			<?=$dtprodcode3;?><?=$brpc3;?>
			<?=$dtprodcode4;?>
		</td>
		<td>
			<?=$dtprodname0;?>
			<?=$dtprodname1;?>
			<?=$dtprodname2;?>
			<?=$dtprodname3;?>
			<?=$dtprodname4;?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><?=$br0;?>
			<?=$ptqty[1];?> <?=$ptsat[1];?><?=$br1;?>
			<?=$ptqty[2];?> <?=$ptsat[2];?><?=$br2;?>
			<?=$ptqty[3];?> <?=$ptsat[3];?><?=$br3;?>
			<?=$ptqty[4];?> <?=$ptsat[4];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><?=$br0;?>
			<?=number_format($ptbox[1],0,'','');?><?=$br1;?>
			<?=number_format($ptbox[2],0,'','');?><?=$br2;?>
			<?=number_format($ptbox[3],0,'','');?><?=$br3;?>
			<?=number_format($ptbox[4],0,'','');?>
		</td>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
	</tr>	
	<?php } elseif($nums==6){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><?=$br0;?>
			<?=$ptno[1];?><?=$br1;?>
			<?=$ptno[2];?><?=$br2;?>
			<?=$ptno[3];?><?=$br3;?>
			<?=$ptno[4];?><?=$br4;?>
			<?=$ptno[5];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><?=$br0;?>
			<?=$ptbuyerpo[1];?><?=$br1;?>
			<?=$ptbuyerpo[2];?><?=$br2;?>
			<?=$ptbuyerpo[3];?><?=$br3;?>
			<?=$ptbuyerpo[4];?><?=$br4;?>
			<?=$ptbuyerpo[5];?>
		</td>
		<td>
			<?=$dtprodcode0;?><?=$brpc0;?>
			<?=$dtprodcode1;?><?=$brpc1;?>
			<?=$dtprodcode2;?><?=$brpc2;?>
			<?=$dtprodcode3;?><?=$brpc3;?>
			<?=$dtprodcode4;?><?=$brpc4;?>
			<?=$dtprodcode5;?>
		</td>
		<td>
			<?=$dtprodname0;?>
			<?=$dtprodname1;?>
			<?=$dtprodname2;?>
			<?=$dtprodname3;?>
			<?=$dtprodname4;?>
			<?=$dtprodname5;?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><?=$br0;?>
			<?=$ptqty[1];?> <?=$ptsat[1];?><?=$br1;?>
			<?=$ptqty[2];?> <?=$ptsat[2];?><?=$br2;?>
			<?=$ptqty[3];?> <?=$ptsat[3];?><?=$br3;?>
			<?=$ptqty[4];?> <?=$ptsat[4];?><?=$br4;?>
			<?=$ptqty[5];?> <?=$ptsat[5];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><?=$br0;?>
			<?=number_format($ptbox[1],0,'','');?><?=$br1;?>
			<?=number_format($ptbox[2],0,'','');?><?=$br2;?>
			<?=number_format($ptbox[3],0,'','');?><?=$br3;?>
			<?=number_format($ptbox[4],0,'','');?><?=$br4;?>
			<?=number_format($ptbox[5],0,'','');?>
		</td>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
	<?php } elseif($nums==7){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><?=$br0;?>
			<?=$ptno[1];?><?=$br1;?>
			<?=$ptno[2];?><?=$br2;?>
			<?=$ptno[3];?><?=$br3;?>
			<?=$ptno[4];?><?=$br4;?>
			<?=$ptno[5];?><?=$br5;?>
			<?=$ptno[6];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><?=$br0;?>
			<?=$ptbuyerpo[1];?><?=$br1;?>
			<?=$ptbuyerpo[2];?><?=$br2;?>
			<?=$ptbuyerpo[3];?><?=$br3;?>
			<?=$ptbuyerpo[4];?><?=$br4;?>
			<?=$ptbuyerpo[5];?><?=$br5;?>
			<?=$ptbuyerpo[6];?>
		</td>
		<td>
			<?=$dtprodcode0;?><?=$brpc0;?>
			<?=$dtprodcode1;?><?=$brpc1;?>
			<?=$dtprodcode2;?><?=$brpc2;?>
			<?=$dtprodcode3;?><?=$brpc3;?>
			<?=$dtprodcode4;?><?=$brpc4;?>
			<?=$dtprodcode5;?><?=$brpc5;?>
			<?=$dtprodcode6;?>
		</td>
		<td>
			<?=$dtprodname0;?>
			<?=$dtprodname1;?>
			<?=$dtprodname2;?>
			<?=$dtprodname3;?>
			<?=$dtprodname4;?>
			<?=$dtprodname5;?>
			<?=$dtprodname6;?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><?=$br0;?>
			<?=$ptqty[1];?> <?=$ptsat[1];?><?=$br1;?>
			<?=$ptqty[2];?> <?=$ptsat[2];?><?=$br2;?>
			<?=$ptqty[3];?> <?=$ptsat[3];?><?=$br3;?>
			<?=$ptqty[4];?> <?=$ptsat[4];?><?=$br4;?>
			<?=$ptqty[5];?> <?=$ptsat[5];?><?=$br5;?>
			<?=$ptqty[6];?> <?=$ptsat[6];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><?=$br0;?>
			<?=number_format($ptbox[1],0,'','');?><?=$br1;?>
			<?=number_format($ptbox[2],0,'','');?><?=$br2;?>
			<?=number_format($ptbox[3],0,'','');?><?=$br3;?>
			<?=number_format($ptbox[4],0,'','');?><?=$br4;?>
			<?=number_format($ptbox[5],0,'','');?><?=$br5;?>
			<?=number_format($ptbox[6],0,'','');?>
		</td>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
	<?php } elseif($nums==8){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><?=$br0;?>
			<?=$ptno[1];?><?=$br1;?>
			<?=$ptno[2];?><?=$br2;?>
			<?=$ptno[3];?><?=$br3;?>
			<?=$ptno[4];?><?=$br4;?>
			<?=$ptno[5];?><?=$br5;?>
			<?=$ptno[6];?><?=$br6;?>
			<?=$ptno[7];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><?=$br0;?>
			<?=$ptbuyerpo[1];?><?=$br1;?>
			<?=$ptbuyerpo[2];?><?=$br2;?>
			<?=$ptbuyerpo[3];?><?=$br3;?>
			<?=$ptbuyerpo[4];?><?=$br4;?>
			<?=$ptbuyerpo[5];?><?=$br5;?>
			<?=$ptbuyerpo[6];?><?=$br6;?>
			<?=$ptbuyerpo[7];?>
		</td>
		<td>
			<?=$dtprodcode0;?><?=$brpc0;?>
			<?=$dtprodcode1;?><?=$brpc1;?>
			<?=$dtprodcode2;?><?=$brpc2;?>
			<?=$dtprodcode3;?><?=$brpc3;?>
			<?=$dtprodcode4;?><?=$brpc4;?>
			<?=$dtprodcode5;?><?=$brpc5;?>
			<?=$dtprodcode6;?><?=$brpc6;?>
			<?=$dtprodcode7;?>
		</td>
		<td>
			<?=$dtprodname0;?>
			<?=$dtprodname1;?>
			<?=$dtprodname2;?>
			<?=$dtprodname3;?>
			<?=$dtprodname4;?>
			<?=$dtprodname5;?>
			<?=$dtprodname6;?>
			<?=$dtprodname7;?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><?=$br0;?>
			<?=$ptqty[1];?> <?=$ptsat[1];?><?=$br1;?>
			<?=$ptqty[2];?> <?=$ptsat[2];?><?=$br2;?>
			<?=$ptqty[3];?> <?=$ptsat[3];?><?=$br3;?>
			<?=$ptqty[4];?> <?=$ptsat[4];?><?=$br4;?>
			<?=$ptqty[5];?> <?=$ptsat[5];?><?=$br5;?>
			<?=$ptqty[6];?> <?=$ptsat[6];?><?=$br6;?>
			<?=$ptqty[7];?> <?=$ptsat[7];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><?=$br0;?>
			<?=number_format($ptbox[1],0,'','');?><?=$br1;?>
			<?=number_format($ptbox[2],0,'','');?><?=$br2;?>
			<?=number_format($ptbox[3],0,'','');?><?=$br3;?>
			<?=number_format($ptbox[4],0,'','');?><?=$br4;?>
			<?=number_format($ptbox[5],0,'','');?><?=$br5;?>
			<?=number_format($ptbox[6],0,'','');?><?=$br6;?>
			<?=number_format($ptbox[7],0,'','');?>
		</td>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
	<?php } elseif($nums==9){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><?=$br0;?>
			<?=$ptno[1];?><?=$br1;?>
			<?=$ptno[2];?><?=$br2;?>
			<?=$ptno[3];?><?=$br3;?>
			<?=$ptno[4];?><?=$br4;?>
			<?=$ptno[5];?><?=$br5;?>
			<?=$ptno[6];?><?=$br6;?>
			<?=$ptno[7];?><?=$br7;?>
			<?=$ptno[8];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><?=$br0;?>
			<?=$ptbuyerpo[1];?><?=$br1;?>
			<?=$ptbuyerpo[2];?><?=$br2;?>
			<?=$ptbuyerpo[3];?><?=$br3;?>
			<?=$ptbuyerpo[4];?><?=$br4;?>
			<?=$ptbuyerpo[5];?><?=$br5;?>
			<?=$ptbuyerpo[6];?><?=$br6;?>
			<?=$ptbuyerpo[7];?><?=$br7;?>
			<?=$ptbuyerpo[8];?>
		</td>
		<td>
			<?=$dtprodcode0;?><?=$brpc0;?>
			<?=$dtprodcode1;?><?=$brpc1;?>
			<?=$dtprodcode2;?><?=$brpc2;?>
			<?=$dtprodcode3;?><?=$brpc3;?>
			<?=$dtprodcode4;?><?=$brpc4;?>
			<?=$dtprodcode5;?><?=$brpc5;?>
			<?=$dtprodcode6;?><?=$brpc6;?>
			<?=$dtprodcode7;?><?=$brpc7;?>
			<?=$dtprodcode8;?>
		</td>
		<td>
			<?=$dtprodname0;?>
			<?=$dtprodname1;?>
			<?=$dtprodname2;?>
			<?=$dtprodname3;?>
			<?=$dtprodname4;?>
			<?=$dtprodname5;?>
			<?=$dtprodname6;?>
			<?=$dtprodname7;?>
			<?=$dtprodname8;?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><?=$br0;?>
			<?=$ptqty[1];?> <?=$ptsat[1];?><?=$br1;?>
			<?=$ptqty[2];?> <?=$ptsat[2];?><?=$br2;?>
			<?=$ptqty[3];?> <?=$ptsat[3];?><?=$br3;?>
			<?=$ptqty[4];?> <?=$ptsat[4];?><?=$br4;?>
			<?=$ptqty[5];?> <?=$ptsat[5];?><?=$br5;?>
			<?=$ptqty[6];?> <?=$ptsat[6];?><?=$br6;?>
			<?=$ptqty[7];?> <?=$ptsat[7];?><?=$br7;?>
			<?=$ptqty[8];?> <?=$ptsat[8];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><?=$br0;?>
			<?=number_format($ptbox[1],0,'','');?><?=$br1;?>
			<?=number_format($ptbox[2],0,'','');?><?=$br2;?>
			<?=number_format($ptbox[3],0,'','');?><?=$br3;?>
			<?=number_format($ptbox[4],0,'','');?><?=$br4;?>
			<?=number_format($ptbox[5],0,'','');?><?=$br5;?>
			<?=number_format($ptbox[6],0,'','');?><?=$br6;?>
			<?=number_format($ptbox[7],0,'','');?><?=$br7;?>
			<?=number_format($ptbox[8],0,'','');?>
		</td>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
	<?php } else { ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><?=$br0;?>
			<?=$ptno[1];?><?=$br1;?>
			<?=$ptno[2];?><?=$br2;?>
			<?=$ptno[3];?><?=$br3;?>
			<?=$ptno[4];?><?=$br4;?>
			<?=$ptno[5];?><?=$br5;?>
			<?=$ptno[6];?><?=$br6;?>
			<?=$ptno[7];?><?=$br7;?>
			<?=$ptno[8];?><?=$br8;?>
			<?=$ptno[9];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><?=$br0;?>
			<?=$ptbuyerpo[1];?><?=$br1;?>
			<?=$ptbuyerpo[2];?><?=$br2;?>
			<?=$ptbuyerpo[3];?><?=$br3;?>
			<?=$ptbuyerpo[4];?><?=$br4;?>
			<?=$ptbuyerpo[5];?><?=$br5;?>
			<?=$ptbuyerpo[6];?><?=$br6;?>
			<?=$ptbuyerpo[7];?><?=$br7;?>
			<?=$ptbuyerpo[8];?><?=$br8;?>
			<?=$ptbuyerpo[9];?>
		</td>
		<td>
			<?=$dtprodcode0;?><?=$brpc0;?>
			<?=$dtprodcode1;?><?=$brpc1;?>
			<?=$dtprodcode2;?><?=$brpc2;?>
			<?=$dtprodcode3;?><?=$brpc3;?>
			<?=$dtprodcode4;?><?=$brpc4;?>
			<?=$dtprodcode5;?><?=$brpc5;?>
			<?=$dtprodcode6;?><?=$brpc6;?>
			<?=$dtprodcode7;?><?=$brpc7;?>
			<?=$dtprodcode8;?><?=$brpc8;?>
			<?=$dtprodcode9;?>
		</td>
		<td>
			<?=$dtprodname0;?>
			<?=$dtprodname1;?>
			<?=$dtprodname2;?>
			<?=$dtprodname3;?>
			<?=$dtprodname4;?>
			<?=$dtprodname5;?>
			<?=$dtprodname6;?>
			<?=$dtprodname7;?>
			<?=$dtprodname8;?>
			<?=$dtprodname9;?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><?=$br0;?>
			<?=$ptqty[1];?> <?=$ptsat[1];?><?=$br1;?>
			<?=$ptqty[2];?> <?=$ptsat[2];?><?=$br2;?>
			<?=$ptqty[3];?> <?=$ptsat[3];?><?=$br3;?>
			<?=$ptqty[4];?> <?=$ptsat[4];?><?=$br4;?>
			<?=$ptqty[5];?> <?=$ptsat[5];?><?=$br5;?>
			<?=$ptqty[6];?> <?=$ptsat[6];?><?=$br6;?>
			<?=$ptqty[7];?> <?=$ptsat[7];?><?=$br7;?>
			<?=$ptqty[8];?> <?=$ptsat[8];?><?=$br8;?>
			<?=$ptqty[9];?> <?=$ptsat[9];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><?=$br0;?>
			<?=number_format($ptbox[1],0,'','');?><?=$br1;?>
			<?=number_format($ptbox[2],0,'','');?><?=$br2;?>
			<?=number_format($ptbox[3],0,'','');?><?=$br3;?>
			<?=number_format($ptbox[4],0,'','');?><?=$br4;?>
			<?=number_format($ptbox[5],0,'','');?><?=$br5;?>
			<?=number_format($ptbox[6],0,'','');?><?=$br6;?>
			<?=number_format($ptbox[7],0,'','');?><?=$br7;?>
			<?=number_format($ptbox[8],0,'','');?><?=$br8;?>
			<?=number_format($ptbox[9],0,'','');?>
		</td>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
	<?php } ?>
	<tr>
		<th colspan="4">TOTAL</th>
		<th><?=number_format($jqty,0,'','.');?></th>
		<th><?=number_format($jbox,0,'','.');?></th>
		<th>&nbsp;</th>
		<th>&nbsp;</th>
	</tr>
</table>
<br><br>
<div class="driver1">DRIVER</div>
<div class="driver2">&nbsp;</div>
<div class="receiver1">RECEIVER</div>
<div class="receiver2">&nbsp;</div>
<div class="sender1">SENDER</div>
<div class="sender2">&nbsp;</div>
<div class="catatan">Note :<?=$to['doch_desc'];?></div>
</body>
</html>
<?php  
	 #PDF
	 $filename="delivery_order_.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; } 
?> 