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.
120 lines
6.1 KiB
PHP
120 lines
6.1 KiB
PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
|
<head>
|
|
<title>Cleopatra</title>
|
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
|
<link rel="stylesheet" type="text/css" href="css/css.css" />
|
|
<link rel="stylesheet" type="text/css" href="css/jqModal.css" />
|
|
<link rel="stylesheet" type="text/css" href="css/dialogcustom.css" />
|
|
<link rel="stylesheet" type="text/css" href="css/jquery-ui.css" />
|
|
<link rel="stylesheet" type="text/css" href="css/superfish.css" media="screen">
|
|
<script type="text/javascript" src="js/superfish.js"></script>
|
|
<script type="text/javascript" src="js/jquery.js"></script>
|
|
<script type="text/javascript" src="js/jquery-ui.min.js"></script>
|
|
<script type="text/javascript" src="js/jqModal.js"></script>
|
|
<script type="text/javascript" src="js/jquery.form.js"></script>
|
|
<script type="text/javascript" src="js/jquery.visibility.js"></script>
|
|
|
|
</head>
|
|
<body>
|
|
<div id="content">
|
|
<div class="headermenu">
|
|
<p id="top">Cleopatra Minimarket</p>
|
|
</div>
|
|
<div class="c_content">
|
|
<?php
|
|
include "./menu.php";
|
|
include "./func_lib.php";
|
|
?>
|
|
<fieldset>
|
|
<legend><strong>Report Pelanggan Tunai</strong></legend>
|
|
<?php
|
|
echo "<style type='text/css'>";
|
|
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 "</style>";
|
|
|
|
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, hp,sum(m.jumlah_total)-hp bathi, (sum(m.jumlah_total)-hp)/sum(m.jumlah_total)*100 profit
|
|
FROM pelanggan p, m_nota_tunai m,(select p.pekerjaan IDpekerjaan,sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp
|
|
from d_nota_tunai d,m_nota_tunai m, pelanggan p
|
|
where d.no_nota = m.no_nota
|
|
and p.kd_customer = m.kd_customer
|
|
and d.harga_pokok IS NOT NULL
|
|
and m.status_nota = 'S'
|
|
and date(m.tgl_nota) between '$startDate' and '$endDate'
|
|
group by p.pekerjaan
|
|
) tmpDetail
|
|
WHERE
|
|
p.pekerjaan = tmpDetail.IDpekerjaan
|
|
and 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
|
|
");
|
|
if($stmt->num_rows > 0) {
|
|
print("<center><div id=\"divprint\" >");
|
|
print("<table border=\"1\" class=\"tbl\">");
|
|
print("<tr class=\"header\"><td>Jenis Pekerjaan</td><td>Jumlah Transaksi</td><td>Rupiah Transaksi</td><td>Tot Hrg Pokok</td><td>Laba</td><td>Profit</td><tr/>");
|
|
|
|
while($a = $stmt->fetch_array(MYSQLI_ASSOC)) {
|
|
$id_pekerjaan = $a['jns_pekerjaan'];
|
|
$juml = $a['jmlTransaksi'];
|
|
$rp = $a['rpTransaksi'];
|
|
$hp = $a['hp'];
|
|
$cwan = $a['bathi'];
|
|
$profit = $a['profit'];
|
|
|
|
print("<tr><td>$id_pekerjaan</td><td align=\"right\">$juml</td><td align=\"right\">".number_format($rp, 0, ",", ".")."</td>
|
|
<td align=\"right\">".number_format($hp, 0, ",", ".")."</td>
|
|
<td align=\"right\">".number_format($cwan, 0, ",", ".")."</td>
|
|
<td align=\"right\">".number_format($profit, 2, ",", ".")."</td></tr>");
|
|
}
|
|
print("</table><br/>");
|
|
print("</table></div></center>");
|
|
|
|
$stmt->close();
|
|
}
|
|
$mysqli->close();
|
|
?>
|
|
</fieldset>
|
|
</div>
|
|
<div class="footer">
|
|
<?php include 'footer.php'; ?>
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|
|
|
|
?>
|