This repository has been archived by the owner on Jun 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
openiit.html
185 lines (153 loc) · 6.42 KB
/
openiit.html
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
176
177
178
179
180
181
182
183
184
185
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-150093374-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-150093374-1');
</script>
<script
src="https://code.jquery.com/jquery-3.3.1.js"
integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
crossorigin="anonymous">
</script>
<script>
$(function(){
$("#header").load("header.html");
$("#footer").load("footer.html");
});
</script>
<meta charset="UTF-8">
<title>Events</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#D02451" />
<meta name="description" content="Official Website of Technology Students Gymkhana, IIT Kharagpur" />
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.gymkhana.iitkgp.ac.in" />
<meta property="og:title" content="Technology Students' Gymkhana, Indian Institute of Technology Kharagpur" />
<meta property="og:description" content="Official Website of Technology Students Gymkhana, IIT Kharagpur" />
<meta property="og:image" content="favicon.png" />
<!-- Twitter -->
<meta property="twitter:card" content="website" />
<meta property="twitter:url" content="http://www.gymkhana.iitkgp.ac.in" />
<meta property="twitter:title" content="Technology Students' Gymkhana, Indian Institute of Technology Kharagpur" />
<meta property="twitter:description" content="Official Website of Technology Students Gymkhana, IIT Kharagpur" />
<meta property="twitter:image" content="favicon.png" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lato:400,400i,700|Playfair+Display|Roboto+Slab:400,700" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
<link rel="icon" type="image/png" href="favicon.png">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<style>
tr th{background-color: #6c7ae0;color: white;font-family: "Roboto Light";}
td{font-family: Roboto;}
table{overflow-x: scroll;position: relative; margin: auto; width: 96%;}
@media only screen and (max-width: 1100px) {
#header {
position: absolute;
left: 0px;
}
#mob-nav {
display: block;
}
#not-on-mob {
display: none;
visibility: hidden;
}
}
</style>
</head>
<body>
<div class="container page z-depth-5">
<div id="header"></div>
<br/><br/>
<h3 style="text-align: center"><strong><u>Open IIT Results</u></strong></h3>
<br>
<br>
<p id="testing">
</p>
<table id="event" class="table table-responsive table-bordered table-fixed">
<tr>
<th> Date </th>
<th> Event</th>
<th> Winner </th>
<th> Runners Up </th>
<th> Second Runners Up </th>
</tr>
</thead>
<tbody id="openiitBody">
<script type='text/javascript'>
function fetchEventsData() {
let output = "";
document.getElementById('openiitBody').innerHTML = `<img src="gif/loader.gif">`;
fetch('http://gymk-back.herokuapp.com/openiit')
.then(response => {
if(!response.ok)
throw Error(response.statusText)
return response;
})
.then (response => response.json())
.then( events => {
if(events.error === 'no data') {
document.getElementById('openiitBody').innerHTML = `<tr><td colspan=7><h1 style="text-align:center;">To Be Updated</h1></td></td>`;
return;
}
events = JSON.parse(events);
events.map(row => {
console.log(row);
let indiv_row = `
<tr>
<td>${row['date']}</td>
<td>${row['eventname']}</td>
<td>${row['winner']}</td>
<td>${row['runnersup']}</td>
<td>${row['secondrunnersup']}</td>
</tr>
`
if (indiv_row != undefined)
{
output += indiv_row;
}
});
})
.then(() => {
document.getElementById('openiitBody').innerHTML = output;
})
.catch(err => {
document.getElementById('openiitBody').innerHTML = `<tr><td colspan=7><h1 style="text-align:center;">To Be Updated</h1></td></td>`;
console.log('Error is ', err);
return;
});
}
fetchEventsData()
</script>
</tbody>
</table>
</div>
<!-- <script src="fetchdata.js"></script>
<script>
function setQuery() {
const site = "http://gymk-back.herokuapp.com" + window.location.pathname;
let temp = site.split('/');
let final = "http://gymk-back.herokuapp.com/" + temp[temp.length - 1];
return final;
}
// document.getElementById('testing').innerText = setQuery();
// for testing purpose
</script> -->
<div id="footer"></div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="materialize/js/bin/materialize.min.js"></script>
<!-- <script type="text/javascript" src="js/blogpost.js"></script> -->
<script type="text/javascript">
$(document).ready(function(){
$('.modal').modal();
$('.sidenav').sidenav();
});
</script>
</body>
</html>