ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
environment.php
Go to the documentation of this file.
1 <?php
2 
3 function environment()
4 {
5  $totals = function ($answers) {
6  $ret = '<table>';
7  $ret .= '<tr><td></td>'
8  . '<td>Amount</td>'
9  . '<td style="padding-left: 10px;">Proportion</td></tr>';
10 
11  foreach ($answers as $answer) {
12  $ret .= '<tr>'
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>';
20  return $ret;
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  }
34  $ret .= '</table>';
35  return $ret;
36  };
37 
38  return array(
39  'totals' => $totals,
40  'chart' => $chart
41  );
42 }
environment()
Definition: environment.php:3
$ret
Definition: parser.php:6