add table with data below chart

This commit is contained in:
Uwe Steinmann 2020-04-02 12:38:16 +02:00
parent dda50a931a
commit daf6ebe454

View File

@ -228,6 +228,29 @@ $(document).ready( function() {
<div id="chart" style="height: 400px;" class="chart"></div> <div id="chart" style="height: 400px;" class="chart"></div>
<?php <?php
$this->contentContainerEnd(); $this->contentContainerEnd();
echo "<table class=\"table table-condensed table-hover\">";
echo "<tr><th>".getMLText('chart_'.$type.'_title')."</th><th>".getMLText('total')."</th></tr>";
$total = 0;
switch($type) {
case 'docspermonth':
case 'docsperuser':
case 'docspermimetype':
case 'docspercategory':
case 'docsperstatus':
foreach($data as $item) {
echo "<tr><td>".htmlspecialchars($item['key'])."</td><td>".$item['total']."</td></tr>";
$total += $item['total'];
}
break;
case 'docsaccumulated':
foreach($data as $item) {
echo "<tr><td>".date('Y-m-d', $item['key']/1000)."</td><td>".$item['total']."</td></tr>";
$total += $item['total'];
}
break;
}
echo "<tr><th></th><th>".$total."<th></tr>";
echo "</table>";
echo "</div>\n"; echo "</div>\n";
if(!in_array($type, array('docspermonth', 'docsaccumulated'))) { if(!in_array($type, array('docspermonth', 'docsaccumulated'))) {
@ -245,4 +268,3 @@ $(document).ready( function() {
$this->htmlEndPage(); $this->htmlEndPage();
} /* }}} */ } /* }}} */
} }
?>