-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathreportContext.php
93 lines (93 loc) · 3.3 KB
/
reportContext.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
<?php
$title='Contexts Summary';
include_once 'reportContext.inc.php';
include_once 'header.inc.php';
gtd_handleEvent(_GTD_ON_DATA,$pagename);
?>
<p>To move to a particular space-time context, select the number or the context name.</p>
<table class="datatable" summary="table of contexts" id="contexttable">
<thead><tr>
<th>Context</th>
<?php
$runningtotals=array();
foreach ($timeframeNames as $tcId => $tname) {
$runningtotals["t$tcId"]=0;
?>
<th id='thtc<?php
echo $tcId;
?>'><?php
echo makeclean($tname);
?></th>
<?php } ?>
<th>Total</th>
</tr></thead>
<tbody><?php foreach ($contextNames as $cid => $cname) {
$runningtotals["c$cid"]=0;
?>
<tr>
<td><a href='#c<?php echo $cid; ?>' ><?php echo makeclean($cname); ?></a>
</td>
<?php foreach ($timeframeNames as $tid => $tname) {
if ($count=$matrixcount[$cid][$tid]) {
echo "<td><a href='#c{$cid}t{$tid}'>$count</a></td>\n";
$runningtotals["c$cid"]+=$count;
$runningtotals["t$tid"]+=$count;
} else { ?>
<td>0</td>
<?php
}
}
?>
<td><?php
echo ($count=$runningtotals["c$cid"])
?"<a href='#c$cid'>$count</a>"
:0;
?>
</td>
</tr>
<?php } ?>
<tr>
<td>Total</td>
<?php
$runningtotals['grand']=0;
foreach ($timeframeNames as $tid => $tname) {
$runningtotals['grand']+=$runningtotals["t$tid"];
?>
<td><?php echo $runningtotals["t$tid"]; ?></td>
<?php } ?>
<td><?php echo $runningtotals['grand']; ?></td>
</tr>
</tbody>
</table>
<?php
foreach ($contextNames as $cid => $cname) {
if (!$runningtotals["c$cid"]) continue;
echo "<div id='dc$cid'>\n"
,"<a id='c$cid'></a>\n"
,"<h2>Context: ",makeclean($cname),"</h2>\n";
foreach ($timeframeNames as $tid => $tname) {
if (isset($matrixout[$cid][$tid])) {
echo "<div class='t{$tid}'>\n"
,"<a id='c{$cid}t{$tid}'></a>\n"
,"<h3>Time Context: ",makeclean($tname),"</h3>\n";
?>
<form action="processItems.php" method="post">
<table class="datatable sortable" summary="table of actions"
id='actiontable<?php echo "C{$cid}T{$tid}"; ?>'>
<?php echo $matrixout[$cid][$tid]; ?>
</table>
<div>
<input type="hidden" name="referrer" value="<?php echo "{$pagename}.php#c{$cid}t{$tid}"; ?>" />
<input type="hidden" name="multi" value="y" />
<input type="hidden" name="wasNAonEntry" value="<?php echo implode(' ',$wasNAonEntry[$cid][$tid]); ?> " />
<input type="hidden" name="action" value="complete" />
<input type="submit" class="button" value="Update Actions" name="submit" />
</div>
</form>
</div>
<?php
}
}
echo '</div>';
}
include_once 'footer.inc.php'; ?>