Cleopatra Minimarket

Poin Pelanggan "; 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 ""; $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("
"); print(""); while($rowdbh1=mysql_fetch_array($querydbh1)){ print ""; print ""; print ""; print ""; print ""; print ""; print ""; $total1 = $rowdbh1['total']; $poin1 = $rowdbh1['poin']; } print("
$rowdbh1[kd_customer]$rowdbh1[nama]$rowdbh1[alamat]".number_format($rowdbh1[total],0,',','.')."$rowdbh1[poin]

"); //amigo02 print(""); while($rowdbh2=mysql_fetch_array($querydbh2)){ print ""; print ""; print ""; print ""; print ""; print ""; print ""; $total2 = $rowdbh2['total']; $poin2 = $rowdbh2['poin']; } print("
$rowdbh2[kd_customer]$rowdbh2[nama]$rowdbh2[alamat]".number_format($rowdbh2[total],0,',','.')."$rowdbh2[poin]

"); //amigo03 print(""); while($rowdbh3=mysql_fetch_array($querydbh3)){ print ""; print ""; print ""; print ""; print ""; print ""; print ""; $total3 = $rowdbh3['total']; $poin3 = $rowdbh3['poin']; } print("
$rowdbh3[kd_customer]$rowdbh3[nama]$rowdbh3[alamat]".number_format($rowdbh3[total],0,',','.')."$rowdbh3[poin]

"); //amigo04 print(""); while($rowdbh4=mysql_fetch_array($querydbh4)){ print ""; print ""; print ""; print ""; print ""; print ""; print ""; $total4 = $rowdbh4['total']; $poin4 = $rowdbh4['poin']; } print("
$rowdbh4[kd_customer]$rowdbh4[nama]$rowdbh4[alamat]".number_format($rowdbh4[total],0,',','.')."$rowdbh4[poin]

"); //amigo05 print(""); while($rowdbh5=mysql_fetch_array($querydbh5)){ print ""; print ""; print ""; print ""; print ""; print ""; print ""; $total5 = $rowdbh5['total']; $poin5 = $rowdbh5['poin']; } print("
$rowdbh5[kd_customer]$rowdbh5[nama]$rowdbh5[alamat]".number_format($rowdbh5[total],0,',','.')."$rowdbh5[poin]

"); //amigo06 print(""); while($rowdbh6=mysql_fetch_array($querydbh6)){ print ""; print ""; print ""; print ""; print ""; print ""; print ""; $total6 = $rowdbh6['total']; $poin6 = $rowdbh6['poin']; } print("
$rowdbh6[kd_customer]$rowdbh6[nama]$rowdbh6[alamat]".number_format($rowdbh6[total],0,',','.')."$rowdbh6[poin]

"); //amigo07 print(""); while($rowdbh7=mysql_fetch_array($querydbh7)){ print ""; print ""; print ""; print ""; print ""; print ""; print ""; $total7 = $rowdbh7['total']; $poin7 = $rowdbh7['poin']; } print("
$rowdbh7[kd_customer]$rowdbh7[nama]$rowdbh7[alamat]".number_format($rowdbh7[total],0,',','.')."$rowdbh7[poin]

"); //amigo08 print(""); while($rowdbh8=mysql_fetch_array($querydbh8)){ print ""; print ""; print ""; print ""; print ""; print ""; print ""; $total8 = $rowdbh8['total']; $poin8 = $rowdbh8['poin']; } print("
$rowdbh8[kd_customer]$rowdbh8[nama]$rowdbh8[alamat]".number_format($rowdbh8[total],0,',','.')."$rowdbh8[poin]

"); //amigo09 print(""); while($rowdbh9=mysql_fetch_array($querydbh9)){ print ""; print ""; print ""; print ""; print ""; print ""; print ""; $total9 = $rowdbh9['total']; $poin9 = $rowdbh9['poin']; } print("
$rowdbh9[kd_customer]$rowdbh9[nama]$rowdbh9[alamat]".number_format($rowdbh9[total],0,',','.')."$rowdbh9[poin]

"); $total_blj = $total1+$total2+$total3+$total4+$total5+$total6+$total7+$total8+$total9; $total_poin = $poin1+$poin2+$poin3+$poin4+$poin5+$poin6+$poin7+$poin8+$poin9; print(""); print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print("
Total Belanja".number_format($total_blj,0,',','.')."
Total Poin".number_format($total_poin,0,',','.')."

"); print("
"); ?>
?>