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

avatar popeyefauzi
@popeyefauzi

2 Kontribusi 0 Poin

Dipost 2 tahun yang lalu

1 Jawaban:

<div>untuk desimalnya sudah saya rubah, tapi masih belum bisa mentotalkan<br><br><figure data-trix-attachment="{&quot;contentType&quot;:&quot;image/png&quot;,&quot;filename&quot;:&quot;image.png&quot;,&quot;filesize&quot;:14997,&quot;height&quot;:119,&quot;url&quot;:&quot;https://i.ibb.co/fn8mwwT/image.png&quot;,&quot;width&quot;:811}" data-trix-content-type="image/png" data-trix-attributes="{&quot;presentation&quot;:&quot;gallery&quot;}" 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>&lt;tbody&gt; &lt;?php foreach($dashboard as $row):

											$target_shift	= $row[&#039;durasi_shift&#039;] * $row[&#039;cycle_mesin&#039;] / 60;
											$target_lembur	= $row[&#039;durasi_lembur&#039;] * $row[&#039;cycle_mesin&#039;] / 60;
											$force_stop		= $row[&#039;durasi_stop&#039;] * $row[&#039;cycle_mesin&#039;] / 60;
											$total_target	= $target_shift + $target_lembur - $force_stop;
											$total_durasi	= $row[&#039;durasi_shift&#039;] + $row[&#039;durasi_lembur&#039;] - $row[&#039;durasi_stop&#039;];
											$otr 			= ($total_durasi - $row[&#039;dt_qty&#039;]) / $total_durasi;
											$per 			= $row[&#039;counter_qty&#039;] / $total_target;
											$qly 			= ($row[&#039;counter_qty&#039;] - $row[&#039;ng_qty&#039;]) / $row[&#039;counter_qty&#039;];
											$oee 			= $otr * $per * $qly;
											$total			= (number_format((float)$oee, 2, &#039;.&#039;, &#039;&#039;));
											
											echo &quot; Hasil $total %&quot;;
											?&amp;gt;
											
										&amp;lt;?php endforeach; ?&amp;gt;
									&amp;lt;/tbody&amp;gt;&lt;/pre&gt;
avatar popeyefauzi
@popeyefauzi

2 Kontribusi 0 Poin

Dipost 2 tahun yang lalu

Login untuk ikut Jawaban