mirror of
https://gitlab.com/nekoya/web.git
synced 2024-12-22 22:45:10 +01:00
Add transaction page
This commit is contained in:
parent
bef3abde74
commit
c32e31edd4
2 changed files with 55 additions and 0 deletions
|
@ -231,6 +231,25 @@ router.get("/payment", (_req, res) => {
|
|||
res.redirect("/");
|
||||
});
|
||||
|
||||
router.get("/transaction", (req, res) => {
|
||||
auth.session_converter(req.cookies.session_token).then((key) => {
|
||||
if (key != null) {
|
||||
controller.transaction(key).then((data) => {
|
||||
if (data[0] == 200) {
|
||||
res.render("pages/transaction", {
|
||||
data: data[1],
|
||||
loggedIn: 'true'
|
||||
});
|
||||
} else {
|
||||
res.redirect("/");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
res.redirect("/login");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
router.get("/about-us", (req, res) => {
|
||||
auth.session_converter(req.cookies.session_token).then((key) => {
|
||||
if (key != null) {
|
||||
|
|
36
views/pages/transaction.ejs
Normal file
36
views/pages/transaction.ejs
Normal file
|
@ -0,0 +1,36 @@
|
|||
<html>
|
||||
|
||||
<%- include('../layouts/header.ejs', {title: 'Transaction List', state: 'transaction'}); %>
|
||||
|
||||
<body class="bg-color">
|
||||
|
||||
<%- include('../layouts/navbar.ejs', {types: 'v1', state: 'transaction'}); %>
|
||||
|
||||
<div class="container-fluid mt-3 comp-color">
|
||||
<table class="table table-hover table-dark comp-color">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Order ID</th>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Logistic</th>
|
||||
<th scope="col">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% for(let i=0; i < data.length; i++) { %>
|
||||
<tr>
|
||||
<th scope="row"><%= data[i].id %></th>
|
||||
<td><%= data[i].firstName + ' ' + data[i].lastName %></td>
|
||||
<td><%= data[i].logistic %></td>
|
||||
<td><%= data[i].status %></td>
|
||||
</tr>
|
||||
<% } %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<%- include('../layouts/footer.ejs', {state: 'transaction'}); %>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in a new issue