";
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 "";
$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("
");
print("
Rekap Rencana Order Per Supplier
");
print("
TOKO ".$_SESSION['namatoko']."
");
print("DICETAK TANGGAL : ".date('d-m-Y')."
");
print("Bulan : ".$bulan."
");
print("Tahun : ".$_POST['tahun']."
");
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."
");
print("Nama Supplier : ".$namasupp."
");
}
}
}
print("
");
print("");
while(mysqli_stmt_fetch($stmt)){
$ttJumlah['jml'] += $vol;
print("| $kdstrip | $vol | $artikel | $nomor |
");
}
print("
");
print("
");
print("| Total Jumlah Beli | : ".number_format($ttJumlah['jml'],0,',','.')." |
");
print("
");
}else{
echo "Tidak ada data rencana order untuk tanggal tersebut!";
}
}
}
?>