芝麻web文件管理V1.00
';
}
else
{
echo 'Danger! Employee Not Added. Try Again.
';
}
}
else
{
echo 'Danger! This Mobile Already Registred.
';
}
}
if(isset($_POST['edit']))
{
$edit_id = $_POST['edit_id'];
$name = mysqli_real_escape_string($cn,$_POST['name']);
$mobile = mysqli_real_escape_string($cn,$_POST['mobile']);
$email = mysqli_real_escape_string($cn,$_POST['email']);
$designation_id = $_POST['designation_id'];
$state_id = $_POST['state_id'];
$city_id = $_POST['city_id'];
$dob = date('Y-m-d',strtotime($_POST['dob']));
$doj = date('Y-m-d',strtotime($_POST['doj']));
$password = encryptIt($_POST['password']);
$salary = $_POST['salary'];
$address = mysqli_real_escape_string($cn,$_POST['address']);
$sqlSubject = mysqli_query($cn, "update `tbl_employee` set `name`='$name', `mobile`='$mobile', `email`='$email', `designation_id`='$designation_id', `address`='$address', `dob`='$dob', `doj`='$doj', `state_id`='$state_id', `city_id`='$city_id', `password`='$password', `salary`='$salary' where `id`='".$edit_id."'");
if ($sqlSubject){
echo 'Success! Employee Update Successfully.
';
}
else
{
echo 'Danger! Employee Not Added. Try Again.
';
}
}
if(isset($_GET['edit_id']))
{
$id = $_GET['edit_id'];
$sql = mysqli_query($cn, "select * from `tbl_employee` where id='$id'");
$sqlData = mysqli_fetch_array ($sql);
}
if(isset($_GET['delete_id']))
{
$id = $_GET['delete_id'];
$sql = mysqli_query($cn, "update `tbl_employee` SET `status`=0 where id='$id'");
}
?>