PhpShit/display.php
2024-05-09 10:20:54 +08:00

56 lines
1.8 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Placeholder Register</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel='stylesheet' type='text/css' media='screen' href='style.css'>
</head>
<body>
<header>
<a href="home.php" style="font-family: cursive; color:white; font-size: xx-large; text-decoration: none"> Placeholder</a>
</header>
<?php
session_start();
$ID = $_SESSION['EmployeeID'];
if ($ID == ''){
header("location:index.php");
}
?>
<div class="login-box">
<center><h1 style="color: aliceblue">Display Records</h1></center>
<?php
$conn = mysqli_connect('localhost','root','','g1_pila');
$command = "select SHIPMENT_ID from shipment";
$result = mysqli_query($conn,$command);
if(mysqli_num_rows($result) > 0){
echo "<table style='color: aliceblue; border: 3px solid deepskyblue; padding: 20px;margin-left: 23%'>";
echo "<tr>";
echo "<th> Shipment ID</th>";
echo "<th>Update?</th>";
echo "<th>Delete?</th>";
echo "</tr>";
while ($row = mysqli_fetch_array($result)){
echo "<tr>";
echo "<td class='white-box'> $row[0] </td>";
echo "<td class='white-box'><a href='update.php?empID=".$row[0]."'>Update</a></td>";
echo "<td class='white-box'><a href = 'delete.php?empID=".$row[0]."' class='white-button'>Delete</a></td>";
echo "</tr>";
}
}else{
echo "<center><h1 style='color: aliceblue'>Sorry, I can't find any records</h1></center>";
}
echo "</table>";
?>
</div>
</body>
</html>
<?php