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

$sql_InvoiceQuery   = mysqli_query($conn,"SELECT count(*) as code FROM product_master");
$rowInvoiceCount    = mysqli_fetch_array($sql_InvoiceQuery,MYSQLI_ASSOC);
$code_count      = $rowInvoiceCount['code']+1;

?>

<!DOCTYPE html>
<html>
<head>
    <title>Product Master</title>
    <?php require 'header.php' ?>


   <!--<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script>
$(function() {
    $("#btn").click(function() {
        $("button").attr("disabled", "disabled");
        setTimeout(function() {
            $("button").removeAttr("disabled");      
        }, 3000);
    });
});

</script>-->

</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="productMasterInsert.php" method="post" onSubmit="return checkForm(this);" name="myForm">
   
    <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" required value="MPR-<?php echo $code_count;?>" readonly>
      </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" required>
      </div>
    </div>
    
     <div class="form-group">
      <label class="control-label col-sm-3" for="email">Product Name Tamil</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="Enter Product Name" name="productname_tamil" required>
        <a href="https://www.google.com/inputtools/try/" target="_blank">Tamil Typing</a>
      </div>
    </div>
    
    <div class="form-group">
      <label class="control-label col-sm-3" for="email">Category</label>
      <div class="col-sm-5">
        <select type="text" class="form-control input-lg" name="category"  required>
		<option value="">--Select Category--</option>
        <option>Gold</option>
        <option>Silver</option>
        </select>
      </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" id="qty_type" required>
		<option value="">--Select Qty--</option>
        <option>GM</option>
        <option>NOS</option>
        <option>Box</option>
		<option>KGS</option>
		
		
        
		</select>
        </div>
		</div>
        
        <!--<div class="form-group">
	<label class="control-label col-sm-3">Product Type</label>
        <div class="col-sm-5">
        <select type="text" class="form-control input-lg" name="product_type" id="product_type" required>
		<option value="">--Select Type--</option>
        <option>Sales</option>
        <option>Purchase</option>
        <option>Both</option>
        
		</select>
        </div>
		</div>-->
    
<div class="form-group">
      <label class="control-label col-sm-3" for="email">GST%</label>
      <div class="col-sm-5">
        <input type="number" class="form-control" placeholder="Enter GST % " name="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" placeholder="Enter HSN " name="hsn_code" required>
      </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" >
      </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" name="myButton" class="btn btn-default" id="btn">Submit</button>
      </div>
    </div>
	
  </form>   
</div>


    <?php require 'footer.php' ?>
    <script>

  var checkForm = function(form) {

    //
    // validate form fields
    //

    form.myButton.disabled = true;
    return true;
  };

</script>
</body>
</html>