|
@@ -1191,7 +1191,7 @@ function validateCompany(source) {
|
|
|
return number_format($n, 3, ',', '');
|
|
return number_format($n, 3, ',', '');
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- $genShowDetails = function($a, $groupField) {
|
|
|
|
|
|
|
+ $genShowDetails = function($a, $groupField) use ($number_format) {
|
|
|
try {
|
|
try {
|
|
|
if (!$groupField) throw new Exception("Brak konfiguracji kolumny grupującej");
|
|
if (!$groupField) throw new Exception("Brak konfiguracji kolumny grupującej");
|
|
|
$tempTable = uniqid('_temp_benford_ids_');
|
|
$tempTable = uniqid('_temp_benford_ids_');
|
|
@@ -1207,9 +1207,9 @@ function validateCompany(source) {
|
|
|
}
|
|
}
|
|
|
$showDetails = "<h4>Najczęściej występujące wartości kolumny {$groupField}</h4>";
|
|
$showDetails = "<h4>Najczęściej występujące wartości kolumny {$groupField}</h4>";
|
|
|
if ($result) {
|
|
if ($result) {
|
|
|
- $showDetails .= "<table class=\"table table-bordered table-hover table-striped table-condensed\"><thead><tr style=\"font-weight:bold;\"><td>Wartość</td><td>Liczba wystąpień</td></tr></thead><tbody>";
|
|
|
|
|
- $showDetails .= implode('', array_map(function($v) {
|
|
|
|
|
- return "<tr><td>{$v['field']}</td><td>{$v['count']}</td></tr>";
|
|
|
|
|
|
|
+ $showDetails .= "<table class=\"table table-bordered table-hover table-striped table-condensed\"><thead><tr style=\"font-weight:bold;\"><td>Wartość</td><td>Liczba wystąpień</td><td>Procent występowania</td></tr></thead><tbody>";
|
|
|
|
|
+ $showDetails .= implode('', array_map(function($v) use ($a, $number_format){
|
|
|
|
|
+ return "<tr><td>{$v['field']}</td><td>{$v['count']}</td><td>" . $number_format(round($v['count'] / count($a) * 100, 3)) . "</td></tr>";
|
|
|
}, $result));
|
|
}, $result));
|
|
|
$showDetails .= "</tbody></table>";
|
|
$showDetails .= "</tbody></table>";
|
|
|
} else {
|
|
} else {
|