From 78d649395a72e8ac1e07d8ae751890a674067ca9 Mon Sep 17 00:00:00 2001 From: Ian Gilfillan Date: Sun, 31 Jul 2016 13:52:46 +0000 Subject: Total and translate statistics --- h-source/Application/Include/myFunctions.php | 55 ++++++++++++++++++++++++++++ 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 @@ - $number) { ?> + $number) { $total_number+=$number; $type=displayName($type);?> - - + + + + + +
".$number."";?>".$number."";?>
TOTAL");?>".$total_number."";?>
-- cgit v1.2.3