Compare commits
2 Commits
9fb08d43d0
...
f01cfaec8c
| Author | SHA1 | Date | |
|---|---|---|---|
| f01cfaec8c | |||
| 1242d6e633 |
8
.idea/.gitignore
vendored
8
.idea/.gitignore
vendored
|
|
@ -1,8 +0,0 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||
<data-source source="LOCAL" name="g1_pila@localhost" uuid="7303aaeb-6e1d-4970-b61b-ab692dc4f07a">
|
||||
<data-source source="LOCAL" name="g1_pila@localhost" uuid="06cec49b-e955-4ad7-913d-f29c2e2b4059">
|
||||
<driver-ref>mysql.8</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/PILA_LoginAndInsert.iml" filepath="$PROJECT_DIR$/.idea/PILA_LoginAndInsert.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/brian.iml" filepath="$PROJECT_DIR$/.idea/brian.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
66
display.php
66
display.php
|
|
@ -9,56 +9,44 @@
|
|||
</head>
|
||||
<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>
|
||||
<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">
|
||||
<table>
|
||||
<tr>
|
||||
<th> Full Name </th>
|
||||
<th>Update?</th>
|
||||
<th>Delete?</th>
|
||||
</tr>
|
||||
<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 CONCAT(FIRST_NAME, ' ',LAST_NAME) as name from employee";
|
||||
$command = "select SHIPMENT_ID from shipment";
|
||||
$result = mysqli_query($conn,$command);
|
||||
|
||||
while ($row = mysqli_fetch_array($result)){
|
||||
if(mysqli_num_rows($result) > 0){
|
||||
echo "<table style='color: aliceblue; border: 3px solid deepskyblue; padding: 20px;margin-left: 23%'>";
|
||||
echo "<tr>";
|
||||
echo "<th> $row[0] </th>";
|
||||
echo "<th><a href = 'update.php'>Update</a></th>";
|
||||
echo "<th><a href = 'delete.php'>Delete</a></th>";
|
||||
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>";
|
||||
?>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
43
home.php
43
home.php
|
|
@ -2,20 +2,38 @@
|
|||
<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>
|
||||
<span style="font-family: cursive; color:white; font-size: xx-large;" >Placeholder</span>
|
||||
<a href="home.php" style="font-family: cursive; color:white; font-size: xx-large; text-decoration: none"> Placeholder</a>
|
||||
|
||||
</header>
|
||||
<div class="login-box">
|
||||
<h2>Hello, User</h2>
|
||||
<?php
|
||||
session_start();
|
||||
if (!isset($_SESSION['EmployeeID'])){
|
||||
header("location:index.php");
|
||||
}
|
||||
?>
|
||||
|
||||
<h2>Hello, <?php
|
||||
$empID = $_SESSION['EmployeeID'];
|
||||
$connect = mysqli_connect("localhost", "root", "", "g1_pila") or die("Unable to connect");
|
||||
|
||||
$sql = "SELECT OWNER FROM store WHERE STORE_ID=$empID ";
|
||||
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>
|
||||
<header>
|
||||
<nav>
|
||||
<nav style="margin-left: 35%">
|
||||
<table>
|
||||
<tr>
|
||||
<th><a href="display.php">
|
||||
|
|
@ -24,13 +42,28 @@
|
|||
<span></span>
|
||||
<span></span>Display Table</a></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><a href="createUser.php">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<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">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>Log-off</a></th>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</nav>
|
||||
</header>
|
||||
|
|
|
|||
23
index.php
23
index.php
|
|
@ -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>
|
||||
|
|
@ -77,7 +56,7 @@
|
|||
if(isset($_POST['Submitto'])){
|
||||
$employeeUser = $_POST['employeeID'];
|
||||
$employeePass = $_POST['employeePassword'];
|
||||
$whereto = "SELECT EMPLOYEE_ID,PASSWD FROM employee where EMPLOYEE_ID='$employeeUser'";
|
||||
$whereto = "SELECT STORE_ID,PASSWORD FROM store where STORE_ID='$employeeUser'";
|
||||
$result = mysqli_query($connect,$whereto);
|
||||
$rows = mysqli_num_rows($result);
|
||||
$row = mysqli_fetch_array($result);
|
||||
|
|
|
|||
13
insert.php
13
insert.php
|
|
@ -9,9 +9,16 @@
|
|||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<span style="font-family: cursive; color:white; font-size: xx-large;" >Placeholder</span>
|
||||
<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','');
|
||||
|
|
|
|||
11
logout.php
Normal file
11
logout.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<html>
|
||||
<body>
|
||||
<div class="login-box">
|
||||
<?php
|
||||
session_start();
|
||||
session_destroy();
|
||||
header("location:index.php");
|
||||
?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
16
style.css
16
style.css
|
|
@ -15,7 +15,7 @@ body {
|
|||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 400px;
|
||||
width: 800px;
|
||||
padding: 40px;
|
||||
transform: translate(-50%, -30%);
|
||||
background: rgba(0,0,0,.5);
|
||||
|
|
@ -36,6 +36,20 @@ header{
|
|||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.white-box{
|
||||
border: 3px solid aliceblue;
|
||||
padding-right: 35px;
|
||||
padding-left: 35px;
|
||||
padding-bottom: 15px;
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
.white-button{
|
||||
text-decoration: none;
|
||||
color: aliceblue;
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
header nav{
|
||||
position: relative;
|
||||
top: 35%;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user