";
echo "div#divprint{width:900px; border:0px solid #000; padding:20px 0; margin-bottom:25px;}";
echo "table.tbl {width:875px;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 "table.tbl1 {width:900px;border-width:0 0 0 0;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:left;}";
echo "table.tbl1,table.tbl1 td {border-color:#000;border-style:solid;}";
echo "table.tbl1 td {margin:0;padding:2px;border-width:0 0 0 0;}";
echo "body {font-size:10pt;}";
echo "div.luar{text-align:left;margin-left:20px;}";
echo ".header{font-weight:bold;text-align:center;}";
echo ".isi{text-align:left;}";
echo ".warnaBarisStrip{font-weight : bold; background-color : #FFFF33;}";
echo ".warnaBarisKategori{font-weight : bold; background-color: #FFCC00;}";
echo ".master{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("
"); } } 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("
"); } } 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("
"); } } function tunai($nonotatunai) { include "./db_login.inc.php"; $toko = substr($nonotatunai,1,1); $database = '$dbh'.$toko; $dbh = mysql_connect(HOST,USER,PASSWORD); $dbh1 = mysql_connect($hostname, $username, $password); $dbh2 = mysql_connect($hostname, $username, $password, true); $dbh3 = mysql_connect($hostname, $username, $password, true); $dbh4 = mysql_connect($hostname, $username, $password, true); $dbh5 = mysql_connect($hostname, $username, $password, true); $dbh6 = mysql_connect($hostname, $username, $password, true); $dbh7 = mysql_connect($hostname, $username, $password, true); $dbh8 = mysql_connect($hostname, $username, $password, true); $dbh9 = mysql_connect($hostname, $username, $password, true); mysql_select_db(DATABASE,$dbh); mysql_select_db('amigo01', $dbh1); mysql_select_db('amigo02', $dbh2); mysql_select_db('amigo03', $dbh3); mysql_select_db('amigo04', $dbh4); mysql_select_db('amigo05', $dbh5); mysql_select_db('amigo06', $dbh6); mysql_select_db('amigo07', $dbh7); mysql_select_db('amigo08', $dbh8); mysql_select_db('amigo09', $dbh9); if($database == '$dbh1'){ $data = $dbh1; }elseif($database == '$dbh2'){ $data = $dbh2; }elseif($database == '$dbh3'){ $data = $dbh3; }elseif($database == '$dbh4'){ $data = $dbh4; }elseif($database == '$dbh5'){ $data = $dbh5; }elseif($database == '$dbh6'){ $data = $dbh6; }elseif($database == '$dbh7'){ $data = $dbh7; }elseif($database == '$dbh8'){ $data = $dbh8; }elseif($database == '$dbh9'){ $data = $dbh9; } /*----------------------------------------Rekap Tunai*/ $query = mysql_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'",$data); $query2 = mysql_query("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'",$data); print("
");
print("
"); 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("
"); print("");
}else{
echo "data tdk ada!";
echo "
"; } } //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("
| Kode Brg. | Nomor | Nama | Juml | Disc | HJ | Sub Total | Kd Pram |
| $kdbrg | $nomor | $nmbrg | $jum | ".$diskon." | ".number_format($hj,0,',','.')." | ".number_format($subtotal,0,',','.')." | $kdpram |
"); print("
"; } } //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("
"); 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("
"); print("");
}else{
echo "data tdk ada!";
echo "
"; } } //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("
| Kode Brg. | Nomor | Nama | Juml | HJ | Sub Total | Kd Pram |
| $kdbrg | $nomor | $nmbrg | $jum | ".number_format($hj,0,',','.')." | ".number_format($subtotal,0,',','.')." | $kdpram |
"); print("
"; } } //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("
"); 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("
"); print("");
}else{
echo "data tdk ada!";
echo "
"; } } //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("
| Kode Brg. | Nomor | Nama | Juml | Disc | HJ | Sub Total | Nota tunai | Kd Pram |
| $kdbrg | $nomor | $nmbrg | $jum | ".$diskon." | ".number_format($hj,0,',','.')." | ".number_format($subtotal,0,',','.')." | $notatunai | $kdpram |
"); print("
"; } } //print("
"); } } function tunai($nonotatunai) { include "./db_login.inc.php"; $toko = substr($nonotatunai,1,1); $database = '$dbh'.$toko; $dbh = mysql_connect(HOST,USER,PASSWORD); $dbh1 = mysql_connect($hostname, $username, $password); $dbh2 = mysql_connect($hostname, $username, $password, true); $dbh3 = mysql_connect($hostname, $username, $password, true); $dbh4 = mysql_connect($hostname, $username, $password, true); $dbh5 = mysql_connect($hostname, $username, $password, true); $dbh6 = mysql_connect($hostname, $username, $password, true); $dbh7 = mysql_connect($hostname, $username, $password, true); $dbh8 = mysql_connect($hostname, $username, $password, true); $dbh9 = mysql_connect($hostname, $username, $password, true); mysql_select_db(DATABASE,$dbh); mysql_select_db('amigo01', $dbh1); mysql_select_db('amigo02', $dbh2); mysql_select_db('amigo03', $dbh3); mysql_select_db('amigo04', $dbh4); mysql_select_db('amigo05', $dbh5); mysql_select_db('amigo06', $dbh6); mysql_select_db('amigo07', $dbh7); mysql_select_db('amigo08', $dbh8); mysql_select_db('amigo09', $dbh9); if($database == '$dbh1'){ $data = $dbh1; }elseif($database == '$dbh2'){ $data = $dbh2; }elseif($database == '$dbh3'){ $data = $dbh3; }elseif($database == '$dbh4'){ $data = $dbh4; }elseif($database == '$dbh5'){ $data = $dbh5; }elseif($database == '$dbh6'){ $data = $dbh6; }elseif($database == '$dbh7'){ $data = $dbh7; }elseif($database == '$dbh8'){ $data = $dbh8; }elseif($database == '$dbh9'){ $data = $dbh9; } /*----------------------------------------Rekap Tunai*/ $query = mysql_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'",$data); $query2 = mysql_query("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'",$data); print("
");
print("
"); print("
"); while($rowM=mysql_fetch_array($query2)){ print("Nomor Nota : ".$rowM['no_nota']."
"); print("Tanggal Nota : ".$rowM['tgl_nota']."
"); print("Plg : ".$rowM['tgl_nota']."
"); print("Total : ".number_format($rowM['jumlah_total'],0,',','.')."
"); print("Jumlah uang : ".number_format($rowM['total_uang'],0,',','.')."
"); print("Discount : ".$rowM['total_diskon']."
"); print("Bank : ".$rowM['bank']."
"); print("No.kartu : ".$rowM['no_kartu']."
"); print("Kasir : ".$rowM['kasir']."
"); } print("");
print("
"); print("");
}
?>
Rincian Penjualan
"); print("
"); while($rowM=mysql_fetch_array($query2)){ print("Nomor Nota : ".$rowM['no_nota']."
"); print("Tanggal Nota : ".$rowM['tgl_nota']."
"); print("Plg : ".$rowM['tgl_nota']."
"); print("Total : ".number_format($rowM['jumlah_total'],0,',','.')."
"); print("Jumlah uang : ".number_format($rowM['total_uang'],0,',','.')."
"); print("Discount : ".$rowM['total_diskon']."
"); print("Bank : ".$rowM['bank']."
"); print("No.kartu : ".$rowM['no_kartu']."
"); print("Kasir : ".$rowM['kasir']."
"); } print("
| Kode Brg. | Nomor | Nama | Juml | Disc | HJ | Sub Total | Kd Pram |
| $rowD[kd_barang] | $rowD[no_barang] | $rowD[nama_barang] | $rowD[jumlah] | $rowD[diskon] | ".number_format($rowD['harga_jual'],0,',','.')." | ".number_format($rowD['subtotal'],0,',','.')." | $rowD[kode_pram] |
"); print("