<style>
    body{
        font-size: 12px;
    }
</style>
<html>

<body>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
    <tr align="center">
        <td valign="top">

			<h2>PT CIPTA MEDIKA INDONESIA </h2>
		</td>
	</tr>
	<tr>
		<td valign="top" align="center">
		<center><span>Jl. Raya Setu Cipayung No. 32, RT. 005 RW. 04, Kel. Cilangkap - Kec. Cipayung Kota Jakarta Timur, Daerah Khusus Ibukota Jakarta 13870 Indonesia Tel. : (62-21) 8430046, &nbsp;&nbsp;&nbsp;
                    </span></center>
		</td>
	</tr>
	<tr>
		<td valign="top" align="center">
		<span>Email : cs2@ciptamedika.com Website : www.ciptamedika.com </span>
		</td>
	</tr>
	<tr>
            <td valign="middle" align="center" style="background-color:grey;color:white;border-top:2px double black;"><span style="font-size:16px">PURCHASE ORDER        </span></td>
     </tr>
<tr>
	<td valign="top"><table width="100%">
<tr>
    <td valign="top" style="width: 50%">
    <table width="100%" style="top: 0px" cellspacing="0">
	<tbody>
		<tr>
			<td width="20%" valign="top">To</td>
			<td style="border-top:1px solid black!important;border-left:1px solid black;border-right:1px solid black;border-bottom:0px;" width="80%" valign="top"><?php echo GetValue('title','sv_master_pabrik',array('id'=>'where/'.$lastq['pabrik'])) ?>
			</td>
		</tr>
		<tr>
			<td width="20%" valign="top">Add</td>
			<td style="border-top:0px;border-left:1px solid black;border-right:1px solid black;
                            border-bottom:1px solid black;" rowspan="3" width="80%" valign="top" rowspan="2"><?php echo GetValue('lokasi','sv_master_pabrik',array('id'=>'where/'.$lastq['pabrik'])) ?>
			</td>
		</tr>
                <tr>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                </tr>
	</tbody>
    </table><br>
	</td>
	<td valign="top" style="width: 50%">
	<table width="100%" height="" border="0px" cellspacing="0">
	<tbody>
		<tr>
			<td width="20%" valign="top" style="border-top:1px solid black;border-left:1px solid black;border-right:0px;border-bottom:0px;">PO No<br>
			</td>
			<td  width="80%" valign="top" style="border-top:1px solid black;border-left:0px;border-right:1px solid black;border-bottom:0px;">:<?php echo $lastq['kode_order'] ?>
			</td>
		</tr>
		<tr>
			<td width="20%" valign="top" style="border-top:0px;border-left:1px solid black;border-right:0px;border-bottom:0px;">Date<br>
			</td>
			<td  style="border-top:0px;border-left:0px;border-right:1px solid black;border-bottom:0px;" width="80%" valign="top">:<?php echo tglindo($lastq['po_date']) ?>
			</td>
		</tr>
		<tr>
			<td valign="top" style="border-top:0px;border-left:1px solid black;;border-right:0px;border-bottom:1px solid black;">Payment<br>
			</td>
                        <td valign="top" style="border-top:0px;border-left:0px;border-right:1px solid black;border-bottom:1px solid black;">:<?php echo tglindo($lastq['date_bp']) ?><br><br>
			</td>
		</tr>
		</tbody>
	</table>
	</td>
    </tr>
    </table>
    
    </td>
</tr>
<tr>
	<td style="border-top:5px double black;">&nbsp;
 
    </td>
</tr>
<tr>
<td><table width="100%" border="1" cellspacing="0" cellpadding="1">
  <tbody>
    <tr style="background-color: grey; color: #FFFFFF;border-color: black!important;">
      <td width="5%" align="center">No</td>
      <td width="14%" align="center">Code</td>
      <td width="23%" align="center">Description</td>
      <td width="11%" align="center">Price</td>
      <td width="21%" align="center">Packaging</td>
      <td width="9%" align="center">Qty</td>
      <td width="17%" align="center">Amount</td>
    </tr>
    <?php
    $isi=$this->db->query("SELECT * FROM sv_stok_pabrikasi_detail WHERE pabrikasi_id='".$lastq['id']."'")->result_array();
    $a=1;
    foreach($isi as $i){
    ?>
    <tr>
      <td align="center"><?php echo $a ?></td>
      <td align="center"><?php echo GetValue('part_number','master_produk',array('id'=>'where/'.$i['produk'])) ?></td>
      <td align="center"><?php echo GetValue('title','master_produk',array('id'=>'where/'.$i['produk'])) ?></td>
      <td align="center"><?php echo number_format(round($i['amount']/$i['total']))?></td>
      <td align="center"><?php echo GetValue('title','ref_satuan',array('id'=>'where/'.$i['satuan'])) ?></td>
      <td align="center"><?php echo $i['total'] ?></td>
      <td align="center"><?php echo number_format($i['amount']) ?></td>
    </tr>
    <?php $a++;}?>
    <tr>
      <td colspan="6">Total Amount</td>
      <td>&nbsp;</td>
    </tr>
  </tbody>
</table> 
</td>
</tr>
<tr>
	<td><br><br>
	</td>
</tr>
<tr>
	<td>
    	<table>
        	<tr>
            	<td>
                Sincerely Yours
                </td>
            </tr>
        	<tr>
            	<td>
                <br>
                <br>
                <br>
                <br>
                <br>
                </td>
            </tr>
        	<tr>
            	<td>
                Erna Lupita Sari
                </td>
            </tr>
        	<tr>
            	<td>
                Purchase Dept.
                </td>
            </tr>
        </table>
	</td>
</tr>
</tbody>
</table>

</body>
</html>