<?php 
require_once("config/configDB.php"); 
require "userPermission.php";
$edit_id  =  $_GET['id'];

$sql_InvoiceQuery   = mysqli_query($conn,"SELECT * FROM vehiclereg where id=".$edit_id." ");

$row=mysqli_fetch_array($sql_InvoiceQuery,MYSQLI_ASSOC);

$regcode  = $row['regcode'];
$regname  = $row['regname'];
$reg_address  = $row['reg_address'];

?>

<!DOCTYPE html>
<html>
<head>
  
  <?php 
    require 'meta.php';  
    require 'header.php'; 
  ?>

</head>
<body>
    <?php require 'menu.php' ?>
<div class="container-fluid">
<h2 class="text-center">Site Master Details</h2><br>
    <form class="form-horizontal" action="vehicleregMasterUpdate.php" method="post" id="siteMasterForm">
      
    <div class="form-group">        
        
        <label class="control-label col-sm-4">Reg Code</label>
        <div class="col-sm-4">
        <input type="text" class="form-control input-lg" placeholder="Enter site code" readonly name="regcode" value="<?php echo $regcode; ?>" autocomplete="off" required> 
        <input type="hidden" value="<?php echo $edit_id;?>" name="edit_id" >
        </div>
        
    </div>
    <div class="form-group">        
        
        <label class="control-label col-sm-4">Reg Person Name</label>
        <div class="col-sm-4">
        <input type="text" class="form-control input-lg" placeholder="Enter Person Name" name="regname" autocomplete="off" required value="<?php echo $regname;?>" >
        </div>
        
    </div>
    
    <div class="form-group" >        
        
        <label class="control-label col-sm-4">Reg Address</label>
        <div class="col-sm-4">
        <textarea class="form-control input-lg" placeholder="Enter Reg Address" name="reg_address" autocomplete="off" required ><?php echo $reg_address;?></textarea>
        </div>
        
    </div>

       <div class="form-group">        
      <div class="col-sm-12 text-center">
        <button type="submit" ame="myButton" class="btn btn-default btn-lg" id="btn">Save</button>
      </div>
    </div>
  </form>   
</div>


    <?php require 'footer.php' ?>
    <script type="text/javascript">var base_url = "<?= $base_url ?>";</script>
    
<script>

  var checkForm = function(form) {

    //
    // validate form fields
    //

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

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