This commit is contained in:
Steven Tracey 2025-07-10 09:04:16 -04:00
parent fd0211efce
commit 356669fdfd
9 changed files with 207 additions and 71 deletions

19
error.php Normal file
View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/head.php" ?>
<body>
<?php include $_SERVER['DOCUMENT_ROOT'].'/snippets/header.php' ?>
<div class="container">
<div class="content flex-vertical">
<div class="section-one">
<h1>Error</h1>
<p>Please report the following to Steven</p>
<p>{{ .error }}</p>
</div>
</div>
</div>
<?php include $_SERVER['DOCUMENT_ROOT'].'/snippets/footer.php' ?>
</body>
</html>

View File

@ -1,10 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Luggage Tracker</title>
<link rel="stylesheet" href="/static/style.css">
</head>
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/head.php" ?>
<body>
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/header.php" ?>

23
info.php Normal file
View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/head.php" ?>
<body>
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/header.php" ?>
<div class="container">
<div class="content flex-vertical">
<div class="section-one flex-vertical">
<h1>Owner Information</h1>
</div>
<div class="section-two flex-vertical align-left">
<p>Contact Name: {{ .contact_name }}</p>
<p>Phone Number: {{ .phone_number }}</p>
<p>Email Address: {{ .email_address }}</p>
<p>Address: {{ .address }}</p>
</div>
</div>
</div>
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/footer.php" ?>
</body>
</html>

6
snippets/head.php Normal file
View File

@ -0,0 +1,6 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, internal-scale=1, viewport-fit=cover">
<title>My Luggage Info</title>
<link rel="stylesheet" href="/static/style.css?v=43">
</head>

View File

@ -2,6 +2,6 @@
<header class="header">
<img class="header-icon" src="/static/icon.png" alt="icon"/>
<h1 class="title">Luggage Tracker</h1>
<h1 class="title">My Luggage Info</h1>
<div class="spacer"></div>
</header>

View File

@ -8,33 +8,144 @@
font-family: Verdana,sans-serif;
}
body {
margin: 0;
height: 100vh;
display: flex;
flex-direction: column;
@media only screen and (min-width: 300px) {
body {
margin: 0;
height: 92vh;
display: flex;
flex-direction: column;
}
.header {
display: flex;
flex: 0 0 auto;
align-items: center;
justify-content: space-between;
background-color: var(--mid-dark);
padding: 0 1rem;
height: 120px;
}
.spacer {
flex: 0 0 72px;
}
.header-icon {
display: block;
flex: 0 0 72px;
width: 20vw;
height: auto;
max-height: 85px;
}
.footer {
background-color: var(--dark);
display: flex;
flex: 0 0 auto;
height: 120px;
}
.content {
display: flex;
width: 85vw;
max-width: 800px;
padding: 1.5rem;
background: white;
border-radius: 5px;
text-align: center;
}
.content input {
font-size: 16px;
}
.content button {
color: var(--dark);
background-color: var(--light);
border-radius: 8px;
border: 2px solid;
border-color: var(--dark);
padding: 8px 12px;
text-align: center;
text-decoration: none;
font-size: 16px;
cursor: pointer;
}
.align-left {
align-items: flex-start;
margin-left: 5vw;
}
}
.header {
display: flex;
flex: 0 0 auto;
align-items: center;
justify-content: space-between;
background-color: var(--mid-dark);
padding: 0 1rem;
height: 80px;
}
@media only screen and (min-width: 700px) {
body {
margin: 0;
height: 100vh;
display: flex;
flex-direction: column;
}
.spacer {
flex: 0 0 64px;
}
.header {
display: flex;
flex: 0 0 auto;
align-items: center;
justify-content: space-between;
background-color: var(--mid-dark);
padding: 0 1rem;
height: 80px;
}
.header-icon {
display: block;
flex: 0 0 64px;
width: 15vw;
height: auto;
max-height: 80px;
.spacer {
flex: 0 0 64px;
}
.header-icon {
display: block;
flex: 0 0 64px;
width: 15vw;
height: auto;
max-height: 80px;
}
.footer {
background-color: var(--dark);
display: flex;
flex: 0 0 auto;
height: 80px;
}
.content {
display: flex;
width: 90vw;
max-width: 800px;
padding: 1.5rem;
background: white;
border-radius: 5px;
text-align: center;
}
.content input {
font-size: 16px;
}
.content button {
color: var(--dark);
background-color: var(--light);
border-radius: 8px;
border: 2px solid;
border-color: var(--dark);
padding: 8px 12px;
text-align: center;
text-decoration: none;
font-size: 16px;
cursor: pointer;
}
.align-left {
align-items: flex-start;
margin-left: 5vw;
}
}
.title {
@ -43,13 +154,6 @@ body {
color: var(--light);
}
.footer {
background-color: var(--dark);
display: flex;
flex: 0 0 auto;
height: 80px;
}
.footer-text {
display: inherit;
align-content: center;
@ -96,13 +200,7 @@ body {
);
}
.content {
display: flex;
width: 90vw;
max-width: 800px;
padding: 1.5rem;
background: white;
border-radius: 5px;
.content h1 {
text-align: center;
}
@ -114,23 +212,6 @@ body {
text-align: center;
}
.content input {
font-size: 16px;
}
.content button {
color: var(--dark);
background-color: var(--light);
border-radius: 8px;
border: 2px solid;
border-color: var(--dark);
padding: 8px 12px;
text-align: center;
text-decoration: none;
font-size: 16px;
cursor: pointer;
}
.content button:hover {
color: var(--light);
background-color: var(--dark);

View File

@ -1,15 +1,12 @@
let baseUrl = "http://localhost:8000"
document.getElementById("submitBtn").addEventListener('click', function(e) {
let code = document.getElementById("code").value;
console.log("Clicked: " + code);
const path = window.location.pathname;
const parts = path.split("/");
//const user = parts.pop();
const user = parts.pop();
const user = "tracey"
fetch(baseUrl + "/api/verify/" + user, {
fetch("/api/verify/" + user, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -26,7 +23,7 @@ document.getElementById("submitBtn").addEventListener('click', function(e) {
} else if (data.status === 200) {
// Display found and redirect to baseUrl/u/user/info with auth token
statusText.innerText = "User found, redirecting...";
window.location.replace(baseUrl + "/u/" + user + "/info")
window.location.replace("/u/" + user + "/info?token=" + data.token);
} else {
// Error
statusText.innerText = "Error, please send this to Steven to be fixed. Error: " + data.error;

18
unauthorized.php Normal file
View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/head.php" ?>
<body>
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/header.php" ?>
<div class="container">
<div class="content flex-vertical">
<div class="section-one">
<h1>Unauthorized</h1>
<p>Maybe you had the wrong code?</p>
</div>
</div>
</div>
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/footer.php" ?>
</body>
</html>

View File

@ -1,10 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Luggage Tracker</title>
<link rel="stylesheet" href="/static/style.css">
</head>
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/head.php" ?>
<body>
<?php include $_SERVER['DOCUMENT_ROOT']."/snippets/header.php" ?>