<!DOCTYPE HTML>
<?php 
include('config.php');
$pageid = "product";
$pagename = "Product";
$navid 	= "masterdata";
$tabid 	= "2";

$penerbit = $_GET['penerbit'];
?>
<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>

<form id="iform">
    <div class="wrapper">
        <!-- Sidebar  -->
		<?php include('../../sys/sidenav.php');?>

        <!-- Page Content  -->
        <div id="content_wrapper" class="mt-0">
			<?php include('../../sys/top_menu.php')?>
            <div class="px-3">
				<div id="tabheader">
				<?php include('tabheader.php')?>
                </div>
                
			    <div class=" tl div_button py-2">
                <table class="table my-0 table-striped">
				<tr class="bold">
                	<td>Nama Item</td>
                    <td>Harga Beli</td>
					<td>Harga Jual</td>
                    
                </tr>
                <?php
				$i = 0;
				$sqln = "SELECT * FROM mst_product WHERE pt_autoid = 1 ORDER BY pc_autoid,pm_name";
				$sql_con = $conn->query($sqln) or die($sqln);
				while($rst = $sql_con->fetch_assoc()){	
				$pm_name = $rst['pm_name'];
					$pm_autoid = $rst['pm_autoid'];
					$pm_sprice = $rst['pm_sprice'];
					$pm_bprice = $rst['pm_bprice'];
				?>
                <tr>
                	<td><?php echo $rst['pm_name'];?>
                    <input type="hidden" name="pm_autoid<?php echo $i?>" value="<?php echo $pm_autoid?>">
                    </td>
                    <td><input type="text" class="input tr" name="pm_bprice<?php echo $i?>" value="<?php echo $pm_bprice?>"></td>
					<td><input type="text" class="input tr" name="pm_sprice<?php echo $i?>" value="<?php echo $pm_sprice?>"></td>
                    
                </tr>
                <?php 
				$i = $i +1;
				} ?>
                <tr>
                	<td colspan="3">
                    <input type="button" class="btn btn-primary" value="Update Harga" onclick="dosubmit('save_price')">
                    </td>
                </tr>
                </table>
                <input type="hidden" name="row" value="<?php echo $i?>">
                </div>

            </div>
	 
    	</div>

  
            </div>
        </div>
        
    </div><!-- end wrapper -->
</form>
</body>

</html>