    <div class="tl">
    	<input type="button" class="btn btn-success" onclick="addrow()" value="Tambah Produk"/>
    	<table id="tbl" class="tbl">
        <thead>
        <tr class="bold">
        	<td style="width:5%">No</td>
            <td>Judul Buku</td>
            <td class="tr" style="width:10%">Harga</td>
            <td class="tr" style="width:10%">Qty</td>
            <td class="tr" style="width:20%">Subtotal</td>
        </tr>
        </thead>
        <tbody>
        <?php
        $i = 1;
		$sqld = "SELECT * FROM detail_paket a, dl_product b  WHERE a.product_id = b.product_id 
				AND a.parent_id = '$autoid' ORDER BY b.product_id";
		$dcond = $conn->query($sqld) or die($sqld);
		while($rsd = $dcond->fetch_assoc()){
			$price = $rsd['hrg_3'];
			$qty = $rsd['dp_qty'];
			$subtotal = $price * $qty;
		?>
        	<tr>
            	<td><?php echo $i?></td>
            	<td>
                	<input type="text"onfocus="pm_auto_complete('<?php echo $i?>')"  class="input" id="pm_name<?php echo $i?>" 
                    value="<?php echo $rsd['product_name']?>" style="width:100%;" />
                    <input type="hidden" id="pm_autoid<?php echo $i?>" name="pm_autoid<?php echo $i?>" value="<?php echo $rsd['product_id'];?>" />
                </td>
            	<td class="tr">
                	<input type="text" class="input tr" id="pm_price<?php echo $i?>" name="pm_price<?php echo $i?>" 
	                value="<?php echo $rsd['hrg_3']?>" style="width:100%"/></td>
                <td class="tr">
                	<input type="text" class="input tr" id="pm_qty<?php echo $i?>"  
	                name="pm_qty<?php echo $i?>"value="<?php echo $rsd['dp_qty']?>"  style="width:100%" onkeyup="calc()"/></td>
                <td class="tr"><input type="text" class="input tr" id="pm_subtotal<?php echo $i?>" 
                name="pm_subtotal<?php echo $i?>" value="<?php echo $subtotal?>"  style="width:100%" onblur="addrow('<?php echo $i?>')" /></td>
            </tr>
         <?php $i = $i + 1;}?>
            </tbody>
            <tfoot>    
            <tr style="background-color:#FFFFCC" class="bold">
            	<td class="tr" colspan="4">TOTAL</td>
                <td class="tr"><span id="gtotal"><?php echo number_format($row['hrg_3'])?></span></td>
            </tr>
	        <tr>
        	<td colspan="5">
            <?php
        	    if($act==1){$save_label = "Simpan Paket";}
    	        if($act==2){$save_label = "Simpan Edit";}
				if($act==3){$save_label = "Hapus Paket";}
			?>
	            <input type="button" value="<?php echo $save_label?>" class="dl-button" onclick="chk_field('save')">
            	<input type="button" value="Kembali Ke Index" class="dl-button" onclick="window.location.href='index'">
                <input type="hidden" id="act" name="act" value="<?php echo $act?>">
            </td>
        </tr>
		</tfoot>
        </table>
        <input type="hidden" id="row" name="row" value="<?php echo $i?>" autocomplete="off"/>
    </div>