-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayment.js
More file actions
51 lines (36 loc) · 1.37 KB
/
Copy pathpayment.js
File metadata and controls
51 lines (36 loc) · 1.37 KB
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
const eventSelect = document.getElementById('event');
const groupSizeContainer = document.getElementById('group-size-container');
const groupSizeInput = document.getElementById('group-size');
const paymentInput = document.getElementById('payment');
function getQueryParam(name) {
const urlSearchParams = new URLSearchParams(window.location.search);
return urlSearchParams.get(name);
}
function redirectToQR() {
window.location.href = 'qr.html';
}
document.addEventListener('DOMContentLoaded', () => {
const selectedEvent = getQueryParam('selectedEvent');
const eventPayments = {
'ctf': 250,
'hackathon': 350,
'Gaming Tournament': 300,
'Coding Competition':250,
'dancing-competition':100,
'singing-competition':100,
'selfie-competition':100,
't-shirt-painting-competition':100
};
if (eventPayments.hasOwnProperty(selectedEvent)) {
paymentInput.value = eventPayments[selectedEvent];
} else {
paymentInput.value = 0;
}
eventSelect.value = selectedEvent;
const groupCompetitions = ['ctf', 'hackathon','Gaming Tournament'];
if (groupCompetitions.includes(selectedEvent)) {
groupSizeContainer.style.display = 'block';
} else {
groupSizeContainer.style.display = 'none';
}
});