Пример #1
0
         $nilai = $nilai + $x['nilaiStok'] / $x['jmlStokIni'] * $x['jmlStokSemua'];
     }
     echo "</table> Nilai Stok : Rp " . number_format($nilai, 0, ',', '.');
     // bersihkan temporary table
     $hasil = mysql_query("DELETE FROM tmp_lap_aging");
     exit;
 case "po":
     // =======================================================================================================================
     echo "<h2>Purchase Order</h2>\n            <form method=POST action='?module=laporan&act=po&action=pesanbarang'>\n                Supplier :\n                <select name=supplierId>";
     $supplier = getSupplier();
     while ($dataSupplier = mysql_fetch_array($supplier)) {
         echo "<option value={$dataSupplier['idSupplier']}>{$dataSupplier['namaSupplier']}::{$dataSupplier['alamatSupplier']}</option>";
     }
     echo "</select>\n\t\t<br />\n\t\tTampilkan hanya barang dengan jumlah lebih kecil dari : <input type=text name=jumlahmin value=0 size=3>\n\t\t<br />\n            &nbsp;&nbsp;&nbsp;&nbsp;\n            <input type=submit value=Pilih>\n            </form>";
     if ($_GET[action] == 'pesanbarang') {
         $supplier = getDetailSupplier($_POST[supplierId]);
         $detailSupplier = mysql_fetch_array($supplier);
         echo "<h2>Pesan Barang di Supplier {$detailSupplier['namaSupplier']}</h2>\n            <br/>Alamat Supplier : {$detailSupplier['alamatSupplier']}<br/><br/>\n            <form method=POST action='modul/js_cetak_PO.php'   onSubmit=\"popupform(this, 'Purchase_Order')\">\n            <table width=500>\n                <tr><th>#</th><th>No</th><th>Barcode</th><th>Nama Barang</th><th>Stok<br />Saat Ini</th><th>Harga<br />Beli</th></tr>";
         $no = 0;
         $queryBarang = getDaftarBarangSupplier($_POST[supplierId], $_POST[jumlahmin]);
         while ($barangSupplier = mysql_fetch_array($queryBarang)) {
             if ($no % 2 == 0) {
                 $warna = "#EAF0F7";
             } else {
                 $warna = "#FFFFFF";
             }
             echo "<tr bgcolor={$warna}>";
             //end warna
             echo "<td class=td align=center><input type=checkbox name=cek[] value={$barangSupplier['barcode']} id=id{$no} checked=true></td>";
             $no++;
             echo "<td class=td>{$no}</td>\n                        <td class=td>{$barangSupplier['barcode']}</td>\n                        <td class=td>{$barangSupplier['namaBarang']}</td>\n                        <td class=td align=right><center>{$barangSupplier['jumBarang']}</center></td>\n                        <td class=td align=right>{$barangSupplier['hargaBeli']}</td>\n                        </tr>";
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License v2 (links provided above) for more details.
  ---------------------------------------------------------------- */
include "../../config/config.php";
include "function.php";
session_start();
if (empty($_SESSION[namauser]) and empty($_SESSION[passuser])) {
    echo "<link href='../../../config/adminstyle.css' rel='stylesheet' type='text/css'>\n <center>Untuk mengakses modul, Anda harus login <br>";
    echo "<a href=index.php><b>LOGIN</b></a></center>";
} else {
    if (isset($_POST['cetak'])) {
        echo "<link href='../../config/adminstyle.css' rel='stylesheet' type='text/css'>";
        echo "<h2>Note Retur Beli</h2>";
        $supplier = getDetailSupplier($_POST[idSupplier]);
        $detailSupplier = mysql_fetch_array($supplier);
        echo "Nama Supplier : {$detailSupplier['namaSupplier']}\n            <br/>Tanggal Retur : {$_POST['tglRetur']} \n\t    <br/>Nota  : {$_POST['idTransaksiBeli']}<br /><br />";
        echo "  <table>\n\t\t<tr><th>No</th><th>Id Barang</th><th>Barcode</th><th>Nama Barang</th>\n\t\t<th>Jumlah<br />Retur</th><th>Harga Beli</th></tr>";
        $sql = "SELECT d.idBarang, d.barcode, d.jumRetur, d.hargaBeli, d.nominal, d.username, b.namaBarang  \n\t\t\tFROM detail_retur_beli AS d, barang AS b \n\t\t\tWHERE idTransaksiBeli = {$_POST['idTransaksiBeli']} AND tglRetur = '{$_POST['tglRetur']}' AND d.barcode = b.barcode";
        $hasil = mysql_query($sql);
        $currentTotal = 0;
        $oldTotal = 0;
        $ctr = 1;
        $totalRecord = mysql_num_rows($hasil);
        while ($x = mysql_fetch_array($hasil)) {
            if ($ctr % 2 == 0) {
                $warna = "#EAF0F7";
            } else {
                $warna = "#FFFFFF";
            }