<?php 
session_start();
include('../includes/dbcon.php');

$str=" ";
$email_edit=" ";




$empname= mysqli_real_escape_string($con,trim($_POST['empname_edit']));
$emp_id= mysqli_real_escape_string($con,trim($_POST['emp_id_edit']));
$address= mysqli_real_escape_string($con,trim($_POST['Address1_edit']));
$telephone = mysqli_real_escape_string($con,trim($_POST['tel_edit']));
$email= mysqli_real_escape_string($con,trim($_POST['email_edit']));
//$city= mysqli_real_escape_string($con,trim($_POST['city_edit']));
$emptype= mysqli_real_escape_string($con,trim($_POST['e_edit']));


if (empty($empname)) {
    
    echo "<script type='text/javascript'>alert('Please Enter employee Name!');</script>";
	echo "<script>document.location='admin_emp.php'</script>"; 
}

else {

$ss="update employee_master set emp_name = '$empname',Address1='$address',mobile='$telephone' ,email='$email',e_id='$emptype'
	  where emp_id=$emp_id  ";
	  
//echo $ss;
//echo "ggg";
//echo $emptype;
if ( mysqli_query($con,"update employee_master set emp_name = '$empname',Address1='$address',mobile='$telephone' ,email='$email',e_id='$emptype'
	  where emp_id=$emp_id ")or die(mysqli_error($con)))
		{
			echo "<script>document.location='admin_emp.php'</script>"; 
		}		

}

?>