<?php 

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

$id  =  $_GET['id'];

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


$areacode   = $row['areacode'];
$areaname   = $row['areaname'];
$area_tamil   = $row['area_tamil'];



?>
<!DOCTYPE html>
<html>
<head>
    <title>Area 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>Edit Area Master</h3></strong>
      </div>
    </div>
    <br><br>



<div class="container-fluid">
    <form class="form-horizontal" action="areaMasterUpdate.php" method="post">
   
    <div class="form-group">
      <label class="control-label col-sm-3" for="email">Area Code</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="Enter Item Code" name="areacode" value='<?php echo $areacode; ?>' readonly>
        <input type="hidden" value='<?php echo $id; ?>' name="edit_id">
      </div>
      <label class="label-command col-sm-4" for="email">( Example : AR0001)</label>
    </div>

    <div class="form-group">
      <label class="control-label col-sm-3" for="email">Area Name</label>
      <div class="col-sm-5">
        <input type="text" class="form-control" placeholder="Enter Area Name" name="areaname" value='<?php echo $areaname; ?>' required>
      </div>
    </div>
    
    
    <div class="form-group">
      <label class="control-label col-sm-3" for="email">Tamil Name</label>
      <div class="col-sm-5">
        <input type="text" class="form-control tamil" placeholder="Enter Area Name" name="area_tamil" id="area_tamil" value='<?php echo $area_tamil; ?>' required>
       
        </select>
      </div>
    </div>
    
    

    
    
    
    <div class="form-group">        
      <div class="col-sm-offset-2 col-sm-10">
        <button type="submit" class="btn btn-default">Submit</button>
      </div>
    </div>
  </form>   
</div>


    <?php require 'footer.php' ?>
    
    <SCRIPT language=JavaScript src="js/utf.js"></SCRIPT>
		<SCRIPT language=JavaScript src="js/tamil.js"></SCRIPT>
		
		<script>
			$(document).ready(function(){
				$('#area_tamil').on('keydown',function(event){
					if(event.which==121){
						$(this).toggleClass('tamil');
						return false;
					}
					if($(this).hasClass('tamil')){
						toggleKBMode(event);
					}else{
						return true;
					}
				});
				$('#area_tamil').on('keypress',function(event){
					if($(this).hasClass('tamil')){
						convertThis(event);
					}
				});
			});
		</script>
</body>
</html>