-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
88 lines (76 loc) · 2.63 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
function ansValidation() {
var passValue = document.getElementById("password").value
var confpassValue = document.getElementById("confirmPassword").value
if (passValue === confpassValue) {
window.alert("Das hat geklappt")
return true;
} else {
window.alert("Passwort stimmt nicht überein");
return false;
}
}
let gametag = ""
let avatar = ""
let pronomen = ""
let spiele = ""
function createUserTable(){
var id1 = crypto.randomUUID()
var id2 = crypto.randomUUID()
var id3 = crypto.randomUUID()
var id4 = crypto.randomUUID()
var id5 = crypto.randomUUID()
var id6 = crypto.randomUUID()
}
const sqlite3 = require('sqlite3').verbose();
let db = new sqlite3.Database('FinderDB.db', (err) => {
if (err) {
return console.error(err.message);
}
console.log("Connected to the FinderDB SQLite database.");
});
db.all("SELECT * FROM User Order By random() Limit 1", [], (err, rows) => {
if (err) {
throw err;
}
rows.forEach((row) => {
gametag = row.gametag
avatar = row.avatar
pronomen = row.pronomen
spiele = row.Spiele
console.log(row);
});
});
db.close((err) => {
if (err) {
return console.error(err.message);
}
console.log("Close the database connection.");
});
GLOBAL.document = new JSDOM("index.html").window.document;
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
//document.getElementById("avatar").value = avatar
//document.getElementById("gametag").value = gametag
//document.getElementById("pronomen").value = pronomen
//document.getElementById("Spiele").value = spiele
/* db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS USER(' +
'"id" INTEGER NOT NULL UNIQUE PRIMARY KEY,' +
'"gametag" TEXT NOT NULL,' +
'"pronomen" TEXT,' +
'"geburtsdatum" Text NOT NULL,' +
'"spiele" Text NOT NULL,' +
'"avatar" INTEGER, ' +
'"email" text NOT NULL,' +
'"password" text NOT NULL)')
tx.executeSql('INSERT INTO USER' +
'VALUES (?, "owlym0wly", "sie/ihr", "06.03.2008, "Ark", "3", "[email protected]", "Password1"), ' +
'(?, "xXelefantenbaendiger297581Xx", "er/ihm", "12.12.2007", "Minecraft", "0", "[email protected]", "Rüssel"), ' +
'(?, "gronkh187", "they/them", "30.04.2010", "Tic Tac Toe", "5", "[email protected]", "12345678"), ' +
'(?, "ApacheFan107", "", "01.01.2005", "cs:go", "4", "[email protected]", "qwertz"), ' +
'(?, "MysterioesesAlpaka", "alpaka/alpaka", "16.05.2005", "GTA 6", "[email protected]", "alpaka")' +
'(?, "DrDoubleNo76", "er/ihm", "06.07.2008", "Foundation", "[email protected]", "Why16Zeichen"'
[id1, id2, id3, id4, id5, id6])
})
};
*/