This commit is contained in:
L12Y08W15 2024-05-09 10:20:54 +08:00
parent 1242d6e633
commit f01cfaec8c
5 changed files with 40 additions and 63 deletions

View File

@ -10,43 +10,25 @@
<body>
<header>
<a href="home.php" style="font-family: cursive; color:white; font-size: xx-large; text-decoration: none"> Placeholder</a>
<nav>
<table>
<tr>
<th><a href="home.php">
<span></span>
<span></span>
<span></span>
<span></span>Home</a></th>
<th><a href="display.php">
<span></span>
<span></span>
<span></span>
<span></span>Equipment</a></th>
<th><a href="">
<span></span>
<span></span>
<span></span>
<span></span>About Us</a></th>
</tr>
</table>
</nav>
</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
session_start();
if($_SESSION['EmployeeID'] = ''){
header("location:index.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: 5%'>";
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>";

View File

@ -2,7 +2,6 @@
<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'>
@ -13,16 +12,23 @@
</header>
<div class="login-box">
<?php
session_start();
if (!isset($_SESSION['EmployeeID'])){
header("location:index.php");
}
?>
<h2>Hello, <?php
session_start();
$empID = $_SESSION['EmployeeID'];
$connect = mysqli_connect("localhost", "root", "", "g1_pila") or die("Unable to connect");
if($empID == ''){
header("location:index.php");
}
$sql = "SELECT OWNER FROM store WHERE STORE_ID=$empID ";
$result = mysqli_query($connect, $sql);
try{
$result = mysqli_query($connect, $sql);
}catch (Exception $ex){
echo "<script>alert('Sum Ting Wong'); window.location='index.php';</script>";
}
$row = mysqli_fetch_assoc($result);
echo $row['OWNER'];
?></h2>
@ -41,14 +47,14 @@
<span></span>
<span></span>
<span></span>
<span></span>Create User</a></th>
<span></span>Create Store</a></th>
</tr>
<tr>
<th><a href="Insert.php">
<span></span>
<span></span>
<span></span>
<span></span>Insert</a></th>
<span></span>Insert Shipment</a></th>
</tr>
<tr>
<th><a href="logout.php">

View File

@ -11,27 +11,6 @@
<body>
<header>
<span style="font-family: cursive; color:white; font-size: xx-large;" >Placeholder</span>
<nav>
<table>
<tr>
<th><a href="index.html">
<span></span>
<span></span>
<span></span>
<span></span>Home</a></th>
<th><a href="Equipment.html">
<span></span>
<span></span>
<span></span>
<span></span>Equipment</a></th>
<th><a href="">
<span></span>
<span></span>
<span></span>
<span></span>About Us</a></th>
</tr>
</table>
</nav>
</header>
<div class="login-box">
<h2>Login</h2>

View File

@ -12,6 +12,13 @@
<a href="home.php" style="font-family: cursive; color:white; font-size: xx-large; text-decoration: none"> Placeholder</a>
</header>
<div class="login-box">
<?php
session_start();
$ID = $_SESSION['EmployeeID'];
if ($ID == ''){
header("location:index.php");
}
?>
<h2>Shipment Fill-out form</h2>
<form action="insert.php" method="post">
<div class="user-box">
@ -48,10 +55,6 @@
</html>
<!--The bettah code that I wrote MWAHAHAHA-->
<?php
session_start();
if($_SESSION['EmployeeID'] = ''){
header("location:index.php");
}
define('MYSQL','localhost');
define('USERNAME','root');
define('PASSWORD','');

View File

@ -1,4 +1,11 @@
<?php
session_destroy();
header("location:index.php");
?>
<html>
<body>
<div class="login-box">
<?php
session_start();
session_destroy();
header("location:index.php");
?>
</div>
</body>
</html>