-
Notifications
You must be signed in to change notification settings - Fork 0
/
grades_mode_html.php
83 lines (81 loc) · 1.93 KB
/
grades_mode_html.php
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
<?php
$html = '<html>
<head>
<title>@UrDUMoodleBot | Brouzer sessiyalari</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="@UrDUMoodleBot,HTML Browser sessions" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body><h2>@UrDUMoodleBot | HTML export sessions</h2>
<table class="generaltable">
<thead>
<tr>
<th class="header c0" style="text-align:left;" scope="col">Course name</th>
<th class="header c1" style="text-align:left;" scope="col">Course ID</th>
<th class="header c2" style="text-align:left;" scope="col">Grade</th>
</tr>
</thead><tbody>';
$lines = file("grades.txt");
$data = array();
foreach ($lines as $line) {
$data[] = explode(';', trim($line));
}
foreach ($data as $td) {
$html .= '<tr class="">
<td class="cell c0" style="text-align:left;">' . $td[0] . '</td>
<td class="cell c1" style="text-align:left;">' . $td[1] . '</td>
<td class="cell c2" style="text-align:left;">' . $td[2] . '</td>
</tr>';
}
$html .= '</tbody></table>
<style>
.generaltable {
width:100%;
margin-bottom:1rem;
color:#343a40;
}
.generaltable th,
.generaltable td {
padding:.75rem;
vertical-align:top;
border-top:1px solid #dee2e6;
}
.generaltable thead th {
vertical-align:bottom;
border-bottom:2px solid #dee2e6
}
.generaltable tbody+tbody {
border-top:2px solid #dee2e6
}
.generaltable tbody tr:nth-of-type(odd) {
background-color:rgba(0,0,0,.05);
}
.generaltable.table-sm th,
.generaltable.table-sm td {
padding:.3rem
}
.generaltable tbody tr:hover {
color:#343a40;
background-color:rgba(0,0,0,.075)
}
table caption {
font-size:24px;
font-weight:700;
line-height:42px;
text-align:left;
caption-side:top
}
.table-dynamic .loading-icon {
position:absolute;
left:calc(50% - 1.5rem);
top:200px
}
.table-dynamic .loading-icon .icon {
height:3rem;
width:3rem;
font-size:3rem
}
</style>
</body>
</html>';
echo $html;