Cleopatra Minimarket

Report Pelanggan Tunai "; echo "div#divprint{width:900px; border:0px solid #000; padding:20px 0; margin-bottom:25px;}"; echo "table.tbl {width:850px;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:10pt;}"; echo "div.luar{text-align:left;margin-left:150px;}"; 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 ""; require_once 'db_login.inc.php'; $startDate = decTgl($_POST['startDate']); $endDate = decTgl($_POST['endDate']); $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); $stmt = $mysqli->query("select case pekerjaan when 1 then 'Ibu Rumah Tangga' when 2 then 'Profesional' when 3 then 'TNI / POLRI' when 4 then 'Guru / Dosen' when 5 then 'Karyawan / Staf BUM Swasta' when 6 then 'Buruh' when 7 then 'Pensiunan / Purnawirawan' when 8 then 'Pegawai Negeri Sipil' when 9 then 'Pelajar / Mahasiswa' when 10 then 'Wiraswasta' when 11 then 'Belum / Tidak Bekerja' when 12 then 'Karyawan / Staf BUMN / BUMD' when 13 then 'Pejabat Pemerintah' when 14 then 'Rohaniawan' when 15 then 'Seniman' end as jns_pekerjaan,count(m.no_nota) jmlTransaksi,sum(m.jumlah_total) rpTransaksi from pelanggan p, m_nota_tunai m where p.kd_customer = m.kd_customer and m.status_nota = 'S' and date(m.tgl_nota) between '$startDate' and '$endDate' group by p.pekerjaan order by jns_pekerjaan"); $totkosong = 0; $totisi = 0; if($stmt->num_rows > 0) { print("
"); print(""); print(""); while($a = $stmt->fetch_array(MYSQLI_ASSOC)) { $id_pekerjaan = $a['jns_pekerjaan']; $juml = $a['jmlTransaksi']; $rp = $a['rpTransaksi']; if ($id_pekerjaan == "") $totkosong += $juml; else $totisi += $juml; print(""); } print("
Jenis PekerjaanJumlah TransaksiRupiah Transaksi
$id_pekerjaan$juml".number_format($rp, 0, ",", ".")."

"); print("
"); $stmt->close(); } $prosenkosong = $totkosong/($totkosong+$totisi)*100; $prosenisi = $totisi/($totkosong+$totisi)*100; print("Yang kosong = ". $totkosong." =>".number_format($prosenkosong, 2, ",", ".")."%"); print("
"); print("Yang isi = ". $totisi." =>".number_format($prosenisi, 2, ",", ".")."%"); $mysqli->close(); ?>
?>