<?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>
<!--<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==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><?=$ptprodcode[0];?></td>
		<td><?=$ptprodname[0];?></td>
		<td align="right"><?=$ptqty[0];?> <?=$ptsat[0];?></td>
		<td align="center"><?=number_format($ptbox[0],0,'','');?></td>
		<td align="center"><?=number_format($ptpallet[0],0,'','');?></td>
		<td>&nbsp;</td>
	</tr>	
	<?php } elseif($nums==2){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br>
			<?=$ptno[1];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br>
			<?=$ptbuyerpo[1];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br>
			<?=$ptprodcode[1];?>
		</td>
		<td>
			<?=$ptprodname[0];?><br>
			<?=$ptprodname[1];?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><br>
			<?=$ptqty[1];?> <?=$ptsat[1];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><br>
			<?=number_format($ptbox[1],0,'','');?>
		</td>
		<td align="center">
			<?=number_format($ptpallet[0],0,'','');?><br>
			<?=number_format($ptpallet[1],0,'','');?>
		</td>
		<td>&nbsp;</td>
	</tr>	
	<?php } elseif($nums==3){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br>
			<?=$ptno[1];?><br>
			<?=$ptno[2];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br>
			<?=$ptbuyerpo[1];?><br>
			<?=$ptbuyerpo[2];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br>
			<?=$ptprodcode[1];?><br>
			<?=$ptprodcode[2];?>
		</td>
		<td>
			<?=$ptprodname[0];?><br>
			<?=$ptprodname[1];?><br>
			<?=$ptprodname[2];?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><br>
			<?=$ptqty[1];?> <?=$ptsat[1];?><br>
			<?=$ptqty[2];?> <?=$ptsat[2];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><br>
			<?=number_format($ptbox[1],0,'','');?><br>
			<?=number_format($ptbox[2],0,'','');?>
		</td>
		<td align="center">
			<?=number_format($ptpallet[0],0,'','');?><br>
			<?=number_format($ptpallet[1],0,'','');?><br>
			<?=number_format($ptpallet[2],0,'','');?>
		</td>
		<td>&nbsp;</td>
	</tr>	
	<?php } elseif($nums==4){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br>
			<?=$ptno[1];?><br>
			<?=$ptno[2];?><br>
			<?=$ptno[3];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br>
			<?=$ptbuyerpo[1];?><br>
			<?=$ptbuyerpo[2];?><br>
			<?=$ptbuyerpo[3];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br>
			<?=$ptprodcode[1];?><br>
			<?=$ptprodcode[2];?><br>
			<?=$ptprodcode[3];?>
		</td>
		<td>
			<?=$ptprodname[0];?><br>
			<?=$ptprodname[1];?><br>
			<?=$ptprodname[2];?><br>
			<?=$ptprodname[3];?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><br>
			<?=$ptqty[1];?> <?=$ptsat[1];?><br>
			<?=$ptqty[2];?> <?=$ptsat[2];?><br>
			<?=$ptqty[3];?> <?=$ptsat[3];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><br>
			<?=number_format($ptbox[1],0,'','');?><br>
			<?=number_format($ptbox[2],0,'','');?><br>
			<?=number_format($ptbox[3],0,'','');?>
		</td>
		<td align="center">
			<?=number_format($ptpallet[0],0,'','');?><br>
			<?=number_format($ptpallet[1],0,'','');?><br>
			<?=number_format($ptpallet[2],0,'','');?><br>
			<?=number_format($ptpallet[3],0,'','');?>
		</td>
		<td>&nbsp;</td>
	</tr>	
	<?php } elseif($nums==5){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br>
			<?=$ptno[1];?><br>
			<?=$ptno[2];?><br>
			<?=$ptno[3];?><br>
			<?=$ptno[4];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br>
			<?=$ptbuyerpo[1];?><br>
			<?=$ptbuyerpo[2];?><br>
			<?=$ptbuyerpo[3];?><br>
			<?=$ptbuyerpo[4];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br>
			<?=$ptprodcode[1];?><br>
			<?=$ptprodcode[2];?><br>
			<?=$ptprodcode[3];?><br>
			<?=$ptprodcode[4];?>
		</td>
		<td>
			<?=$ptprodname[0];?><br>
			<?=$ptprodname[1];?><br>
			<?=$ptprodname[2];?><br>
			<?=$ptprodname[3];?><br>
			<?=$ptprodname[4];?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><br>
			<?=$ptqty[1];?> <?=$ptsat[1];?><br>
			<?=$ptqty[2];?> <?=$ptsat[2];?><br>
			<?=$ptqty[3];?> <?=$ptsat[3];?><br>
			<?=$ptqty[4];?> <?=$ptsat[4];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><br>
			<?=number_format($ptbox[1],0,'','');?><br>
			<?=number_format($ptbox[2],0,'','');?><br>
			<?=number_format($ptbox[3],0,'','');?><br>
			<?=number_format($ptbox[4],0,'','');?>
		</td>
		<td align="center">
			<?=number_format($ptpallet[0],0,'','');?><br>
			<?=number_format($ptpallet[1],0,'','');?><br>
			<?=number_format($ptpallet[2],0,'','');?><br>
			<?=number_format($ptpallet[3],0,'','');?><br>
			<?=number_format($ptpallet[4],0,'','');?>
		</td>
		<td>&nbsp;</td>
	</tr>	
	<?php } elseif($nums==6){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br>
			<?=$ptno[1];?><br>
			<?=$ptno[2];?><br>
			<?=$ptno[3];?><br>
			<?=$ptno[4];?><br>
			<?=$ptno[5];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br>
			<?=$ptbuyerpo[1];?><br>
			<?=$ptbuyerpo[2];?><br>
			<?=$ptbuyerpo[3];?><br>
			<?=$ptbuyerpo[4];?><br>
			<?=$ptbuyerpo[5];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br>
			<?=$ptprodcode[1];?><br>
			<?=$ptprodcode[2];?><br>
			<?=$ptprodcode[3];?><br>
			<?=$ptprodcode[4];?><br>
			<?=$ptprodcode[5];?>
		</td>
		<td>
			<?=$ptprodname[0];?><br>
			<?=$ptprodname[1];?><br>
			<?=$ptprodname[2];?><br>
			<?=$ptprodname[3];?><br>
			<?=$ptprodname[4];?><br>
			<?=$ptprodname[5];?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><br>
			<?=$ptqty[1];?> <?=$ptsat[1];?><br>
			<?=$ptqty[2];?> <?=$ptsat[2];?><br>
			<?=$ptqty[3];?> <?=$ptsat[3];?><br>
			<?=$ptqty[4];?> <?=$ptsat[4];?><br>
			<?=$ptqty[5];?> <?=$ptsat[5];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><br>
			<?=number_format($ptbox[1],0,'','');?><br>
			<?=number_format($ptbox[2],0,'','');?><br>
			<?=number_format($ptbox[3],0,'','');?><br>
			<?=number_format($ptbox[4],0,'','');?><br>
			<?=number_format($ptbox[5],0,'','');?>
		</td>
		<td align="center">
			<?=number_format($ptpallet[0],0,'','');?><br>
			<?=number_format($ptpallet[1],0,'','');?><br>
			<?=number_format($ptpallet[2],0,'','');?><br>
			<?=number_format($ptpallet[3],0,'','');?><br>
			<?=number_format($ptpallet[4],0,'','');?><br>
			<?=number_format($ptpallet[5],0,'','');?>
		</td>
		<td>&nbsp;</td>
	</tr>
	<?php } elseif($nums==7){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br>
			<?=$ptno[1];?><br>
			<?=$ptno[2];?><br>
			<?=$ptno[3];?><br>
			<?=$ptno[4];?><br>
			<?=$ptno[5];?><br>
			<?=$ptno[6];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br>
			<?=$ptbuyerpo[1];?><br>
			<?=$ptbuyerpo[2];?><br>
			<?=$ptbuyerpo[3];?><br>
			<?=$ptbuyerpo[4];?><br>
			<?=$ptbuyerpo[5];?><br>
			<?=$ptbuyerpo[6];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br>
			<?=$ptprodcode[1];?><br>
			<?=$ptprodcode[2];?><br>
			<?=$ptprodcode[3];?><br>
			<?=$ptprodcode[4];?><br>
			<?=$ptprodcode[5];?><br>
			<?=$ptprodcode[6];?>
		</td>
		<td>
			<?=$ptprodname[0];?><br>
			<?=$ptprodname[1];?><br>
			<?=$ptprodname[2];?><br>
			<?=$ptprodname[3];?><br>
			<?=$ptprodname[4];?><br>
			<?=$ptprodname[5];?><br>
			<?=$ptprodname[6];?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><br>
			<?=$ptqty[1];?> <?=$ptsat[1];?><br>
			<?=$ptqty[2];?> <?=$ptsat[2];?><br>
			<?=$ptqty[3];?> <?=$ptsat[3];?><br>
			<?=$ptqty[4];?> <?=$ptsat[4];?><br>
			<?=$ptqty[5];?> <?=$ptsat[5];?><br>
			<?=$ptqty[6];?> <?=$ptsat[6];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><br>
			<?=number_format($ptbox[1],0,'','');?><br>
			<?=number_format($ptbox[2],0,'','');?><br>
			<?=number_format($ptbox[3],0,'','');?><br>
			<?=number_format($ptbox[4],0,'','');?><br>
			<?=number_format($ptbox[5],0,'','');?><br>
			<?=number_format($ptbox[6],0,'','');?>
		</td>
		<td align="center">
			<?=number_format($ptpallet[0],0,'','');?><br>
			<?=number_format($ptpallet[1],0,'','');?><br>
			<?=number_format($ptpallet[2],0,'','');?><br>
			<?=number_format($ptpallet[3],0,'','');?><br>
			<?=number_format($ptpallet[4],0,'','');?><br>
			<?=number_format($ptpallet[5],0,'','');?><br>
			<?=number_format($ptpallet[6],0,'','');?>
		</td>
		<td>&nbsp;</td>
	</tr>
	<?php } elseif($nums==8){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br>
			<?=$ptno[1];?><br>
			<?=$ptno[2];?><br>
			<?=$ptno[3];?><br>
			<?=$ptno[4];?><br>
			<?=$ptno[5];?><br>
			<?=$ptno[6];?><br>
			<?=$ptno[7];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br>
			<?=$ptbuyerpo[1];?><br>
			<?=$ptbuyerpo[2];?><br>
			<?=$ptbuyerpo[3];?><br>
			<?=$ptbuyerpo[4];?><br>
			<?=$ptbuyerpo[5];?><br>
			<?=$ptbuyerpo[6];?><br>
			<?=$ptbuyerpo[7];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br>
			<?=$ptprodcode[1];?><br>
			<?=$ptprodcode[2];?><br>
			<?=$ptprodcode[3];?><br>
			<?=$ptprodcode[4];?><br>
			<?=$ptprodcode[5];?><br>
			<?=$ptprodcode[6];?><br>
			<?=$ptprodcode[7];?>
		</td>
		<td>
			<?=$ptprodname[0];?><br>
			<?=$ptprodname[1];?><br>
			<?=$ptprodname[2];?><br>
			<?=$ptprodname[3];?><br>
			<?=$ptprodname[4];?><br>
			<?=$ptprodname[5];?><br>
			<?=$ptprodname[6];?><br>
			<?=$ptprodname[7];?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><br>
			<?=$ptqty[1];?> <?=$ptsat[1];?><br>
			<?=$ptqty[2];?> <?=$ptsat[2];?><br>
			<?=$ptqty[3];?> <?=$ptsat[3];?><br>
			<?=$ptqty[4];?> <?=$ptsat[4];?><br>
			<?=$ptqty[5];?> <?=$ptsat[5];?><br>
			<?=$ptqty[6];?> <?=$ptsat[6];?><br>
			<?=$ptqty[7];?> <?=$ptsat[7];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><br>
			<?=number_format($ptbox[1],0,'','');?><br>
			<?=number_format($ptbox[2],0,'','');?><br>
			<?=number_format($ptbox[3],0,'','');?><br>
			<?=number_format($ptbox[4],0,'','');?><br>
			<?=number_format($ptbox[5],0,'','');?><br>
			<?=number_format($ptbox[6],0,'','');?><br>
			<?=number_format($ptbox[7],0,'','');?>
		</td>
		<td align="center">
			<?=number_format($ptpallet[0],0,'','');?><br>
			<?=number_format($ptpallet[1],0,'','');?><br>
			<?=number_format($ptpallet[2],0,'','');?><br>
			<?=number_format($ptpallet[3],0,'','');?><br>
			<?=number_format($ptpallet[4],0,'','');?><br>
			<?=number_format($ptpallet[5],0,'','');?><br>
			<?=number_format($ptpallet[6],0,'','');?><br>
			<?=number_format($ptpallet[7],0,'','');?>
		</td>
		<td>&nbsp;</td>
	</tr>
	<?php } elseif($nums==9){ ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br>
			<?=$ptno[1];?><br>
			<?=$ptno[2];?><br>
			<?=$ptno[3];?><br>
			<?=$ptno[4];?><br>
			<?=$ptno[5];?><br>
			<?=$ptno[6];?><br>
			<?=$ptno[7];?><br>
			<?=$ptno[8];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br>
			<?=$ptbuyerpo[1];?><br>
			<?=$ptbuyerpo[2];?><br>
			<?=$ptbuyerpo[3];?><br>
			<?=$ptbuyerpo[4];?><br>
			<?=$ptbuyerpo[5];?><br>
			<?=$ptbuyerpo[6];?><br>
			<?=$ptbuyerpo[7];?><br>
			<?=$ptbuyerpo[8];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br>
			<?=$ptprodcode[1];?><br>
			<?=$ptprodcode[2];?><br>
			<?=$ptprodcode[3];?><br>
			<?=$ptprodcode[4];?><br>
			<?=$ptprodcode[5];?><br>
			<?=$ptprodcode[6];?><br>
			<?=$ptprodcode[7];?><br>
			<?=$ptprodcode[8];?>
		</td>
		<td>
			<?=$ptprodname[0];?><br>
			<?=$ptprodname[1];?><br>
			<?=$ptprodname[2];?><br>
			<?=$ptprodname[3];?><br>
			<?=$ptprodname[4];?><br>
			<?=$ptprodname[5];?><br>
			<?=$ptprodname[6];?><br>
			<?=$ptprodname[7];?><br>
			<?=$ptprodname[8];?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><br>
			<?=$ptqty[1];?> <?=$ptsat[1];?><br>
			<?=$ptqty[2];?> <?=$ptsat[2];?><br>
			<?=$ptqty[3];?> <?=$ptsat[3];?><br>
			<?=$ptqty[4];?> <?=$ptsat[4];?><br>
			<?=$ptqty[5];?> <?=$ptsat[5];?><br>
			<?=$ptqty[6];?> <?=$ptsat[6];?><br>
			<?=$ptqty[7];?> <?=$ptsat[7];?><br>
			<?=$ptqty[8];?> <?=$ptsat[8];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><br>
			<?=number_format($ptbox[1],0,'','');?><br>
			<?=number_format($ptbox[2],0,'','');?><br>
			<?=number_format($ptbox[3],0,'','');?><br>
			<?=number_format($ptbox[4],0,'','');?><br>
			<?=number_format($ptbox[5],0,'','');?><br>
			<?=number_format($ptbox[6],0,'','');?><br>
			<?=number_format($ptbox[7],0,'','');?><br>
			<?=number_format($ptbox[8],0,'','');?>
		</td>
		<td align="center">
			<?=number_format($ptpallet[0],0,'','');?><br>
			<?=number_format($ptpallet[1],0,'','');?><br>
			<?=number_format($ptpallet[2],0,'','');?><br>
			<?=number_format($ptpallet[3],0,'','');?><br>
			<?=number_format($ptpallet[4],0,'','');?><br>
			<?=number_format($ptpallet[5],0,'','');?><br>
			<?=number_format($ptpallet[6],0,'','');?><br>
			<?=number_format($ptpallet[7],0,'','');?><br>
			<?=number_format($ptpallet[8],0,'','');?>
		</td>
		<td>&nbsp;</td>
	</tr>
	<?php } else { ?>
	<tr>
		<td align="center">
			<?=$ptno[0];?><br>
			<?=$ptno[1];?><br>
			<?=$ptno[2];?><br>
			<?=$ptno[3];?><br>
			<?=$ptno[4];?><br>
			<?=$ptno[5];?><br>
			<?=$ptno[6];?><br>
			<?=$ptno[7];?><br>
			<?=$ptno[8];?><br>
			<?=$ptno[9];?>
		</td>
		<td>
			<?=$ptbuyerpo[0];?><br>
			<?=$ptbuyerpo[1];?><br>
			<?=$ptbuyerpo[2];?><br>
			<?=$ptbuyerpo[3];?><br>
			<?=$ptbuyerpo[4];?><br>
			<?=$ptbuyerpo[5];?><br>
			<?=$ptbuyerpo[6];?><br>
			<?=$ptbuyerpo[7];?><br>
			<?=$ptbuyerpo[8];?><br>
			<?=$ptbuyerpo[9];?>
		</td>
		<td>
			<?=$ptprodcode[0];?><br>
			<?=$ptprodcode[1];?><br>
			<?=$ptprodcode[2];?><br>
			<?=$ptprodcode[3];?><br>
			<?=$ptprodcode[4];?><br>
			<?=$ptprodcode[5];?><br>
			<?=$ptprodcode[6];?><br>
			<?=$ptprodcode[7];?><br>
			<?=$ptprodcode[8];?><br>
			<?=$ptprodcode[9];?>
		</td>
		<td>
			<?=$ptprodname[0];?><br>
			<?=$ptprodname[1];?><br>
			<?=$ptprodname[2];?><br>
			<?=$ptprodname[3];?><br>
			<?=$ptprodname[4];?><br>
			<?=$ptprodname[5];?><br>
			<?=$ptprodname[6];?><br>
			<?=$ptprodname[7];?><br>
			<?=$ptprodname[8];?><br>
			<?=$ptprodname[9];?>
		</td>
		<td align="right">
			<?=$ptqty[0];?> <?=$ptsat[0];?><br>
			<?=$ptqty[1];?> <?=$ptsat[1];?><br>
			<?=$ptqty[2];?> <?=$ptsat[2];?><br>
			<?=$ptqty[3];?> <?=$ptsat[3];?><br>
			<?=$ptqty[4];?> <?=$ptsat[4];?><br>
			<?=$ptqty[5];?> <?=$ptsat[5];?><br>
			<?=$ptqty[6];?> <?=$ptsat[6];?><br>
			<?=$ptqty[7];?> <?=$ptsat[7];?><br>
			<?=$ptqty[8];?> <?=$ptsat[8];?><br>
			<?=$ptqty[9];?> <?=$ptsat[9];?>
		</td>
		<td align="center">
			<?=number_format($ptbox[0],0,'','');?><br>
			<?=number_format($ptbox[1],0,'','');?><br>
			<?=number_format($ptbox[2],0,'','');?><br>
			<?=number_format($ptbox[3],0,'','');?><br>
			<?=number_format($ptbox[4],0,'','');?><br>
			<?=number_format($ptbox[5],0,'','');?><br>
			<?=number_format($ptbox[6],0,'','');?><br>
			<?=number_format($ptbox[7],0,'','');?><br>
			<?=number_format($ptbox[8],0,'','');?><br>
			<?=number_format($ptbox[9],0,'','');?>
		</td>
		<td align="center">
			<?=number_format($ptpallet[0],0,'','');?><br>
			<?=number_format($ptpallet[1],0,'','');?><br>
			<?=number_format($ptpallet[2],0,'','');?><br>
			<?=number_format($ptpallet[3],0,'','');?><br>
			<?=number_format($ptpallet[4],0,'','');?><br>
			<?=number_format($ptpallet[5],0,'','');?><br>
			<?=number_format($ptpallet[6],0,'','');?><br>
			<?=number_format($ptpallet[7],0,'','');?><br>
			<?=number_format($ptpallet[8],0,'','');?><br>
			<?=number_format($ptpallet[9],0,'','');?>
		</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><?=number_format($jpallet,0,'','.');?></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; } 
?> 