Go to the source code of this file.
◆ environment()
Definition at line 3 of file environment.php.
4{
5 $totals = function ($answers) {
7 $ret .=
'<tr><td></td>'
8 . '<td>Amount</td>'
9 . '<td style="padding-left: 10px;">Proportion</td></tr>';
10
11 foreach ($answers as $answer) {
13 . '<td style="padding-right: 10px;">' . $answer['title'] . '</td>'
14 . '<td align="right">' . $answer['amount'] . '</td>'
15 . '<td align="right">' . $answer['proportion'] . '%</td>'
16 . '</tr>';
17 }
18
19 $ret .=
'</table><br>';
21 };
22
23
24 $chart = function ($answers) {
25 $ret =
'<table style="width:100%">';
26 foreach ($answers as $answer) {
27 $ret .=
'<tr style="border-bottom: 1px solid black;">'
28 . '<td style="width: 200px;">'
29 . $answer['title']
30 . '</td><td>'
31 . '<div style="background-color:grey; height:20px; width:' . $answer['proportion'] . '%;"></div>'
32 . '</td></tr>';
33 }
36 };
37
38 return array(
39 'totals' => $totals,
40 'chart' => $chart
41 );
42}
References $ret.
Referenced by base1().