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.
278 lines
13 KiB
PHP
278 lines
13 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";
|
|
include "./db_login.inc.php";
|
|
?>
|
|
<fieldset>
|
|
<legend><strong>History Pelanggan</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: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: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>";
|
|
|
|
$startDate = decTgl($_POST['startDate']);
|
|
$endDate = decTgl($_POST['endDate']);
|
|
$kdplg = $_POST['kodeplg'];
|
|
|
|
$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(!empty($kdplg)){
|
|
$querydbhA1 = mysql_query("SELECT p.kd_customer,p.alias,p.ktp,p.nama,p.alamat,p.wilayah,DATE_FORMAT(p.tgl_lahir,'%d-%m-%Y') tanggal_lahir,(year(curdate())-year(tgl_lahir)) as umur,
|
|
case agama
|
|
when 1 then 'Islam'
|
|
when 2 then 'Katholik'
|
|
when 3 then 'Kristen'
|
|
when 4 then 'Budha'
|
|
when 5 then 'Hindu'
|
|
when 6 then 'Lainnya'
|
|
end as agama,
|
|
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,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline
|
|
FROM pelanggan p
|
|
WHERE p.kd_customer = '$kdplg' OR p.alias = '$kdplg'", $dbh);
|
|
|
|
//localhost
|
|
print("<center><div id=\"divprint\" >");
|
|
print("<table border=\"1\" class=\"tbl1\">");
|
|
while($rowdbhA1=mysql_fetch_array($querydbhA1)){
|
|
print "<tr>";
|
|
print "<td>Kd.Pelanggan</td><td><i>$rowdbhA1[kd_customer]</i></td>";
|
|
print "<td width='20px'></td>";
|
|
print "<td>Nama</td><td><i>$rowdbhA1[nama]</i></td>";
|
|
print "<td width='20px'></td>";
|
|
print "<td>Tgl Lahir,Usia</td><td width='100px'><i>$rowdbhA1[tanggal_lahir], $rowdbhA1[umur]th</i></td>";
|
|
print "<td width='20px'></td>";
|
|
print "<td>Nama Upline</td><td><i>$rowdbhA1[nama_upline]</i></td>";
|
|
print "</tr>";
|
|
|
|
print "<tr>";
|
|
print "<td>Kd.Kartu</td><td><i>$rowdbhA1[alias]</i></td>";
|
|
print "<td width='20px'></td>";
|
|
print "<td>Alamat</td><td><i>$rowdbhA1[alamat]</i></td>";
|
|
print "<td width='20px'></td>";
|
|
print "<td>Agama</td><td><i>$rowdbhA1[agama]</i></td>";
|
|
print "</tr>";
|
|
|
|
print "<tr>";
|
|
print "<td>No.KTP</td><td><i>$rowdbhA1[ktp]</i></td>";
|
|
print "<td width='20px'></td>";
|
|
print "<td></td><td><i>$rowdbhA1[wilayah]</i></td>";
|
|
print "<td width='20px'></td>";
|
|
print "<td>Pekerjaan</td><td><i>$rowdbhA1[jns_pekerjaan]</i></td>";
|
|
print "</tr>";
|
|
}
|
|
print("</table><br/>");
|
|
print "<hr>";
|
|
|
|
print "<fieldset>";
|
|
print "<legend><strong>Transaksi Tunai periode ".encTgl($startDate) ." s/d ".encTgl($endDate)."</strong></legend>";
|
|
|
|
$tmp_total1 = 0;
|
|
$tmp_poin1 = 0;
|
|
$tmp_total2 = 0;
|
|
$tmp_poin2 = 0;
|
|
$tmp_total = 0;
|
|
$tmp_poin = 0;
|
|
for ($n = 1; $n < 10; $n++){
|
|
$database = '$dbh'.$n;
|
|
|
|
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;
|
|
}
|
|
|
|
$querydbh[$n] = mysql_query("select m.no_nota,m.tgl_nota, m.kd_customer, m.jumlah_total, floor(jumlah_total/100000) poin
|
|
FROM m_nota_tunai m, pelanggan p
|
|
where m.status_bayar = 'T'
|
|
and m.status_nota = 'S'
|
|
and m.no_nota_retur = ''
|
|
and p.kd_customer = m.kd_customer
|
|
and m.kd_customer != ''
|
|
and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate'
|
|
and (p.kd_customer = '$kdplg' OR p.alias = '$kdplg')
|
|
order by m.tgl_nota", $data);
|
|
|
|
print("<table border=\"1\" class=\"tbl\">");
|
|
$query = $querydbh[$n];
|
|
while($row=mysql_fetch_array($query)){
|
|
print "<tr>";
|
|
print "<td width=\"100px\"><a href='rincian_jual.php?nota=".$row['no_nota']."'target='blank'>$row[no_nota]</td>";
|
|
print "<td width=\"150px\">$row[tgl_nota]</td>";
|
|
print "<td width=\"200px\">".number_format($row[jumlah_total],0,',','.')."</td>";
|
|
print "<td width=\"200px\">".number_format($row[poin],0,',','.')."</td>";
|
|
print "</tr>";
|
|
$tmp_total1 += $row[jumlah_total];
|
|
$tmp_poin1 += $row[poin];
|
|
}
|
|
print("</table><br/>");
|
|
|
|
}
|
|
|
|
print "</fieldset>";
|
|
print "<br />";
|
|
// print "<fieldset>";
|
|
// print "<legend><strong>Transaksi Tukar Tambah periode ".encTgl($startDate) ." s/d ".encTgl($endDate)."</strong></legend>";
|
|
//
|
|
// for ($n = 1; $n < 10; $n++){
|
|
// $dtbase = '$dbh'.$n;
|
|
//
|
|
// if($dtbase == '$dbh1'){
|
|
// $dta = $dbh1;
|
|
// }elseif($dtbase == '$dbh2'){
|
|
// $dta = $dbh2;
|
|
// }elseif($dtbase == '$dbh3'){
|
|
// $dta = $dbh3;
|
|
// }elseif($dtbase == '$dbh4'){
|
|
// $dta = $dbh4;
|
|
// }elseif($dtbase == '$dbh5'){
|
|
// $dta = $dbh5;
|
|
// }elseif($dtbase == '$dbh6'){
|
|
// $dta = $dbh6;
|
|
// }elseif($dtbase == '$dbh7'){
|
|
// $dta = $dbh7;
|
|
// }elseif($dtbase == '$dbh8'){
|
|
// $dta = $dbh8;
|
|
// }elseif($dtbase == '$dbh9'){
|
|
// $dta = $dbh9;
|
|
// }
|
|
//
|
|
// $querydbhB[$n] = mysql_query("SELECT m.no_nota,m.tgl_nota, m.kd_customer, m.jumlah_total,
|
|
// m.no_nota_retur, m.jumlah_total_retur,floor(m.jumlah_total_retur/100000) poin
|
|
// FROM m_nota_tunai m, pelanggan p
|
|
// WHERE m.status_bayar = 'T'
|
|
// and m.no_nota_retur != ''
|
|
// and m.status_nota = 'S'
|
|
// and m.kd_customer = p.kd_customer
|
|
// and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate'
|
|
// and (p.kd_customer = '$kdplg' OR p.alias = '$kdplg')
|
|
// ORDER BY m.tgl_nota", $dta);
|
|
// print("<table border=\"1\" class=\"tbl\">");
|
|
// $querydb = $querydbhB[$n];
|
|
// while($rowdb=mysql_fetch_array($querydb)){
|
|
// print "<tr>";
|
|
// print "<td width=\"100px\">$rowdb[no_nota]</td>";
|
|
// print "<td width=\"150px\">$rowdb[tgl_nota]</td>";
|
|
// print "<td width=\"150px\">$rowdb[no_nota_retur]</td>";
|
|
// print "<td width=\"200px\">".number_format($rowdb[jumlah_total_retur],0,',','.')."</td>";
|
|
// print "<td width=\"200px\">".number_format($rowdb[poin],0,',','.')."</td>";
|
|
// print "</tr>";
|
|
// $tmp_total2 += $rowdb[jumlah_total_retur];
|
|
// $tmp_poin2 += $rowdb[poin];
|
|
// }
|
|
// print("</table><br/>");
|
|
// }
|
|
// print "</fieldset>";
|
|
//
|
|
// $tmp_total = $tmp_total1 + $tmp_total2;
|
|
// $tmp_poin = $tmp_poin1 + $tmp_poin2;
|
|
|
|
print "<br /><fieldset>";
|
|
print "<legend><strong>TOTAL POIN</strong></legend>";
|
|
print("<table border=\"1\" class=\"tbl\">");
|
|
print "<tr><td>Rupiah Transaksi</td><td>".number_format($tmp_total1,0,',','.')."</td></tr>";
|
|
print "<tr><td>Total POIN</td><td>".number_format($tmp_poin1,0,',','.')."</td></tr>";
|
|
print("</table><br/>");
|
|
print "</fieldset>";
|
|
|
|
}else{
|
|
echo "Masukkan kode pelanggan";
|
|
}
|
|
|
|
?>
|
|
</fieldset>
|
|
</div>
|
|
<div class="footer">
|
|
<?php include 'footer.php'; ?>
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|