-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete_employee.php
40 lines (37 loc) · 1009 Bytes
/
delete_employee.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php include ('session.php'); ?>
<!DOCTYPE html>
<html>
<head>
<title>Delete Employee</title>
<link rel="stylesheet" href="styling.css?v=<?php echo time(); ?>">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script type="text/javascript">
function goBack() {
window.history.back();
}
</script>
</head>
<body>
<?php include 'navigation.php'?>
<div class="response">
<?php
include 'dbconnection.php';
$emp_id = $_GET['emp_id'];
$query = "delete from employees where employee_ID=$emp_id";
if($result = $mysqli -> query($query)) {
echo 'Operation successful';
}
else {
echo 'An error occured';
}
//Close database connection
$mysqli->close();
?>
<br>
<div class="link">
<button onClick="goBack();">Go Back</button>
</div>
</div>
<?php include 'footer.php'; ?>
</body>
<div>