diff options
author | Ian Gilfillan <ian@greenman.co.za> | 2016-07-31 13:52:46 +0000 |
---|---|---|
committer | Ian Gilfillan <ian@greenman.co.za> | 2016-07-31 13:52:46 +0000 |
commit | 78d649395a72e8ac1e07d8ae751890a674067ca9 (patch) | |
tree | 751849838f4f950e965229dc74de118f91f38af8 /h-source | |
parent | ae9775b52ffadec19f6ebb5a9fc8d858953180da (diff) |
Total and translate statistics
Diffstat (limited to 'h-source')
-rw-r--r-- | h-source/Application/Include/myFunctions.php | 55 | ||||
-rw-r--r-- | h-source/Application/Views/Desktop/right.php | 10 |
2 files changed, 62 insertions, 3 deletions
diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index c4a220b..b121424 100644 --- a/h-source/Application/Include/myFunctions.php +++ b/h-source/Application/Include/myFunctions.php @@ -485,3 +485,58 @@ function getTranslationFunction($fieldName) return "gtext"; } + +//Map db type names to display names +function displayName($name) { + switch ($name) { + case '3G-card': + $name = '3G cards'; + break; + case 'bluetooth': + $name = 'Bluetooth'; + break; + case 'ethernet-card': + $name = 'Ethernet cards'; + break; + case 'fingerprint-reader': + $name = 'Fingerprint readers'; + break; + case 'host-controller': + $name = 'Host Controllers'; + break; + case 'modem': + $name = 'Modems'; + break; + case 'notebook': + $name = 'Notebooks'; + break; + case 'printer': + $name = 'Printers'; + break; + case 'RAID-adapter'; + $name = 'RAID adapters'; + break; + case 'scanner': + $name = 'Scanners'; + break; + case 'sd-card-reader': + $name = 'SD card readers'; + break; + case 'soundcard': + $name = 'Sound cards'; + break; + case 'videocard': + $name = 'Video cards'; + break; + case 'webcam': + $name = 'Webcams'; + break; + case 'wifi': + $name = 'Wifi cards'; + break; + case 'acquisition-card': + $name = 'Acquisition cards'; + break; + } + return $name; +} diff --git a/h-source/Application/Views/Desktop/right.php b/h-source/Application/Views/Desktop/right.php index 352386a..0e6c22a 100644 --- a/h-source/Application/Views/Desktop/right.php +++ b/h-source/Application/Views/Desktop/right.php @@ -136,12 +136,16 @@ </div> <table width="100%"> - <?php foreach ($stat as $type => $number) { ?> + <?php $total_number=0;foreach ($stat as $type => $number) { $total_number+=$number; $type=displayName($type);?> <tr> - <td><?php echo $type;?></td> - <td><?php echo "<b>".$number."</b>";?></td> + <td><?php echo gtext($type);?></td> + <td align="right"><?php echo "<b>".$number."</b>";?></td> </tr> <?php } ?> + <tr> + <td><?php echo gtext("<b>TOTAL</b>");?></td> + <td align="right"><?php echo "<b>".$total_number."</b>";?></td> + </tr> </table> <div class="statistics_hard_title"> |