-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdminUpdateForm.php
More file actions
57 lines (46 loc) · 1.67 KB
/
AdminUpdateForm.php
File metadata and controls
57 lines (46 loc) · 1.67 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
49
50
51
52
53
54
55
56
57
<?php
// Include database connection
require_once "AdminconnectDB.php";
if (isset($_GET['id'])) {
$id = $_GET['id'];
// Fetch the staff member's information based on the provided ID
$sql = "SELECT * FROM `staff_member` WHERE id = '$id'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$fname = $row["first_name"];
$lname = $row["last_name"];
$username = $row["user_name"];
$pass = $row["pass"];
$email = $row["email"];
} else {
echo "Staff member not found with the provided ID.";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Update Staff Member</title>
<link rel="stylesheet" type="text/css" href="AdminUpdateFormCSS.css">
</head>
<body>
<header>
<h2>Update Staff Member</h2>
</header>
<form action= AdminUpdate.php method="post">
<input type="hidden" name="id" value="<?php echo $id; ?>">
<label for="first_name">Update First Name:</label>
<input type="text" name="first_name" value="<?php echo $fname; ?>"><br>
<label for="last_name">Update Last Name:</label>
<input type="text" name="last_name" value="<?php echo $lname; ?>"><br>
<label for="user_name">Update Username:</label>
<input type="text" name="user_name" value="<?php echo $username; ?>"><br>
<label for="pass">Update Password:</label>
<input type="text" name="pass" value="<?php echo $pass; ?>"><br>
<label for="email">Update Email:</label>
<input type="text" name="email" value="<?php echo $email; ?>"><br>
<input actio type="submit" name="update" value="Update">
</form>
</body>
</html>