-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.php
68 lines (63 loc) · 2.76 KB
/
update.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Dashboard-Update</title>
<link rel="stylesheet" href="style.css">
<script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css" integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
</head>
<body>
<?php
include "include/navbar.php";
?>
<div id="display" style="overflow-y: scroll;">
<table class="table table-bordered" id="table">
<thead>
<tr>
<th scope="col">Employee Number</th>
<th scope="col">Employee Name</th>
<th scope="col">Employee Email</th>
<th scope="col">Employee Salary</th>
<th scope="col">Update Details</th>
</tr>
</thead>
<?php
$con = new mysqli("localhost", "root", "", "suraj");
$qry = "select * from employee";
$result = $con->query($qry);
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>" . $row["empno"] . "</td>";
echo "<td>" . $row["name"] . "</td>";
echo "<td>" . $row["email"] . "</td>";
echo "<td>" . $row["salary"] . "</td>";
echo "<td>
<a href='edit.php?empno=" . $row["empno"] . "'>
<i class='fa-solid fa-pen-to-square'></i>
</a>
<a href='delete.php?empno=" . $row["empno"] . "' style='margin-left:10px'>
<i class='fa-solid fa-trash-can'></i>
</a>
</td>";
echo "</tr>";
}
?>
</table>
</div>
<?php
if (isset($_GET["update"])) {
echo "<script>";
echo "alert('Data succesfully updated!!!')";
echo "</script>";
}
?>
<?php
include "include/footer.php";
?>
<script src="script.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
</body>
</html>