<?php require_once("config/configDB.php"); 
require "userPermission.php"; 

$id  =  $_GET['id'];

$sql = mysqli_query($conn,"SELECT * FROM purchase_product_master WHERE id='$id' ");
 
$row=mysqli_fetch_array($sql,MYSQLI_ASSOC);


$productcode   = $row['productcode'];
$productname   = $row['productname'];
$qty_type   = $row['qty_type'];
$purchase_rate   = $row['purchase_rate'];
$gst   = $row['gst'];

$description   = $row['prodct_description'];
$hsn=$row['hsn'];


?>
<!DOCTYPE html>
<html>
<head>
    <title>Product Master</title>
    <?php require 'header.php' ?>
     
</head>
<body>
    <?php require 'menu.php' ?>
    <div class="container-fluid text-center">
    <div class="row col-sm-12">
      <strong><h3>Purchase Product Master</h3></strong>
      </div>
    </div>
    <br><br>



<div class="container-fluid">
    <form class="form-horizontal" action="purchase_productMasterUpdate.php" method="post">
   
    <div class="form-group">
      <label class="control-label col-sm-3" for="email">Product Code</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="Enter Item Code" name="productcode" value='<?php echo $productcode; ?>' required readonly>
        <input type="hidden" value='<?php echo $id; ?>' name="edit_id">
      </div>
      
    </div>

    <div class="form-group">
      <label class="control-label col-sm-3" for="email">Product Name</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="Enter Product Name" name="productname" value='<?php echo $productname; ?>' required>
      </div>
    </div>


<div class="form-group">
	<label class="control-label col-sm-3">Qty Type</label>
        <div class="col-sm-5">
        <select type="text" class="form-control input-lg" name="qty_type">
		<option ><?php echo $qty_type;?></option>
		<option>KGS</option>
		<option>Unit</option>
		<option>TON</option>
         <option>NOS</option>
		</select>
        </div>
		</div>


    <div class="form-group">
      <label class="control-label col-sm-3" for="email">Rate</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="Enter Purchase Rate" name="purchase_rate" value='<?php echo $purchase_rate; ?>' required >
      </div>
    </div>
    <div class="form-group">
      <label class="control-label col-sm-3" for="email">GST%</label>
      <div class="col-sm-5">
        <input type="text" class="form-control"  name="gst" value='<?php echo $gst; ?>' required >
      </div>
    </div>
    
    <div class="form-group">
      <label class="control-label col-sm-3" for="email">HSN</label>
      <div class="col-sm-5">
        <input type="text" class="form-control"  name="hsn_code" required value='<?php echo $hsn; ?>'>
      </div>
    </div>
    
    <div class="form-group">
      <label class="control-label col-sm-3" for="email"> Description</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="Enter Item Description" name="description" value='<?php echo $description; ?>' >
      </div>
    </div>
	
	
	<div class="form-group">
      <label class="control-label col-sm-3" for="email"> &nbsp;</label>
      <div class="col-sm-5">
       <button type="submit" class="btn btn-default" id="btn">Submit</button>
      </div>
    </div>
	
	
    
  </form>   
</div>


    <?php require 'footer.php' ?>
</body>
</html>