"; 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 = decTgl($_POST['startDate']); $endDate = decTgl($_POST['endDate']); $kodeplg = $_POST['kdplg']; if(bukaKoneksi()){ global $conn; IF (strlen($startDate) > 2 && strlen($endDate) > 2 && $kodeplg !=''){ $query = "select m.no_nota, m.tgl_nota, m.kd_customer,p.nama, p.upline,m.jumlah_total, k.nama kasir from m_nota_bawa m, karyawan k ,pelanggan p where m.status_nota = 'S' and m.kd_customer = p.kd_customer and k.nik = m.kasir and date(m.tgl_nota) BETWEEN '$startDate' and '$endDate' and m.kd_customer = '$kodeplg' order by m.tgl_nota,m.no_nota"; }elseif ($startDate != '' && $endDate != '' && $kodeplg =='' ){ $query = "select m.no_nota, m.tgl_nota, m.kd_customer,p.nama, p.upline,m.jumlah_total, k.nama kasir from m_nota_bawa m, karyawan k ,pelanggan p where m.status_nota = 'S' and m.kd_customer = p.kd_customer and k.nik = m.kasir and date(m.tgl_nota) BETWEEN '$startDate' and '$endDate' order by m.tgl_nota,m.no_nota"; }elseif (strlen($startDate) <= 2 && strlen($endDate) <= 2 && $kodeplg !='') { $query = "select m.no_nota, m.tgl_nota, m.kd_customer,p.nama, p.upline,m.jumlah_total, k.nama kasir from m_nota_bawa m, karyawan k ,pelanggan p where m.status_nota = 'S' and m.kd_customer = p.kd_customer and k.nik = m.kasir and m.kd_customer = '$kodeplg' order by m.tgl_nota,m.no_nota"; } 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,$nota,$tgl,$kdcust,$nama,$upline,$total,$kasir); $ttJumlah = array(); $ttJumlah['hp'] = 0; print("
"); print("

Laporan Rekap Bawa Barang



"); print("
TOKO ".$_SESSION['namatoko']."
"); print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); print(""); print(""); while(mysqli_stmt_fetch($stmt)){ $ttJumlah['hp'] += $total; print(""); } print("
No.NotaTgl.NotaKd.PlgNamaUplineTotal BawaKasir
$nota$tgl$kdcust$nama$upline".number_format($total, 0, ",", ".")."$kasir

"); print("
"); print(""); print("
Total Transaksi Bawa : ".number_format($ttJumlah['hp'],0,',','.')."
"); }else{ echo "Data tidak ditemukan!"; } } } ?>