From 24b01903efb49ddc45871ea285d9cfcd67a3e7cd Mon Sep 17 00:00:00 2001 From: vextv Date: Wed, 20 Nov 2024 22:41:34 +0100 Subject: [PATCH 01/24] added first working db query and script to fill DB with random data (WIP) --- database/db_scripts/create_db.sql | 18 +++++++++--------- database/db_scripts/fill_database.sql | 13 +++++++++++++ database/query/get_users.js | 17 ----------------- process.env | 2 +- scripts/query/get_users.js | 17 +++++++++++++++++ 5 files changed, 40 insertions(+), 27 deletions(-) create mode 100644 database/db_scripts/fill_database.sql delete mode 100644 database/query/get_users.js create mode 100644 scripts/query/get_users.js diff --git a/database/db_scripts/create_db.sql b/database/db_scripts/create_db.sql index 343c50e..8ce4e11 100644 --- a/database/db_scripts/create_db.sql +++ b/database/db_scripts/create_db.sql @@ -1,10 +1,10 @@ CREATE TABLE `discount` ( - `deleted_at` INT(8) NOT NULL, - `name` VARCHAR(255) NOT NULL, `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `name` VARCHAR(255) NOT NULL, `description` TEXT NOT NULL, `discount_percent` DECIMAL(8, 2) NOT NULL, + `deleted_at` INT(8) NOT NULL, `modified_at` INT(8) NOT NULL, `created_at` INT(8) NOT NULL, `active` BOOLEAN NOT NULL @@ -101,16 +101,16 @@ CREATE TABLE `product_category` ); CREATE TABLE `user` ( - `is_active` BOOLEAN NOT NULL, + `is_active` BOOLEAN NOT NULL DEFAULT '1', `lower_name` VARCHAR(255) NOT NULL, - `email` VARCHAR(255) NOT NULL, - `passwd_hash_algo` VARCHAR(255) NOT NULL, - `modified_at` INT(8) NOT NULL, - `is_admin` BOOLEAN NOT NULL, + `email` VARCHAR(255) NOT NULL DEFAULT 'NONE', + `passwd_hash_algo` VARCHAR(255) NOT NULL DEFAULT 'NONE', + `modified_at` INT(8) NOT NULL DEFAULT '0', + `is_admin` BOOLEAN NOT NULL DEFAULT '0', `name` VARCHAR(255) NOT NULL, `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - `created_at` INT(8) NOT NULL, - `passwd` VARCHAR(255) NOT NULL + `created_at` INT(8) NOT NULL DEFAULT '0', + `passwd` VARCHAR(255) NOT NULL DEFAULT 'NONE' ); ALTER TABLE `user` diff --git a/database/db_scripts/fill_database.sql b/database/db_scripts/fill_database.sql new file mode 100644 index 0000000..3b27652 --- /dev/null +++ b/database/db_scripts/fill_database.sql @@ -0,0 +1,13 @@ +CREATE PROCEDURE prepare_data() +BEGIN + DECLARE i INT DEFAULT 1; + + WHILE i < 100 + DO + INSERT INTO webshop.user(is_active, name, lower_name, email) + VALUES ('1', 'harry', 'potter', 'test@test.de'); + SET i = i + 1; + end while; +end; + +CALL prepare_data(); \ No newline at end of file diff --git a/database/query/get_users.js b/database/query/get_users.js deleted file mode 100644 index f899821..0000000 --- a/database/query/get_users.js +++ /dev/null @@ -1,17 +0,0 @@ -const mysql = require('mysql'); - -const connection = mysql.createConnection({ - host: "localhost", - user: "root", - password: "", - database: "webshop" -}); - -connection.connect(function (err) { - if (err) throw err; - console.log("Connected to database"); - connection.query("SELECT * FROM user", function (err, result) { - if (err) throw err; - console.log(result); - }) -}); \ No newline at end of file diff --git a/process.env b/process.env index 840a0a6..13dd02d 100644 --- a/process.env +++ b/process.env @@ -5,4 +5,4 @@ APP_PORT=3000 DB_HOST=172.0.0.1:3306 DB_USER=root DB_PASSWORD= -DB_DATABASE= +DB_DATABASE=webshop diff --git a/scripts/query/get_users.js b/scripts/query/get_users.js new file mode 100644 index 0000000..3f80d31 --- /dev/null +++ b/scripts/query/get_users.js @@ -0,0 +1,17 @@ +const mysql = require('mysql'); + +const connection = mysql.createConnection({ + host: "localhost", + user: "root", + password: "", + database: "webshop" +}) + +connection.connect(function (err) { + if (err) throw err + console.log("Connected to database") + connection.query("SELECT * FROM user WHERE ID = 1", function (err, result) { + if (err) throw err + console.log(result) + }) +}) \ No newline at end of file From ce8cf93f4690aa9beccb2637f69ece9a55eba2e7 Mon Sep 17 00:00:00 2001 From: vex Date: Fri, 22 Nov 2024 11:38:58 +0100 Subject: [PATCH 02/24] added working routine to fill "user" table with data --- database/db_scripts/fill_database.sql | 7 +++++-- scripts/query/get_users.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/database/db_scripts/fill_database.sql b/database/db_scripts/fill_database.sql index 3b27652..b54923f 100644 --- a/database/db_scripts/fill_database.sql +++ b/database/db_scripts/fill_database.sql @@ -1,13 +1,16 @@ CREATE PROCEDURE prepare_data() BEGIN DECLARE i INT DEFAULT 1; + DECLARE emailString CHAR(16) DEFAULT 'test'; + WHILE i < 100 DO + SET emailString = CONCAT(emailString, CAST(i AS CHAR(16)), '@test.de'); INSERT INTO webshop.user(is_active, name, lower_name, email) - VALUES ('1', 'harry', 'potter', 'test@test.de'); + VALUES ('1', 'harry', 'potter', emailString); SET i = i + 1; end while; end; -CALL prepare_data(); \ No newline at end of file +#CALL prepare_data(); \ No newline at end of file diff --git a/scripts/query/get_users.js b/scripts/query/get_users.js index 3f80d31..42de95b 100644 --- a/scripts/query/get_users.js +++ b/scripts/query/get_users.js @@ -10,7 +10,7 @@ const connection = mysql.createConnection({ connection.connect(function (err) { if (err) throw err console.log("Connected to database") - connection.query("SELECT * FROM user WHERE ID = 1", function (err, result) { + connection.query("SELECT * FROM webshop.user WHERE ID = 1", function (err, result) { if (err) throw err console.log(result) }) From 6681b29d51db0987ebaca38512aaddd94de4ce8a Mon Sep 17 00:00:00 2001 From: vex Date: Fri, 22 Nov 2024 12:40:38 +0100 Subject: [PATCH 03/24] cleaned up code --- database/db_scripts/delete_db.sql | 3 +-- database/db_scripts/fill_database.sql | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/database/db_scripts/delete_db.sql b/database/db_scripts/delete_db.sql index 29a0cf7..58f5dfd 100644 --- a/database/db_scripts/delete_db.sql +++ b/database/db_scripts/delete_db.sql @@ -20,5 +20,4 @@ drop table if exists user; drop table if exists user_address; -drop table if exists user_payment; - +drop table if exists user_payment; \ No newline at end of file diff --git a/database/db_scripts/fill_database.sql b/database/db_scripts/fill_database.sql index b54923f..523ec8b 100644 --- a/database/db_scripts/fill_database.sql +++ b/database/db_scripts/fill_database.sql @@ -1,8 +1,9 @@ -CREATE PROCEDURE prepare_data() +CREATE PROCEDURE fill_user_table() BEGIN DECLARE i INT DEFAULT 1; DECLARE emailString CHAR(16) DEFAULT 'test'; + DELETE FROM webshop.user; WHILE i < 100 DO @@ -10,7 +11,5 @@ BEGIN INSERT INTO webshop.user(is_active, name, lower_name, email) VALUES ('1', 'harry', 'potter', emailString); SET i = i + 1; - end while; -end; - -#CALL prepare_data(); \ No newline at end of file + END WHILE; +END; \ No newline at end of file From 67e5d2085406c906e69e4ac093145ee31bd28944 Mon Sep 17 00:00:00 2001 From: vex Date: Tue, 7 Jan 2025 12:02:09 +0100 Subject: [PATCH 04/24] =?UTF-8?q?absoluter=20pfad=20f=C3=BCr=20.env=20date?= =?UTF-8?q?ien=20notwendig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 122 ++++++++++++++++++++++++++++++++++ package.json | 1 + process.env | 2 +- scripts/modules/db-connect.js | 2 +- scripts/modules/test.js | 9 +++ scripts/query/get_users.js | 2 +- 6 files changed, 135 insertions(+), 3 deletions(-) create mode 100644 scripts/modules/test.js diff --git a/package-lock.json b/package-lock.json index 3460d88..016df15 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "express": "^4.21.1", "express-session": "^1.18.1", "mysql": "^2.18.1", + "mysql2": "^3.12.0", "path": "^0.12.7" } }, @@ -33,6 +34,15 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, + "node_modules/aws-ssl-profiles": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz", + "integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/bignumber.js": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", @@ -151,6 +161,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -338,6 +357,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "license": "MIT", + "dependencies": { + "is-property": "^1.0.2" + } + }, "node_modules/get-intrinsic": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", @@ -450,11 +478,47 @@ "node": ">= 0.10" } }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==", + "license": "MIT" + }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "license": "Apache-2.0" + }, + "node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/lru.min": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.1.tgz", + "integrity": "sha512-FbAj6lXil6t8z4z3j0E5mfRlPzxkySotzUHwRXjlpRh10vc6AI6WN62ehZj82VG7M20rqogJ0GLwar2Xa05a8Q==", + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=1.30.0", + "node": ">=8.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + } + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -533,6 +597,59 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, + "node_modules/mysql2": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.12.0.tgz", + "integrity": "sha512-C8fWhVysZoH63tJbX8d10IAoYCyXy4fdRFz2Ihrt9jtPILYynFEKUUzpp1U7qxzDc3tMbotvaBH+sl6bFnGZiw==", + "license": "MIT", + "dependencies": { + "aws-ssl-profiles": "^1.1.1", + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.6.3", + "long": "^5.2.1", + "lru.min": "^1.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/mysql2/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mysql2/node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "license": "MIT", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -741,6 +858,11 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, + "node_modules/seq-queue": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + }, "node_modules/serve-static": { "version": "1.16.2", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", diff --git a/package.json b/package.json index 27b6f65..74a3901 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "express": "^4.21.1", "express-session": "^1.18.1", "mysql": "^2.18.1", + "mysql2": "^3.12.0", "path": "^0.12.7" } } diff --git a/process.env b/process.env index 13dd02d..237aa94 100644 --- a/process.env +++ b/process.env @@ -2,7 +2,7 @@ APP_PORT=3000 # configuration for db access -DB_HOST=172.0.0.1:3306 +DB_HOST=localhost DB_USER=root DB_PASSWORD= DB_DATABASE=webshop diff --git a/scripts/modules/db-connect.js b/scripts/modules/db-connect.js index 00b0540..037d14d 100644 --- a/scripts/modules/db-connect.js +++ b/scripts/modules/db-connect.js @@ -1,5 +1,5 @@ const mysql = require('mysql2'); -require('dotenv').config({path:'process.env'}); +require('dotenv').config({path: 'C:/Daten/Webshop/process.env'}); const connection = mysql.createConnection({ host : process.env.DB_HOST, diff --git a/scripts/modules/test.js b/scripts/modules/test.js new file mode 100644 index 0000000..4946a75 --- /dev/null +++ b/scripts/modules/test.js @@ -0,0 +1,9 @@ +require('mysql2') +var connection = require('./db-connect') +connection.query("SELECT * FROM webshop.user WHERE ID = 15", function (err, result) { + if (err) throw err + console.log(result) +}) +connection.end() + +// require("dotenv").config({path:'C:/Daten/Webshop/process.env'}) \ No newline at end of file diff --git a/scripts/query/get_users.js b/scripts/query/get_users.js index 42de95b..72caeef 100644 --- a/scripts/query/get_users.js +++ b/scripts/query/get_users.js @@ -10,7 +10,7 @@ const connection = mysql.createConnection({ connection.connect(function (err) { if (err) throw err console.log("Connected to database") - connection.query("SELECT * FROM webshop.user WHERE ID = 1", function (err, result) { + connection.query("SELECT * FROM webshop.user WHERE ID = 15", function (err, result) { if (err) throw err console.log(result) }) From 2897a9c0a3a76b66972ab4bc9d68e7c8a16a15b1 Mon Sep 17 00:00:00 2001 From: vextv Date: Tue, 7 Jan 2025 20:37:25 +0100 Subject: [PATCH 05/24] =?UTF-8?q?NPM=20'app-root-path'=20Modul=20eingebaut?= =?UTF-8?q?=20um=20absolute=20Pfade=20f=C3=BCr=20.js=20zu=20vermeiden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- scripts/modules/db-connect.js | 2 ++ scripts/modules/test.js | 11 ++++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index d3e6c52..a2b6d9c 100644 --- a/.gitignore +++ b/.gitignore @@ -104,7 +104,6 @@ dist # vuepress v2.x temp and cache directory .temp -.cache # Docusaurus cache and generated files .docusaurus @@ -132,3 +131,5 @@ dist .pnp.* /.idea/git_toolbox_blame.xml +.package.json +.package-lock.json \ No newline at end of file diff --git a/scripts/modules/db-connect.js b/scripts/modules/db-connect.js index 037d14d..97419f7 100644 --- a/scripts/modules/db-connect.js +++ b/scripts/modules/db-connect.js @@ -1,5 +1,7 @@ const mysql = require('mysql2'); require('dotenv').config({path: 'C:/Daten/Webshop/process.env'}); +//to-do: '.env' Dateien aus anderen Directories aufrufen ohne absoluten Pfad +// require("dotenv").config({path:'C:/Daten/Webshop/process.env'}) const connection = mysql.createConnection({ host : process.env.DB_HOST, diff --git a/scripts/modules/test.js b/scripts/modules/test.js index 4946a75..f101177 100644 --- a/scripts/modules/test.js +++ b/scripts/modules/test.js @@ -1,9 +1,10 @@ require('mysql2') -var connection = require('./db-connect') -connection.query("SELECT * FROM webshop.user WHERE ID = 15", function (err, result) { + +let appRoot = require('app-root-path') +let dbConnect = require(appRoot + '/scripts/modules/db-connect.js') + +dbConnect.query("SELECT * FROM webshop.user WHERE ID = 0", function (err, result) { if (err) throw err console.log(result) }) -connection.end() - -// require("dotenv").config({path:'C:/Daten/Webshop/process.env'}) \ No newline at end of file +dbConnect.end() \ No newline at end of file From 0907e841101f2146de024230de8927bb6388a367 Mon Sep 17 00:00:00 2001 From: vex Date: Wed, 8 Jan 2025 12:41:06 +0100 Subject: [PATCH 06/24] login skript erstellt --- scripts/modules/{test.js => login.js} | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename scripts/modules/{test.js => login.js} (54%) diff --git a/scripts/modules/test.js b/scripts/modules/login.js similarity index 54% rename from scripts/modules/test.js rename to scripts/modules/login.js index f101177..454dccc 100644 --- a/scripts/modules/test.js +++ b/scripts/modules/login.js @@ -1,9 +1,11 @@ require('mysql2') +let userInput = "test1" + let appRoot = require('app-root-path') let dbConnect = require(appRoot + '/scripts/modules/db-connect.js') -dbConnect.query("SELECT * FROM webshop.user WHERE ID = 0", function (err, result) { +dbConnect.query("SELECT * FROM webshop.user WHERE email = " + "'" + userInput + "'", function (err, result) { if (err) throw err console.log(result) }) From 3bab7599c7723a5ff5a012f7d6c99b4f608e75b4 Mon Sep 17 00:00:00 2001 From: vex Date: Thu, 27 Feb 2025 11:16:17 +0100 Subject: [PATCH 07/24] changed gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index a2b6d9c..97fad76 100644 --- a/.gitignore +++ b/.gitignore @@ -132,4 +132,6 @@ dist /.idea/git_toolbox_blame.xml .package.json +.package-lock.json +.package.json .package-lock.json \ No newline at end of file From 1670b943f798c34c8e21e002580ce16bce9c785f Mon Sep 17 00:00:00 2001 From: vextv Date: Fri, 7 Mar 2025 23:13:58 +0100 Subject: [PATCH 08/24] login funktion angepasst --- package-lock.json | 10 ++++++++++ package.json | 1 + scripts/modules/login.js | 21 ++++++++++++++++++--- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index dd91a0c..8ccc96d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "app-root-path": "^3.1.0", "dotenv": "^16.4.7", "express": "^4.21.2", "express-session": "^1.18.1", @@ -29,6 +30,15 @@ "node": ">= 0.6" } }, + "node_modules/app-root-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", + "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", diff --git a/package.json b/package.json index c7934d8..c391410 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "license": "ISC", "description": "Webshop Autohändler", "dependencies": { + "app-root-path": "^3.1.0", "dotenv": "^16.4.7", "express": "^4.21.2", "express-session": "^1.18.1", diff --git a/scripts/modules/login.js b/scripts/modules/login.js index 454dccc..e265f91 100644 --- a/scripts/modules/login.js +++ b/scripts/modules/login.js @@ -5,8 +5,23 @@ let userInput = "test1" let appRoot = require('app-root-path') let dbConnect = require(appRoot + '/scripts/modules/db-connect.js') -dbConnect.query("SELECT * FROM webshop.user WHERE email = " + "'" + userInput + "'", function (err, result) { - if (err) throw err - console.log(result) +dbConnect.query("SELECT is_active, name, passwd FROM webshop.user WHERE email = " + "'" + userInput + "'", async (err, result) => { + if (err) + console.log(err) + + if(result.length > 0){ + // tell user "email is already in use" + } else if (passwd !== passwd_confirm){ + // tell user "passwords do not match" + } + let hashedPasswd = await bcrypt.hash(password, 8) + + dbConnect.query('INSERT INTO user SET?', {name: name, email: email, passwd: hashedPasswd}, (err, res) => { + if(err) + console.log(err) + else{ + // tell user "user registered" + } + }) }) dbConnect.end() \ No newline at end of file From 81808ab120a5dc604fcc1b3be9b62f8df3d0f78d Mon Sep 17 00:00:00 2001 From: rgemm Date: Thu, 10 Apr 2025 18:24:47 +0200 Subject: [PATCH 09/24] =?UTF-8?q?Hinzuf=C3=BCgen=20des=20Warenkorbs=20und?= =?UTF-8?q?=20css=20NICHT=20fertig/final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/Warenkorb/warenkorb.html | 33 +++++++++++ public/startseite/startseite.html | 6 +- scripts/routes/other/route-index.js | 3 + static/Styles/Warenkorb/warenkorb.css | 79 +++++++++++++++++++++++++++ 4 files changed, 118 insertions(+), 3 deletions(-) create mode 100644 public/Warenkorb/warenkorb.html create mode 100644 static/Styles/Warenkorb/warenkorb.css diff --git a/public/Warenkorb/warenkorb.html b/public/Warenkorb/warenkorb.html new file mode 100644 index 0000000..1a51dd8 --- /dev/null +++ b/public/Warenkorb/warenkorb.html @@ -0,0 +1,33 @@ + + + + + Warenkorb + + + +
+

đź›’ Dein Warenkorb

+ +
+
+ Produkt 1 + +
+ +
+ +
+
+ Produkt 2 +
+ +
+ +
+
+ + +
+ + diff --git a/public/startseite/startseite.html b/public/startseite/startseite.html index 7640721..7e443f4 100644 --- a/public/startseite/startseite.html +++ b/public/startseite/startseite.html @@ -15,10 +15,10 @@

Autohändler Webshop

diff --git a/scripts/routes/other/route-index.js b/scripts/routes/other/route-index.js index 227b036..1d6c308 100644 --- a/scripts/routes/other/route-index.js +++ b/scripts/routes/other/route-index.js @@ -17,4 +17,7 @@ router.get('/registrieren', (req, res) => { res.sendFile(path.join(__dirname, '../../../public/registrieren/registrieren.html')); }) +router.get('/Warenkorb', (req, res) => { + res.sendFile(path.join(__dirname, '../../../public/warenkorb/warenkorb.html')); +}) module.exports = router; \ No newline at end of file diff --git a/static/Styles/Warenkorb/warenkorb.css b/static/Styles/Warenkorb/warenkorb.css new file mode 100644 index 0000000..b1209d4 --- /dev/null +++ b/static/Styles/Warenkorb/warenkorb.css @@ -0,0 +1,79 @@ +body { + font-family: Arial, sans-serif; + background-color: #f3f3f3; + margin: 0; + padding: 130px; +} + +.warenkorb { + max-width: 500px; + margin: 0 auto; + background: white; + padding: 120px; + border-radius: 12px; + box-shadow: 0 4px 12px rgba(0,0,0,0.1); +} + +.warenkorb h2 { + font-size: 30px; + text-align: center; + margin-bottom: 60px; +} + +.item { + display: flex; + justify-content: space-between; + align-items: center; + border-bottom: 1px solid #ddd; + padding: 10px 0; + margin-bottom: 35px; +} + +.item .info { + display: flex; + flex-direction: column; +} + +.item .name { + font-weight: bold; +} + +.item .price { + color: #555; +} + +.remove { + background-color: #ff4d4f; + border: none; + color: white; + padding: 6px 12px; + border-radius: 6px; + cursor: pointer; +} + +.remove:hover { + background-color: #e60000; +} + +.summary { + text-align: right; + font-size: 1.1em; + margin: 20px 0; +} + +.checkout { + display: block; + width: 100%; + padding: 12px; + background-color: #4CAF50; + border: none; + color: white; + font-size: 16px; + border-radius: 8px; + cursor: pointer; + margin-top: 90px; +} + +.checkout:hover { + background-color: #45a049; +} From e7562304c4dccc6f654d5f36f86e6260e00bc6c6 Mon Sep 17 00:00:00 2001 From: rgemm Date: Fri, 11 Apr 2025 08:43:47 +0200 Subject: [PATCH 10/24] Butten Farbe in Warenkrob angepasst --- scripts/routes/other/route-index.js | 4 ++++ static/Styles/Warenkorb/warenkorb.css | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/routes/other/route-index.js b/scripts/routes/other/route-index.js index 1d6c308..16d8d17 100644 --- a/scripts/routes/other/route-index.js +++ b/scripts/routes/other/route-index.js @@ -20,4 +20,8 @@ router.get('/registrieren', (req, res) => { router.get('/Warenkorb', (req, res) => { res.sendFile(path.join(__dirname, '../../../public/warenkorb/warenkorb.html')); }) + +router.get('/Bestellformular', (req, res) => { + res.sendFile(path.join(__dirname, '../../../public/bestellformular/bestellformular.html')); +}) module.exports = router; \ No newline at end of file diff --git a/static/Styles/Warenkorb/warenkorb.css b/static/Styles/Warenkorb/warenkorb.css index b1209d4..9fc13d4 100644 --- a/static/Styles/Warenkorb/warenkorb.css +++ b/static/Styles/Warenkorb/warenkorb.css @@ -65,7 +65,7 @@ body { display: block; width: 100%; padding: 12px; - background-color: #4CAF50; + background-color: #ff6600; border: none; color: white; font-size: 16px; From 641d14a2dd94e6872f5b2d9fbe5e46974d13dbe6 Mon Sep 17 00:00:00 2001 From: vex Date: Fri, 11 Apr 2025 08:54:50 +0200 Subject: [PATCH 11/24] - fixed database fill script - added new query script --- database/db_scripts/fill_database.sql | 2 -- package-lock.json | 4 +--- scripts/query/get_products.js | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 scripts/query/get_products.js diff --git a/database/db_scripts/fill_database.sql b/database/db_scripts/fill_database.sql index 523ec8b..5fcda43 100644 --- a/database/db_scripts/fill_database.sql +++ b/database/db_scripts/fill_database.sql @@ -3,8 +3,6 @@ BEGIN DECLARE i INT DEFAULT 1; DECLARE emailString CHAR(16) DEFAULT 'test'; - DELETE FROM webshop.user; - WHILE i < 100 DO SET emailString = CONCAT(emailString, CAST(i AS CHAR(16)), '@test.de'); diff --git a/package-lock.json b/package-lock.json index 1d8698a..8ccc96d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,11 +9,9 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "app-root-path": "^3.1.0", "dotenv": "^16.4.7", "express": "^4.21.2", - "app-root-path": "^3.1.0", - "dotenv": "^16.4.5", - "express": "^4.21.1", "express-session": "^1.18.1", "mysql": "^2.18.1", "mysql2": "^3.12.0", diff --git a/scripts/query/get_products.js b/scripts/query/get_products.js new file mode 100644 index 0000000..9f51378 --- /dev/null +++ b/scripts/query/get_products.js @@ -0,0 +1,17 @@ +const mysql = require('mysql'); + +const connection = mysql.createConnection({ + host: "localhost", + user: "root", + password: "", + database: "webshop" +}) + +connection.connect(function (err) { + if (err) throw err + console.log("Connected to database") + connection.query("SELECT * FROM webshop.product LIMIT 10", function (err, result) { + if (err) throw err + console.log(result) + }) +}) \ No newline at end of file From 0482eeec59c81acc1f1ec25a7d6b58e181f08a09 Mon Sep 17 00:00:00 2001 From: vex Date: Fri, 11 Apr 2025 09:03:30 +0200 Subject: [PATCH 12/24] - fixed new query script --- database/db_scripts/fill_database.sql | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/database/db_scripts/fill_database.sql b/database/db_scripts/fill_database.sql index 5fcda43..c923fcd 100644 --- a/database/db_scripts/fill_database.sql +++ b/database/db_scripts/fill_database.sql @@ -1,13 +1,16 @@ -CREATE PROCEDURE fill_user_table() +CREATE + DEFINER = root@localhost procedure prepare_data() BEGIN DECLARE i INT DEFAULT 1; DECLARE emailString CHAR(16) DEFAULT 'test'; + DECLARE readyEmailString CHAR(32); WHILE i < 100 DO - SET emailString = CONCAT(emailString, CAST(i AS CHAR(16)), '@test.de'); + SET readyEmailString = CONCAT(emailString, CAST(i AS CHAR(16)), '@test.de'); INSERT INTO webshop.user(is_active, name, lower_name, email) - VALUES ('1', 'harry', 'potter', emailString); + VALUES ('1', 'harry', 'potter', readyEmailString); SET i = i + 1; END WHILE; -END; \ No newline at end of file +END; + From 1e0aea7fd54727dc805138e4dda155a97bb4bc6f Mon Sep 17 00:00:00 2001 From: vex Date: Fri, 11 Apr 2025 09:26:22 +0200 Subject: [PATCH 13/24] - added script to fill product table [WIP] --- database/db_scripts/fill_products.sql | 30 +++++++++++++++++++ .../{fill_database.sql => fill_users.sql} | 3 +- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 database/db_scripts/fill_products.sql rename database/db_scripts/{fill_database.sql => fill_users.sql} (98%) diff --git a/database/db_scripts/fill_products.sql b/database/db_scripts/fill_products.sql new file mode 100644 index 0000000..757f560 --- /dev/null +++ b/database/db_scripts/fill_products.sql @@ -0,0 +1,30 @@ +INSERT INTO webshop.product_inventory (id) VALUE (1); + +INSERT INTO webshop.product (model, color, engine, description, make, + discount_id, created_at, name, + deleted_at, modified_at, price, inventory_id, category_id) + VALUES +-- Example row 1 +('Model X', 'Red', 'V8', 'A powerful red car', 'Tesla', + FLOOR(1 + RAND() * 5), UNIX_TIMESTAMP(), 'Red Thunder', + 1, UNIX_TIMESTAMP(), ROUND(50000 + (RAND() * 50000), 2), id, 1), + +-- Example row 2 +('Civic', 'Blue', 'I4', 'Efficient and reliable', 'Honda', + FLOOR(1 + RAND() * 5), UNIX_TIMESTAMP(), 'Blue Breeze', + 1, UNIX_TIMESTAMP(), ROUND(20000 + (RAND() * 15000), 2), id, 1), + +-- Example row 3 +('Mustang', 'Black', 'V6', 'A sleek muscle car', 'Ford', + FLOOR(1 + RAND() * 5), UNIX_TIMESTAMP(), 'Black Panther', + 1, UNIX_TIMESTAMP(), ROUND(30000 + (RAND() * 20000), 2), id, 1), + +-- Example row 4 +('Camry', 'White', 'Hybrid', 'Eco-friendly and spacious', 'Toyota', + FLOOR(1 + RAND() * 5), UNIX_TIMESTAMP(), 'White Cloud', + 1, UNIX_TIMESTAMP(), ROUND(25000 + (RAND() * 10000), 2), id, 1), + +-- Example row 5 +('A4', 'Gray', 'V6 Turbo', 'Luxury and performance', 'Audi', + FLOOR(1 + RAND() * 5), UNIX_TIMESTAMP(), 'Gray Ghost', + 1, UNIX_TIMESTAMP(), ROUND(40000 + (RAND() * 30000), 2), id, 1); \ No newline at end of file diff --git a/database/db_scripts/fill_database.sql b/database/db_scripts/fill_users.sql similarity index 98% rename from database/db_scripts/fill_database.sql rename to database/db_scripts/fill_users.sql index c923fcd..d21e23b 100644 --- a/database/db_scripts/fill_database.sql +++ b/database/db_scripts/fill_users.sql @@ -12,5 +12,4 @@ BEGIN VALUES ('1', 'harry', 'potter', readyEmailString); SET i = i + 1; END WHILE; -END; - +END; \ No newline at end of file From 418ed285cfe6db46d5a61baa279fb7bc994bd7ac Mon Sep 17 00:00:00 2001 From: rgemm Date: Mon, 14 Apr 2025 18:51:40 +0200 Subject: [PATCH 14/24] =?UTF-8?q?Farben=20ge=C3=A4ndert=20bei=20Warenkorb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/Styles/Warenkorb/warenkorb.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/Styles/Warenkorb/warenkorb.css b/static/Styles/Warenkorb/warenkorb.css index 9fc13d4..8c8d6c3 100644 --- a/static/Styles/Warenkorb/warenkorb.css +++ b/static/Styles/Warenkorb/warenkorb.css @@ -43,7 +43,7 @@ body { } .remove { - background-color: #ff4d4f; + background-color: #ff6600; border: none; color: white; padding: 6px 12px; @@ -52,7 +52,7 @@ body { } .remove:hover { - background-color: #e60000; + background-color: #ff6600; } .summary { @@ -75,5 +75,5 @@ body { } .checkout:hover { - background-color: #45a049; + background-color: #ff6600; } From 97a1ac474419f2b66d8f36d0b70b1307a6d38601 Mon Sep 17 00:00:00 2001 From: Fabian Date: Mon, 14 Apr 2025 19:22:40 +0200 Subject: [PATCH 15/24] fixed create DB script to actually create a database --- database/db_scripts/create_db.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/database/db_scripts/create_db.sql b/database/db_scripts/create_db.sql index 8ce4e11..164043d 100644 --- a/database/db_scripts/create_db.sql +++ b/database/db_scripts/create_db.sql @@ -1,3 +1,7 @@ +CREATE DATABASE IF NOT EXISTS `webshop` + CHARACTER SET utf8 COLLATE utf8_general_ci; +USE `webshop`; + CREATE TABLE `discount` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, From 6783aaeb1a7efac90a3bbafe0580bbecd21ed41b Mon Sep 17 00:00:00 2001 From: Fabian Date: Mon, 14 Apr 2025 17:43:51 +0000 Subject: [PATCH 16/24] README.md aktualisiert --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 11e1154..230d2a9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # Webshop -Webshop Autohändler \ No newline at end of file +Webshop für Modellautos \ No newline at end of file From ff594657b01cfbcea17530c14d5754cfce335458 Mon Sep 17 00:00:00 2001 From: Fabian Date: Mon, 14 Apr 2025 22:31:24 +0200 Subject: [PATCH 17/24] - deleted unnecessary files - created a new script to fill the databse with random testdata - improved the script to create the databse --- database/db_scripts/create_db.sql | 174 ------ database/db_scripts/delete_db.sql | 23 - database/db_scripts/fill_products.sql | 30 - database/db_scripts/fill_users.sql | 15 - database/db_scripts/webshop_structure.sql | 146 +++++ database/db_scripts/webshop_test-data.sql | 643 ++++++++++++++++++++++ 6 files changed, 789 insertions(+), 242 deletions(-) delete mode 100644 database/db_scripts/create_db.sql delete mode 100644 database/db_scripts/delete_db.sql delete mode 100644 database/db_scripts/fill_products.sql delete mode 100644 database/db_scripts/fill_users.sql create mode 100644 database/db_scripts/webshop_structure.sql create mode 100644 database/db_scripts/webshop_test-data.sql diff --git a/database/db_scripts/create_db.sql b/database/db_scripts/create_db.sql deleted file mode 100644 index 164043d..0000000 --- a/database/db_scripts/create_db.sql +++ /dev/null @@ -1,174 +0,0 @@ -CREATE DATABASE IF NOT EXISTS `webshop` - CHARACTER SET utf8 COLLATE utf8_general_ci; -USE `webshop`; - -CREATE TABLE `discount` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - `name` VARCHAR(255) NOT NULL, - `description` TEXT NOT NULL, - `discount_percent` DECIMAL(8, 2) NOT NULL, - `deleted_at` INT(8) NOT NULL, - `modified_at` INT(8) NOT NULL, - `created_at` INT(8) NOT NULL, - `active` BOOLEAN NOT NULL -); -CREATE TABLE `user_address` -( - `address_line1` VARCHAR(255) NOT NULL, - `city` VARCHAR(255) NOT NULL, - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - `country` VARCHAR(2) NOT NULL, - `user_id` INT UNSIGNED NOT NULL, - `mobile` VARCHAR(255) NOT NULL, - `postal_code` INT NOT NULL, - `address_line2` VARCHAR(255) NOT NULL, - `telephone` VARCHAR(255) NOT NULL -); -ALTER TABLE - `user_address` - ADD UNIQUE `user_address_mobile_unique` (`mobile`); -ALTER TABLE - `user_address` - ADD UNIQUE `user_address_telephone_unique` (`telephone`); -CREATE TABLE `product_inventory` -( - `created_at` INT(8) NOT NULL, - `modified_at` INT(8) NOT NULL, - `quantity` INT NOT NULL, - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - `deleted_at` INT(8) NOT NULL -); -CREATE TABLE `payment_details` -( - `order_id` INT NOT NULL, - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - `status` VARCHAR(255) NOT NULL, - `provider` VARCHAR(255) NOT NULL, - `modified_at` INT(8) NOT NULL, - `amount` INT NOT NULL, - `created_at` INT(8) NOT NULL -); -CREATE TABLE `order_details` -( - `payment_id` INT UNSIGNED NOT NULL, - `total` DECIMAL(8, 2) NOT NULL, - `modified_at` INT(8) NOT NULL, - `created_at` INT(8) NOT NULL, - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - `user_id` INT UNSIGNED NOT NULL -); -CREATE TABLE `order_items` -( - `modified_at` INT(8) NOT NULL, - `user_id` BIGINT NOT NULL, - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - `quantity` INT NOT NULL, - `order_id` INT UNSIGNED NOT NULL, - `created_at` INT(8) NOT NULL, - `product_id` INT UNSIGNED NOT NULL -); -CREATE TABLE `user_payment` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - `provider` VARCHAR(255) NOT NULL, - `account_no` VARCHAR(255) NOT NULL, - `expiry` DATE NOT NULL, - `payment_type` VARCHAR(255) NOT NULL, - `user_id` INT UNSIGNED NOT NULL -); -CREATE TABLE `product` -( - `category_id` INT UNSIGNED NOT NULL, - `model` VARCHAR(255) NOT NULL, - `color` VARCHAR(255) NOT NULL, - `engine` VARCHAR(255) NOT NULL, - `description` TEXT NOT NULL, - `make` VARCHAR(255) NOT NULL, - `inventory_id` INT UNSIGNED NOT NULL, - `discount_id` INT UNSIGNED NOT NULL, - `created_at` INT(8) NOT NULL, - `name` VARCHAR(255) NOT NULL, - `deleted_at` INT(8) NOT NULL, - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - `modified_at` INT(8) NOT NULL, - `price` DECIMAL(8, 2) NOT NULL -); -CREATE TABLE `product_category` -( - `created_at` INT(8) NOT NULL, - `name` VARCHAR(255) NOT NULL, - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - `modified_at` INT(8) NOT NULL, - `desc` TEXT NOT NULL, - `deleted_at` INT(8) NOT NULL -); -CREATE TABLE `user` -( - `is_active` BOOLEAN NOT NULL DEFAULT '1', - `lower_name` VARCHAR(255) NOT NULL, - `email` VARCHAR(255) NOT NULL DEFAULT 'NONE', - `passwd_hash_algo` VARCHAR(255) NOT NULL DEFAULT 'NONE', - `modified_at` INT(8) NOT NULL DEFAULT '0', - `is_admin` BOOLEAN NOT NULL DEFAULT '0', - `name` VARCHAR(255) NOT NULL, - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - `created_at` INT(8) NOT NULL DEFAULT '0', - `passwd` VARCHAR(255) NOT NULL DEFAULT 'NONE' -); -ALTER TABLE - `user` - ADD UNIQUE `user_email_unique` (`email`); -CREATE TABLE `shopping_session` -( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - `created_at` INT(8) NOT NULL, - `user_id` INT UNSIGNED NOT NULL, - `modified_at` INT(8) NOT NULL, - `total` DECIMAL(8, 2) NOT NULL -); -CREATE TABLE `cart_item` -( - `product_id` INT UNSIGNED NOT NULL, - `session_id` INT UNSIGNED NOT NULL, - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - `created_at` INT(8) NOT NULL, - `modified_at` INT(8) NOT NULL, - `quantity` INT NOT NULL -); -ALTER TABLE - `product` - ADD CONSTRAINT `product_inventory_id_foreign` FOREIGN KEY (`inventory_id`) REFERENCES `product_inventory` (`id`); -ALTER TABLE - `order_items` - ADD CONSTRAINT `order_items_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `order_details` (`id`); -ALTER TABLE - `product` - ADD CONSTRAINT `product_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `product_category` (`id`); -ALTER TABLE - `order_details` - ADD CONSTRAINT `order_details_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`); -ALTER TABLE - `cart_item` - ADD CONSTRAINT `cart_item_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`); -ALTER TABLE - `order_items` - ADD CONSTRAINT `order_items_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`); -ALTER TABLE - `user_address` - ADD CONSTRAINT `user_address_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`); -ALTER TABLE - `order_details` - ADD CONSTRAINT `order_details_payment_id_foreign` FOREIGN KEY (`payment_id`) REFERENCES `payment_details` (`id`); -ALTER TABLE - `product` - ADD CONSTRAINT `product_discount_id_foreign` FOREIGN KEY (`discount_id`) REFERENCES `discount` (`id`); -ALTER TABLE - `user_payment` - ADD CONSTRAINT `user_payment_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`); -ALTER TABLE - `shopping_session` - ADD CONSTRAINT `shopping_session_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`); -ALTER TABLE - `cart_item` - ADD CONSTRAINT `cart_item_session_id_foreign` FOREIGN KEY (`session_id`) REFERENCES `shopping_session` (`id`); \ No newline at end of file diff --git a/database/db_scripts/delete_db.sql b/database/db_scripts/delete_db.sql deleted file mode 100644 index 58f5dfd..0000000 --- a/database/db_scripts/delete_db.sql +++ /dev/null @@ -1,23 +0,0 @@ -drop table if exists cart_item; - -drop table if exists discount; - -drop table if exists oder_items; - -drop table if exists order_details; - -drop table if exists payment_details; - -drop table if exists product; - -drop table if exists product_category; - -drop table if exists product_inventory; - -drop table if exists shopping_session; - -drop table if exists user; - -drop table if exists user_address; - -drop table if exists user_payment; \ No newline at end of file diff --git a/database/db_scripts/fill_products.sql b/database/db_scripts/fill_products.sql deleted file mode 100644 index 757f560..0000000 --- a/database/db_scripts/fill_products.sql +++ /dev/null @@ -1,30 +0,0 @@ -INSERT INTO webshop.product_inventory (id) VALUE (1); - -INSERT INTO webshop.product (model, color, engine, description, make, - discount_id, created_at, name, - deleted_at, modified_at, price, inventory_id, category_id) - VALUES --- Example row 1 -('Model X', 'Red', 'V8', 'A powerful red car', 'Tesla', - FLOOR(1 + RAND() * 5), UNIX_TIMESTAMP(), 'Red Thunder', - 1, UNIX_TIMESTAMP(), ROUND(50000 + (RAND() * 50000), 2), id, 1), - --- Example row 2 -('Civic', 'Blue', 'I4', 'Efficient and reliable', 'Honda', - FLOOR(1 + RAND() * 5), UNIX_TIMESTAMP(), 'Blue Breeze', - 1, UNIX_TIMESTAMP(), ROUND(20000 + (RAND() * 15000), 2), id, 1), - --- Example row 3 -('Mustang', 'Black', 'V6', 'A sleek muscle car', 'Ford', - FLOOR(1 + RAND() * 5), UNIX_TIMESTAMP(), 'Black Panther', - 1, UNIX_TIMESTAMP(), ROUND(30000 + (RAND() * 20000), 2), id, 1), - --- Example row 4 -('Camry', 'White', 'Hybrid', 'Eco-friendly and spacious', 'Toyota', - FLOOR(1 + RAND() * 5), UNIX_TIMESTAMP(), 'White Cloud', - 1, UNIX_TIMESTAMP(), ROUND(25000 + (RAND() * 10000), 2), id, 1), - --- Example row 5 -('A4', 'Gray', 'V6 Turbo', 'Luxury and performance', 'Audi', - FLOOR(1 + RAND() * 5), UNIX_TIMESTAMP(), 'Gray Ghost', - 1, UNIX_TIMESTAMP(), ROUND(40000 + (RAND() * 30000), 2), id, 1); \ No newline at end of file diff --git a/database/db_scripts/fill_users.sql b/database/db_scripts/fill_users.sql deleted file mode 100644 index d21e23b..0000000 --- a/database/db_scripts/fill_users.sql +++ /dev/null @@ -1,15 +0,0 @@ -CREATE - DEFINER = root@localhost procedure prepare_data() -BEGIN - DECLARE i INT DEFAULT 1; - DECLARE emailString CHAR(16) DEFAULT 'test'; - DECLARE readyEmailString CHAR(32); - - WHILE i < 100 - DO - SET readyEmailString = CONCAT(emailString, CAST(i AS CHAR(16)), '@test.de'); - INSERT INTO webshop.user(is_active, name, lower_name, email) - VALUES ('1', 'harry', 'potter', readyEmailString); - SET i = i + 1; - END WHILE; -END; \ No newline at end of file diff --git a/database/db_scripts/webshop_structure.sql b/database/db_scripts/webshop_structure.sql new file mode 100644 index 0000000..dc5ef4a --- /dev/null +++ b/database/db_scripts/webshop_structure.sql @@ -0,0 +1,146 @@ +DROP DATABASE IF EXISTS webshop; +CREATE DATABASE IF NOT EXISTS `webshop` + CHARACTER SET utf8 COLLATE utf8_general_ci; + +USE `webshop`; + +CREATE TABLE `user` +( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `name` VARCHAR(255) NOT NULL, + `lower_name` VARCHAR(255) NOT NULL, + `email` VARCHAR(255) NOT NULL DEFAULT 'NONE', + `passwd` VARCHAR(255) NOT NULL DEFAULT 'NONE', + `passwd_hash_algo` VARCHAR(255) NOT NULL DEFAULT 'NONE', + `is_admin` BOOLEAN NOT NULL DEFAULT '0' +); +ALTER TABLE + `user` + ADD UNIQUE `user_email_unique` (`email`); +CREATE TABLE `user_address` +( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `user_id` INT UNSIGNED NOT NULL, + `address_line1` VARCHAR(255) NOT NULL, + `address_line2` VARCHAR(255) NOT NULL, + `city` VARCHAR(255) NOT NULL, + `postal_code` INT NOT NULL, + `country` VARCHAR(2) NOT NULL, + `telephone` VARCHAR(255) NOT NULL +); +ALTER TABLE + `user_address` + ADD UNIQUE `user_address_telephone_unique` (`telephone`); +CREATE TABLE `user_payment` +( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `user_id` INT UNSIGNED NOT NULL, + `payment_type` VARCHAR(255) NOT NULL, + `provider` VARCHAR(255) NOT NULL, + `account_no` VARCHAR(255) NOT NULL, + `expiry` DATE NOT NULL +); +CREATE TABLE `shopping_session` +( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `user_id` INT UNSIGNED NOT NULL, + `total` DECIMAL(8, 2) NOT NULL +); +CREATE TABLE `cart_item` +( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `session_id` INT UNSIGNED NOT NULL, + `product_id` INT UNSIGNED NOT NULL, + `quantity` INT NOT NULL +); +CREATE TABLE `payment_details` +( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `order_id` INT NOT NULL, + `amount` INT NOT NULL, + `provider` VARCHAR(255) NOT NULL, + `status` VARCHAR(255) NOT NULL +); +CREATE TABLE `product` +( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `name` VARCHAR(255) NOT NULL, + `make` VARCHAR(255) NOT NULL, + `model` VARCHAR(255) NOT NULL, + `description` TEXT NOT NULL, + `category_id` INT UNSIGNED NOT NULL, + `price` DECIMAL(8, 2) NOT NULL, + `discount_id` INT UNSIGNED NOT NULL, + `created_at` DATE NOT NULL +); +CREATE TABLE `discount` +( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `name` VARCHAR(255) NOT NULL, + `description` TEXT NOT NULL, + `discount_percent` DECIMAL(8, 2) NOT NULL, + `active` BOOLEAN NOT NULL +); +CREATE TABLE `order_items` +( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `order_id` INT UNSIGNED NOT NULL, + `product_id` INT UNSIGNED NOT NULL, + `quantity` INT NOT NULL, + `user_id` BIGINT NOT NULL +); +CREATE TABLE `product_category` +( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `name` VARCHAR(255) NOT NULL +); +CREATE TABLE `order_details` +( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `user_id` INT UNSIGNED NOT NULL, + `total` DECIMAL(8, 2) NOT NULL, + `payment_id` INT UNSIGNED NOT NULL +); +CREATE TABLE `product_pictures` +( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + `product_id` INT UNSIGNED NOT NULL, + `picture_base64` TEXT NOT NULL, + `is_primary` BOOLEAN NOT NULL +); +ALTER TABLE + `product_pictures` + ADD CONSTRAINT `product_pictures_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`); +ALTER TABLE + `user_payment` + ADD CONSTRAINT `user_payment_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`); +ALTER TABLE + `order_details` + ADD CONSTRAINT `order_details_payment_id_foreign` FOREIGN KEY (`payment_id`) REFERENCES `payment_details` (`id`); +ALTER TABLE + `order_details` + ADD CONSTRAINT `order_details_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`); +ALTER TABLE + `order_items` + ADD CONSTRAINT `order_items_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`); +ALTER TABLE + `product` + ADD CONSTRAINT `product_discount_id_foreign` FOREIGN KEY (`discount_id`) REFERENCES `discount` (`id`); +ALTER TABLE + `shopping_session` + ADD CONSTRAINT `shopping_session_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`); +ALTER TABLE + `product` + ADD CONSTRAINT `product_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `product_category` (`id`); +ALTER TABLE + `user_address` + ADD CONSTRAINT `user_address_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`); +ALTER TABLE + `order_items` + ADD CONSTRAINT `order_items_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `order_details` (`id`); +ALTER TABLE + `cart_item` + ADD CONSTRAINT `cart_item_session_id_foreign` FOREIGN KEY (`session_id`) REFERENCES `shopping_session` (`id`); +ALTER TABLE + `cart_item` + ADD CONSTRAINT `cart_item_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`); \ No newline at end of file diff --git a/database/db_scripts/webshop_test-data.sql b/database/db_scripts/webshop_test-data.sql new file mode 100644 index 0000000..2e4bd83 --- /dev/null +++ b/database/db_scripts/webshop_test-data.sql @@ -0,0 +1,643 @@ +USE webshop; + +-- Product Categories +INSERT INTO product_category (id, name) +VALUES (1, 'Electronics'); +INSERT INTO product_category (id, name) +VALUES (2, 'Home Appliances'); +INSERT INTO product_category (id, name) +VALUES (3, 'Clothing'); +INSERT INTO product_category (id, name) +VALUES (4, 'Sports'); +INSERT INTO product_category (id, name) +VALUES (5, 'Books'); + +-- Discounts +INSERT INTO discount (id, name, description, discount_percent, active) +VALUES (1, 'Spring Sale', 'Description for Spring Sale', 15, TRUE); +INSERT INTO discount (id, name, description, discount_percent, active) +VALUES (2, 'Black Friday', 'Description for Black Friday', 40, TRUE); +INSERT INTO discount (id, name, description, discount_percent, active) +VALUES (3, 'New User', 'Description for New User', 10, TRUE); +INSERT INTO discount (id, name, description, discount_percent, active) +VALUES (4, 'Clearance', 'Description for Clearance', 25, TRUE); +INSERT INTO discount (id, name, description, discount_percent, active) +VALUES (5, 'Holiday Deal', 'Description for Holiday Deal', 20, TRUE); + +-- Users +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (1, 'User1', LOWER('User1'), 'user1@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (2, 'User2', LOWER('User2'), 'user2@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (3, 'User3', LOWER('User3'), 'user3@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (4, 'User4', LOWER('User4'), 'user4@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (5, 'User5', LOWER('User5'), 'user5@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (6, 'User6', LOWER('User6'), 'user6@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (7, 'User7', LOWER('User7'), 'user7@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (8, 'User8', LOWER('User8'), 'user8@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (9, 'User9', LOWER('User9'), 'user9@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (10, 'User10', LOWER('User10'), 'user10@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (11, 'User11', LOWER('User11'), 'user11@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (12, 'User12', LOWER('User12'), 'user12@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (13, 'User13', LOWER('User13'), 'user13@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (14, 'User14', LOWER('User14'), 'user14@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (15, 'User15', LOWER('User15'), 'user15@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (16, 'User16', LOWER('User16'), 'user16@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (17, 'User17', LOWER('User17'), 'user17@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (18, 'User18', LOWER('User18'), 'user18@example.com', 'password123', 'bcrypt', FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (19, 'User19', LOWER('User19'), 'user19@example.com', 'password123', 'bcrypt',FALSE); +INSERT INTO user (id, name, lower_name, email, passwd, passwd_hash_algo, is_admin) +VALUES (20, 'User20', LOWER('User20'), 'user20@example.com', 'password123', 'bcrypt', FALSE); + +-- User Addresses +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (1, '123 Main St', 'Apt 1', 'Berlin', 10001, 'DE', '1234567891'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (2, '123 Main St', 'Apt 2', 'Toronto', 10002, 'DE', '1234567892'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (3, '123 Main St', 'Apt 3', 'New York', 10003, 'GB', '1234567893'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (4, '123 Main St', 'Apt 4', 'Paris', 10004, 'DE', '1234567894'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (5, '123 Main St', 'Apt 5', 'Paris', 10005, 'FR', '1234567895'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (6, '123 Main St', 'Apt 6', 'New York', 10006, 'DE', '1234567896'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (7, '123 Main St', 'Apt 7', 'Berlin', 10007, 'FR', '1234567897'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (8, '123 Main St', 'Apt 8', 'Paris', 10008, 'US', '1234567898'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (9, '123 Main St', 'Apt 9', 'London', 10009, 'FR', '1234567899'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (10, '123 Main St', 'Apt 10', 'Paris', 10010, 'CA', '12345678910'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (11, '123 Main St', 'Apt 11', 'London', 10011, 'DE', '12345678911'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (12, '123 Main St', 'Apt 12', 'London', 10012, 'US', '12345678912'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (13, '123 Main St', 'Apt 13', 'Toronto', 10013, 'US', '12345678913'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (14, '123 Main St', 'Apt 14', 'Toronto', 10014, 'CA', '12345678914'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (15, '123 Main St', 'Apt 15', 'Paris', 10015, 'CA', '12345678915'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (16, '123 Main St', 'Apt 16', 'London', 10016, 'US', '12345678916'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (17, '123 Main St', 'Apt 17', 'New York', 10017, 'CA', '12345678917'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (18, '123 Main St', 'Apt 18', 'Berlin', 10018, 'GB', '12345678918'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (19, '123 Main St', 'Apt 19', 'Berlin', 10019, 'DE', '12345678919'); +INSERT INTO user_address (user_id, address_line1, address_line2, city, postal_code, country, telephone) +VALUES (20, '123 Main St', 'Apt 20', 'Berlin', 10020, 'GB', '12345678920'); + +-- User Payments +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (1, 'Credit Card', 'Stripe', 'ACCNO0001', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (2, 'Debit Card', 'Visa', 'ACCNO0002', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (3, 'PayPal', 'Stripe', 'ACCNO0003', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (4, 'PayPal', 'Visa', 'ACCNO0004', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (5, 'Debit Card', 'MasterCard', 'ACCNO0005', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (6, 'Credit Card', 'Visa', 'ACCNO0006', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (7, 'Debit Card', 'Stripe', 'ACCNO0007', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (8, 'PayPal', 'Stripe', 'ACCNO0008', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (9, 'Credit Card', 'MasterCard', 'ACCNO0009', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (10, 'PayPal', 'Stripe', 'ACCNO0010', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (11, 'PayPal', 'Visa', 'ACCNO0011', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (12, 'Debit Card', 'PayPal', 'ACCNO0012', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (13, 'PayPal', 'PayPal', 'ACCNO0013', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (14, 'PayPal', 'MasterCard', 'ACCNO0014', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (15, 'Credit Card', 'PayPal', 'ACCNO0015', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (16, 'Debit Card', 'Visa', 'ACCNO0016', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (17, 'Credit Card', 'PayPal', 'ACCNO0017', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (18, 'Debit Card', 'MasterCard', 'ACCNO0018', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (19, 'Debit Card', 'PayPal', 'ACCNO0019', '2026-12-31'); +INSERT INTO user_payment (user_id, payment_type, provider, account_no, expiry) +VALUES (20, 'PayPal', 'Stripe', 'ACCNO0020', '2026-12-31'); + +-- Products +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (1, 'Product1', 'BrandA', 'Model1', 'Description for Product1', 5, 318.94, 2, '2024-06-16'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (2, 'Product2', 'BrandC', 'Model2', 'Description for Product2', 5, 521.19, 5, '2025-03-05'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (3, 'Product3', 'BrandB', 'Model3', 'Description for Product3', 2, 230.04, 2, '2024-08-12'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (4, 'Product4', 'BrandC', 'Model4', 'Description for Product4', 1, 147.85, 4, '2025-03-02'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (5, 'Product5', 'BrandA', 'Model5', 'Description for Product5', 4, 520.02, 3, '2024-09-08'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (6, 'Product6', 'BrandC', 'Model6', 'Description for Product6', 4, 146.06, 5, '2024-07-08'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (7, 'Product7', 'BrandC', 'Model7', 'Description for Product7', 1, 862.11, 3, '2025-03-20'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (8, 'Product8', 'BrandC', 'Model8', 'Description for Product8', 1, 313.82, 2, '2024-10-17'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (9, 'Product9', 'BrandA', 'Model9', 'Description for Product9', 2, 491.74, 2, '2025-01-17'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (10, 'Product10', 'BrandB', 'Model10', 'Description for Product10', 3, 182.49, 3, '2025-01-02'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (11, 'Product11', 'BrandB', 'Model11', 'Description for Product11', 4, 907.39, 3, '2025-01-29'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (12, 'Product12', 'BrandB', 'Model12', 'Description for Product12', 2, 962.56, 2, '2024-07-01'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (13, 'Product13', 'BrandC', 'Model13', 'Description for Product13', 5, 933.24, 5, '2024-05-24'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (14, 'Product14', 'BrandB', 'Model14', 'Description for Product14', 2, 474.63, 1, '2024-11-26'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (15, 'Product15', 'BrandC', 'Model15', 'Description for Product15', 5, 112.99, 1, '2024-07-14'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (16, 'Product16', 'BrandA', 'Model16', 'Description for Product16', 5, 92.21, 5, '2024-06-21'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (17, 'Product17', 'BrandB', 'Model17', 'Description for Product17', 1, 30.15, 4, '2024-10-04'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (18, 'Product18', 'BrandA', 'Model18', 'Description for Product18', 2, 169.85, 1, '2024-11-07'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (19, 'Product19', 'BrandB', 'Model19', 'Description for Product19', 5, 559.7, 1, '2024-09-12'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (20, 'Product20', 'BrandB', 'Model20', 'Description for Product20', 1, 617.8, 4, '2024-04-26'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (21, 'Product21', 'BrandB', 'Model21', 'Description for Product21', 1, 353.15, 4, '2024-04-24'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (22, 'Product22', 'BrandA', 'Model22', 'Description for Product22', 4, 827.72, 1, '2024-04-17'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (23, 'Product23', 'BrandB', 'Model23', 'Description for Product23', 4, 24.71, 2, '2025-03-24'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (24, 'Product24', 'BrandB', 'Model24', 'Description for Product24', 1, 452.61, 1, '2024-07-06'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (25, 'Product25', 'BrandA', 'Model25', 'Description for Product25', 3, 245.66, 2, '2024-05-20'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (26, 'Product26', 'BrandA', 'Model26', 'Description for Product26', 4, 741.09, 2, '2024-12-23'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (27, 'Product27', 'BrandB', 'Model27', 'Description for Product27', 2, 549.64, 2, '2025-01-28'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (28, 'Product28', 'BrandC', 'Model28', 'Description for Product28', 3, 93.43, 2, '2024-07-15'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (29, 'Product29', 'BrandC', 'Model29', 'Description for Product29', 1, 610.66, 1, '2024-08-07'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (30, 'Product30', 'BrandC', 'Model30', 'Description for Product30', 4, 537.6, 3, '2024-06-24'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (31, 'Product31', 'BrandB', 'Model31', 'Description for Product31', 4, 377.7, 1, '2024-06-20'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (32, 'Product32', 'BrandA', 'Model32', 'Description for Product32', 4, 353.25, 2, '2024-09-20'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (33, 'Product33', 'BrandB', 'Model33', 'Description for Product33', 4, 550.94, 3, '2024-08-02'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (34, 'Product34', 'BrandA', 'Model34', 'Description for Product34', 1, 692.25, 4, '2024-04-16'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (35, 'Product35', 'BrandB', 'Model35', 'Description for Product35', 4, 249.37, 3, '2024-05-10'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (36, 'Product36', 'BrandC', 'Model36', 'Description for Product36', 4, 418.07, 1, '2024-08-18'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (37, 'Product37', 'BrandC', 'Model37', 'Description for Product37', 1, 455.82, 4, '2024-04-27'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (38, 'Product38', 'BrandA', 'Model38', 'Description for Product38', 4, 664.72, 1, '2024-12-28'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (39, 'Product39', 'BrandB', 'Model39', 'Description for Product39', 3, 80.6, 1, '2024-10-18'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (40, 'Product40', 'BrandA', 'Model40', 'Description for Product40', 4, 28.12, 4, '2024-09-05'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (41, 'Product41', 'BrandA', 'Model41', 'Description for Product41', 3, 251.78, 5, '2025-02-08'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (42, 'Product42', 'BrandC', 'Model42', 'Description for Product42', 4, 144.43, 1, '2024-05-11'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (43, 'Product43', 'BrandA', 'Model43', 'Description for Product43', 5, 748.88, 3, '2025-01-04'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (44, 'Product44', 'BrandB', 'Model44', 'Description for Product44', 5, 882.23, 1, '2024-08-19'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (45, 'Product45', 'BrandB', 'Model45', 'Description for Product45', 3, 899.3, 4, '2024-07-03'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (46, 'Product46', 'BrandC', 'Model46', 'Description for Product46', 4, 272.38, 4, '2024-11-11'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (47, 'Product47', 'BrandB', 'Model47', 'Description for Product47', 3, 470.78, 2, '2024-10-28'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (48, 'Product48', 'BrandC', 'Model48', 'Description for Product48', 2, 116.97, 1, '2024-09-13'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (49, 'Product49', 'BrandA', 'Model49', 'Description for Product49', 5, 30.57, 4, '2024-09-18'); +INSERT INTO product (id, name, make, model, description, category_id, price, discount_id, created_at) +VALUES (50, 'Product50', 'BrandB', 'Model50', 'Description for Product50', 2, 861.84, 4, '2024-11-26'); + +-- Product Pictures +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (1, 'mnELxugt4Ydr4FUssyH+bkSevIrNl/KBGyH8LLhxFKI=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (2, 'mr6UQfVtBB6Gj7MaxDer/zNGsEeJ3DHH5JzLZmKUC+c=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (3, 'yCeHteIvMo3LNNxflAknKAm3TUm6bI/+cUe4mCyp5Vs=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (4, 'A1trFKv8HmX7+WxtkRAod/QbH2xKBUr3AS0sh7OT+oI=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (5, 'zdfKP/uLcgmMv1x4v+5FA2gEGK00yW2HJDHemYAxEBk=', TRUE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (6, 'wFpi7y31rFU7VICwWc8ONnx2ApSFSaF1do/ozuoENTM=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (7, 'KkpNEMOR/cMQ3zv7mjdiMG8lWh6x7S6C8vQFzqN8YYk=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (8, 'VadAqdlySAPOguy/vVfGGaUzbMciyv9niqjS2peB79c=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (9, 'pecXJbykN65n5BwAuGiWEiW2YRP1vxk5JUaBB7Z2QKE=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (10, 'JRkmNYuGySf+MCx+dPRj5cVMOu0AhHEUhSeKWGvsoM0=', TRUE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (11, 'Tln4hU4s5Nyx5wkzA/kCn4puKxHqfrdpiEaOn+Dsj0c=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (12, 'rmlebzsSR28Xl8W7HrrCetU/Xlww/m750el2QgCLrtw=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (13, 'aSXu2+PDwlE0bJ7+JgifoIRYmNFgpf4Rac1Hih3OaoQ=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (14, '0nTDMczLNN5MmLM9CecyZyNHSjAg3+hj3QIEKjEheIw=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (15, 'eKKF0BWqGh977FJNERzlZH01xvLCJLfWO507tFctImA=', TRUE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (16, 'Qx0W4ZIOI3EWcdESsMm3Wp/NEfeGssKrTD4D7hH3bzs=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (17, 't70dXq30C82ca1wRo7TmG3GBEa1MrTccl6uVbOYUcf8=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (18, 'o2xac1ar86EUPNi/q+FJEqvfIjIVUTBBKCmHoMaAqKU=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (19, 'j252AyKpFxiTVlXHar/vicn1NBzUoZtMOA7V+bVSuto=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (20, 'ddoRalgx15Oq2XgG83ksnZYnr38k3bgytWyuvMwPVNc=', TRUE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (21, 'iPcGIdcvwInGY3mc6wMKYyfAagIz5ZRjmfbbtg2+fDc=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (22, 'vtP3wxpUhcgg+M1BQV88MlIWbsOU0FkT/3qiDEJfjsM=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (23, 'lkMSOWhVUXQJwj8qui8OsevJp+a8drNyYY1PdsF9ofQ=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (24, 'OXZP3Y5ZNRREjBlK49W4oESBVc1CaPPPOJXi6mlH6n4=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (25, '1ODn0qkTCPxfapjkV8baMp+KuFrkbaLhTZfb9NQgUPU=', TRUE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (26, 'bgz2EcoOVDRagfBNLi8aPMx3yE8TbmQryWKsT7dI35c=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (27, '5KkXTV4R2M4vbf9/1R4F1pEqt02AlU6BGcUSTzD/8PI=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (28, 'ZXLkPF69pEUGz7/asGZ/n1n1yOfknrWYFv13SpvpJ9s=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (29, 'DC8UtBTDA80YqgOKxu2jNfdm4Y8JpxzuCoRiHbAiT10=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (30, 'OFm88w/1zT7DQjOVXcANhLLD6khvrF3UI7b56KmBzaU=', TRUE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (31, 'DfPzNf2+gQ9fx7QGxDY2t8VL0rtizZGY8zPvzAbqMIk=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (32, 'w89sMLHYMX7IW5ykCvu4BW448GkG4/MAWt89jbkr7YI=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (33, 'syvLhg+8VIt4Gihgq+FtmPABuD3sAMTdDlyhOu85Kqo=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (34, '2fDRzCfntjtZAneqqyzr3hD6RV/0Ad/YmCwTwjNlenc=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (35, 'ygca9b8poneJF/3RS5Kr5GMfH7+kv6m0VFDDvknfwfE=', TRUE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (36, 'tRriLe4gYRGOepP/Bn0kb6ChEKoOfKMxgnmxOh1sgS0=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (37, 'ir5yC2KMiX0w7fnaGNp85WrZU04Mgc59KWr0hkx6DIc=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (38, 'oNw9xNd/JfmOFAVX+sKWiLfH2ipyP/z/wW4dmaPN2qM=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (39, 'D+mT9AXixD432UIBcTQBZ9sd+d6W6MsnJaSOWom2DxA=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (40, 'QbjTL1bK2X5GE2KGpisiI9UIBboZhv+zFH2S16cl2E0=', TRUE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (41, 'MrUZXSdNCy3Uiochw8wSQjMu4veozWLywvp3IlbIQwo=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (42, 'i2+PZBqElXU+yUCGWRpz/HOxy2RMbmFz+9Z/JWkOgHU=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (43, 'D73S1+s3ILVdRaXj0ow+baD0QAtBCUh6jNVyYkKx3Cs=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (44, 'gHDoV2NuiBiDGJEIWLy32zrFRQb5C0ocSIgKjYs1E84=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (45, 'ks4WUYGB7sv8hFgK+H3v72t7HXDMcArsRdtj2U9B798=', TRUE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (46, '4pX2NjrxNZCSy96Uj3yXSbcM+CZ8N0WZTKVzuEl4kls=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (47, 'lY+/60wB02mXhaMBw2vcGhkYyOHUxgw0ItOqcb+wM/Q=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (48, '/QDMi1jgaR9dDlJEKLte5Zf+aMe+7Z3BLdndbgOIDO4=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (49, 'oyYP6vIP1QfDWGJBF8DJrzrx9o44aH4tnXOGCPQfEF8=', FALSE); +INSERT INTO product_pictures (product_id, picture_base64, is_primary) +VALUES (50, 'fstdpDDpSI+KUdWR7zzqlsaHRQ82Elx396/DLJXgf6o=', TRUE); + +-- Shopping Sessions +INSERT INTO shopping_session (id, user_id, total) +VALUES (1, 1, 538.84); +INSERT INTO shopping_session (id, user_id, total) +VALUES (2, 2, 734.36); +INSERT INTO shopping_session (id, user_id, total) +VALUES (3, 3, 1680.53); +INSERT INTO shopping_session (id, user_id, total) +VALUES (4, 4, 303.57); +INSERT INTO shopping_session (id, user_id, total) +VALUES (5, 5, 1924.56); +INSERT INTO shopping_session (id, user_id, total) +VALUES (6, 6, 46.64); +INSERT INTO shopping_session (id, user_id, total) +VALUES (7, 7, 266.57); +INSERT INTO shopping_session (id, user_id, total) +VALUES (8, 8, 1503.89); +INSERT INTO shopping_session (id, user_id, total) +VALUES (9, 9, 1808.29); +INSERT INTO shopping_session (id, user_id, total) +VALUES (10, 10, 1890.97); +INSERT INTO shopping_session (id, user_id, total) +VALUES (11, 11, 30.01); +INSERT INTO shopping_session (id, user_id, total) +VALUES (12, 12, 1479.1); +INSERT INTO shopping_session (id, user_id, total) +VALUES (13, 13, 1559.22); +INSERT INTO shopping_session (id, user_id, total) +VALUES (14, 14, 1612.68); +INSERT INTO shopping_session (id, user_id, total) +VALUES (15, 15, 1905.59); +INSERT INTO shopping_session (id, user_id, total) +VALUES (16, 16, 141.6); +INSERT INTO shopping_session (id, user_id, total) +VALUES (17, 17, 496.74); +INSERT INTO shopping_session (id, user_id, total) +VALUES (18, 18, 1678.68); +INSERT INTO shopping_session (id, user_id, total) +VALUES (19, 19, 1140.02); +INSERT INTO shopping_session (id, user_id, total) +VALUES (20, 20, 872.75); + +-- Cart Items +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (1, 1, 40, 3); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (2, 1, 26, 1); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (3, 2, 19, 4); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (4, 2, 23, 4); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (5, 3, 4, 3); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (6, 3, 6, 5); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (7, 4, 21, 3); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (8, 4, 26, 4); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (9, 5, 20, 1); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (10, 5, 3, 1); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (11, 6, 22, 2); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (12, 6, 1, 3); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (13, 7, 49, 1); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (14, 7, 45, 1); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (15, 8, 7, 3); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (16, 8, 20, 5); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (17, 9, 21, 2); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (18, 9, 13, 2); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (19, 10, 41, 4); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (20, 10, 21, 3); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (21, 11, 19, 5); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (22, 11, 36, 3); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (23, 12, 10, 4); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (24, 12, 38, 5); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (25, 13, 16, 3); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (26, 13, 2, 1); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (27, 14, 22, 4); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (28, 14, 44, 3); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (29, 15, 14, 1); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (30, 15, 14, 2); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (31, 16, 25, 4); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (32, 16, 1, 2); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (33, 17, 33, 3); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (34, 17, 42, 4); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (35, 18, 48, 4); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (36, 18, 18, 5); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (37, 19, 21, 5); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (38, 19, 26, 2); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (39, 20, 36, 3); +INSERT INTO cart_item (id, session_id, product_id, quantity) +VALUES (40, 20, 36, 3); + +-- Orders and Payment Details +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (1, 1, 650, 'MasterCard', 'Failed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (1, 1, 650, 1); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (2, 2, 241, 'MasterCard', 'Pending'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (2, 2, 241, 2); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (3, 3, 134, 'PayPal', 'Failed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (3, 3, 134, 3); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (4, 4, 761, 'Stripe', 'Completed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (4, 4, 761, 4); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (5, 5, 356, 'Stripe', 'Failed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (5, 5, 356, 5); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (6, 6, 187, 'Visa', 'Failed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (6, 6, 187, 6); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (7, 7, 610, 'MasterCard', 'Completed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (7, 7, 610, 7); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (8, 8, 457, 'PayPal', 'Completed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (8, 8, 457, 8); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (9, 9, 178, 'MasterCard', 'Failed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (9, 9, 178, 9); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (10, 10, 156, 'Stripe', 'Failed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (10, 10, 156, 10); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (11, 11, 919, 'PayPal', 'Pending'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (11, 11, 919, 11); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (12, 12, 877, 'MasterCard', 'Failed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (12, 12, 877, 12); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (13, 13, 746, 'Visa', 'Completed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (13, 13, 746, 13); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (14, 14, 440, 'Stripe', 'Completed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (14, 14, 440, 14); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (15, 15, 983, 'Stripe', 'Completed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (15, 15, 983, 15); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (16, 16, 530, 'Visa', 'Failed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (16, 16, 530, 16); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (17, 17, 900, 'Visa', 'Completed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (17, 17, 900, 17); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (18, 18, 338, 'Stripe', 'Completed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (18, 18, 338, 18); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (19, 19, 759, 'PayPal', 'Pending'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (19, 19, 759, 19); +INSERT INTO payment_details (id, order_id, amount, provider, status) +VALUES (20, 20, 956, 'Stripe', 'Completed'); +INSERT INTO order_details (id, user_id, total, payment_id) +VALUES (20, 20, 956, 20); + +-- Order Items +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (1, 1, 21, 3, 1); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (2, 1, 25, 2, 1); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (3, 2, 22, 2, 2); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (4, 2, 27, 1, 2); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (5, 3, 15, 2, 3); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (6, 3, 32, 2, 3); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (7, 4, 17, 3, 4); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (8, 4, 28, 1, 4); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (9, 5, 47, 1, 5); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (10, 5, 34, 3, 5); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (11, 6, 16, 3, 6); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (12, 6, 19, 1, 6); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (13, 7, 17, 2, 7); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (14, 7, 10, 1, 7); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (15, 8, 40, 3, 8); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (16, 8, 29, 2, 8); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (17, 9, 23, 1, 9); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (18, 9, 13, 3, 9); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (19, 10, 8, 1, 10); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (20, 10, 2, 3, 10); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (21, 11, 27, 1, 11); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (22, 11, 4, 1, 11); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (23, 12, 27, 1, 12); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (24, 12, 10, 2, 12); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (25, 13, 8, 2, 13); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (26, 13, 22, 2, 13); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (27, 14, 33, 1, 14); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (28, 14, 46, 2, 14); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (29, 15, 37, 1, 15); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (30, 15, 10, 2, 15); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (31, 16, 27, 3, 16); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (32, 16, 26, 2, 16); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (33, 17, 15, 2, 17); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (34, 17, 12, 3, 17); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (35, 18, 39, 2, 18); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (36, 18, 26, 1, 18); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (37, 19, 15, 1, 19); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (38, 19, 29, 1, 19); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (39, 20, 16, 3, 20); +INSERT INTO order_items (id, order_id, product_id, quantity, user_id) +VALUES (40, 20, 8, 1, 20); \ No newline at end of file From 557ffb2bb7c5903d81bf10e0a36b006cd2f29596 Mon Sep 17 00:00:00 2001 From: rgemm Date: Thu, 24 Apr 2025 18:08:15 +0200 Subject: [PATCH 18/24] =?UTF-8?q?Bestellformular=20+=20CSS=20hinzugef?= =?UTF-8?q?=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/dataSources.xml | 8 ++- public/Warenkorb/warenkorb.html | 3 +- public/bestellformular/bestellformular.html | 26 ++++++++++ scripts/routes/other/route-index.js | 2 +- static/Styles/Warenkorb/warenkorb.css | 15 ++++++ .../bestellformular/bestellformular.css | 50 +++++++++++++++++++ 6 files changed, 97 insertions(+), 7 deletions(-) create mode 100644 public/bestellformular/bestellformular.html create mode 100644 static/Styles/bestellformular/bestellformular.css diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index 935ffdb..35b7183 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -2,14 +2,12 @@ - mysql.8 + mariadb true - com.mysql.cj.jdbc.Driver - jdbc:mysql://localhost:3306 + org.mariadb.jdbc.Driver + jdbc:mariadb://localhost:3306 - - $ProjectFileDir$ diff --git a/public/Warenkorb/warenkorb.html b/public/Warenkorb/warenkorb.html index 1a51dd8..ab0c188 100644 --- a/public/Warenkorb/warenkorb.html +++ b/public/Warenkorb/warenkorb.html @@ -27,7 +27,8 @@
- + Zur Kasse gehen + diff --git a/public/bestellformular/bestellformular.html b/public/bestellformular/bestellformular.html new file mode 100644 index 0000000..80dda50 --- /dev/null +++ b/public/bestellformular/bestellformular.html @@ -0,0 +1,26 @@ + + + + + Bestellformular + + + +
+
+

Bestellformular

+ + + + + + + + + + + +
+
+ + diff --git a/scripts/routes/other/route-index.js b/scripts/routes/other/route-index.js index 16d8d17..b10bead 100644 --- a/scripts/routes/other/route-index.js +++ b/scripts/routes/other/route-index.js @@ -21,7 +21,7 @@ router.get('/Warenkorb', (req, res) => { res.sendFile(path.join(__dirname, '../../../public/warenkorb/warenkorb.html')); }) -router.get('/Bestellformular', (req, res) => { +router.get('/bestellformular', (req, res) => { res.sendFile(path.join(__dirname, '../../../public/bestellformular/bestellformular.html')); }) module.exports = router; \ No newline at end of file diff --git a/static/Styles/Warenkorb/warenkorb.css b/static/Styles/Warenkorb/warenkorb.css index 8c8d6c3..23fc4b9 100644 --- a/static/Styles/Warenkorb/warenkorb.css +++ b/static/Styles/Warenkorb/warenkorb.css @@ -77,3 +77,18 @@ body { .checkout:hover { background-color: #ff6600; } + +.checkout { + display: inline-block; + background-color: #ff6600; + color: white; + padding: 10px 20px; + margin-top: 20px; + text-align: center; + text-decoration: none; + font-size: 16px; + border-radius: 5px; + transition: background-color 0.3s; +} + + diff --git a/static/Styles/bestellformular/bestellformular.css b/static/Styles/bestellformular/bestellformular.css new file mode 100644 index 0000000..fc2003d --- /dev/null +++ b/static/Styles/bestellformular/bestellformular.css @@ -0,0 +1,50 @@ +body { + font-family: Arial, sans-serif; + padding: 20px; + background-color: #f7f7f7; +} + +.form-container form { + max-width: 600px; + margin: auto; + padding: 20px; + background-color: white; + border: 1px solid #ccc; + border-radius: 8px; +} + +form h2 { + margin-top: 0; + text-align: center; +} + + +label { + display: block; + margin-bottom: 10px; + font-weight: bold; +} + +input[type="text"], +textarea { + width: 100%; + padding: 8px; + margin-bottom: 15px; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + +input[type="submit"] { + background-color: #ff6600; + color: white; + padding: 10px 20px; + border: none; + border-radius: 4px; + cursor: pointer; + font-size: 16px; +} + +input[type="submit"]:hover { + background-color: #ff6600; +} From 15a45a07d8ff9a4a4efed947d7e288deb10969e3 Mon Sep 17 00:00:00 2001 From: rgemm Date: Thu, 24 Apr 2025 18:18:35 +0200 Subject: [PATCH 19/24] =?UTF-8?q?CSS=20ge=C3=A4ndert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/bestellformular/bestellformular.html | 17 ++++++++--- .../bestellformular/bestellformular.css | 28 ++++++++++--------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/public/bestellformular/bestellformular.html b/public/bestellformular/bestellformular.html index 80dda50..4da7e81 100644 --- a/public/bestellformular/bestellformular.html +++ b/public/bestellformular/bestellformular.html @@ -8,16 +8,25 @@
-

Bestellformular

+

Bestellformular

- - + + + + + + + + + + + - +
diff --git a/static/Styles/bestellformular/bestellformular.css b/static/Styles/bestellformular/bestellformular.css index fc2003d..3857f2d 100644 --- a/static/Styles/bestellformular/bestellformular.css +++ b/static/Styles/bestellformular/bestellformular.css @@ -1,48 +1,50 @@ body { font-family: Arial, sans-serif; + background-color: #f2f2f2; padding: 20px; - background-color: #f7f7f7; } -.form-container form { +.form-container { max-width: 600px; margin: auto; - padding: 20px; - background-color: white; - border: 1px solid #ccc; + background-color: #ffffff; + padding: 25px; border-radius: 8px; + box-shadow: 0 0 10px rgba(0,0,0,0.1); } form h2 { - margin-top: 0; text-align: center; + margin-bottom: 20px; } - label { display: block; - margin-bottom: 10px; + margin-top: 15px; font-weight: bold; } input[type="text"], +input[type="tel"], textarea { width: 100%; - padding: 8px; - margin-bottom: 15px; + padding: 10px; + margin-top: 5px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; } input[type="submit"] { + margin-top: 20px; background-color: #ff6600; color: white; - padding: 10px 20px; border: none; - border-radius: 4px; - cursor: pointer; + padding: 12px; + border-radius: 5px; font-size: 16px; + cursor: pointer; + width: 100%; } input[type="submit"]:hover { From 57d82e168d5b06fb76e1f190cdca422a47bb8dc3 Mon Sep 17 00:00:00 2001 From: rgemm Date: Thu, 24 Apr 2025 18:47:11 +0200 Subject: [PATCH 20/24] . --- public/startseite/startseite.html | 1 - 1 file changed, 1 deletion(-) diff --git a/public/startseite/startseite.html b/public/startseite/startseite.html index 7e443f4..8c920be 100644 --- a/public/startseite/startseite.html +++ b/public/startseite/startseite.html @@ -80,7 +80,6 @@
- From 310d739bdc1f64c9d804d458b62418eb50d58a9c Mon Sep 17 00:00:00 2001 From: rgemm Date: Thu, 24 Apr 2025 19:23:22 +0200 Subject: [PATCH 21/24] Bestellformular Angepasst an Vorgaben -> Bestellen per KundenNr u. Artikel Nr. --- public/bestellformular/bestellformular.html | 24 +++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/public/bestellformular/bestellformular.html b/public/bestellformular/bestellformular.html index 4da7e81..96c2706 100644 --- a/public/bestellformular/bestellformular.html +++ b/public/bestellformular/bestellformular.html @@ -10,23 +10,29 @@

Bestellformular

- - + + + + + + + + - + - + - + - - + + - - + +
From 8b6ced83d8ca0fa39f1fe396d7e790832bced383 Mon Sep 17 00:00:00 2001 From: rgemm Date: Fri, 25 Apr 2025 19:23:30 +0200 Subject: [PATCH 22/24] Bestellformular hat im Warenkorb keinen Sinn gemacht. Setze ihn an andere Stelle --- public/Warenkorb/warenkorb.html | 3 +- public/bestellformular/bestellformular.html | 41 ----------- static/Styles/Warenkorb/warenkorb.css | 70 +++++++++++++++++++ .../bestellformular/bestellformular.css | 52 -------------- 4 files changed, 71 insertions(+), 95 deletions(-) delete mode 100644 public/bestellformular/bestellformular.html delete mode 100644 static/Styles/bestellformular/bestellformular.css diff --git a/public/Warenkorb/warenkorb.html b/public/Warenkorb/warenkorb.html index ab0c188..5373864 100644 --- a/public/Warenkorb/warenkorb.html +++ b/public/Warenkorb/warenkorb.html @@ -26,8 +26,7 @@
- - Zur Kasse gehen + diff --git a/public/bestellformular/bestellformular.html b/public/bestellformular/bestellformular.html deleted file mode 100644 index 96c2706..0000000 --- a/public/bestellformular/bestellformular.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Bestellformular - - - -
-
-

Bestellformular

- - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - diff --git a/static/Styles/Warenkorb/warenkorb.css b/static/Styles/Warenkorb/warenkorb.css index 23fc4b9..eb64110 100644 --- a/static/Styles/Warenkorb/warenkorb.css +++ b/static/Styles/Warenkorb/warenkorb.css @@ -91,4 +91,74 @@ body { transition: background-color 0.3s; } +body { + font-family: Arial, sans-serif; + background-color: #f2f2f2; + padding: 20px; +} + +.form-container { + max-width: 600px; + margin: auto; + background-color: #ffffff; + padding: 25px; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0,0,0,0.1); +} + +form h2 { + text-align: center; + margin-bottom: 20px; +} + +label { + display: block; + margin-top: 15px; + font-weight: bold; +} + +input[type="text"], +input[type="tel"], +textarea { + width: 100%; + padding: 10px; + margin-top: 5px; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + +input[type="submit"] { + margin-top: 20px; + background-color: #ff6600; + color: white; + border: none; + padding: 12px; + border-radius: 5px; + font-size: 16px; + cursor: pointer; + width: 100%; +} + +input[type="submit"]:hover { + background-color: #ff6600; +} + +.zurKasse { + display: block; + margin: 20px auto; + background-color: #ff6600; + color: white; + border: none; + padding: 12px 24px; + font-size: 16px; + border-radius: 8px; + cursor: pointer; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); +} + +.zurKasse:hover { + background-color: #ff6600; +} + diff --git a/static/Styles/bestellformular/bestellformular.css b/static/Styles/bestellformular/bestellformular.css deleted file mode 100644 index 3857f2d..0000000 --- a/static/Styles/bestellformular/bestellformular.css +++ /dev/null @@ -1,52 +0,0 @@ -body { - font-family: Arial, sans-serif; - background-color: #f2f2f2; - padding: 20px; -} - -.form-container { - max-width: 600px; - margin: auto; - background-color: #ffffff; - padding: 25px; - border-radius: 8px; - box-shadow: 0 0 10px rgba(0,0,0,0.1); -} - -form h2 { - text-align: center; - margin-bottom: 20px; -} - -label { - display: block; - margin-top: 15px; - font-weight: bold; -} - -input[type="text"], -input[type="tel"], -textarea { - width: 100%; - padding: 10px; - margin-top: 5px; - border: 1px solid #ccc; - border-radius: 4px; - box-sizing: border-box; -} - -input[type="submit"] { - margin-top: 20px; - background-color: #ff6600; - color: white; - border: none; - padding: 12px; - border-radius: 5px; - font-size: 16px; - cursor: pointer; - width: 100%; -} - -input[type="submit"]:hover { - background-color: #ff6600; -} From 21acc115b8e7489f7759e6b2c3f8c493e8da3f2a Mon Sep 17 00:00:00 2001 From: vextv Date: Sat, 26 Apr 2025 12:08:21 +0200 Subject: [PATCH 23/24] - fixed a merge error that showed the default site twice --- .idea/Webshop.iml | 2 +- .idea/jsLibraryMappings.xml | 2 +- public/startseite/startseite.html | 72 ------------------------------- 3 files changed, 2 insertions(+), 74 deletions(-) diff --git a/.idea/Webshop.iml b/.idea/Webshop.iml index 8b332b7..018ea30 100644 --- a/.idea/Webshop.iml +++ b/.idea/Webshop.iml @@ -5,7 +5,7 @@ - +
\ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml index 2f279b3..93218c2 100644 --- a/.idea/jsLibraryMappings.xml +++ b/.idea/jsLibraryMappings.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/public/startseite/startseite.html b/public/startseite/startseite.html index d74b29c..d525c15 100644 --- a/public/startseite/startseite.html +++ b/public/startseite/startseite.html @@ -96,78 +96,6 @@ - -
- -
-

Autohändler Webshop

- -
- - - - - -
- - -
-
- Auto -

BMW 3er Limousine

-

Preis: 35.000€

-

Baujahr: 2020 | Kilometerstand: 20.000 km

- -
-
- Auto -

Audi Q5

-

Preis: 50.000€

-

Baujahr: 2022 | Kilometerstand: 10.000 km

- -
-
-
-
From 3d051471887d021160ae415d46c7daf4d431772f Mon Sep 17 00:00:00 2001 From: rgemm Date: Sat, 26 Apr 2025 12:20:37 +0200 Subject: [PATCH 24/24] -fixed warenkorb auf startseite --- public/Warenkorb/warenkorb.html | 7 ++++++- public/header_footer/header.html | 9 ++++++--- static/Styles/Warenkorb/warenkorb.css | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/public/Warenkorb/warenkorb.html b/public/Warenkorb/warenkorb.html index 5373864..762972d 100644 --- a/public/Warenkorb/warenkorb.html +++ b/public/Warenkorb/warenkorb.html @@ -4,8 +4,12 @@ Warenkorb + + + +

đź›’ Dein Warenkorb

@@ -27,7 +31,8 @@
-
+ + diff --git a/public/header_footer/header.html b/public/header_footer/header.html index 656d9ab..a9ac989 100644 --- a/public/header_footer/header.html +++ b/public/header_footer/header.html @@ -6,9 +6,12 @@
-
- - 0 +
diff --git a/static/Styles/Warenkorb/warenkorb.css b/static/Styles/Warenkorb/warenkorb.css index eb64110..43ae701 100644 --- a/static/Styles/Warenkorb/warenkorb.css +++ b/static/Styles/Warenkorb/warenkorb.css @@ -6,7 +6,7 @@ body { } .warenkorb { - max-width: 500px; + max-width: 700px; margin: 0 auto; background: white; padding: 120px;