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.

303 lines
15 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>Poin 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: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>";
$kdplg = $_POST['kodeplg'];
$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('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)){
$querydbh1 = mysql_query("SELECT p.kd_customer,p.alamat,p.nama,sum(jumlah_total) total, floor(sum(jumlah_total)/100000) poin
FROM pelanggan p, m_nota_tunai m
WHERE
m.status_nota = 'S'
and p.kd_customer = m.kd_customer
and m.kd_customer != ''
and (p.kd_customer = '$kdplg' OR p.alias = '$kdplg')
GROUP BY p.kd_customer", $dbh1);
$querydbh2 = mysql_query("SELECT p.kd_customer,p.alamat,p.nama,sum(jumlah_total) total, floor(sum(jumlah_total)/100000) poin
FROM pelanggan p, m_nota_tunai m
WHERE
m.status_nota = 'S'
and p.kd_customer = m.kd_customer
and m.kd_customer != ''
and (p.kd_customer = '$kdplg' OR p.alias = '$kdplg')
GROUP BY p.kd_customer", $dbh2);
$querydbh3 = mysql_query("SELECT p.kd_customer,p.alamat,p.nama,sum(jumlah_total) total, floor(sum(jumlah_total)/100000) poin
FROM pelanggan p, m_nota_tunai m
WHERE
m.status_nota = 'S'
and p.kd_customer = m.kd_customer
and m.kd_customer != ''
and (p.kd_customer = '$kdplg' OR p.alias = '$kdplg')
GROUP BY p.kd_customer", $dbh3);
$querydbh4 = mysql_query("SELECT p.kd_customer,p.alamat,p.nama,sum(jumlah_total) total, floor(sum(jumlah_total)/100000) poin
FROM pelanggan p, m_nota_tunai m
WHERE
m.status_nota = 'S'
and p.kd_customer = m.kd_customer
and m.kd_customer != ''
and (p.kd_customer = '$kdplg' OR p.alias = '$kdplg')
GROUP BY p.kd_customer", $dbh4);
$querydbh5 = mysql_query("SELECT p.kd_customer,p.alamat,p.nama,sum(jumlah_total) total, floor(sum(jumlah_total)/100000) poin
FROM pelanggan p, m_nota_tunai m
WHERE
m.status_nota = 'S'
and p.kd_customer = m.kd_customer
and m.kd_customer != ''
and (p.kd_customer = '$kdplg' OR p.alias = '$kdplg')
GROUP BY p.kd_customer", $dbh5);
$querydbh6 = mysql_query("SELECT p.kd_customer,p.alamat,p.nama,sum(jumlah_total) total, floor(sum(jumlah_total)/100000) poin
FROM pelanggan p, m_nota_tunai m
WHERE
m.status_nota = 'S'
and p.kd_customer = m.kd_customer
and m.kd_customer != ''
and (p.kd_customer = '$kdplg' OR p.alias = '$kdplg')
GROUP BY p.kd_customer", $dbh6);
$querydbh7 = mysql_query("SELECT p.kd_customer,p.alamat,p.nama,sum(jumlah_total) total, floor(sum(jumlah_total)/100000) poin
FROM pelanggan p, m_nota_tunai m
WHERE
m.status_nota = 'S'
and p.kd_customer = m.kd_customer
and m.kd_customer != ''
and (p.kd_customer = '$kdplg' OR p.alias = '$kdplg')
GROUP BY p.kd_customer", $dbh7);
$querydbh8 = mysql_query("SELECT p.kd_customer,p.alamat,p.nama,sum(jumlah_total) total, floor(sum(jumlah_total)/100000) poin
FROM pelanggan p, m_nota_tunai m
WHERE
m.status_nota = 'S'
and p.kd_customer = m.kd_customer
and m.kd_customer != ''
and (p.kd_customer = '$kdplg' OR p.alias = '$kdplg')
GROUP BY p.kd_customer", $dbh8);
$querydbh9 = mysql_query("SELECT p.kd_customer,p.alamat,p.nama,sum(jumlah_total) total, floor(sum(jumlah_total)/100000) poin
FROM pelanggan p, m_nota_tunai m
WHERE
m.status_nota = 'S'
and p.kd_customer = m.kd_customer
and m.kd_customer != ''
and (p.kd_customer = '$kdplg' OR p.alias = '$kdplg')
GROUP BY p.kd_customer", $dbh9);
}else{
echo "Masukkan kode pelanggan";
}
//amigo01
print("<center><div id=\"divprint\" >");
print("<table border=\"1\" class=\"tbl\">");
while($rowdbh1=mysql_fetch_array($querydbh1)){
print "<tr>";
print "<td width=\"100px\">$rowdbh1[kd_customer]</td>";
print "<td width=\"150px\">$rowdbh1[nama]</td>";
print "<td>$rowdbh1[alamat]</td>";
print "<td width=\"200px\">".number_format($rowdbh1[total],0,',','.')."</td>";
print "<td width=\"150px\">$rowdbh1[poin]</td>";
print "</tr>";
$total1 = $rowdbh1['total'];
$poin1 = $rowdbh1['poin'];
}
print("</table><br/>");
//amigo02
print("<table border=\"1\" class=\"tbl\">");
while($rowdbh2=mysql_fetch_array($querydbh2)){
print "<tr>";
print "<td width=\"100px\">$rowdbh2[kd_customer]</td>";
print "<td width=\"150px\">$rowdbh2[nama]</td>";
print "<td>$rowdbh2[alamat]</td>";
print "<td width=\"200px\">".number_format($rowdbh2[total],0,',','.')."</td>";
print "<td width=\"150px\">$rowdbh2[poin]</td>";
print "</tr>";
$total2 = $rowdbh2['total'];
$poin2 = $rowdbh2['poin'];
}
print("</table><br/>");
//amigo03
print("<table border=\"1\" class=\"tbl\">");
while($rowdbh3=mysql_fetch_array($querydbh3)){
print "<tr>";
print "<td width=\"100px\">$rowdbh3[kd_customer]</td>";
print "<td width=\"150px\">$rowdbh3[nama]</td>";
print "<td>$rowdbh3[alamat]</td>";
print "<td width=\"200px\">".number_format($rowdbh3[total],0,',','.')."</td>";
print "<td width=\"150px\">$rowdbh3[poin]</td>";
print "</tr>";
$total3 = $rowdbh3['total'];
$poin3 = $rowdbh3['poin'];
}
print("</table><br/>");
//amigo04
print("<table border=\"1\" class=\"tbl\">");
while($rowdbh4=mysql_fetch_array($querydbh4)){
print "<tr>";
print "<td width=\"100px\">$rowdbh4[kd_customer]</td>";
print "<td width=\"150px\">$rowdbh4[nama]</td>";
print "<td>$rowdbh4[alamat]</td>";
print "<td width=\"200px\">".number_format($rowdbh4[total],0,',','.')."</td>";
print "<td width=\"150px\">$rowdbh4[poin]</td>";
print "</tr>";
$total4 = $rowdbh4['total'];
$poin4 = $rowdbh4['poin'];
}
print("</table><br/>");
//amigo05
print("<table border=\"1\" class=\"tbl\">");
while($rowdbh5=mysql_fetch_array($querydbh5)){
print "<tr>";
print "<td width=\"100px\">$rowdbh5[kd_customer]</td>";
print "<td width=\"150px\">$rowdbh5[nama]</td>";
print "<td>$rowdbh5[alamat]</td>";
print "<td width=\"200px\">".number_format($rowdbh5[total],0,',','.')."</td>";
print "<td width=\"150px\">$rowdbh5[poin]</td>";
print "</tr>";
$total5 = $rowdbh5['total'];
$poin5 = $rowdbh5['poin'];
}
print("</table><br/>");
//amigo06
print("<table border=\"1\" class=\"tbl\">");
while($rowdbh6=mysql_fetch_array($querydbh6)){
print "<tr>";
print "<td width=\"100px\">$rowdbh6[kd_customer]</td>";
print "<td width=\"150px\">$rowdbh6[nama]</td>";
print "<td>$rowdbh6[alamat]</td>";
print "<td width=\"200px\">".number_format($rowdbh6[total],0,',','.')."</td>";
print "<td width=\"150px\">$rowdbh6[poin]</td>";
print "</tr>";
$total6 = $rowdbh6['total'];
$poin6 = $rowdbh6['poin'];
}
print("</table><br/>");
//amigo07
print("<table border=\"1\" class=\"tbl\">");
while($rowdbh7=mysql_fetch_array($querydbh7)){
print "<tr>";
print "<td width=\"100px\">$rowdbh7[kd_customer]</td>";
print "<td width=\"150px\">$rowdbh7[nama]</td>";
print "<td>$rowdbh7[alamat]</td>";
print "<td width=\"200px\">".number_format($rowdbh7[total],0,',','.')."</td>";
print "<td width=\"150px\">$rowdbh7[poin]</td>";
print "</tr>";
$total7 = $rowdbh7['total'];
$poin7 = $rowdbh7['poin'];
}
print("</table><br/>");
//amigo08
print("<table border=\"1\" class=\"tbl\">");
while($rowdbh8=mysql_fetch_array($querydbh8)){
print "<tr>";
print "<td width=\"100px\">$rowdbh8[kd_customer]</td>";
print "<td width=\"150px\">$rowdbh8[nama]</td>";
print "<td>$rowdbh8[alamat]</td>";
print "<td width=\"200px\">".number_format($rowdbh8[total],0,',','.')."</td>";
print "<td width=\"150px\">$rowdbh8[poin]</td>";
print "</tr>";
$total8 = $rowdbh8['total'];
$poin8 = $rowdbh8['poin'];
}
print("</table><br/>");
//amigo09
print("<table border=\"1\" class=\"tbl\">");
while($rowdbh9=mysql_fetch_array($querydbh9)){
print "<tr>";
print "<td width=\"100px\">$rowdbh9[kd_customer]</td>";
print "<td width=\"150px\">$rowdbh9[nama]</td>";
print "<td>$rowdbh9[alamat]</td>";
print "<td width=\"200px\">".number_format($rowdbh9[total],0,',','.')."</td>";
print "<td width=\"150px\">$rowdbh9[poin]</td>";
print "</tr>";
$total9 = $rowdbh9['total'];
$poin9 = $rowdbh9['poin'];
}
print("</table><br/>");
$total_blj = $total1+$total2+$total3+$total4+$total5+$total6+$total7+$total8+$total9;
$total_poin = $poin1+$poin2+$poin3+$poin4+$poin5+$poin6+$poin7+$poin8+$poin9;
print("<table border=\"1\">");
print "<tr>";
print "<td width=\"100px\">Total Belanja</td>";
print "<td width=\"200px\">".number_format($total_blj,0,',','.')."</td>";
print "</tr>";
print "<tr>";
print "<td width=\"100px\">Total Poin</td>";
print "<td width=\"200px\">".number_format($total_poin,0,',','.')."</td>";
print "</tr>";
print("</table><br/>");
print("</div></center>");
?>
</fieldset>
</div>
<div class="footer">
<?php include 'footer.php'; ?>
</div>
</div>
</body>
</html>
?>