<table class="table tl" onclick="$('#infosave').fadeOut()">
        <tr>
        	<td class="h4" colspan="2">
            <?php if($_GET['info']==1){?>
			<b class="text text-success">Data Saved !</b>
			<?php }?>
            </td>
            <td class="h4 tr" colspan="2"><?php echo $act_desc?></td>
        </tr>
        <tr>
        	<td>Category</td>
            <td colspan="3">
            	<select class="input w-80" name="pc_autoid" id="pc_autoid">
                <?php
                $sqlsc = "select * from mst_parttype a, mst_partclass b  
						WHERE a.pt_autoid = b.pt_autoid AND b.pc_autoid = 100  order by b.pc_name";
				$sc_con = $conn->query($sqlsc) or die($sqlsc);
				while($rsc = $sc_con->fetch_assoc()){
					if($rsx['pt_autoid']=="1"){$txt_class = 'color:#06F';}
					else{
						$txt_class = 'color:#666';
						}
				?>
                	<option style="<?php echo $txt_class?>" <?php if($pc_autoid==$rsc['pc_autoid']){echo "selected='selected'";}?> 
                    value="<?php echo $rsc['pc_autoid']?>"><?php echo $rsc['pc_name']?> | <?php echo $rsc['pt_code']?></option>
                <?php } ?>
                </select>
            </td>
        </tr>
    	<tr>
        	<td style="width:200px;">Nama Promo</td>
            <td colspan="3">
                        	<input type="hidden" id="pm_barcode" name="pm_barcode" class="input" placeholder="Barcode" value="<?php echo $row['pm_barcode']?>">
            	<input type="text" id="pm_name" name="pm_name" class="input w-80" placeholder="Product Name" value="<?php echo $row['pm_name']?>">
            </td>
        </tr>
      	<tr>
        	<td>Harga Regular</td>
            <td colspan="3">
            	<input type="text" id="pm_sprice" name="pm_sprice" class="input tr" placeholder="0" value="<?php echo $row['pm_sprice']?>">
            </td>
        </tr>  
      	<tr>
        	<td>Harga Gofood</td>
            <td colspan="3">
            	<input type="text" id="pm_sprice_app" name="pm_sprice_app" class="input tr" placeholder="0" value="<?php echo $row['pm_sprice_app']?>">
            </td>
        </tr>  
        <tr>
        	<td>Kategori Promo</td>
            <td>
			<select class="form-control" id="item_promo_1" name="item_promo_1">
            <option value="">Pilih Kategori Promo 1</option>
	        <?php
			$sqln = "select * from mst_partclass WHERE pt_autoid = 1 ORDER BY pc_name";
			$dcon_n 	= $conn->query($sqln) or die($sqln);
			while($rsn 	= $dcon_n->fetch_array()){
				$pc_autoid_1 = $rsn['pc_autoid'];
				$n_pm_name_1 = $rsn['pc_name'];
				?>
        	<option <?php if($pc_1==$pc_autoid_1){echo 'selected';}?> value="<?php echo $pc_autoid_1?>"><?php echo $n_pm_name_1?> </option>
            <?php } ?>
        </select> 
            
            </td>
            <td>
			<select class="form-control" id="item_promo_2" name="item_promo_2">
			<option value="">Pilih Kategori Promo 2</option>
	        <?php
			$sqln = "select * from mst_partclass WHERE pt_autoid = 1 ORDER BY pc_name";
			$dcon_n 	= $conn->query($sqln) or die($sqln);
			while($rsn 	= $dcon_n->fetch_array()){
				$pc_autoid_2 = $rsn['pc_autoid'];
				$n_pm_name_2 = $rsn['pc_name'];
				?>
        	<option <?php if($pc_2==$pc_autoid_2){echo 'selected';}?> value="<?php echo $pc_autoid_2?>"><?php echo $n_pm_name_2?> </option>
            <?php } ?>
        </select>
            </td>
        </tr>
        <tr>
        	<td>Status</td>
            <td colspan="3">
            	<select class="form-control w-25" id="pm_status" name="pm_status">
                <option <?php if($pm_status==1){echo 'selected';}?> value="1">Aktif</option>
                <option <?php if($pm_status==99){echo 'selected';}?> value="99">Non Aktif</option>
                </select>
            </td>
        </tr>
		<tr>
        	<td>Description</td>
            <td colspan="3">
            <textarea class="input" style="width:80%" name="pm_desc"><?php echo $row['pm_desc']?></textarea>
            </td>
        </tr>
    </table>
    
<table class="table tl">

        <tr>
        	<td style="width:200px;">Product Image 1</td>
            <td>
				<input type="file" name="img_file_1" id="img_file" class="input"/> 
                <i class="text text-danger">* W = 620px H =800px</i>
            </td>
            <td>
                	<img src="../../../<?php echo $img_1 ?>" style="height:50px;" />
            </td>
        </tr>
</table>

<div class="px-2">
            <?php
            if($act=="add"){$save_label = "Save Product";}
            if($act=="edit"){$save_label = "Save Edit";}
			if($act=="delete"){$save_label = "Delete Product";}
			?>
            <input type="button" value="<?php echo $save_label?>" class="btn btn-success btn-sm mr-3" onclick="confirm_save('save_promo')">
            <input type="button" value="Back To Index" class="btn btn-dark btn-sm" onclick="window.location.href='index_promo'">
			<input type="hidden" id="act" name="act" value="<?php echo $act?>">
		 	<input type="hidden" id="autoid" name="autoid" value="<?php echo $autoid?>">

</div>
  
