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.
86 lines
3.2 KiB
PHP
86 lines
3.2 KiB
PHP
<?php
|
|
include "../func_lib.php";
|
|
|
|
echo "<style type='text/css'>";
|
|
echo "table.tbl {width:750px;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}";
|
|
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>";
|
|
|
|
$nonota = $_GET['nota'];
|
|
$nonotabon = $nonota;
|
|
bon($nonotabon);
|
|
|
|
function bon($nonotabon)
|
|
{
|
|
if(bukaKoneksi()){
|
|
global $conn;
|
|
/*----------------------------------------Rekap Bon*/
|
|
$query = "SELECT d.`kd_brg`, d.`nomor`, b.nama_barang,d.`jumlah`, d.`diskon`,
|
|
d.`hrg_satuan`,(d.`hrg_satuan`*d.`jumlah`) subtotal,d.`kd_pram`
|
|
FROM d_bon d,barang b
|
|
where d.`kd_brg`=b.kode_barang
|
|
and d.no_bon = '$nonotabon'";
|
|
$query2 = "select m.no_bon,m.tgl_bon,m.kode_plg,
|
|
m.jumlah_total,m.diskon,
|
|
m.bank,m.no_kartu,m.kasir
|
|
from m_bon m
|
|
where m.no_bon = '$nonotabon'";
|
|
|
|
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,$kdbrg,$nomor,$nmbrg,$jum,$diskon,$hj,$subtotal,$kdpram);
|
|
|
|
print("<center><div id=\"divprint\" >");
|
|
print("<h2>Rincian Penjualan</h2><br/>");
|
|
print("<div class=\"luar\"><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,$nota,$tglnota,$kdcust,$tot,$disc,$bank,$kartu,$kasir);
|
|
while(mysqli_stmt_fetch($stmt2)){
|
|
print("Nomor Nota : ".$nota."<br/>");
|
|
print("Tanggal Nota : ".$tglnota."<br/>");
|
|
print("Plg : ".$kdcust."<br/>");
|
|
print("Total : ".number_format($tot,0,',','.')."<br/>");
|
|
print("Jumlah uang : ".number_format($totuang,0,',','.')."<br/>");
|
|
print("Discount : ".$disc."<br/>");
|
|
print("Bank : ".$bank."<br/>");
|
|
print("No.kartu : ".$kartu."<br/>");
|
|
print("Kasir : ".$kasir."<br/><br/>");
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
print("<table border=\"1\" class=\"tbl\">");
|
|
print("<tr class=\"header\"><td>Kode Brg.</td><td>Nomor</td><td>Nama</td><td>Juml</td><td>Disc</td><td>HJ</td><td>Sub Total</td><td>Kd Pram</td></tr>");
|
|
|
|
while(mysqli_stmt_fetch($stmt)){
|
|
print("<tr class=\"isi\"><td align=\"center\">$kdbrg</td><td align=\"center\">$nomor</td><td>$nmbrg</td><td align=\"center\">$jum</td><td align=\"center\">".$diskon."</td><td align=\"right\">".number_format($hj,0,',','.')."</td><td align=\"right\">".number_format($subtotal,0,',','.')."</td><td align=\"center\">$kdpram</td></tr>");
|
|
}
|
|
|
|
print("</table><br/>");
|
|
print("</div></center>");
|
|
}else{
|
|
echo "data tdk ada!";
|
|
echo "<br/>";
|
|
}
|
|
}
|
|
print("</h2></div></center><br/>");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
?>
|