<?php 
include "config.php";
session_start();
$userid=$_SESSION['log'];
$code = $_POST['employeecodeedit'];
$name = $_POST['employeenameedit'];
$user = $_POST['useredit'];
$mobile = $_POST['mobileedit'];
$password = $_POST['passwordedit'];
$statuslive = $_POST['statusliveedit'];
$usertype = $_POST['employeetypeedit'.$code.''];

$sql = "update  employeedetails  set status='deleted' where employeecode = '$code' ";
echo $sql;
$inssql = "insert into employeedetails (employeecode,employeename,username,mobile,usertype,password,statuslive,editdate,edittime,editby,status) values('$code','$name','$user','$mobile','$usertype','$password','$statuslive',CURDATE(),CURTIME(),'$userid','updated')";
  $go = mysqli_query($connect,$sql);
$gosql = mysqli_query($connect,$inssql);
  header('Location:masteremployee.php');

?>
