You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
3.5 KiB
PHTML
96 lines
3.5 KiB
PHTML
<?php
|
|
include "../func_lib.php";
|
|
|
|
session_start();
|
|
if($_SESSION['validAssko'] !== TRUE && $_SESSION['validAdmin'] !== TRUE && $_SESSION['validPemko'] !== TRUE)
|
|
{
|
|
header("location: ../index.php");
|
|
exit();
|
|
}
|
|
|
|
echo "<style type='text/css'>";
|
|
echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}";
|
|
echo "table.tbl {width:750px;border-width:0 0 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}";
|
|
echo "table.tbl,table.tbl td {border-color:#000;border-style:solid;}";
|
|
echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}";
|
|
echo "body {font-size:9pt;}";
|
|
echo "div.luar{text-align:left;margin-left:150px;}";
|
|
echo ".header{font-weight:bold;text-align:center;}";
|
|
echo ".isi{text-align:left;}";
|
|
echo "</style>";
|
|
|
|
$startDate = $_POST['startDate'];
|
|
$endDate = $_POST['endDate'];
|
|
$bulan = $_POST['bulan'];
|
|
$tahun = substr($_POST['tahun'],2,2);
|
|
|
|
if(bukaKoneksi()){
|
|
global $conn;
|
|
if ($startDate != '' and $endDate != '' and $bulan != '' and $tahun != ''){
|
|
$query = "select m.kode_strip, d.vol_revisi,d.artikel_revisi,d.nomor_revisi
|
|
from m_rencana_beli m inner join d_rencana_beli d on (m.id=d.id)
|
|
where m.status_revisi = '1'
|
|
and d.kode_supplier = '$startDate'
|
|
and m.kode_strip = '$endDate'
|
|
and m.bulanR = '$bulan'
|
|
and m.tahunR = '$tahun'";
|
|
}else{
|
|
$query = "select m.kode_strip, d.vol_revisi,d.artikel_revisi,d.nomor_revisi
|
|
from m_rencana_beli m inner join d_rencana_beli d on (m.id=d.id)
|
|
where m.status_revisi = '1'
|
|
and d.kode_supplier = '$startDate'
|
|
and m.bulanR = '$bulan'
|
|
and m.tahunR = '$tahun'";
|
|
}
|
|
$query2 = "select s.nama_supplier
|
|
from supplier s
|
|
where s.kd_supplier = '$startDate'";
|
|
|
|
if($stmt = mysqli_prepare($conn,$query)){
|
|
mysqli_stmt_execute($stmt);
|
|
mysqli_stmt_store_result($stmt);
|
|
$cek = mysqli_stmt_num_rows($stmt);
|
|
if($cek > 0){
|
|
mysqli_stmt_bind_result($stmt,$kdstrip,$vol,$artikel,$nomor);
|
|
$ttJumlah = array();
|
|
$ttJumlah['jml'] = 0;
|
|
|
|
print("<center><div id=\"divprint\" >");
|
|
print("<h2>Rekap Rencana Order Per Supplier</h2><br/><br/>");
|
|
print("<div class=\"luar\">TOKO ".$_SESSION['namatoko']."<br/>");
|
|
print("DICETAK TANGGAL : ".date('d-m-Y')."<br/><br/>");
|
|
print("Bulan : ".$bulan."<br/>");
|
|
print("Tahun : ".$_POST['tahun']."<br/>");
|
|
if($stmt2 = mysqli_prepare($conn,$query2)){
|
|
mysqli_stmt_execute($stmt2);
|
|
mysqli_stmt_store_result($stmt2);
|
|
$cek2 = mysqli_stmt_num_rows($stmt2);
|
|
if($cek2 > 0){
|
|
mysqli_stmt_bind_result($stmt2,$namasupp);
|
|
while(mysqli_stmt_fetch($stmt2)){
|
|
print("Kode Supplier : ".$startDate."<br/>");
|
|
print("Nama Supplier : ".$namasupp."</div><br/><br/>");
|
|
|
|
}
|
|
}
|
|
}
|
|
print("<table border=\"1\" class=\"tbl\">");
|
|
print("<tr class=\"header\"><td>Lini Produk</td><td>Juml Barang</td><td>Artikel</td><td>Nomor Brg</td></tr>");
|
|
|
|
while(mysqli_stmt_fetch($stmt)){
|
|
$ttJumlah['jml'] += $vol;
|
|
print("<tr class=\"isi\"><td align=\"center\">$kdstrip</td><td align=\"center\">$vol</td><td>$artikel</td><td align=\"center\">$nomor</td></tr>");
|
|
}
|
|
|
|
print("</table><br/>");
|
|
print("<div class=\"luar\"><table border=\"0\">");
|
|
|
|
print("<tr><td>Total Jumlah Beli</td><td> : ".number_format($ttJumlah['jml'],0,',','.')."</td></tr>");
|
|
print("</table></div></div></center>");
|
|
}else{
|
|
echo "Tidak ada data rencana order untuk tanggal tersebut!";
|
|
}
|
|
}
|
|
}
|
|
?>
|