<!DOCTYPE HTML>
<?php 
include('config.php');

$pt_autoid = $_POST['pt_autoid'];
$pagename = "Listing Produk";

if($pt_autoid){ $q_kategori = " AND pt_autoid = '$pt_autoid'";}
?>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title><?php echo $pagename?></title>
    <?php include('../../common/script_css.php');?>

</head>
<body class="print_body">
<?php include('../../sys/navprint.php')?>

	<div>
    	<h5 class="bold">Listing Product</h5>
    </div>
    <table class="table" border="1" bordercolor="#CCCCCC" style="font-size:12px;">
    <thead>
    	<tr class="bold">
        	<td style="width:30px;">No</td>
            <td style="width:220px;">Product Name</td>
            <td class="tc" style="width:100px">Harga Beli</td>
            <td class="tc" style="width:60px">Satuan</td>
            <td style="width:120px">Kategori</td>
	</tr>
	</thead>

<?php
$i = 1;
  $sql = " SELECT * FROM mst_product WHERE active = 1 $q_kategori ORDER BY pm_name";
  $dcon = $conn->query($sql) or die($sql);
  while($rs = $dcon->fetch_assoc()){
		
	$id 		=  $rs['pm_autoid'];
	$pc_autoid 	=  $rs['pc_autoid'];
	
?> 
	<tr>
    	<td><?php echo $i?></td>
            <td><?php echo $rs['pm_name']?></td>
            <td class="tr"><?php echo number_format($rs['pm_bprice'])?></td>
            <td class="tc"><?php echo $rs['pm_ums']?></td>
            <td><?php echo $_pc_name[$pc_autoid]?></td>
	</tr>
<?php 
$i = $i + 1;
} ?>

</div>
</body>

</html>