Minggu, 19 Februari 2017

kasir nota penjualan

script kasir nota penjalan


<?php
include "cek_user.php";
include "fungsi.php";
$username = $_SESSION[username];
$password = $_SESSION[password];
$akses = $_SESSION[akses];

?>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function printPage() {
if (window.print) {
agree = confirm('Apakah Akan Mencetak Nota ini ?');
if (agree) window.print();
   }
}
//  End -->
</script>
<body OnLoad="printPage()">
<?php


if($akses=='3'||$akses=='1'){

include "koneksi.php";

$tgl=date('Y-m-d');

$nonota=$_GET[nonota];
echo "Nota Belanja<br>";
echo "No. Nota : $nonota |  Tanggal : $tgl | Kasir : ";
echo nama_user($username);
echo "<br>";
                          
$hasil=mysql_query("SELECT penjualan.id_buku, buku.judul, buku.harga_jual, penjualan.jumlah FROM penjualan,buku WHERE penjualan.id_buku=buku.id_buku and penjualan.nonota='$nonota'",$id_mysql);

//echo "angka=$angka<br>";

echo '<table border=1 width=400>
             <tr>
            <td>No</td>
            <td>Judul</td>
            <td>Harga</td>
            <td>Jumlah</td>
            <td>Total</td>
        </tr>';
        $no=1;
while($baris=mysql_fetch_row($hasil)){
echo "<tr>
        <td>$no</td>
        <td>$baris[1]</td>
        <td align=right>$baris[2]</td>
        <td align=center>$baris[3]
        </td><td align=right>";
$sub_total = $baris[2] * $baris[3];
echo "$sub_total";
echo "</td></tr>";   
if($no=='1')
    $total = $sub_total;
else
    $total = $total + $sub_total;

$no++;
}
echo "<tr>
        <td colspan=4  align=center>Jumlah</td>
        <td align=right>$total</td>";

        echo "</table>";
}
else
    echo "Anda tidak berhak mengakses file ini";
    ?>
    </body>

1 komentar:

  1. JT Gaming and casino resort in Bristol, United States - KT Hub
    JT Gaming and casino resort in Bristol, United States 광명 출장샵 JT 시흥 출장샵 Gaming and casino resort in Bristol, United States 당진 출장마사지 JTG Gaming and casino resort 용인 출장안마 in Bristol, United States. 강릉 출장안마

    BalasHapus