Postingan lainnya
report tabel di ubah ke persen & grafik
gan gmna data report, dari beberapa tabel database di rubah ke informasi persentase & grafik
image.png
<div class="content">
<div class="page-inner">
<!--<div class="mt-2 mb-4">
<h2 class="text-white pb-2">Welcome back, Hizrian!</h2>
<h5 class="text-white op-7 mb-4">Yesterday I was clever, so I wanted to change the world. Today I am wise, so I am changing myself.</h5>
</div>-->
<!-- Table -->
<div class="row row-card-no-pd">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<div class="card-head-row">
<h4 class="card-title">Prosentase Data</h4>
<div class="card-tools">
<button class="btn btn-icon btn-link btn-primary btn-xs"><span class="fa fa-angle-down"></span></button>
<button class="btn btn-icon btn-link btn-primary btn-xs btn-refresh-card"><span class="fa fa-sync-alt"></span></button>
<button class="btn btn-icon btn-link btn-primary btn-xs"><span class="fa fa-times"></span></button>
</div>
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-12">
<div class="table-responsive table-hover table-sales">
<table class="table">
<tbody>
<?php
foreach($dashboard as $row):
$target_shift = $row['durasi_shift'] * $row['cycle_mesin'] / 60;
$target_lembur = $row['durasi_lembur'] * $row['cycle_mesin'] / 60;
$force_stop = $row['durasi_stop'] * $row['cycle_mesin'] / 60;
$total_target = $target_shift + $target_lembur - $force_stop;
$total_durasi = $row['durasi_shift'] + $row['durasi_lembur'] - $row['durasi_stop'];
$otr = ($total_durasi - $row['dt_qty']) / $total_durasi;
$per = $row['counter_qty'] / $total_target;
$qly = ($row['counter_qty'] - $row['ng_qty']) / $row['counter_qty'];
$oee = $otr * $per * $qly;
?>
<tr>
<td> <?= $row['tanggal'] ?></td>
<td> <?= $row['nama_mesin'] ?></td>
<td> <?= $row['cycle_mesin'] ?></td>
<td> <?= $row['nama_kalender'] ?></td>
<td> <?= $row['nama_shift'] ?></td>
<td> <?= $row['counter_qty'] ?></td>
<td> <?= $row['ng_qty'] ?></td>
<td> <?= $row['dt_qty'] ?></td>
<td> <?= $row['durasi_shift'] ?></td>
<td> <?= $target_shift ?></td>
<td> <?= $row['durasi_lembur'] ?></td>
<td> <?= $target_lembur ?></td>
<td> <?= $row['durasi_stop'] ?></td>
<td> <?= $force_stop ?></td>
<td> <?= $total_durasi ?></td>
<td> <?= $total_target ?></td>
<td> <?= number_format((float)$otr, 2, '.', '') ?></td>
<td> <?= number_format((float)$per, 2, '.', '') ?></td>
<td> <?= number_format((float)$qly, 2, '.', '') ?></td>
<td> <?= number_format((float)$oee, 2, '.', '') ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
naaah ane dah buatkan
image.png
<div class="content">
<div class="page-inner">
<!--<div class="mt-2 mb-4">
<h2 class="text-white pb-2">Welcome back, Hizrian!</h2>
<h5 class="text-white op-7 mb-4">Yesterday I was clever, so I wanted to change the world. Today I am wise, so I am changing myself.</h5>
</div>-->
<!-- Table -->
<div class="row row-card-no-pd">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<div class="card-head-row">
<h4 class="card-title">Prosentase Data</h4>
<div class="card-tools">
<button class="btn btn-icon btn-link btn-primary btn-xs"><span class="fa fa-angle-down"></span></button>
<button class="btn btn-icon btn-link btn-primary btn-xs btn-refresh-card"><span class="fa fa-sync-alt"></span></button>
<button class="btn btn-icon btn-link btn-primary btn-xs"><span class="fa fa-times"></span></button>
</div>
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-12">
<div class="table-responsive table-hover table-sales">
<table class="table">
<tbody>
<?php
foreach($dashboard as $row):
$target_shift = $row['durasi_shift'] * $row['cycle_mesin'] / 60;
$target_lembur = $row['durasi_lembur'] * $row['cycle_mesin'] / 60;
$force_stop = $row['durasi_stop'] * $row['cycle_mesin'] / 60;
$total_target = $target_shift + $target_lembur - $force_stop;
$total_durasi = $row['durasi_shift'] + $row['durasi_lembur'] - $row['durasi_stop'];
$otr = ($total_durasi - $row['dt_qty']) / $total_durasi;
$per = $row['counter_qty'] / $total_target;
$qly = ($row['counter_qty'] - $row['ng_qty']) / $row['counter_qty'];
$oee = ($otr * $per * $qly)*100;
echo " Hasil $oee %";
?>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
minta bantuannya sama agan untuk hasilnya bisa di tampilkan dalam persentase
1 Jawaban:
<div>untuk desimalnya sudah saya rubah, tapi masih belum bisa mentotalkan<br><br><figure data-trix-attachment="{"contentType":"image/png","filename":"image.png","filesize":14997,"height":119,"url":"https://i.ibb.co/fn8mwwT/image.png","width":811}" data-trix-content-type="image/png" data-trix-attributes="{"presentation":"gallery"}" class="attachment attachment--preview attachment--png"><img src="https://i.ibb.co/fn8mwwT/image.png" width="811" height="119"><figcaption class="attachment__caption"><span class="attachment__name">image.png</span></figcaption></figure></div><pre><tbody> <?php foreach($dashboard as $row):
$target_shift = $row['durasi_shift'] * $row['cycle_mesin'] / 60;
$target_lembur = $row['durasi_lembur'] * $row['cycle_mesin'] / 60;
$force_stop = $row['durasi_stop'] * $row['cycle_mesin'] / 60;
$total_target = $target_shift + $target_lembur - $force_stop;
$total_durasi = $row['durasi_shift'] + $row['durasi_lembur'] - $row['durasi_stop'];
$otr = ($total_durasi - $row['dt_qty']) / $total_durasi;
$per = $row['counter_qty'] / $total_target;
$qly = ($row['counter_qty'] - $row['ng_qty']) / $row['counter_qty'];
$oee = $otr * $per * $qly;
$total = (number_format((float)$oee, 2, '.', ''));
echo " Hasil $total %";
?&gt;
&lt;?php endforeach; ?&gt;
&lt;/tbody&gt;</pre>