-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupdatedeptdb.php
More file actions
48 lines (33 loc) · 1 KB
/
Copy pathupdatedeptdb.php
File metadata and controls
48 lines (33 loc) · 1 KB
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
41
42
43
44
45
46
47
48
<?php
include("config/config.php");
if(isset($_POST['departmentname'])){
$deptname=$_POST['departmentname'];
$deptpasswd=$_POST['passwrd'];
$deptmail=$_POST['heademail'];
$deptid=$_POST['deptid'];
$deptdid=$_POST['deptdid'];
$deptoldname=$_POST['oldname'];
$sqlque="update department set dname='".$deptname."' WHERE id=$deptdid;" ;
$res_u=mysqli_query($con,$sqlque);
$sqlque="update user set name='".$deptname."', username='".$deptname."' , email='".$deptmail."' ,password='".$deptpasswd."' WHERE id=$deptid";
$res_u=mysqli_query($con,$sqlque);
$sqlque="update complain set Departmentname='".$deptname."' WHERE Departmentname='".$deptoldname."'";
$res_u=mysqli_query($con,$sqlque);
echo'
<html>
<body>
<script src="assets/js/plugins/sweetalert2.js"></script>
<script>
swal("Department Updated","","success");
setTimeout(function(){
window.location.href = "./admindashboard.php";
},1000);
</script>
</body>
</html>';
}
else{
header("Location: index.php");
exit();
}
?>