-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.js
58 lines (40 loc) · 1.69 KB
/
main.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
let textContent;
function chooseDoctor(department,chosenDoctor) {
// console.log("Department : ",department);
// console.log("chosenDoctor : ",chosenDoctor);
let departments;
// departments[department][chosenDoctor]++;
// console.log("Token Count is : ",departments[department][chosenDoctor]);
// console.log(departments);
// const tokenNumber = departments[department][chosenDoctor];
// const tokenInfo = { department, doctor: chosenDoctor, token: tokenNumber };
// const updatedDepartments = JSON.stringify(departments);
if(sessionStorage.getItem('department')){
departments = JSON.parse(sessionStorage.getItem('department'));
}else{
departments = {
Lungs: { doc1: 0, doc2: 0 },
Gyno: { doc1: 0, doc2: 0 },
Heart: { doc1: 0, doc2: 0 }
};
}
console.log("Departments is :",departments);
departments[department][chosenDoctor]++;
sessionStorage.setItem('department', JSON.stringify(departments));
sessionStorage.setItem('tokenCount',departments[department][chosenDoctor]);
setTimeout(() => {
window.location.href = 'final.html';
}, 2000);
// textContent = tokenInfo.token;
// localStorage.setItem('tokenContent', textContent);
}
function redirectToPreviousPagep(){
window.location.href = "nextpage4.html";
}
function redirectToNextPage() {
window.location.href = "nextpage4.html"; // Replace with the URL of the next page
}
function updateTokenDisplay() {
const tokenDisplay = document.getElementById('tokenCount');
tokenDisplay.innerText = textContent;
}