    <script>
    function get_item(id){
		$('.div_pc').hide();
		$('#div_pc_'+id).show();
		$('.link_pc').removeClass('bold');		
		$('#link_'+id).addClass('bold');
	}
    </script>
	<?php
	$sql_pc = "SELECT * FROM mst_partclass WHERE pt_autoid = 1 ORDER BY pc_name";
	$dcon_pc 	= $conn->query($sql_pc) or die($sql_pc);
	while($rspc 	= $dcon_pc->fetch_array()){
		$pc_autoid = $rspc['pc_autoid'];
	?>
	    <a class="btn btn-light btn-sm link_pc" href="javascript:void(0)" id="link_<?php echo $pc_autoid?>" 
        onclick="get_item('<?php echo $pc_autoid?>')"><?php echo $rspc['pc_name']?></a>
	<?php } ?>
    
	<div class="content_height">
    <?php
	$sql_pc = "SELECT * FROM mst_partclass WHERE pt_autoid = 1 ORDER BY pc_name";
	$dcon_pc 	= $conn->query($sql_pc) or die($sql_pc);
	while($rspc 	= $dcon_pc->fetch_array()){
		$pc_autoid = $rspc['pc_autoid'];
	?>
    <div id="div_pc_<?php echo $pc_autoid?>" class="div_pc">
    	<?php 
		$sql_pm = "SELECT * FROM mst_product WHERE pc_autoid = '$pc_autoid' ORDER BY pm_name";
		$dcon 	= $conn->query($sql_pm) or die($sql_pm);
		while($rs 	= $dcon->fetch_array()){
			$pm_autoid = $rs['pm_autoid'];
		?>	
		        
    	<a href="javascript:void()" onclick="add_item('<?php echo $pm_autoid?>','add')">
			<span style="display:inline-block;width:30%;height:80px;font-size:12px" class="mx-1 my-2 px-2 py-2 bg bg-dark text-light">
			   <?php echo $rs['pm_name']?><br>
                Stok : <?php echo $_stok_qty[$pm_autoid]?>
		    </span>	
        </a>
		<?php } ?>
    </div>   
    
 <?php } ?>
</div> <!-- end pc -->
