Minggu, 19 Februari 2017

kasir nota cetak

kasir nota cetak ya..



<?php
include "cek_user.php";
include "atas.php";

if($akses=='3'||$akses=='1'){
?>
<SCRIPT LANGUAGE="JavaScript">
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=0,width=500,height=400,left = 340,top = 100');");
}
</script>
<?php
include "koneksi.php";
include "fungsi.php";

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

echo "Cetak Nota Belanja<br>";
echo '<table border=1 width=700>
             <tr>
            <td>No Nota</td>
            <td>Tanggal</td>
            <td>Jumlah Harga</td>
            <td>Nama Kasir</td>
            <td>Cetak</td>
        </tr>';


$hasil=mysql_query("SELECT DISTINCT nonota FROM penjualan order by nonota desc limit 15",$id_mysql);

while($baris=mysql_fetch_array($hasil)){
echo "<tr>
        <td>$baris[nonota]</td>
";
$angka = $baris[nonota];

$hasil1=mysql_query("SELECT * FROM penjualan WHERE nonota='$baris[nonota]'",$id_mysql);
$no=1;
$total1='0';
while($baris1=mysql_fetch_array($hasil1)){
    $tanggal=$baris1[tanggal];
    $kasir = $baris1[id_kasir];
if($no=='1')
    $total1 = $baris1[total];

else
    $total1 = $total1 + $baris1[total];
   

$no++;
}
echo "<td align=right>$tanggal</td><td align=right>$total1</td><td>";
echo nama_kasir($kasir);

echo "</td><td>";

?>

<a onClick="javascript:popUp('kasir_nota_penjualan.php?nonota=<?php echo "$angka"; ?>') " href=# title="Cetak Nota">Cetak Nota</a>       
       
<?php
}    echo "</td></tr></table>";
}
else
    echo "Anda tidak berhak mengakses file ini";

include "bawah.php";
?>

Tidak ada komentar:

Posting Komentar