<div align="RiGHT">
<h3>
<a href="?mnu=analisa">Per Barang</a> |
<a href="?mnu=analisa2">Per Waktu %Y%M</a>
</h3>
</div>
<?php
$sql0 = "SELECT * from `tb_barang` order by id_barang asc";
$no = 1;
$arr0 = getData($conn, $sql0);
foreach ($arr0 as $d0) {
$id_barang = $d0["id_barang"];
$nama_barang = $d0["nama_barang"];
$sql = "select `$tbpo`.`id_po`,`$tbpo`.`tanggal` ,`$tbdetail`.`jumlah_karton` from `$tbpo`,`$tbdetail`
where `$tbpo`.id_po=`$tbdetail`.id_po
and `$tbdetail`.id_barang='$id_barang'
order by `$tbpo`.`tanggal` asc";
$tot=0;
$jum = getJum($conn, $sql);
$gab="<b>$nama_barang ($id_barang)</b><ol>";
if ($jum > 0) {
$no = 1;
$arr = getData($conn, $sql);
foreach ($arr as $d) {
$id_po = $d["id_po"];
$tanggal = $d["tanggal"];
$jumlah_karton = $d["jumlah_karton"];
$tot+=$jumlah_karton;
$gab.="<li><a href='?mnu=detail&id=$id_po'>$id_po</a> $tanggal : <b>$jumlah_karton</b></li>";
}
$gab.="</ol><b>Total $tot</b><br>";
echo $gab;
}//jum
}
==================================
<div align="RiGHT">
<h3>
<a href="?mnu=analisa">Per Barang</a> |
<a href="?mnu=analisa2">Per Waktu %Y%M</a>
</h3>
</div>
<?php
$no = 1;
$tot=0;
$sql0 = "SELECT distinct(`id_barang`) from `$tbdetail` order by id_barang asc";
$arr0 = getData($conn, $sql0);
foreach ($arr0 as $d0) {
$id_barang = $d0["id_barang"];
$nama_barang = getBarang($conn,$id_barang);
$gab="<b>$no. $nama_barang ($id_barang)</b><ol>";
$sql00 = "SELECT `tb_po`.`tanggal` from
`tb_po`,`$tbdetail`
where
`tb_po`.id_po=`$tbdetail`.id_po
and
`$tbdetail`.id_barang='$id_barang'
GROUP BY DATE_FORMAT(`tb_po`.tanggal, '%Y%m') order by `tb_po`.tanggal asc";
$arr00 = getData($conn, $sql00);
foreach ($arr00 as $d00) {
$tanggal = $d00["tanggal"];
$TGL=setBul($tanggal);
$ar=explode("-",$tanggal);
$bln=$ar[1];
$thn=$ar[0];
$per1="$thn-$bln-01";
$per2="$thn-$bln-31";
$sql = "select sum(`$tbdetail`.`jumlah_karton`) as `subjumlah` from `$tbpo`,`$tbdetail`
where `$tbpo`.id_po=`$tbdetail`.id_po
and (`$tbpo`.tanggal between '$per1' and '$per2')
and `$tbdetail`.id_barang='$id_barang'
order by `$tbpo`.`tanggal` asc";
$jum = getJum($conn, $sql);
if ($jum > 0) {
$no = 1;
$d = getField($conn, $sql);
$subjumlah = $d["subjumlah"]+0;
$tot+=$subjumlah;
$gab.="<li><a href='?mnu=po2&tgl=$tanggal&id_barang=$id_barang'>Periode $TGL</a>:<b>$subjumlah</b></li>";
}//jum
}//distinct Bulan thn
$gab.="</ol>Total $tot Item<br>";
echo $gab;
$no++;
}
============
<?php
//error_reporting(0);
?>
<script type="text/javascript">
function PRINT() {
win = window.open('po/po_print.php', 'win', 'width=1000, height=400, menubar=0, scrollbars=1, resizable=0, location=0, toolbar=0, status=0');
}
</script>
<?php
$tanggal = $_GET["tgl"];
$id_barang= $_GET["id_barang"];
$TGL=setBul($tanggal);
$ar=explode("-",$tanggal);
$bln=$ar[1];
$thn=$ar[0];
$per1="$thn-$bln-01";
$per2="$thn-$bln-31";
$w1=WKT($per1);
$w2=WKT($per2);
$NB=getBarang($conn,$id_barang);
?>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<h6>Rekapitulasi <?php echo $TGL;?></h6>
<hr>
<div class="row">
<div class="col-md-6">
<label for="id_po">Nama Barang</label>
<input type="text" class="form-control" required name="id_po" id="id_po" value="<?php echo $NB; ?>" readonly>
</div>
<div class="col-md-6">
<label for="id_pelanggan">ID Barang</label>
<input type="text" class="form-control" required name="id_po" id="id_po" value="<?php echo $id_barang; ?>" readonly>
</div>
</div>
<div class="row">
<div class="col-md-12"><br>
<label for="status">Periode</label><br>
<input type="text" class="form-control" required name="id_po" id="id_po" value="<?php echo "$w1 s/d $w2"; ?>" readonly>
</div>
</div>
</div>
</div>
</div>
</div>
<hr>
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-table me-1"></i>
Data PO :| <img src='ypathicon/print.png' title='PRINT' OnClick="PRINT()"> |
</div>
<div class="card-body">
<table class="table table-striped" id="myTable">
<thead>
<tr>
<th width="3%">No</td>
<th width="80%">Data Order</th>
<th width="15%">Status</th>
</tr>
</thead>
<tbody>
<?php
$tot=0;
$sql = "select `$tbpo`.id_po,`$tbpo`.tanggal,`$tbpo`.id_pelanggan,`$tbpo`.status from `$tbpo`
where (`$tbpo`.tanggal between '$per1' and '$per2')
order by `$tbpo`.`tanggal` asc";
$no = 1;
$arr = getData($conn, $sql);
foreach ($arr as $d) {
$stot=0;
$id_po = $d["id_po"];
$tanggal_po = WKT($d["tanggal"]);
$id_pelanggan = $d["id_pelanggan"];
$NP=getPelanggan($conn,$id_pelanggan);
$status= $d["status"];
$sqlv = "select id_barang,jumlah_karton,jumlah_pcs from `$tbdetail` where id_po='$id_po' and `id_barang`='$id_barang' order by `id_detail` desc";
if(getJum($conn,$sqlv)>0){
$gab = "<ul>";
$arrv = getData($conn, $sqlv);
foreach ($arrv as $dv) {
$jumlah_karton = $dv["jumlah_karton"];
$jumlah_pcs = $dv["jumlah_pcs"];
$id_barang = $dv["id_barang"];
$stot+=$jumlah_karton;
$tot+=$jumlah_karton;
$gab .= "<li><small>$id_barang |$NB</small> : <label title='PCS: $jumlah_pcs'>$jumlah_karton Item</label</li>";
}
$gab .= "</ul>";
echo "<tr>
<td>$no</td>
<td><b>$id_po ($tanggal_po)#$NP|$id_pelanggan </b>
<br>$gab
</td>
<td align='center'>$stot /$tot<br><br><br>$status</td>
</tr>";
$no++;
}//jumv
}
?>
</tbody>
</table>
<?php
echo "<big>Total Transaksi $NB : $tot Item</big>";
?>
</div>
</div>
<div align="RiGHT">
<h3>
<a href="?mnu=nb">Algoritma NB</a> |
<a href="?mnu=svm">Algoritma SVM</a>
</h3>
</div>
<hr>
<?php
$sql = "select * from `$tbpengujian` order by `id_pengujian` desc";
if(isset($_GET["id"])){
$id_pengujian=$_GET["id"];
$sql = "select * from `$tbpengujian` where id_pengujian='$id_pengujian'";
}
$d = getField($conn, $sql);
$id_pengujian = $d["id_pengujian"];
$tanggal = WKT($d["tanggal"]);
$jam = $d["jam"];
$id_barang = $d["id_barang"];
$nama_pengujian = $d["nama_pengujian"];
$group = $d["group"];
$durasi = $d["durasi"];
$sql = "select * from `$tbbarang` where `id_barang`='$id_barang'";
$d = getField($conn, $sql);
$nama_barang = $d["nama_barang"];
$deskripsi = $d["deskripsi"];
$gambar = $d["gambar"];
$harga = $d["harga"];
$satuan = $d["satuan"];
$pcs = $d["pcs"];
$berat = $d["berat"];
$ukuran = $d["ukuran"];
$arJ=array();
$i=0;
$sql = "SELECT `jumlah` from `tb_normalisasi` where `id_pengujian`='$id_pengujian' order by id_norm asc";
$arr = getData($conn, $sql);
foreach ($arr as $d) {
$jumlah = $d["jumlah"];
$arJ[$i]=$jumlah;
$i++;
}
$max=max($arJ);
$min=min($arJ);
$ARL=setLevel($min,$max,$group);
?>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<h6>Data Pengujian UJI:<?php echo $id_pengujian;?></h6>
<hr>
<div class="row">
<div class="col-md-3">
<label for="id_barang">ID Pengujian</label>
<input type="text" class="form-control" required name="id_pengujian0" id="id_pengujian0" value="UJI:<?php echo $id_pengujian; ?>" readonly>
</div>
<div class="col-md-9">
<label for="nama_barang">Nama Pengujian</label>
<input type="text" class="form-control" required name="nama_pengujian" readonly id="nama_pengujian" value="<?php echo $nama_pengujian; ?>" placeholder="">
</div>
</div>
<div class="row">
<div class="col-md-3">
<label for="id_barang">ID Barang</label>
<input type="text" class="form-control" required name="id_barang" id="id_barang" value="<?php echo $id_barang; ?>" readonly>
</div>
<div class="col-md-9">
<label for="nama_barang">Nama Barang</label>
<input type="text" class="form-control" required name="nama_barang" id="nama_barang" value="<?php echo $nama_barang; ?>" readonly placeholder="">
</div>
</div>
<div class="row">
<div class="col-md-3">
<label for="id_barang">Group Pengujian</label>
<input type="text" class="form-control" required name="group" id="group" value="<?php echo $group; ?> Level" readonly placeholder="">
</div>
<div class="col-md-9">
<label for="nama_barang">Lama Prediksi</label>
<input type="text" class="form-control" required name="durasi" id="durasi" value="<?php echo $durasi; ?> Bulan Yang Akan Datang" readonly>
</div>
</div>
<div class="row">
<div class="col-md-12">
<table class="table table-striped" id="myTable">
<thead>
<tr>
<th width="3%">No</td>
<th width="15%">Periode</td>
<th width="7%">Jumlah</td>
<th width="7%">Level</td>
</tr>
</thead>
<tbody>
<?php
$arP=array();
$sql = "SELECT * from `tb_normalisasi` where `id_pengujian`='$id_pengujian' order by id_norm asc";
$jum = getJum($conn, $sql);
if ($jum > 0) {
$no = 1;
$arr = getData($conn, $sql);
foreach ($arr as $d) {
$id_barang = $d["id_barang"];
$jumlah = $d["jumlah"];
$periode = $d["periode"];
$keterangan = $d["keterangan"];
$id_norm = $d["id_norm"];
$level=getLevel($ARL,$jumlah);
$i=$no-1;
$arP[$i]=$level;
$sqlUP = "UPDATE `tb_normalisasi` set `level`='$level' where `id_norm`='$id_norm'";
process($conn, $sqlUP);
echo "<tr>
<td>$no</td>
<td>$periode</td>
<td>$jumlah</td>
<td>$level</td></tr>
";
$no++;
} //for dalam
} //if
else {
echo "<tr><td colspan='6'><blink>Maaf, Data Normalisasi belum tersedia...</blink></td></tr>";
}
?>
</tbody>
</table></div> </div>
<?php
$jiter=$i-$group;
$gab="<h3>Dataset @$group Item</h3><ol>";
$arUji=array();
$gabUji="<h3>Dataset @$group Item</h3><ol>";
for($i=0;$i<=$jiter;$i++){
$gab.="<li>";
for($j=$i;$j<$group+$i;$j++){
$gab.=$arP[$j]."|";
}
$gab.=" = ".$arP[$i+$group]."</li>";
}
$gab.="</ol>";
echo $gab;
$gab="<h3>Prediksi $durasi Bulan YAD</h3>";
$arN=setINC($periode, $durasi);
for($i=0;$i<count($arN);$i++){
$gab.="$i.".$arN[$i]."<br>";
}
echo $gab;
?>
</div>
</div>
</div>
</div>