-
Notifications
You must be signed in to change notification settings - Fork 0
/
depedit.php
128 lines (105 loc) · 3.07 KB
/
depedit.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
include("db.php");
$id = $_GET['id'];
$sql = "SELECT * FROM department WHERE id = '$id'";
$result = $conn->query($sql);
if ($result->num_rows == 0) {
header('Location: depview.php');
}
$row = $result->fetch_assoc();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Department Registration Form</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
background-image: url('img/dep.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
.container {
max-width: 500px;
margin: 20px auto;
padding: 30px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
backdrop-filter: blur(10px);
color: white;
}
h2 {
text-align: center;
}
form {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}
.form-group {
width: 100%;
margin: 10px 0;
}
label {
font-weight: bold;
display: block;
margin-bottom: 5px;
margin-top: 5px;
}
input[type="text"],
input[type="number"],
select {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}
input[type=submit] {
background: red;
color: #fff;
padding: 10px 15px;
margin-left: 50px;
border: 0;
border-radius: 5px;
cursor: pointer;
width: 400px;
margin-top: 20px;
}
@media screen and (max-width: 600px) {
.container {
width: 80%;
}
}
</style>
</head>
<body>
<div class="container">
<h2>Department Registration Form</h2>
<form method="post" action="depupdate.php">
<input type="hidden" name="id" value="<?php echo $row['id']; ?>">
<div class="form-group">
<label for="depName">Department Name:</label>
<input type="text" id="depName" name="depName" value="<?php echo $row['depName']; ?>">
</div>
<div class="form-group">
<label for="semesterFee">Semester Fee:</label>
<input type="number" id="semesterFee" name="semesterFee" value="<?php echo $row['semesterFee']; ?>">
</div>
<input type="submit" id="submit" name="submit" value="Update">
</div>
</form>
</div>
</body>
</html>
<?php
// Close the database connection
$conn->close();
?>