From 8c814d79235a38465ef46052cf9a523d555a29e7 Mon Sep 17 00:00:00 2001 From: Mhykol Date: Fri, 3 May 2024 10:56:46 -0400 Subject: Initial commit --- scripts/shop.js | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 scripts/shop.js (limited to 'scripts/shop.js') diff --git a/scripts/shop.js b/scripts/shop.js new file mode 100644 index 0000000..87ddc0c --- /dev/null +++ b/scripts/shop.js @@ -0,0 +1,45 @@ +const database = require('../source/database') +const estore = database('EStore') + +class Shop { + constructor() {} + + async Main() { + return estore.Query('SELECT * FROM Products').then(output => { + const data = { + start: ` +
+
+

This is the Shop page

+ `, + body: '', + end: ` +
+
+ ` + } + for (let i = 0; i < output[0].length; i++) { + data.body += ` +
+

${output[0][i].ProductName}

+

ID: ${output[0][i].ID}

+
+ ` + } + return data.start + data.body + data.end + }) + } + Product() { + const data = ` +
+
+

This is the Product page

+

Description

+
+
+ ` + return data + } +} + +module.exports = () => {return new Shop()} -- cgit v1.2.3-70-g09d2