-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
95 lines (91 loc) · 2.65 KB
/
index.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
84
85
86
87
88
89
90
91
92
93
94
95
<?php
require('SplClassLoader.php');
$classLoader = new SplClassLoader('PodioStats', '.');
$classLoader->register();
$maildirParser = new PodioStats\MaildirParser();
?>
<!DOCTYPE html>
<html lang="sv">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Podiostatistics for Christian Sipola</title>
<script src="js/jquery/jquery.1.7.2.min.js"></script>
<script src="js/jquery-plugins/jquery.dataTables.js"></script>
<script src="js/Chart.js"></script>
<link href="css/demo_table.css" rel="stylesheet">
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
</head>
<body>
<h1>Podiostatistics for Christian Sipola</h1>
<canvas id="myChart" width="1200" height="400"></canvas>
<div style="width:400px">
<table id="datatable" style="width:100%">
<thead>
<tr>
<th>Date</th>
<th>Day</th>
<th>Notices</th>
<th>Mentions</th>
<th>Mentions %</th>
<th>Messages</th>
</tr>
</thead>
<tbody>
<?php
/* @var $day PodioStats\Day */
foreach($maildirParser->getData() as $ymd => $day){
?>
<tr>
<td>
<?=$day->getDate()->format('y-m-d') ?>
</td>
<td>
<?=$day->getDate()->format('D') ?>
</td>
<td>
<?=$day->getNotices() ?>
</td>
<td>
<?=$day->getMentions() ?>
</td>
<td>
<?=$day->getPercentMentions() ?>
</td>
<td>
<?=$day->getMessages() ?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div>Not readable:</div>
<?=implode(', ', $maildirParser->getNotReadable()) ?>
<script type="text/javascript">
var data = <?=\PodioStats\Day::getArrayAsLineChartJson($maildirParser->getData()) ?>;
var options = { datasetFill : true};
//Get the context of the canvas element we want to select
var ctx = document.getElementById("myChart").getContext("2d");
var myNewChart = new Chart(ctx).Line(data,options);
</script>
<script type="text/javascript">
jQuery(document).ready(function(){
//.columnFilter() on oTable is column filter
var oTable = jQuery('#datatable').dataTable( {
//C = show hide columns
//i = paginate info
//p = paginate select
//l = number of rows per page
//f = search
//r = ?
//t = ?
//T = tableTools
//<"clear"> = ?
"sDom": 'CipflT<"clear">t',
"bPaginate": false,
//"aaSorting": [[ 0, 'asc' ]]
} )
});
</script>
</body>
</html>