-
Notifications
You must be signed in to change notification settings - Fork 0
/
simpleads-statsprint.tpl.php
61 lines (61 loc) · 2.72 KB
/
simpleads-statsprint.tpl.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
<?php
/**
* @file
* Format the table to be printed in pdf.
*
* Available variables:
* - $data: contains an array of simpleads stats.
* @see print.ad.stat.inc
*/
$index = count($data[1]);
?>
<h1 style="text-align: center">SimpleAds Statistics</h1>
<h2>Total</h2>
<table style="border-collapse: collapse; width: 100%;">
<tr>
<th style="text-align: left; padding: 8px; background-color: #E1E2DC; color: #000;">Clicks</th>
<th style="text-align: left; padding: 8px; background-color: #E1E2DC; color: #000;">Unique clicks</th>
<th style="text-align: left; padding: 8px; background-color: #E1E2DC; color: #000;">Impressions</th>
<th style="text-align: left; padding: 8px; background-color: #E1E2DC; color: #000;">Unique impressions</th>
<th style="text-align: left; padding: 8px; background-color: #E1E2DC; color: #000;">Click-through rate</th>
</tr>
<tr>
<td style="text-align: left; padding: 8px;"><?php print $data[0]['click']; ?></td>
<td style="text-align: left; padding: 8px;"><?php print $data[0]['unique_clicks']; ?></td>
<td style="text-align: left; padding: 8px;"><?php print $data[0]['impressions']; ?></td>
<td style="text-align: left; padding: 8px;"><?php print $data[0]['unique_impressions']; ?></td>
<td style="text-align: left; padding: 8px;"><?php print
round(
(($data[0]['unique_clicks']/$data[0]['unique_impressions']) * 100), 4) . '%' ;
?></td>
</tr>
</table>
<h2>Daily statistics</h2>
<table style="border-collapse: collapse; width: 100%;">
<tr>
<th style="text-align: left; padding: 8px; background-color: #E1E2DC; color: #000;">Date</th>
<th style="text-align: left; padding: 8px; background-color: #E1E2DC; color: #000;">Clicks</th>
<th style="text-align: left; padding: 8px; background-color: #E1E2DC; color: #000;">Unique Clicks</th>
<th style="text-align: left; padding: 8px; background-color: #E1E2DC; color: #000;">Impressions</th>
<th style="text-align: left; padding: 8px; background-color: #E1E2DC; color: #000;">Unique Impressions</th>
</tr>
<?php for ($i = 0; $i < $index; $i++): ?>
<tr>
<td style="text-align: left; padding: 8px;">
<?php print date('d/m/y H:i A', $data[1][$i]['date']); ?>
</td>
<td style="text-align: left; padding: 8px;">
<?php print $data[1][$i]['click']; ?>
</td>
<td style="text-align: left; padding: 8px;">
<?php print $data[1][$i]['unique_clicks']; ?>
</td>
<td style="text-align: left; padding: 8px;">
<?php print $data[1][$i]['impressions']; ?>
</td>
<td style="text-align: left; padding: 8px;">
<?php print $data[1][$i]['unique_impressions']; ?>
</td>
</tr>
<?php endfor; ?>
</table>