-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPooja.html
More file actions
175 lines (153 loc) · 5.6 KB
/
Pooja.html
File metadata and controls
175 lines (153 loc) · 5.6 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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<html>
<head>
<title>GATE 2021</title>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th,td {
text-align: center;
}
.modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.4);
}
.modal-content {
background-color: #fefefe;
margin: 13% auto;
padding: 20px;
border: 1px solid #888;
width: 50%;
}
.close {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: black;
text-decoration: none;
cursor: pointer;
}
</style>
</head>
<body>
<center>
<div id="myModal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<div id="schedules"></div>
</div>
</div>
<h1 id="header" style="color: #006400;"></h1>
<div id="time" style="margin-top: 300px; color: #F00;"></div>
<div id="login" style="margin-top: 500px;"></div>
<button id="myBtn" style="cursor: pointer;">See Schedule</button>
</center>
<script>
var today = new Date();
var dd = String(today.getDate()).padStart(2, '0');
var mm = String(today.getMonth()).padStart(2, '0'); //January is 0!
var yyyy = today.getFullYear();
today = new Date( yyyy, mm, dd);
var todayTime = today.getTime();
var Dates = [
["Jan 24, 2021", "15:00:00", "GATE 2016-1", "https://gateoverflow.in/quiz/?exam_id=8", "https://gateoverflow.in/exam/8/gate-2016-1"],
["Jan 27, 2021", "20:30:00", "GATE 2016-2", "https://gateoverflow.in/quiz/?exam_id=9", "https://gateoverflow.in/exam/9/gate-2016-2"],
["Jan 30, 2021", "15:00:00", "GATE 2017-1", "https://gateoverflow.in/quiz/?exam_id=76", "https://gateoverflow.in/exam/76/gate-2017-set-1"],
["Jan 31, 2021", "15:00:00", "GATE 2017-2", "https://gateoverflow.in/quiz/?exam_id=75", "https://gateoverflow.in/exam/75/gate-2017-set-2"],
["Feb 03, 2021", "20:30:00", "GATE 2018", "https://gateoverflow.in/quiz/?exam_id=88", "https://gateoverflow.in/exam/88/gate2018"],
["Feb 06, 2021", "15:00:00", "GATE 2020", "https://gateoverflow.in/quiz/?exam_id=218", "https://gateoverflow.in/exam/218/gate-cse-2020"],
["Feb 10, 2021", "20:30:00", "GATE 2019", "https://gateoverflow.in/quiz/?exam_id=141", "https://gateoverflow.in/exam/141/gate-2019"]
];
var arrayLength = Dates.length;
var data = -1;
var nextTime;
var arrayTime;
var schedule = '<table style="width:50%"><tr><th bgcolor="green">DATE</th><th bgcolor="green">TEST</th></tr>';
for (var i = 0; i < arrayLength; i++) {
arrayTime = new Date(Dates[i][0]).getTime();
if(arrayTime === todayTime)
{
data = i;
schedule = schedule +"<tr><td bgcolor='yellow'>"+Dates[i][0]+"</td><td bgcolor='yellow'>"+Dates[i][2]+"</td></tr>";
} else if(arrayTime < todayTime)
{
nextTime = i;
schedule = schedule +"<tr><td bgcolor='#ccc'>"+Dates[i][0]+"</td><td bgcolor='#ccc'><a href='"+Dates[i][4]+"'>"+Dates[i][2]+"</a></td></tr>";
} else {
schedule = schedule +"<tr><td>"+Dates[i][0]+"</td><td>"+Dates[i][2]+"</td></tr>";
}
}
schedule = schedule + "</table>";
document.getElementById("schedules").innerHTML = schedule;
if(data === -1)
{
document.getElementById("header").innerHTML = "Today, there is no test.<br>Only Revision.";
document.getElementById("time").innerHTML = "Next Test is on "+Dates[nextTime+1][0];
document.getElementById("login").innerHTML = Dates[nextTime+1][2];
}
else
{
document.getElementById("header").innerHTML = Dates[data][2];
if(Dates[data][2].includes("AG")) {
document.getElementById("login").innerHTML = '<h2><a href="https://gate.appliedroots.com/login" target="_blank">Check Login Status</a></h2>';
} else {
document.getElementById("login").innerHTML = '<h2><a href="https://gateoverflow.in/login" target="_blank">Check Login Status</a></h2>';
}
var countDownDate = new Date(Dates[data][0]+" "+Dates[data][1]).getTime();
// Update the count down every 1 second
var x = setInterval(function() {
var now = new Date().getTime();
var distance = countDownDate - now;
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
document.getElementById("time").innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s";
if (distance < 0) {
clearInterval(x);
if(Dates[data][2].includes("AG"))
{
window.open(Dates[data][3], "aaicTest", "width="+screen.width+",height="+screen.height+",toolbar=0,location=0, directories=0, status=0,location=no,menubar=0");
}
else {
window.location = Dates[data][3];
}
}
}, 1000);
}
// Get the modal
var modal = document.getElementById("myModal");
// Get the button that opens the modal
var btn = document.getElementById("myBtn");
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks on the button, open the modal
btn.onclick = function() {
modal.style.display = "block";
}
// When the user clicks on <span> (x), close the modal
span.onclick = function() {
modal.style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
</script>
</body>
</html>