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"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
<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>
|
<driver-ref>mysql.8</driver-ref>
|
||||||
<synchronize>true</synchronize>
|
<synchronize>true</synchronize>
|
||||||
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectModuleManager">
|
<component name="ProjectModuleManager">
|
||||||
<modules>
|
<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>
|
</modules>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
64
display.php
64
display.php
|
|
@ -9,56 +9,44 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<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>
|
||||||
<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>
|
</header>
|
||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
$ID = $_SESSION['EmployeeID'];
|
||||||
|
if ($ID == ''){
|
||||||
|
header("location:index.php");
|
||||||
|
}
|
||||||
|
?>
|
||||||
<div class="login-box">
|
<div class="login-box">
|
||||||
<table>
|
<center><h1 style="color: aliceblue">Display Records</h1></center>
|
||||||
<tr>
|
|
||||||
<th> Full Name </th>
|
|
||||||
<th>Update?</th>
|
|
||||||
<th>Delete?</th>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
if($_SESSION['EmployeeID'] = ''){
|
|
||||||
header("location:index.php");
|
|
||||||
}
|
|
||||||
$conn = mysqli_connect('localhost','root','','g1_pila');
|
$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);
|
$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)){
|
while ($row = mysqli_fetch_array($result)){
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo "<th> $row[0] </th>";
|
echo "<td class='white-box'> $row[0] </td>";
|
||||||
echo "<th><a href = 'update.php'>Update</a></th>";
|
echo "<td class='white-box'><a href='update.php?empID=".$row[0]."'>Update</a></td>";
|
||||||
echo "<th><a href = 'delete.php'>Delete</a></th>";
|
echo "<td class='white-box'><a href = 'delete.php?empID=".$row[0]."' class='white-button'>Delete</a></td>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo "<center><h1 style='color: aliceblue'>Sorry, I can't find any records</h1></center>";
|
||||||
|
}
|
||||||
|
echo "</table>";
|
||||||
?>
|
?>
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
43
home.php
43
home.php
|
|
@ -2,20 +2,38 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset='utf-8'>
|
<meta charset='utf-8'>
|
||||||
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
|
|
||||||
<title>Placeholder Register</title>
|
<title>Placeholder Register</title>
|
||||||
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
||||||
<link rel='stylesheet' type='text/css' media='screen' href='style.css'>
|
<link rel='stylesheet' type='text/css' media='screen' href='style.css'>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<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>
|
</header>
|
||||||
<div class="login-box">
|
<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>
|
<header>
|
||||||
<nav>
|
<nav style="margin-left: 35%">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th><a href="display.php">
|
<th><a href="display.php">
|
||||||
|
|
@ -24,13 +42,28 @@
|
||||||
<span></span>
|
<span></span>
|
||||||
<span></span>Display Table</a></th>
|
<span></span>Display Table</a></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a href="createUser.php">
|
||||||
|
<span></span>
|
||||||
|
<span></span>
|
||||||
|
<span></span>
|
||||||
|
<span></span>Create Store</a></th>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><a href="Insert.php">
|
<th><a href="Insert.php">
|
||||||
<span></span>
|
<span></span>
|
||||||
<span></span>
|
<span></span>
|
||||||
<span></span>
|
<span></span>
|
||||||
<span></span>Insert</a></th>
|
<span></span>Insert Shipment</a></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a href="logout.php">
|
||||||
|
<span></span>
|
||||||
|
<span></span>
|
||||||
|
<span></span>
|
||||||
|
<span></span>Log-off</a></th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
||||||
23
index.php
23
index.php
|
|
@ -11,27 +11,6 @@
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<span style="font-family: cursive; color:white; font-size: xx-large;" >Placeholder</span>
|
<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>
|
</header>
|
||||||
<div class="login-box">
|
<div class="login-box">
|
||||||
<h2>Login</h2>
|
<h2>Login</h2>
|
||||||
|
|
@ -77,7 +56,7 @@
|
||||||
if(isset($_POST['Submitto'])){
|
if(isset($_POST['Submitto'])){
|
||||||
$employeeUser = $_POST['employeeID'];
|
$employeeUser = $_POST['employeeID'];
|
||||||
$employeePass = $_POST['employeePassword'];
|
$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);
|
$result = mysqli_query($connect,$whereto);
|
||||||
$rows = mysqli_num_rows($result);
|
$rows = mysqli_num_rows($result);
|
||||||
$row = mysqli_fetch_array($result);
|
$row = mysqli_fetch_array($result);
|
||||||
|
|
|
||||||
13
insert.php
13
insert.php
|
|
@ -9,9 +9,16 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<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>
|
</header>
|
||||||
<div class="login-box">
|
<div class="login-box">
|
||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
$ID = $_SESSION['EmployeeID'];
|
||||||
|
if ($ID == ''){
|
||||||
|
header("location:index.php");
|
||||||
|
}
|
||||||
|
?>
|
||||||
<h2>Shipment Fill-out form</h2>
|
<h2>Shipment Fill-out form</h2>
|
||||||
<form action="insert.php" method="post">
|
<form action="insert.php" method="post">
|
||||||
<div class="user-box">
|
<div class="user-box">
|
||||||
|
|
@ -48,10 +55,6 @@
|
||||||
</html>
|
</html>
|
||||||
<!--The bettah code that I wrote MWAHAHAHA-->
|
<!--The bettah code that I wrote MWAHAHAHA-->
|
||||||
<?php
|
<?php
|
||||||
session_start();
|
|
||||||
if($_SESSION['EmployeeID'] = ''){
|
|
||||||
header("location:index.php");
|
|
||||||
}
|
|
||||||
define('MYSQL','localhost');
|
define('MYSQL','localhost');
|
||||||
define('USERNAME','root');
|
define('USERNAME','root');
|
||||||
define('PASSWORD','');
|
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;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
width: 400px;
|
width: 800px;
|
||||||
padding: 40px;
|
padding: 40px;
|
||||||
transform: translate(-50%, -30%);
|
transform: translate(-50%, -30%);
|
||||||
background: rgba(0,0,0,.5);
|
background: rgba(0,0,0,.5);
|
||||||
|
|
@ -36,6 +36,20 @@ header{
|
||||||
overflow-x: auto;
|
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{
|
header nav{
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 35%;
|
top: 35%;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user