summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server.js160
-rw-r--r--views/change-password.ejs3
-rw-r--r--views/error.ejs3
-rw-r--r--views/index.ejs15
-rw-r--r--views/login.ejs3
-rw-r--r--views/marketplace-spike.ejs455
-rw-r--r--views/marketplace.ejs320
-rw-r--r--views/profile.ejs25
-rw-r--r--views/signup.ejs3
9 files changed, 960 insertions, 27 deletions
diff --git a/server.js b/server.js
index a0326af..f77f8c3 100644
--- a/server.js
+++ b/server.js
@@ -285,6 +285,24 @@ app.post('/logout', (req, res, next) => {
// });
app.get('/profile', async (req, res, next) => {
+ let EntryCount = await EntryItem.countDocuments();
+ let UserCount = await User.countDocuments();
+
+ let rawUptime = process.uptime();
+ const date = new Date(rawUptime * 1000);
+ const days = date.getUTCDate() - 1,
+ hours = date.getUTCHours(),
+ minutes = date.getUTCMinutes(),
+ seconds = date.getUTCSeconds(),
+ milliseconds = date.getUTCMilliseconds();
+ let segments = [];
+ if (days > 0) segments.push(days + ' day' + ((days == 1) ? '' : 's'));
+ if (hours > 0) segments.push(hours + ' hour' + ((hours == 1) ? '' : 's'));
+ if (minutes > 0) segments.push(minutes + ' minute' + ((minutes == 1) ? '' : 's'));
+ if (seconds > 0) segments.push(seconds + ' second' + ((seconds == 1) ? '' : 's'));
+ if (milliseconds > 0) segments.push(milliseconds + ' millisecond' + ((seconds == 1) ? '' : 's'));
+ const dateString = segments.join(', ');
+
User.findById(req.session.userId)
.exec((error, user) => {
if (error) {
@@ -307,7 +325,10 @@ app.get('/profile', async (req, res, next) => {
req: req,
User: User,
name: user.username,
- quote: quotes.getRandomQuote()
+ quote: quotes.getRandomQuote(),
+ EntryCount: EntryCount,
+ UserCount: UserCount,
+ dateString: dateString
});
}
}
@@ -355,30 +376,30 @@ app.get('/terms', (req, res) => {
// })
// });
-app.get('/marketplace', (req, res) => {
- User.findById(req.session.userId)
- .exec((error, user) => {
- if (error) {
- return res.render('error', {
- quote: quotes.getRandomQuote(),
- errorMsg: 'Unknown error.'
- });
- } else {
- if (user === null) {
- //let err = new Error('Not logged in!');
- return res.render('login', {
- req: req,
- User: User,
- quote: quotes.getRandomQuote()
- });
- //return err.status = 400;
- //return next(err);
- } else {
- return res.redirect('/')
- }
- }
- })
-})
+// app.get('/marketplace', (req, res) => {
+// User.findById(req.session.userId)
+// .exec((error, user) => {
+// if (error) {
+// return res.render('error', {
+// quote: quotes.getRandomQuote(),
+// errorMsg: 'Unknown error.'
+// });
+// } else {
+// if (user === null) {
+// //let err = new Error('Not logged in!');
+// return res.render('login', {
+// req: req,
+// User: User,
+// quote: quotes.getRandomQuote()
+// });
+// //return err.status = 400;
+// //return next(err);
+// } else {
+// return res.redirect('/')
+// }
+// }
+// })
+// })
app.post('/closeExampleVideo', async (req, res) => {
req.session.exampleVideo = false;
@@ -489,6 +510,95 @@ app.post('/deleteItem/:id', (req, res) => {
})
})
+app.get('/marketplace', async (req, res) => {
+ //const todoItems = await TodoItem.find();
+ User.findById(req.session.userId)
+ .exec(async (error, user) => {
+ if (error) {
+ return res.render('error', {
+ quote: quotes.getRandomQuote(),
+ errorMsg: 'Unknown error.'
+ });
+ } else {
+ if (user === null) {
+ //let err = new Error('Not logged in!');
+ res.render('marketplace', {
+ req: req,
+ User: User,
+ name: null,
+ quote: quotes.getRandomQuote()
+ });
+ //return err.status = 400;
+ //return next(err);
+ } else {
+ const entryItems = EntryItem;
+ const loop = await EntryItem.find({
+ "type": "purchase",
+ user: user.username
+ });
+ const loopCount = await EntryItem.find({
+ "type": "purchase",
+ "user": user.username
+ }).countDocuments();
+
+ const loop2 = await EntryItem.find({
+ "type": "sale",
+ "user": user.username
+ });
+ const loop2Count = await EntryItem.find({
+ "type": "sale",
+ "user": user.username
+ }).countDocuments();
+
+ const loop3 = await EntryItem.find({
+ "type": "trade",
+ "user": user.username
+ });
+ const loop3Count = await EntryItem.find({
+ "type": "trade",
+ "user": user.username
+ }).countDocuments();
+
+ let EntryCount = await EntryItem.countDocuments();
+ let UserCount = await User.countDocuments();
+
+ let rawUptime = process.uptime();
+ const date = new Date(rawUptime * 1000);
+ const days = date.getUTCDate() - 1,
+ hours = date.getUTCHours(),
+ minutes = date.getUTCMinutes(),
+ seconds = date.getUTCSeconds(),
+ milliseconds = date.getUTCMilliseconds();
+ let segments = [];
+ if (days > 0) segments.push(days + ' day' + ((days == 1) ? '' : 's'));
+ if (hours > 0) segments.push(hours + ' hour' + ((hours == 1) ? '' : 's'));
+ if (minutes > 0) segments.push(minutes + ' minute' + ((minutes == 1) ? '' : 's'));
+ if (seconds > 0) segments.push(seconds + ' second' + ((seconds == 1) ? '' : 's'));
+ if (milliseconds > 0) segments.push(milliseconds + ' millisecond' + ((seconds == 1) ? '' : 's'));
+ const dateString = segments.join(', ');
+
+ return res.render('marketplace', {
+ req: req,
+ User: User,
+ name: user.username,
+ entryItems: entryItems,
+ user: user,
+ loop: loop,
+ loopCount: loopCount,
+ loop2: loop2,
+ loop2Count: loop2Count,
+ loop3: loop3,
+ loop3Count: loop3Count,
+ EntryCount: EntryCount,
+ UserCount: UserCount,
+ dateString: dateString,
+ quote: quotes.getRandomQuote()
+ });
+ }
+ }
+ });
+});
+
app.get('*', (req, res) => {
res.redirect('/')
})
diff --git a/views/change-password.ejs b/views/change-password.ejs
index aa24b28..05c0588 100644
--- a/views/change-password.ejs
+++ b/views/change-password.ejs
@@ -83,6 +83,9 @@
<li class="nav-item">
<a class="nav-link" href="/">Home</a>
</li>
+ <li class="nav-item">
+ <a href="/marketplace" class="nav-link">Marketplace Beta</a>
+ </li>
<!--<li class="nav-item">
<a class="nav-link" href="/discord/bots/uwufier/about/">About</a>
</li>-->
diff --git a/views/error.ejs b/views/error.ejs
index 829840d..aeea886 100644
--- a/views/error.ejs
+++ b/views/error.ejs
@@ -73,6 +73,9 @@
<li class="nav-item">
<a class="nav-link" href="/">Home</a>
</li>
+ <li class="nav-item">
+ <a href="/marketplace" class="nav-link">Marketplace Beta</a>
+ </li>
<!--<li class="nav-item">
<a class="nav-link" href="/discord/bots/uwufier/about/">About</a>
</li>-->
diff --git a/views/index.ejs b/views/index.ejs
index c3071d3..4f86498 100644
--- a/views/index.ejs
+++ b/views/index.ejs
@@ -60,7 +60,7 @@
<script src="js/main.js"></script>
</head>
<body>
- <!-- Visable Scripts -->
+ <!-- Visible Scripts -->
<nav class="navbar navbar-expand-lg bg-transparent hideme" id="navbar-remove">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
@@ -77,6 +77,9 @@
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
+ <li class="nav-item">
+ <a href="/marketplace" class="nav-link">Marketplace Beta</a>
+ </li>
<!--<li class="nav-item">
<a class="nav-link" href="/discord/bots/uwufier/about/">About</a>
</li>-->
@@ -325,7 +328,7 @@
</tbody>
</table>
</div>
- <% } %>
+ <% } %>
<% if (req.session.exampleVideo) { %>
<div class="example-video__container hideme" style="position: fixed; bottom: 25px; left: 25px;">
@@ -364,5 +367,13 @@
</script>
<script src="https://code.jquery.com/jquery-3.5.0.min.js"
integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script>
+ <script>
+ $('tbody').each(function() {
+ const list = $(this).children('tr');
+ $(this).html(list.get().reverse())
+ });
+
+ // if you are seeing this, this took way to long to complete.
+ </script>
</body>
</html> \ No newline at end of file
diff --git a/views/login.ejs b/views/login.ejs
index b2845de..62460ea 100644
--- a/views/login.ejs
+++ b/views/login.ejs
@@ -73,6 +73,9 @@
<li class="nav-item">
<a class="nav-link" href="/">Home</a>
</li>
+ <li class="nav-item">
+ <a href="/marketplace" class="nav-link">Marketplace Beta</a>
+ </li>
<!--<li class="nav-item">
<a class="nav-link" href="/discord/bots/uwufier/about/">About</a>
</li>-->
diff --git a/views/marketplace-spike.ejs b/views/marketplace-spike.ejs
new file mode 100644
index 0000000..178d83e
--- /dev/null
+++ b/views/marketplace-spike.ejs
@@ -0,0 +1,455 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
+ <title>Sin's SS Logger | Marketplace</title>
+ <link rel="shortcut icon" href="https://i.imgur.com/69mCrs0.jpg" type="image/jpg">
+ <!-- CSS -->
+ <link rel="stylesheet" href="css/main.css">
+ <link rel="stylesheet" href="css/now-ui-kit.css">
+ <link rel="stylesheet" href="css/bootstrap.min.css">
+
+ <style>
+ html,
+ body {
+ background-color: #202124;
+ user-select: none;
+ }
+
+ .container {
+ z-index: 999;
+ }
+
+ #white-txt {
+ color: white !important;
+ }
+
+ .highlightable {
+ user-select: text;
+ }
+
+ footer {
+ position: fixed;
+ left: 0;
+ bottom: 3px;
+ width: 100%;
+ color: white;
+ text-align: center;
+ }
+
+ #pink-link {
+ color: pink;
+ }
+ #pink-link:hover {
+ color: rgb(214, 161, 170);
+ }
+
+ @media (max-width: 1810px) {
+ .newest {
+ display: none;
+ }
+ }
+ </style>
+ <!-- External Libraries -->
+ <!-- Invisible Scripts -->
+ <script src="https://code.jquery.com/jquery-3.5.0.min.js"
+ integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script>
+ <script src="js/now-ui-kit.js"></script>
+ <script src="js/main.js"></script>
+ </head>
+ <body>
+ <!-- Visible Scripts -->
+
+ <nav class="navbar navbar-expand-lg bg-transparent hideme" id="navbar-remove">
+ <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
+ <span class="navbar-toggler-icon"></span>
+ </button>
+
+ <div class="collapse navbar-collapse" id="navbarSupportedContent">
+ <ul class="navbar-nav ml-auto">
+ <li class="nav-item">
+ <a href="#" class="nav-link disabled" style="opacity: 1;">Database Status: <span
+ style="color: #99CC33;">Online</span></a>
+ </li>
+ <div class="divider-vertical"></div>
+ <li class="nav-item">
+ <a class="nav-link" href="/">Home</a>
+ </li>
+ <li class="nav-item active">
+ <a href="#" class="nav-link">Marketplace Beta <span class="sr-only">(current)</span></a>
+ </li>
+ <!--<li class="nav-item">
+ <a class="nav-link" href="/discord/bots/uwufier/about/">About</a>
+ </li>-->
+ <li class="nav-item">
+ <a href="/profile" class="nav-link">Profile</a>
+ </li>
+ <li class="nav-item disabled">
+ <a href="#" class="nav-link disabled">API</a>
+ </li>
+ <div class="divider-vertical"></div>
+ <li class="nav-item">
+ <a href="https://kyzer.co" class="nav-link">More stuff from Sin</a>
+ </li>
+ </ul>
+ <!-- <button class="btn btn-outline-secondary my-2 my-sm-0 btn-round btn-sm">LOGIN</button> -->
+ </div>
+ </nav>
+
+ <div class="container my-5">
+ <form action="/submitMarketEntry" method="POST" class="my-4 form-inline hideme">
+ <div class="row">
+ <div class="col-sm">
+ <label for="transactionType" class="sr-only">Type of transaction</label>
+ <select name="transactionType" id="transactionType" class="form-control mr-2"
+ <% if (name === null) { %> disabled data-toggle="tooltip" data-placement="top"
+ title="Login to submit" <% } %>>
+ <option value="purchase">Purchase</option>
+ <option value="sale">Sale</option>
+ <option value="trade">Trade</option>
+ </select>
+
+ <label for="carsType" class="sr-only">Cars</label>
+ <input type="text" name="carsType" id="carsType" class="form-control mr-2"
+ placeholder="Car(s)" min="2" max="16" required <% if (name === null) { %> disabled
+ data-toggle="tooltip" data-placement="top"
+ title="Login to submit" <% } %>>
+
+ <label for="sellerType" class="sr-only">Seller, Buyer or Trader's Name</label>
+ <input type="text" name="sellerType" id="sellerType" class="form-control mr-2"
+ placeholder="Seller/ Buyer/ Trader's Name" min="1" max="50" required
+ <% if (name === null) { %> disabled data-toggle="tooltip" data-placement="top"
+ title="Login to submit" <% } %>>
+
+ <label for="priceType" class="sr-only">Price or Received Cars</label>
+ <input type="text" name="priceType" id="priceType" class="form-control mr-2"
+ placeholder="Price/ Received Car(s)" min="1" required <% if (name === null) { %> disabled
+ data-toggle="tooltip" data-placement="top"
+ title="Login to submit"
+ <% } %>>
+
+ <% if (name === null) { %>
+ <a href="/login">
+ <button type="button" class="btn btn-danger">Login to submit</button>
+ </a>
+ <% } else { %>
+ <button type="submit" class="btn btn-success">Submit</button>
+ <% } %>
+ </div>
+ </div>
+ </form>
+
+ <form action="/searchEntries" method="POST" class="my-4 form-inline hideme">
+ <div class="row">
+ <div class="col-sm">
+ <label for="transactionType" class="sr-only">Type of transaction</label>
+ <select name="transactionType" id="transactionType" class="form-control mr-2"
+ <% if (name === null) { %> disabled data-toggle="tooltip" data-placement="top"
+ title="Login to submit" <% } %>>
+ <option value="car-name">Name</option>
+ <option value="price">Price</option>
+ </select>
+
+ <label for="carsType" class="sr-only">Cars</label>
+ <input type="text" name="carsType" id="carsType" class="form-control mr-2"
+ placeholder="Car Name or Price" min="2" max="16" required <% if (name === null) { %> disabled
+ data-toggle="tooltip" data-placement="top"
+ title="Login to submit" <% } %>>
+
+ <a href="/login">
+ <button type="button" disabled class="btn btn-success">Search</button>
+ </a>
+ </div>
+ </div>
+ </form>
+
+ <div class="row">
+ <div class="col-sm">
+ <h3 id="white-txt" class="hideme">Your Listings</h3>
+ <table class="table table-striped">
+ <thead class="hideme">
+ <tr>
+ <th id="white-txt" class="hideme">Car(s)</th>
+ <th id="white-txt" class="hideme">Seller</th>
+ <th id="white-txt" class="hideme">Price</th>
+ <!-- <th id="white-txt" class="hideme" data-toggle="tooltip" data-placement="top"
+ title="Time of Sale">TOS</th> -->
+ <% if (name === null) { } else { %>
+ <th id="white-txt" class="hideme"></th>
+ <% } %>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td id="white-txt" class="highlightable hideme">RX7</td>
+ <td id="white-txt" class="highlightable hideme">Sin</td>
+ <td id="white-txt" class="highlightable hideme">150000</td>
+ <td id="white-txt" class="highlightable hideme">2020-05-12T03:01:12.6FS9</td>
+ </tr>
+ <!-- <% if (name === null) { %>
+ <tr>
+ <td id="white-txt" class="highlightable hideme">RX7</td>
+ <td id="white-txt" class="highlightable hideme">Sin</td>
+ <td id="white-txt" class="highlightable hideme">150000</td>
+ <td id="white-txt" class="highlightable hideme">2020-05-12T03:01:12.6FS9</td>
+ </tr>
+ <% } else { %>
+ <% if (loopCount < 1) { %>
+ <tr>
+ <td id="white-txt" class="highlightable hideme"></td>
+ <td id="white-txt" class="highlightable hideme"></td>
+ <td id="white-txt" class="highlightable hideme"></td>
+ <td id="white-txt" class="highlightable hideme"></td>
+ </tr>
+ <% } else { %>
+ <% loop.forEach(lp => { %>
+ <tr>
+ <td id="white-txt" class="highlightable hideme"><%= lp.cars %></td>
+ <td id="white-txt" class="highlightable hideme"><%= lp.seller %></td>
+ <td id="white-txt" class="highlightable hideme"><%= lp.price %></td>
+ <td id="white-txt" class="highlightable hideme"><%= lp.date %></td>
+ <!-- <td id="white-txt id" class="highlightable" style="display: none;"><%= lp._id %></td> -->
+ <td class="hideme">
+ <form action="/deleteItem/<%= lp._id %>" method="post">
+ <button type="submit" class="btn btn-danger"
+ style="float: right; font-size: 10px !important;"
+ data-toggle="tooltip" data-placement="top"
+ title="Delete this entry" data-delete-item-button>Delete</button>
+ </form>
+ </td>
+ </tr>
+ <% }) %>
+ <% } %>
+ <% } %> -->
+ </tbody>
+ </table>
+ </div>
+ <div class="col-sm">
+ <h3 id="white-txt" class="hideme">From Today</h3>
+ <table class="table table-striped">
+ <thead class="hideme">
+ <tr>
+ <th id="white-txt" class="hideme">Car(s)</th>
+ <th id="white-txt" class="hideme">Seller</th>
+ <th id="white-txt" class="hideme">Price</th>
+ <!-- <th id="white-txt" class="hideme" data-toggle="tooltip" data-placement="top"
+ title="Time of Sale">TOS</th> -->
+ <% if (name === null) { } else { %>
+ <th id="white-txt" class="hideme"></th>
+ <% } %>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td id="white-txt" class="highlightable hideme">RX7</td>
+ <td id="white-txt" class="highlightable hideme">Sin</td>
+ <td id="white-txt" class="highlightable hideme">150000</td>
+ <td id="white-txt" class="highlightable hideme">2020-05-06T08:08:34.827Z</td>
+ </tr>
+ <!-- <% if (name === null) { %>
+ <tr>
+ <td id="white-txt" class="highlightable hideme">RX7</td>
+ <td id="white-txt" class="highlightable hideme">Sin</td>
+ <td id="white-txt" class="highlightable hideme">150000</td>
+ <td id="white-txt" class="highlightable hideme">2020-05-06T08:08:34.827Z</td>
+ </tr>
+ <% } else { %>
+ <% if (loopCount < 1) { %>
+ <tr>
+ <td id="white-txt" class="highlightable hideme"></td>
+ <td id="white-txt" class="highlightable hideme"></td>
+ <td id="white-txt" class="highlightable hideme"></td>
+ <td id="white-txt" class="highlightable hideme"></td>
+ </tr>
+ <% } else { %>
+ <% loop.forEach(lp => { %>
+ <tr>
+ <td id="white-txt" class="highlightable hideme"><%= lp.cars %></td>
+ <td id="white-txt" class="highlightable hideme"><%= lp.seller %></td>
+ <td id="white-txt" class="highlightable hideme"><%= lp.price %></td>
+ <td id="white-txt" class="highlightable hideme"><%= lp.date %></td>
+ <!-- <td id="white-txt id" class="highlightable" style="display: none;"><%= lp._id %></td> -->
+ <td class="hideme">
+ <form action="/deleteItem/<%= lp._id %>" method="post">
+ <button type="submit" class="btn btn-danger"
+ style="float: right; font-size: 10px !important;"
+ data-toggle="tooltip" data-placement="top"
+ title="Delete this entry" data-delete-item-button>Delete</button>
+ </form>
+ </td>
+ </tr>
+ <% }) %>
+ <% } %>
+ <% } %> -->
+ </tbody>
+ </table>
+ </div>
+ <div class="col-sm">
+ <h3 id="white-txt" class="hideme">From This Week</h3>
+ <table class="table table-striped">
+ <thead class="hideme">
+ <tr>
+ <th id="white-txt" class="hideme">Car(s)</th>
+ <th id="white-txt" class="hideme">Buyer</th>
+ <th id="white-txt" class="hideme">Price</th>
+ <!-- <th id="white-txt" class="hideme" data-toggle="tooltip" data-placement="top"
+ title="Time of Sale">TOS</th> -->
+ <% if (name === null) { } else { %>
+ <th id="white-txt" class="hideme"></th>
+ <% } %>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td id="white-txt" class="highlightable hideme">R34</td>
+ <td id="white-txt" class="highlightable hideme">Sin</td>
+ <td id="white-txt" class="highlightable hideme">180000</td>
+ <td id="white-txt" class="highlightable hideme">2020-05-04T02:02:56.8F9J</td>
+ </tr>
+ <!-- <% if (name === null) { %>
+ <tr>
+ <td id="white-txt" class="highlightable hideme">R34</td>
+ <td id="white-txt" class="highlightable hideme">Sin</td>
+ <td id="white-txt" class="highlightable hideme">180000</td>
+ <td id="white-txt" class="highlightable hideme">2020-05-04T02:02:56.8F9J</td>
+ </tr>
+ <% } else { %>
+ <% if (loop2Count < 1) { %>
+ <tr>
+ <td id="white-txt" class="highlightable hideme"></td>
+ <td id="white-txt" class="highlightable hideme"></td>
+ <td id="white-txt" class="highlightable hideme"></td>
+ <td id="white-txt" class="highlightable hideme"></td>
+ </tr>
+ <% } else { %>
+ <% loop2.forEach(lp => { %>
+ <tr>
+ <td id="white-txt" class="highlightable hideme"><%= lp.cars %></td>
+ <td id="white-txt" class="highlightable hideme"><%= lp.seller %></td>
+ <td id="white-txt" class="highlightable hideme"><%= lp.price %></td>
+ <td id="white-txt" class="highlightable hideme"><%= lp.date %></td>
+ <!-- <td id="white-txt id" class="highlightable" style="display: none;"><%= lp._id %></td> -->
+ <td class="hideme">
+ <form action="/deleteItem/<%= lp._id %>" method="post">
+ <button type="submit" class="btn btn-danger"
+ style="float: right; font-size: 10px !important;"
+ data-toggle="tooltip" data-placement="top"
+ title="Delete this entry" data-delete-item-button>Delete</button>
+ </form>
+ </td>
+ </tr>
+ <% }) %>
+ <% } %>
+ <% } %> -->
+ </tbody>
+ </table>
+ </div>
+ <div class="col-sm">
+ <h3 id="white-txt" class="hideme">From This Month</h3>
+ <table class="table table-striped">
+ <thead class="hideme">
+ <tr>
+ <th id="white-txt">Received Car(s)</th>
+ <th id="white-txt">Trader</th>
+ <th id="white-txt">Traded Car(s)</th>
+ <!-- <th id="white-txt" data-toggle="tooltip" data-placement="top" title="Time of Sale">TOS</th> -->
+ <% if (name === null) { } else { %>
+ <th id="white-txt" class="hideme"></th>
+ <% } %>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td id="white-txt" class="highlightable hideme">R32</td>
+ <td id="white-txt" class="highlightable hideme">Sin</td>
+ <td id="white-txt" class="highlightable hideme">R34</td>
+ <td id="white-txt" class="highlightable hideme">2020-05-02T06:21:23.2J7F</td>
+ </tr>
+ <!-- <% if (name === null) { %>
+ <td id="white-txt" class="highlightable hideme">R32</td>
+ <td id="white-txt" class="highlightable hideme">Sin</td>
+ <td id="white-txt" class="highlightable hideme">R34</td>
+ <td id="white-txt" class="highlightable hideme">2020-05-02T06:21:23.2J7F</td>
+ <% } else { %>
+ <% if (loop3Count < 1) { %>
+ <tr>
+ <td id="white-txt" class="highlightable hideme"></td>
+ <td id="white-txt" class="highlightable hideme"></td>
+ <td id="white-txt" class="highlightable hideme"></td>
+ <td id="white-txt" class="highlightable hideme"></td>
+ </tr>
+ <% } else { %>
+ <% loop3.forEach(lp => { %>
+ <tr>
+ <td id="white-txt" class="highlightable hideme"><%= lp.cars %></td>
+ <td id="white-txt" class="highlightable hideme"><%= lp.seller %></td>
+ <td id="white-txt" class="highlightable hideme"><%= lp.price %></td>
+ <td id="white-txt" class="highlightable hideme"><%= lp.date %></td>
+ <!-- <td id="white-txt id" class="highlightable" style="display: none;"><%= lp._id %></td> -->
+ <td class="hideme">
+ <form action="/deleteItem/<%= lp._id %>" method="post">
+ <button type="submit" class="btn btn-danger"
+ style="float: right; font-size: 10px !important;"
+ data-toggle="tooltip" data-placement="top"
+ title="Delete this entry" data-delete-item-button>Delete</button>
+ </form>
+ </td>
+ </tr>
+ <% }) %>
+ <% } %>
+ <% } %> -->
+ </tbody>
+ </table>
+ </div>
+ </div>
+
+ <% if (name === 'sin') { %>
+ <div class="newest hideme" style="position: absolute; top: 15px; left: 15px;">
+ <!-- <div class="newest hideme" style="position: fixed; top: 5%; left: 5%;"> -->
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th id="white-txt">Users</th>
+ <th id="white-txt">Entries</th>
+ <th id="white-txt">Uptime</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td id="white-txt" class="highlightable"><%= UserCount %></td>
+ <td id="white-txt" class="highlightable"><%= EntryCount %></td>
+ <td id="white-txt" class="highlightable"><%= dateString %></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <% } %>
+ </div>
+
+ <footer class="hideme">
+ <link rel="stylesheet" type="text/css"
+ href="//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" />
+ Made with <i class="icon ion-heart"></i> by <a href="https://kyzer.co/">Sin</a>. |
+ <span class="highlightable"><%= quote.text %> -<%= quote.author.name %></span>
+ </footer>
+
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
+ integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous">
+ </script>
+ <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
+ integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous">
+ </script>
+ <script src="https://code.jquery.com/jquery-3.5.0.min.js"
+ integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script>
+ <script>
+ $('tbody').each(function() {
+ const list = $(this).children('tr');
+ $(this).html(list.get().reverse())
+ });
+
+ // if you are seeing this, this took way to long to complete.
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/views/marketplace.ejs b/views/marketplace.ejs
new file mode 100644
index 0000000..b538692
--- /dev/null
+++ b/views/marketplace.ejs
@@ -0,0 +1,320 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
+ <title>Sin's SS Logger | Marketplace</title>
+ <link rel="shortcut icon" href="https://i.imgur.com/69mCrs0.jpg" type="image/jpg">
+ <!-- CSS -->
+ <link rel="stylesheet" href="css/main.css">
+ <link rel="stylesheet" href="css/now-ui-kit.css">
+ <link rel="stylesheet" href="css/bootstrap.min.css">
+
+ <style>
+ html,
+ body {
+ background-color: #202124;
+ user-select: none;
+ }
+
+ .container {
+ z-index: 999;
+ }
+
+ #white-txt {
+ color: white !important;
+ }
+
+ .highlightable {
+ user-select: text;
+ }
+
+ footer {
+ position: fixed;
+ left: 0;
+ bottom: 3px;
+ width: 100%;
+ color: white;
+ text-align: center;
+ }
+
+ #pink-link {
+ color: pink;
+ }
+ #pink-link:hover {
+ color: rgb(214, 161, 170);
+ }
+
+ @media (max-width: 1810px) {
+ .newest {
+ display: none;
+ }
+ }
+ </style>
+ <!-- External Libraries -->
+ <!-- Invisible Scripts -->
+ <script src="https://code.jquery.com/jquery-3.5.0.min.js"
+ integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script>
+ <script src="js/now-ui-kit.js"></script>
+ <script src="js/main.js"></script>
+ </head>
+ <body>
+ <!-- Visible Scripts -->
+
+ <nav class="navbar navbar-expand-lg bg-transparent hideme" id="navbar-remove">
+ <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
+ <span class="navbar-toggler-icon"></span>
+ </button>
+
+ <div class="collapse navbar-collapse" id="navbarSupportedContent">
+ <ul class="navbar-nav ml-auto">
+ <li class="nav-item">
+ <a href="#" class="nav-link disabled" style="opacity: 1;">Database Status: <span
+ style="color: #99CC33;">Online</span></a>
+ </li>
+ <div class="divider-vertical"></div>
+ <li class="nav-item">
+ <a class="nav-link" href="/">Home</a>
+ </li>
+ <li class="nav-item active">
+ <a href="#" class="nav-link">Marketplace Beta <span class="sr-only">(current)</span></a>
+ </li>
+ <!--<li class="nav-item">
+ <a class="nav-link" href="/discord/bots/uwufier/about/">About</a>
+ </li>-->
+ <li class="nav-item">
+ <a href="/profile" class="nav-link">Profile</a>
+ </li>
+ <li class="nav-item disabled">
+ <a href="#" class="nav-link disabled">API</a>
+ </li>
+ <div class="divider-vertical"></div>
+ <li class="nav-item">
+ <a href="https://kyzer.co" class="nav-link">More stuff from Sin</a>
+ </li>
+ </ul>
+ <!-- <button class="btn btn-outline-secondary my-2 my-sm-0 btn-round btn-sm">LOGIN</button> -->
+ </div>
+ </nav>
+
+ <div class="container my-5">
+ <form action="/submitMarketEntry" method="POST" class="my-4 form-inline hideme">
+ <div class="row">
+ <div class="col-sm">
+ <label for="transactionType" class="sr-only">Type of transaction</label>
+ <select name="transactionType" id="transactionType" class="form-control mr-2"
+ <% if (name === null) { %> disabled data-toggle="tooltip" data-placement="top"
+ title="Login to submit" <% } %> disabled>
+ <option value="purchase">Purchase</option>
+ <option value="sale">Sale</option>
+ <option value="trade">Trade</option>
+ </select>
+
+ <label for="carsType" class="sr-only">Cars</label>
+ <input type="text" name="carsType" id="carsType" class="form-control mr-2"
+ placeholder="Car(s)" min="2" max="16" required <% if (name === null) { %> disabled
+ data-toggle="tooltip" data-placement="top"
+ title="Login to submit" <% } %> disabled>
+
+ <label for="sellerType" class="sr-only">Seller, Buyer or Trader's Name</label>
+ <input type="text" name="sellerType" id="sellerType" class="form-control mr-2"
+ placeholder="Seller/ Buyer/ Trader's Name" min="1" max="50" required
+ <% if (name === null) { %> disabled data-toggle="tooltip" data-placement="top"
+ title="Login to submit" <% } %> disabled>
+
+ <label for="priceType" class="sr-only">Price or Received Cars</label>
+ <input type="text" name="priceType" id="priceType" class="form-control mr-2"
+ placeholder="Price/ Received Car(s)" min="1" required <% if (name === null) { %> disabled
+ data-toggle="tooltip" data-placement="top"
+ title="Login to submit"
+ <% } %> disabled>
+
+ <% if (name === null) { %>
+ <a href="/login">
+ <button type="button" class="btn btn-danger">Login to submit</button>
+ </a>
+ <% } else { %>
+ <button type="submit" class="btn btn-success" disabled>Submit</button>
+ <% } %>
+
+ <small class="form-text" style="color: #99CC33;">Marketplace coming soon!
+ </small>
+ </div>
+ </div>
+ </form>
+
+ <form action="/searchEntries" method="POST" class="my-4 form-inline hideme">
+ <div class="row">
+ <div class="col-sm">
+ <label for="transactionType" class="sr-only">Type of transaction</label>
+ <select name="transactionType" id="transactionType" class="form-control mr-2"
+ <% if (name === null) { %> disabled data-toggle="tooltip" data-placement="top"
+ title="Login to submit" <% } %> disabled>
+ <option value="car-name">Name</option>
+ <option value="price">Price</option>
+ </select>
+
+ <label for="carsType" class="sr-only">Cars</label>
+ <input type="text" name="carsType" id="carsType" class="form-control mr-2"
+ placeholder="Car Name or Price" min="2" max="16" required <% if (name === null) { %> disabled
+ data-toggle="tooltip" data-placement="top"
+ title="Login to submit" <% } %> disabled>
+
+ <a href="/login">
+ <button type="button" disabled class="btn btn-success">Search</button>
+ </a>
+ </div>
+ </div>
+ </form>
+
+ <div class="row">
+ <div class="col-sm">
+ <h3 id="white-txt" class="hideme">Your Listings</h3>
+ <table class="table table-striped">
+ <thead class="hideme">
+ <tr>
+ <th id="white-txt" class="hideme">Car(s)</th>
+ <th id="white-txt" class="hideme">Seller</th>
+ <th id="white-txt" class="hideme">Price</th>
+ <!-- <th id="white-txt" class="hideme" data-toggle="tooltip" data-placement="top"
+ title="Time of Sale">TOS</th> -->
+ <% if (name === null) { } else { %>
+ <th id="white-txt" class="hideme"></th>
+ <% } %>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td id="white-txt" class="highlightable hideme">RX7</td>
+ <td id="white-txt" class="highlightable hideme">Sin</td>
+ <td id="white-txt" class="highlightable hideme">150000</td>
+ <td id="white-txt" class="highlightable hideme">2020-05-12T03:01:12.6FS9</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="col-sm">
+ <h3 id="white-txt" class="hideme">From Today</h3>
+ <table class="table table-striped">
+ <thead class="hideme">
+ <tr>
+ <th id="white-txt" class="hideme">Car(s)</th>
+ <th id="white-txt" class="hideme">Seller</th>
+ <th id="white-txt" class="hideme">Price</th>
+ <!-- <th id="white-txt" class="hideme" data-toggle="tooltip" data-placement="top"
+ title="Time of Sale">TOS</th> -->
+ <% if (name === null) { } else { %>
+ <th id="white-txt" class="hideme"></th>
+ <% } %>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td id="white-txt" class="highlightable hideme">RX7</td>
+ <td id="white-txt" class="highlightable hideme">Sin</td>
+ <td id="white-txt" class="highlightable hideme">150000</td>
+ <td id="white-txt" class="highlightable hideme">2020-05-06T08:08:34.827Z</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="col-sm">
+ <h3 id="white-txt" class="hideme">From This Week</h3>
+ <table class="table table-striped">
+ <thead class="hideme">
+ <tr>
+ <th id="white-txt" class="hideme">Car(s)</th>
+ <th id="white-txt" class="hideme">Buyer</th>
+ <th id="white-txt" class="hideme">Price</th>
+ <!-- <th id="white-txt" class="hideme" data-toggle="tooltip" data-placement="top"
+ title="Time of Sale">TOS</th> -->
+ <% if (name === null) { } else { %>
+ <th id="white-txt" class="hideme"></th>
+ <% } %>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td id="white-txt" class="highlightable hideme">R34</td>
+ <td id="white-txt" class="highlightable hideme">Sin</td>
+ <td id="white-txt" class="highlightable hideme">180000</td>
+ <td id="white-txt" class="highlightable hideme">2020-05-04T02:02:56.8F9J</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="col-sm">
+ <h3 id="white-txt" class="hideme">From This Month</h3>
+ <table class="table table-striped">
+ <thead class="hideme">
+ <tr>
+ <th id="white-txt">Received Car(s)</th>
+ <th id="white-txt">Trader</th>
+ <th id="white-txt">Traded Car(s)</th>
+ <!-- <th id="white-txt" data-toggle="tooltip" data-placement="top" title="Time of Sale">TOS</th> -->
+ <% if (name === null) { } else { %>
+ <th id="white-txt" class="hideme"></th>
+ <% } %>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td id="white-txt" class="highlightable hideme">R32</td>
+ <td id="white-txt" class="highlightable hideme">Sin</td>
+ <td id="white-txt" class="highlightable hideme">R34</td>
+ <td id="white-txt" class="highlightable hideme">2020-05-02T06:21:23.2J7F</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+
+ <% if (name === 'sin') { %>
+ <div class="newest hideme" style="position: absolute; top: 15px; left: 15px;">
+ <!-- <div class="newest hideme" style="position: fixed; top: 5%; left: 5%;"> -->
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th id="white-txt">Users</th>
+ <th id="white-txt">Entries</th>
+ <th id="white-txt">Uptime</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td id="white-txt" class="highlightable"><%= UserCount %></td>
+ <td id="white-txt" class="highlightable"><%= EntryCount %></td>
+ <td id="white-txt" class="highlightable"><%= dateString %></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <% } %>
+ </div>
+
+ <footer class="hideme">
+ <link rel="stylesheet" type="text/css"
+ href="//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" />
+ Made with <i class="icon ion-heart"></i> by <a href="https://kyzer.co/">Sin</a>. |
+ <span class="highlightable"><%= quote.text %> -<%= quote.author.name %></span>
+ </footer>
+
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
+ integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous">
+ </script>
+ <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
+ integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous">
+ </script>
+ <script src="https://code.jquery.com/jquery-3.5.0.min.js"
+ integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script>
+ <script>
+ $('tbody').each(function() {
+ const list = $(this).children('tr');
+ $(this).html(list.get().reverse())
+ });
+
+ // if you are seeing this, this took way to long to complete.
+ </script>
+ </body>
+</html> \ No newline at end of file
diff --git a/views/profile.ejs b/views/profile.ejs
index 3d3e214..0223c7b 100644
--- a/views/profile.ejs
+++ b/views/profile.ejs
@@ -83,6 +83,9 @@
<li class="nav-item">
<a class="nav-link" href="/">Home</a>
</li>
+ <li class="nav-item">
+ <a href="/marketplace" class="nav-link">Marketplace Beta</a>
+ </li>
<!--<li class="nav-item">
<a class="nav-link" href="/discord/bots/uwufier/about/">About</a>
</li>-->
@@ -135,6 +138,28 @@
</div>
</div>
+ <% if (name === 'sin') { %>
+ <div class="newest hideme" style="position: absolute; top: 15px; left: 15px;">
+ <!-- <div class="newest hideme" style="position: fixed; top: 5%; left: 5%;"> -->
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th id="white-txt">Users</th>
+ <th id="white-txt">Entries</th>
+ <th id="white-txt">Uptime</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td id="white-txt" class="highlightable"><%= UserCount %></td>
+ <td id="white-txt" class="highlightable"><%= EntryCount %></td>
+ <td id="white-txt" class="highlightable"><%= dateString %></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <% } %>
+
<footer class="hideme">
<link rel="stylesheet" type="text/css"
href="//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" />
diff --git a/views/signup.ejs b/views/signup.ejs
index 25d222d..61a0cc0 100644
--- a/views/signup.ejs
+++ b/views/signup.ejs
@@ -73,6 +73,9 @@
<li class="nav-item">
<a class="nav-link" href="/">Home</a>
</li>
+ <li class="nav-item">
+ <a href="/marketplace" class="nav-link">Marketplace Beta</a>
+ </li>
<!--<li class="nav-item">
<a class="nav-link" href="/discord/bots/uwufier/about/">About</a>
</li>-->