Repository navigation
Expand file tree
/
Copy pathredirect.php
More file actions
140 lines (125 loc) · 3.88 KB
/
Copy pathredirect.php
File metadata and controls
140 lines (125 loc) · 3.88 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
<? session_start(); ?>
<!DOCTYPE html>
<?php require_once './fetcher.php'; ?>
<html lang="en">
<head>
<?php include 'components/header.php'; ?>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0">
<title>Check Hours</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<link rel="stylesheet" href="./static/css/style_hours.css">
</head>
<body>
<?php include 'components/navbar.php'; ?>
<div class="container">
<a href="./logout.php" class="btn btn-outline-danger">
<div id="logout">Logout</div>
</a>
<?php
$sem_indx = 0;
?>
<?php foreach ($data as $sem_name => $sem_events) : $sem_indx++; ?>
<div style="padding: 15px;">
<h4 data-toggle="collapse" <?php echo 'href="' . '#sem_' . $sem_indx . '"'; ?>>
<?php echo $sem_name . " (" . $semwise_total[$sem_name] . ") "; ?>
</h4>
<div <?php echo 'id="' . 'sem_' . $sem_indx . '"'; ?> class="collapse show">
<table class="table table-striped table-hover table-bordered">
<thead class='thead-dark'>
<tr>
<th>
Event Name
</th>
<th>
Hours
</th>
</tr>
</thead>
<tbody>
<?php foreach ($sem_events as $event_name => $event_hours) : ?>
<tr>
<td>
<?php echo $event_name; ?>
</td>
<td>
<?php echo $event_hours; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<!-- <canvas id="skillsChart"></canvas> -->
</div>
<?php endforeach; ?>
</div>
<?php include 'components/footer.php'; ?>
<!-- jQuery -->
<?php include 'components/scripts.php'; ?>
<!-- partial -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.bundle.min.js'></script>
<script src='https://code.jquery.com/jquery-2.2.4.min.js'></script>
<script>
/* #####################################################################*/
function addEntry(data, country, visits) {
data.push({
country,
visits
});
}
/* #####################################################################*/
// var records =
// PHP
// echo json_encode($records[0]);
// // ["10", "12", "2", "3", "4", "2"];
// // <?php ?>;
// // echo json_encode($records);
// var tags =
// PHP
// echo json_encode($tags[0]);
// // ["qweq", "qeqw", "qew", "wqe", "qwewq", "rrs"];
// records.forEach((hours, index) => {
// if (index < 3 || index == records.length - 1) { // First 3 cols are for user info, last one is for total hours !
// return;
// }
// const eventName = tags[index];
// const tBody = document.getElementById("tBody");
// if (eventName && hours) {
// tBody.innerHTML += `
// <tr>
// <td>
// ${eventName}
// </td>
// <td>
// ${hours}
// </td>
// </tr>
// `;
// }
// })
// <?php ?>;
// echo json_encode($tags);
// let data =
// PHP
// echo json_encode($data);
/*
data = {
"Session 19-20" : {
"Event 1": 34,
"Event 2": 12,
"Event 3": 13,
}
}
for(let semName in data){
let semEvents = data[semName];
for(let event in semEvents){
let hours = semEvents[event];
console.log(`${event} : ${hours}`);
}
}
*/
</script>
<script src="./static/js/script_hours.js"></script>
</body>
</html>