"; 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 ""; $nonota = $_GET['nota']; if(substr($_GET['nota'],0,2) == 'B-'): $nonotabon = $nonota; bon($nonotabon); elseif(substr($_GET['nota'],0,2) == 'W-'): $nonotabawa = $nonota; bawa($nonotabawa); elseif(substr($_GET['nota'],0,2) == 'R-'): $nonotaretur = $nonota; retur($nonotaretur); else: $nonotatunai = $nonota; tunai($nonotatunai); endif; 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("
"); print("

Rincian Penjualan


"); print("

"); 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."
"); print("Tanggal Nota : ".$tglnota."
"); print("Plg : ".$kdcust."
"); print("Total : ".number_format($tot,0,',','.')."
"); print("Jumlah uang : ".number_format($totuang,0,',','.')."
"); print("Discount : ".$disc."
"); print("Bank : ".$bank."
"); print("No.kartu : ".$kartu."
"); print("Kasir : ".$kasir."

"); } } } print(""); print(""); while(mysqli_stmt_fetch($stmt)){ print(""); } print("
Kode Brg.NomorNamaJumlDiscHJSub TotalKd Pram
$kdbrg$nomor$nmbrg$jum".$diskon."".number_format($hj,0,',','.')."".number_format($subtotal,0,',','.')."$kdpram

"); print("
"); }else{ echo "data tdk ada!"; echo "
"; } } print("
"); } } function bawa($nonotabawa) { if(bukaKoneksi()){ global $conn; /*----------------------------------------Rekap Bawa*/ $query = "SELECT d.`kd_barang`, d.`no_barang`, b.nama_barang,d.`jumlah`, d.`harga_satuan`,(d.`harga_satuan`*d.`jumlah`) subtotal,d.`kode_pram` FROM d_nota_bawa d,barang b where d.`kd_barang`=b.kode_barang and d.no_nota = '$nonotabawa'"; $query2 = "select m.no_nota,m.tgl_nota,m.kd_customer, m.jumlah_total,m.kasir from m_nota_bawa m where m.no_nota = '$nonotabawa'"; 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,$hj,$subtotal,$kdpram); print("
"); print("

Rincian Penjualan


"); print("

"); 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,$kasir); while(mysqli_stmt_fetch($stmt2)){ print("Nomor Nota : ".$nota."
"); print("Tanggal Nota : ".$tglnota."
"); print("Plg : ".$kdcust."
"); print("Total : ".number_format($tot,0,',','.')."
"); print("Kasir : ".$kasir."

"); } } } print(""); print(""); while(mysqli_stmt_fetch($stmt)){ print(""); } print("
Kode Brg.NomorNamaJumlHJSub TotalKd Pram
$kdbrg$nomor$nmbrg$jum".number_format($hj,0,',','.')."".number_format($subtotal,0,',','.')."$kdpram

"); print("
"); }else{ echo "data tdk ada!"; echo "
"; } } print("
"); } } function retur($nonotaretur) { if(bukaKoneksi()){ global $conn; /*----------------------------------------Rekap Tunai*/ $query = "SELECT d.`kd_barang`, d.`no_barang`, b.nama_barang,d.`jumlah`, d.`diskon`, d.`harga_jual`,(d.`harga_jual`*d.`jumlah`) subtotal,d.no_nota_tunai,d.`kode_pram` FROM d_nota_retur d,barang b where d.`kd_barang`=b.kode_barang and d.no_nota = '$nonotaretur'"; $query2 = "select m.no_nota,m.tgl_nota,m.kd_customer, m.jumlah_total,m.total_diskon,m.keterangan,m.kasir from m_nota_retur m where m.no_nota = '$nonotaretur'"; 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,$notatunai,$kdpram); print("
"); print("

Rincian Penjualan


"); print("

"); 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,$keterangan,$kasir); while(mysqli_stmt_fetch($stmt2)){ print("Nomor Nota : ".$nota."
"); print("Tanggal Nota : ".$tglnota."
"); print("Plg : ".$kdcust."
"); print("Total : ".number_format($tot,0,',','.')."
"); print("Keterangan : ".$keterangan."
"); print("Kasir : ".$kasir."

"); } } } print(""); print(""); while(mysqli_stmt_fetch($stmt)){ print(""); } print("
Kode Brg.NomorNamaJumlDiscHJSub TotalNota tunaiKd Pram
$kdbrg$nomor$nmbrg$jum".$diskon."".number_format($hj,0,',','.')."".number_format($subtotal,0,',','.')."$notatunai$kdpram

"); print("
"); }else{ echo "data tdk ada!"; echo "
"; } } print("
"); } } function tunai($nonotatunai) { if(bukaKoneksi()){ global $conn; /*----------------------------------------Rekap Tunai*/ $query = "SELECT d.`kd_barang`, d.`no_barang`, b.nama_barang,d.`jumlah`, d.`diskon`, d.`harga_jual`,(d.`harga_jual`*d.`jumlah`) subtotal,d.`kode_pram` FROM d_nota_tunai d,barang b where d.`kd_barang`=b.kode_barang and d.no_nota = '$nonotatunai'"; $query2 = "select m.no_nota,m.tgl_nota,m.kd_customer, m.jumlah_total,m.total_uang,m.total_diskon, m.bank,m.no_kartu,m.kasir from m_nota_tunai m where m.no_nota = '$nonotatunai'"; 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("
"); print("

Rincian Penjualan


"); print("

"); 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,$totuang,$disc,$bank,$kartu,$kasir); while(mysqli_stmt_fetch($stmt2)){ print("Nomor Nota : ".$nota."
"); print("Tanggal Nota : ".$tglnota."
"); print("Plg : ".$kdcust."
"); print("Total : ".number_format($tot,0,',','.')."
"); print("Jumlah uang : ".number_format($totuang,0,',','.')."
"); print("Discount : ".$disc."
"); print("Bank : ".$bank."
"); print("No.kartu : ".$kartu."
"); print("Kasir : ".$kasir."

"); } } } print(""); print(""); while(mysqli_stmt_fetch($stmt)){ print(""); } print("
Kode Brg.NomorNamaJumlDiscHJSub TotalKd Pram
$kdbrg$nomor$nmbrg$jum".$diskon."".number_format($hj,0,',','.')."".number_format($subtotal,0,',','.')."$kdpram

"); print("
"); }else{ echo "data tdk ada!"; echo "
"; } } print("
"); } } ?>