Skip to content
Snippets Groups Projects
Commit bdd5a2ba authored by Venny Larasati's avatar Venny Larasati
Browse files

statistik workingtapi legendanya masih jelek

parent 1deac3dd
Branches
No related merge requests found
Pipeline #2962 skipped
...@@ -9,20 +9,21 @@ function getStatistik(){ ...@@ -9,20 +9,21 @@ function getStatistik(){
$i = 0; $i = 0;
// hitung per skpd // hitung per skpd
foreach ($skpd as $skpd){ foreach ($skpd as $skpd){
$res[$i]['nama'] = $skpd['nama']; $sum = 0;
$res[$i]['sum'] = 0; $count = 0;
$res[$i]['count'] = 0; $avg = 0;
$res[$i]['avg'] = 0;
foreach($penilaian as $n){ foreach($penilaian as $n){
if (strcmp($skpd['nama'], $n['unit_kerja'])) { if (strcmp($skpd['nama'], $n['unit_kerja']) == 0) {
$res[$i]['sum'] += $n['nilai']; $res[$i]['nama'] = $skpd['nama'];
$res[$i]['count']++; $sum += $n['nilai'];
$count++;
} }
} }
if ($res[$i]['count'] != 0) { if ($count != 0) {
$res[$i]['avg'] = $res[$i]['sum']/$res[$i]['count']; $avg = $sum/$count;
$res[$i]['avg'] = $avg;
$i++; $i++;
} }
} }
return $res; return $res;
......
...@@ -93,10 +93,11 @@ ...@@ -93,10 +93,11 @@
</div> </div>
<div class="panel-body no-padder"> <div class="panel-body no-padder">
<div class="wrapper20 inline full-width"> <div class="wrapper20 inline full-width">
Keterangan:
<?php <?php
$skpd = getStatistik(); $skpd = getStatistik();
foreach ($skpd as $skpd){ foreach ($skpd as $skpd){
echo $skpd['nama'] . "<br/>"; echo "<li>". $skpd['nama'] . "</li>";
} }
?> ?>
</div> </div>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment