From 2ff639a1edb28c714d6d4d5dad2dde299d22298c Mon Sep 17 00:00:00 2001 From: Deardo Satria Date: Tue, 20 Oct 2026 11:40:48 +0700 Subject: [PATCH] Add legacy PHP source as reference --- .gitignore | 3 + CLAUDE.md | 118 + old-source/.sync.ffs_db | Bin 0 -> 2773 bytes old-source/LaporanBeli/ajaxsupplier.php | 134 + old-source/LaporanBeli/belidlmpdk.php | 83 + old-source/LaporanBeli/belikons.php | 82 + old-source/LaporanBeli/beliperfaktur.php | 114 + old-source/LaporanBeli/beliperkategori.php | 81 + old-source/LaporanBeli/belipersupplier.php | 158 + old-source/LaporanBeli/belirevisi.php | 81 + old-source/LaporanBeli/brgexp.php | 81 + old-source/LaporanBeli/cetakPembelian.php | 130 + old-source/LaporanBeli/hmenu.php~ | 133 + old-source/LaporanBeli/lap_rnc_and_order.php~ | 441 + .../LaporanBeli/lap_rnc_order_brgdtg.php~ | 642 ++ old-source/LaporanBeli/lapbelidlmpdk.php | 249 + old-source/LaporanBeli/lapbelidlmpdk.php~ | 310 + old-source/LaporanBeli/lapbelikons.php | 273 + old-source/LaporanBeli/lapbelikons.php~ | 309 + old-source/LaporanBeli/lapbeliperfak.php | 109 + old-source/LaporanBeli/lapbeliperfak.php~ | 70 + old-source/LaporanBeli/lapbeliperkat.php | 233 + old-source/LaporanBeli/lapbeliperkat.php~ | 306 + old-source/LaporanBeli/lapbelipersup.php | 297 + old-source/LaporanBeli/lapbelirevisi.php | 74 + old-source/LaporanBeli/lapexpdate.php | 71 + old-source/LaporanBeli/lapgrouppersup.php | 115 + old-source/LaporanBeli/lapobd.php~ | 356 + old-source/LaporanBeli/laprekapretbeli.php | 71 + old-source/LaporanBeli/laprekapretbeli.php~ | 72 + old-source/LaporanBeli/lapreturperasko.php~ | 92 + old-source/LaporanBeli/laprncordersupp.php~ | 95 + old-source/LaporanBeli/laprncpersupp.php~ | 312 + old-source/LaporanBeli/lapsuppjtempo.php | 91 + old-source/LaporanBeli/menu.php | 129 + old-source/LaporanBeli/orderblmdtg.php~ | 96 + old-source/LaporanBeli/rekapretbeli.php | 82 + old-source/LaporanBeli/rnc_and_order.php~ | 96 + old-source/LaporanBeli/rnc_order_brgdtg.php~ | 96 + old-source/LaporanBeli/rncordersupp.php~ | 95 + old-source/LaporanBeli/rncpersupp.php~ | 96 + old-source/LaporanJual/ajaxpelanggan.php | 173 + old-source/LaporanJual/ajaxsupplier.php | 134 + old-source/LaporanJual/ak7.php | 86 + old-source/LaporanJual/bawa.php | 125 + old-source/LaporanJual/detailjual.php | 80 + old-source/LaporanJual/fast_move.php | 112 + old-source/LaporanJual/jualdlmpdk.php | 81 + old-source/LaporanJual/jualperkategori.php | 80 + old-source/LaporanJual/jualpersupplier.php | 142 + old-source/LaporanJual/kartu.php | 81 + old-source/LaporanJual/kembalibawa.php | 74 + old-source/LaporanJual/komposisi.php | 81 + old-source/LaporanJual/konsinyasibawa.php | 295 + old-source/LaporanJual/lap_ak7.php | 758 ++ old-source/LaporanJual/lap_ak7rinci.php | 148 + old-source/LaporanJual/lap_fastmoving.php | 215 + old-source/LaporanJual/lapdetailjual.php | 437 + old-source/LaporanJual/lapdisp.php | 139 + old-source/LaporanJual/lapjualdlmpdk.php | 208 + .../LaporanJual/lapjualgrouppersupp.php | 251 + old-source/LaporanJual/lapjualperkat.php | 275 + old-source/LaporanJual/lapjualpersup.php | 726 ++ old-source/LaporanJual/lapkomposisi.php | 386 + old-source/LaporanJual/lappk8.php | 138 + old-source/LaporanJual/lapstok.php | 298 + old-source/LaporanJual/lapstokps1c.php | 222 + old-source/LaporanJual/lapstokps1c.php~ | 116 + old-source/LaporanJual/laptransbrg.php | 110 + old-source/LaporanJual/menu.php | 129 + old-source/LaporanJual/pk8.php | 81 + old-source/LaporanJual/prosesbawa.php | 130 + old-source/LaporanJual/rekapbawa.php | 88 + old-source/LaporanJual/rekapkartu.php | 233 + old-source/LaporanJual/rekapprosesbawa.php | 98 + old-source/LaporanJual/rekaptunai.php | 230 + old-source/LaporanJual/returkonsinyasi.php | 83 + old-source/LaporanJual/rincian_jual.php | 289 + old-source/LaporanJual/rincibeli.php | 73 + old-source/LaporanJual/rincijual.php | 139 + old-source/LaporanJual/rincirekapbawa.php | 69 + old-source/LaporanJual/rinciretur.php | 69 + old-source/LaporanJual/rincirevisi.php | 75 + old-source/LaporanJual/rincistockopname.php | 70 + old-source/LaporanJual/rincistokmin.php | 66 + old-source/LaporanJual/rincitrans.php | 161 + old-source/LaporanJual/rincitransfer.php | 67 + .../LaporanJual/rincitransferkembali.php | 67 + old-source/LaporanJual/send_lapdetailjual.php | 89 + old-source/LaporanJual/send_lapjualperkat.php | 95 + old-source/LaporanJual/stokps1c.php | 100 + old-source/LaporanJual/transbrg.php | 81 + old-source/LaporanJual/transbrg.php~ | 72 + old-source/LaporanJual/tunai.php | 117 + old-source/README.md | 0 old-source/ajaxbarang.php | 410 + old-source/ajaxbayar.php | 109 + old-source/ajaxdlmpdk.php | 181 + old-source/ajaxedittmpbeli.php | 62 + old-source/ajaxkaryawan.php | 248 + old-source/ajaxpelanggan.php | 266 + old-source/ajaxplafon.php | 127 + old-source/ajaxpurchase.php | 141 + old-source/ajaxrak.php | 167 + old-source/ajaxsatuanbrg.php | 168 + old-source/ajaxstrip.php | 250 + old-source/ajaxsuppbarang.php | 43 + old-source/ajaxsupplier.php | 288 + old-source/ajaxtmpbeli.php | 82 + old-source/barang.php | 226 + old-source/barang_ambilgroup.php | 29 + old-source/barang_ambilsatuan.php | 29 + old-source/barcoding/barcode.php | 49 + old-source/barcoding/barcode_cari_barang.php | 111 + old-source/barcoding/barcode_cari_barang.php~ | 97 + old-source/barcoding/barcode_form.php | 249 + old-source/barcoding/barcode_hasil (copy).php | 80 + old-source/barcoding/barcode_hasil.php | 138 + old-source/barcoding/barcode_hasil2.php | 130 + old-source/barcoding/barcode_kbarang.php | 50 + old-source/barcoding/barcode_nota.php | 51 + .../barcoding/class_barcode/BarCode.php | 128 + old-source/barcoding/class_barcode/FColor.php | 59 + .../barcoding/class_barcode/FDrawing.php | 98 + old-source/barcoding/class_barcode/bar128.php | 52 + .../class_barcode/code128.barcode.php | 306 + old-source/barcoding/class_barcode/index.php | 26 + old-source/barcoding/down.php | 19 + old-source/barcoding/hmenu.php~ | 128 + old-source/barcoding/lapdisp.php | 218 + old-source/barcoding/menu.php | 130 + old-source/bayar.php | 120 + old-source/bon/ajaxpelanggan.php | 266 + old-source/bon/ak4.php | 74 + old-source/bon/komisi.php | 94 + old-source/bon/kontrolbon.php | 64 + old-source/bon/lapak4.php | 125 + old-source/bon/lapbonperiode.php | 98 + old-source/bon/lapkomisi.php | 96 + old-source/bon/lapkontrolbon.php | 65 + old-source/bon/laprekapbon.php | 108 + old-source/bon/laprekappj.php | 297 + old-source/bon/lapreturbon.php | 103 + old-source/bon/laprincikomisi.php | 90 + old-source/bon/lapsaldobon.php | 142 + old-source/bon/laptitipan.php | 100 + old-source/bon/menu.php | 130 + old-source/bon/rekapbon.php | 112 + old-source/bon/rekappj.php | 112 + old-source/bon/returbon.php | 112 + old-source/bon/rincian_jual.php | 85 + old-source/bon/rincikomisi.php | 94 + old-source/bon/saldobon.php | 81 + old-source/bon/saldobonperiode.php | 88 + old-source/bon/titipan.php | 113 + old-source/convert_hp.php | 16 + old-source/css/css.css | 86 + old-source/css/dialogcustom.css | 71 + old-source/css/flora.datepicker.css | 216 + .../ui-bg_diagonals-thick_18_b81900_40x40.png | Bin 0 -> 260 bytes .../ui-bg_diagonals-thick_20_666666_40x40.png | Bin 0 -> 251 bytes .../ui-bg_diagonals-thick_75_f3d8d8_40x40.png | Bin 0 -> 256 bytes .../images/ui-bg_dots-small_65_a6a6a6_2x2.png | Bin 0 -> 83 bytes .../css/images/ui-bg_flat_0_333333_40x100.png | Bin 0 -> 180 bytes .../images/ui-bg_flat_100_eeeeee_40x100.png | Bin 0 -> 180 bytes .../images/ui-bg_flat_10_000000_40x100.png | Bin 0 -> 178 bytes .../images/ui-bg_flat_15_cc0000_40x100.png | Bin 0 -> 180 bytes .../images/ui-bg_flat_65_ffffff_40x100.png | Bin 0 -> 178 bytes .../images/ui-bg_flat_75_ffffff_40x100.png | Bin 0 -> 178 bytes .../images/ui-bg_glass_100_f6f6f6_1x400.png | Bin 0 -> 104 bytes .../images/ui-bg_glass_100_fdf5ce_1x400.png | Bin 0 -> 125 bytes .../images/ui-bg_glass_55_fbf8ee_1x400.png | Bin 0 -> 143 bytes .../images/ui-bg_glass_65_ffffff_1x400.png | Bin 0 -> 105 bytes .../ui-bg_gloss-wave_35_f6a828_500x100.png | Bin 0 -> 4427 bytes .../ui-bg_highlight-hard_100_f6f6f6_1x100.png | Bin 0 -> 89 bytes .../ui-bg_highlight-soft_100_eeeeee_1x100.png | Bin 0 -> 90 bytes .../ui-bg_highlight-soft_75_ffe45c_1x100.png | Bin 0 -> 129 bytes .../css/images/ui-icons_004276_256x240.png | Bin 0 -> 4369 bytes .../css/images/ui-icons_222222_256x240.png | Bin 0 -> 4369 bytes .../css/images/ui-icons_228ef1_256x240.png | Bin 0 -> 4369 bytes .../css/images/ui-icons_cc0000_256x240.png | Bin 0 -> 4369 bytes .../css/images/ui-icons_ef8c08_256x240.png | Bin 0 -> 4369 bytes .../css/images/ui-icons_ffd27a_256x240.png | Bin 0 -> 5355 bytes .../css/images/ui-icons_ffffff_256x240.png | Bin 0 -> 4369 bytes old-source/css/jqModal.css | 37 + old-source/css/jquery-ui.css | 406 + old-source/css/jquery.autocomplete.css | 48 + old-source/css/style.css | 324 + old-source/css/superfish.css | 136 + old-source/css/ui.all.css | 3 + old-source/daftarpelanggan.php | 60 + old-source/dlmpdk.php | 99 + old-source/footer.php | 4 + old-source/func_lib.php | 1136 +++ old-source/getTempo.php | 30 + old-source/images/calendar.gif | Bin 0 -> 269 bytes old-source/images/close.gif | Bin 0 -> 807 bytes old-source/images/delete.png | Bin 0 -> 675 bytes old-source/images/edit.png | Bin 0 -> 544 bytes old-source/images/load.gif | Bin 0 -> 2608 bytes old-source/images/logo.JPG | Bin 0 -> 24536 bytes old-source/images/logocleo.jpg | Bin 0 -> 24536 bytes old-source/index.php | 46 + old-source/js/barang.js | 482 + old-source/js/barcoding.js | 224 + old-source/js/dlmpdk.js | 106 + old-source/js/jqModal.js | 69 + old-source/js/jqSajax.class.php | 313 + old-source/js/jquery-1.2.6.js | 3549 +++++++ old-source/js/jquery-ui.min.js | 298 + old-source/js/jquery.autocomplete.js | 808 ++ old-source/js/jquery.autocomplete.min.js | 13 + old-source/js/jquery.autocomplete.pack.js | 12 + old-source/js/jquery.form.js | 643 ++ old-source/js/jquery.hotkeys.js | 244 + old-source/js/jquery.js | 4376 ++++++++ old-source/js/jquery.ui.all.js | 8894 +++++++++++++++++ old-source/js/jquery.visibility.js | 17 + old-source/js/json2.js | 481 + old-source/js/karyawan.js | 108 + old-source/js/merk.js | 51 + old-source/js/pelanggan.js | 295 + old-source/js/pelanggan.js~ | 214 + old-source/js/plafon.js | 96 + old-source/js/rak.js | 105 + old-source/js/returnew.js | 785 ++ old-source/js/revisi_faktur.js | 526 + old-source/js/rpembelian.js | 706 ++ old-source/js/satuanbrg.js | 105 + old-source/js/shortcut.js | 223 + old-source/js/strip.js | 125 + old-source/js/superfish.js | 121 + old-source/js/suppbarang.js | 25 + old-source/js/supplier.js | 211 + old-source/js/supplier.js~ | 110 + old-source/js/transferbarang.js | 803 ++ old-source/js/transferbarangkembali.js | 510 + old-source/js/ubah_hp.js | 507 + old-source/js/ui.datepicker.js | 1533 +++ old-source/karyawan.php | 142 + old-source/lap_cekpelanggangroup.php | 202 + old-source/lap_cekpoinplg.php | 303 + old-source/lap_historyplg.php | 277 + old-source/lap_profitperjnspekerjaan.php | 120 + old-source/lap_profitperplg.php | 115 + old-source/lap_transaksiperjnspekerjaan.php | 115 + old-source/lapbayar.php | 358 + old-source/lapbayarpersup.php | 82 + old-source/lapbayarpersupp.php | 154 + old-source/laprincbayarpersupp.php | 117 + old-source/login.php | 37 + old-source/logout.php | 20 + old-source/menu.php | 133 + old-source/pelanggan.php | 270 + old-source/plgjobkosong.php | 78 + old-source/plgperjnspekerjaan.php | 94 + old-source/poinplg.php | 58 + old-source/proses_lini.php | 24 + old-source/proses_negara.php | 18 + old-source/proses_supp.php | 21 + old-source/purchase.php | 259 + old-source/rak.php | 92 + old-source/report_profitperjnspekerjaan.php | 70 + old-source/report_profitperplg.php | 70 + .../report_transaksiperjnspekerjaan.php | 70 + old-source/retur_beli (copy)/ambil_barang.php | 51 + .../ambil_barang_kembali.php | 49 + .../retur_beli (copy)/ambil_kode_barang.php | 53 + old-source/retur_beli (copy)/ambil_nomor.php | 36 + old-source/retur_beli (copy)/cari_nota.php | 94 + old-source/retur_beli (copy)/fungsi_retur.php | 567 ++ old-source/retur_beli (copy)/hmenu.php~ | 128 + old-source/retur_beli (copy)/menu.php | 138 + .../retur_beli (copy)/retur_ambil_alasan.php | 28 + .../retur_beli (copy)/retur_ambil_barang.php | 45 + .../retur_ambil_keterangan.php | 33 + .../retur_beli (copy)/retur_cari_nota.php | 60 + old-source/retur_beli (copy)/retur_fbaru.php | 233 + old-source/retur_beli (copy)/retur_fedit.php | 241 + old-source/retur_beli (copy)/retur_fprint.php | 214 + old-source/retur_beli (copy)/retur_hapus.php | 30 + old-source/retur_beli (copy)/retur_print.php | 163 + old-source/retur_beli (copy)/retur_simpan.php | 97 + old-source/retur_beli (copy)/retur_update.php | 124 + .../retur_beli (copy)/retur_validasi.php | 66 + old-source/retur_beli/ambil_barang.php | 51 + .../retur_beli/ambil_barang_kembali.php | 49 + old-source/retur_beli/ambil_kode_barang.php | 53 + old-source/retur_beli/ambil_nomor.php | 36 + old-source/retur_beli/cari_nota.php | 94 + old-source/retur_beli/fungsi_retur.php | 567 ++ old-source/retur_beli/hmenu.php~ | 128 + old-source/retur_beli/menu.php | 130 + old-source/retur_beli/retur_ambil_alasan.php | 28 + old-source/retur_beli/retur_ambil_barang.php | 45 + .../retur_beli/retur_ambil_keterangan.php | 33 + old-source/retur_beli/retur_beli_fbaru.php | 233 + old-source/retur_beli/retur_beli_fedit.php | 241 + old-source/retur_beli/retur_beli_fprint.php | 214 + old-source/retur_beli/retur_cari_nota.php | 60 + old-source/retur_beli/retur_hapus.php | 30 + old-source/retur_beli/retur_print.php | 163 + old-source/retur_beli/retur_simpan.php | 97 + old-source/retur_beli/retur_update.php | 124 + old-source/retur_beli/retur_validasi.php | 66 + old-source/rincian_jual.php | 351 + old-source/rincitrans.php | 160 + old-source/satuanbrg.php | 92 + old-source/strip.php | 180 + old-source/supp_barang.php | 60 + old-source/supplier.php | 183 + old-source/tmplapbyrpersup.php | 82 + old-source/transfer_barang/ambil_barang.php | 51 + .../transfer_barang/ambil_barang_kembali.php | 49 + .../transfer_barang/ambil_kode_barang.php | 53 + old-source/transfer_barang/ambil_nomor.php | 36 + .../transfer_barang/ambil_nomor_kembali.php | 35 + old-source/transfer_barang/cari_nota.php | 94 + .../transfer_barang/fungsi_transfer.php | 567 ++ old-source/transfer_barang/hmenu.php~ | 128 + old-source/transfer_barang/menu.php | 130 + .../transfer_barang/transfer_ambil_barang.php | 45 + .../transfer_barang/transfer_cari_nota.php | 61 + old-source/transfer_barang/transfer_fbaru.php | 215 + old-source/transfer_barang/transfer_fedit.php | 230 + .../transfer_barang/transfer_fprint.php | 195 + old-source/transfer_barang/transfer_hapus.php | 31 + .../transfer_barang/transfer_kembali.php | 224 + old-source/transfer_barang/transfer_print.php | 165 + .../transfer_barang/transfer_simpan.php | 91 + .../transfer_simpan_kembali.php | 94 + .../transfer_barang/transfer_update.php | 132 + .../transfer_barang/transfer_validasi.php | 69 + .../transfer_validasi_kembali.php | 66 + old-source/ubah_hp/ajaxsupplier.php | 134 + old-source/ubah_hp/fungsi_ubah_hp.php | 619 ++ old-source/ubah_hp/fungsi_ubah_hp.php~ | 563 ++ old-source/ubah_hp/hmenu.php~ | 128 + old-source/ubah_hp/menu.php | 129 + old-source/ubah_hp/revisifaktur_fbaru.php | 185 + old-source/ubah_hp/revisifaktur_simpan.php | 119 + old-source/ubah_hp/ubahhp.php | 248 + old-source/umum/ambil_barang.php | 44 + old-source/umum/ambil_kode_barang.php | 51 + old-source/umum/ambil_nomor.php | 34 + old-source/umum/ambil_nota.php | 84 + old-source/umum/cari_nota.php | 94 + old-source/umum/cari_nota.php~ | 93 + old-source/update tabel d_retur_beli.txt | 1 + old-source/viewtmpbeli.php | 93 + 350 files changed, 68017 insertions(+) create mode 100644 CLAUDE.md create mode 100644 old-source/.sync.ffs_db create mode 100644 old-source/LaporanBeli/ajaxsupplier.php create mode 100644 old-source/LaporanBeli/belidlmpdk.php create mode 100644 old-source/LaporanBeli/belikons.php create mode 100644 old-source/LaporanBeli/beliperfaktur.php create mode 100644 old-source/LaporanBeli/beliperkategori.php create mode 100644 old-source/LaporanBeli/belipersupplier.php create mode 100644 old-source/LaporanBeli/belirevisi.php create mode 100644 old-source/LaporanBeli/brgexp.php create mode 100644 old-source/LaporanBeli/cetakPembelian.php create mode 100644 old-source/LaporanBeli/hmenu.php~ create mode 100644 old-source/LaporanBeli/lap_rnc_and_order.php~ create mode 100644 old-source/LaporanBeli/lap_rnc_order_brgdtg.php~ create mode 100644 old-source/LaporanBeli/lapbelidlmpdk.php create mode 100644 old-source/LaporanBeli/lapbelidlmpdk.php~ create mode 100644 old-source/LaporanBeli/lapbelikons.php create mode 100644 old-source/LaporanBeli/lapbelikons.php~ create mode 100644 old-source/LaporanBeli/lapbeliperfak.php create mode 100644 old-source/LaporanBeli/lapbeliperfak.php~ create mode 100644 old-source/LaporanBeli/lapbeliperkat.php create mode 100644 old-source/LaporanBeli/lapbeliperkat.php~ create mode 100644 old-source/LaporanBeli/lapbelipersup.php create mode 100644 old-source/LaporanBeli/lapbelirevisi.php create mode 100644 old-source/LaporanBeli/lapexpdate.php create mode 100644 old-source/LaporanBeli/lapgrouppersup.php create mode 100644 old-source/LaporanBeli/lapobd.php~ create mode 100644 old-source/LaporanBeli/laprekapretbeli.php create mode 100644 old-source/LaporanBeli/laprekapretbeli.php~ create mode 100644 old-source/LaporanBeli/lapreturperasko.php~ create mode 100644 old-source/LaporanBeli/laprncordersupp.php~ create mode 100644 old-source/LaporanBeli/laprncpersupp.php~ create mode 100644 old-source/LaporanBeli/lapsuppjtempo.php create mode 100644 old-source/LaporanBeli/menu.php create mode 100644 old-source/LaporanBeli/orderblmdtg.php~ create mode 100644 old-source/LaporanBeli/rekapretbeli.php create mode 100644 old-source/LaporanBeli/rnc_and_order.php~ create mode 100644 old-source/LaporanBeli/rnc_order_brgdtg.php~ create mode 100644 old-source/LaporanBeli/rncordersupp.php~ create mode 100644 old-source/LaporanBeli/rncpersupp.php~ create mode 100644 old-source/LaporanJual/ajaxpelanggan.php create mode 100644 old-source/LaporanJual/ajaxsupplier.php create mode 100644 old-source/LaporanJual/ak7.php create mode 100644 old-source/LaporanJual/bawa.php create mode 100644 old-source/LaporanJual/detailjual.php create mode 100644 old-source/LaporanJual/fast_move.php create mode 100644 old-source/LaporanJual/jualdlmpdk.php create mode 100644 old-source/LaporanJual/jualperkategori.php create mode 100644 old-source/LaporanJual/jualpersupplier.php create mode 100644 old-source/LaporanJual/kartu.php create mode 100644 old-source/LaporanJual/kembalibawa.php create mode 100644 old-source/LaporanJual/komposisi.php create mode 100644 old-source/LaporanJual/konsinyasibawa.php create mode 100644 old-source/LaporanJual/lap_ak7.php create mode 100644 old-source/LaporanJual/lap_ak7rinci.php create mode 100644 old-source/LaporanJual/lap_fastmoving.php create mode 100644 old-source/LaporanJual/lapdetailjual.php create mode 100644 old-source/LaporanJual/lapdisp.php create mode 100644 old-source/LaporanJual/lapjualdlmpdk.php create mode 100644 old-source/LaporanJual/lapjualgrouppersupp.php create mode 100644 old-source/LaporanJual/lapjualperkat.php create mode 100644 old-source/LaporanJual/lapjualpersup.php create mode 100644 old-source/LaporanJual/lapkomposisi.php create mode 100644 old-source/LaporanJual/lappk8.php create mode 100644 old-source/LaporanJual/lapstok.php create mode 100644 old-source/LaporanJual/lapstokps1c.php create mode 100644 old-source/LaporanJual/lapstokps1c.php~ create mode 100644 old-source/LaporanJual/laptransbrg.php create mode 100644 old-source/LaporanJual/menu.php create mode 100644 old-source/LaporanJual/pk8.php create mode 100644 old-source/LaporanJual/prosesbawa.php create mode 100644 old-source/LaporanJual/rekapbawa.php create mode 100644 old-source/LaporanJual/rekapkartu.php create mode 100644 old-source/LaporanJual/rekapprosesbawa.php create mode 100644 old-source/LaporanJual/rekaptunai.php create mode 100644 old-source/LaporanJual/returkonsinyasi.php create mode 100644 old-source/LaporanJual/rincian_jual.php create mode 100644 old-source/LaporanJual/rincibeli.php create mode 100644 old-source/LaporanJual/rincijual.php create mode 100644 old-source/LaporanJual/rincirekapbawa.php create mode 100644 old-source/LaporanJual/rinciretur.php create mode 100644 old-source/LaporanJual/rincirevisi.php create mode 100644 old-source/LaporanJual/rincistockopname.php create mode 100644 old-source/LaporanJual/rincistokmin.php create mode 100644 old-source/LaporanJual/rincitrans.php create mode 100644 old-source/LaporanJual/rincitransfer.php create mode 100644 old-source/LaporanJual/rincitransferkembali.php create mode 100644 old-source/LaporanJual/send_lapdetailjual.php create mode 100644 old-source/LaporanJual/send_lapjualperkat.php create mode 100644 old-source/LaporanJual/stokps1c.php create mode 100644 old-source/LaporanJual/transbrg.php create mode 100644 old-source/LaporanJual/transbrg.php~ create mode 100644 old-source/LaporanJual/tunai.php create mode 100644 old-source/README.md create mode 100644 old-source/ajaxbarang.php create mode 100644 old-source/ajaxbayar.php create mode 100644 old-source/ajaxdlmpdk.php create mode 100644 old-source/ajaxedittmpbeli.php create mode 100644 old-source/ajaxkaryawan.php create mode 100644 old-source/ajaxpelanggan.php create mode 100644 old-source/ajaxplafon.php create mode 100644 old-source/ajaxpurchase.php create mode 100644 old-source/ajaxrak.php create mode 100644 old-source/ajaxsatuanbrg.php create mode 100644 old-source/ajaxstrip.php create mode 100644 old-source/ajaxsuppbarang.php create mode 100644 old-source/ajaxsupplier.php create mode 100644 old-source/ajaxtmpbeli.php create mode 100644 old-source/barang.php create mode 100644 old-source/barang_ambilgroup.php create mode 100644 old-source/barang_ambilsatuan.php create mode 100644 old-source/barcoding/barcode.php create mode 100644 old-source/barcoding/barcode_cari_barang.php create mode 100644 old-source/barcoding/barcode_cari_barang.php~ create mode 100644 old-source/barcoding/barcode_form.php create mode 100644 old-source/barcoding/barcode_hasil (copy).php create mode 100644 old-source/barcoding/barcode_hasil.php create mode 100644 old-source/barcoding/barcode_hasil2.php create mode 100644 old-source/barcoding/barcode_kbarang.php create mode 100644 old-source/barcoding/barcode_nota.php create mode 100644 old-source/barcoding/class_barcode/BarCode.php create mode 100644 old-source/barcoding/class_barcode/FColor.php create mode 100644 old-source/barcoding/class_barcode/FDrawing.php create mode 100644 old-source/barcoding/class_barcode/bar128.php create mode 100644 old-source/barcoding/class_barcode/code128.barcode.php create mode 100644 old-source/barcoding/class_barcode/index.php create mode 100644 old-source/barcoding/down.php create mode 100644 old-source/barcoding/hmenu.php~ create mode 100644 old-source/barcoding/lapdisp.php create mode 100644 old-source/barcoding/menu.php create mode 100644 old-source/bayar.php create mode 100644 old-source/bon/ajaxpelanggan.php create mode 100644 old-source/bon/ak4.php create mode 100644 old-source/bon/komisi.php create mode 100644 old-source/bon/kontrolbon.php create mode 100644 old-source/bon/lapak4.php create mode 100644 old-source/bon/lapbonperiode.php create mode 100644 old-source/bon/lapkomisi.php create mode 100644 old-source/bon/lapkontrolbon.php create mode 100644 old-source/bon/laprekapbon.php create mode 100644 old-source/bon/laprekappj.php create mode 100644 old-source/bon/lapreturbon.php create mode 100644 old-source/bon/laprincikomisi.php create mode 100644 old-source/bon/lapsaldobon.php create mode 100644 old-source/bon/laptitipan.php create mode 100644 old-source/bon/menu.php create mode 100644 old-source/bon/rekapbon.php create mode 100644 old-source/bon/rekappj.php create mode 100644 old-source/bon/returbon.php create mode 100644 old-source/bon/rincian_jual.php create mode 100644 old-source/bon/rincikomisi.php create mode 100644 old-source/bon/saldobon.php create mode 100644 old-source/bon/saldobonperiode.php create mode 100644 old-source/bon/titipan.php create mode 100644 old-source/convert_hp.php create mode 100644 old-source/css/css.css create mode 100644 old-source/css/dialogcustom.css create mode 100644 old-source/css/flora.datepicker.css create mode 100644 old-source/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png create mode 100644 old-source/css/images/ui-bg_diagonals-thick_20_666666_40x40.png create mode 100644 old-source/css/images/ui-bg_diagonals-thick_75_f3d8d8_40x40.png create mode 100644 old-source/css/images/ui-bg_dots-small_65_a6a6a6_2x2.png create mode 100644 old-source/css/images/ui-bg_flat_0_333333_40x100.png create mode 100644 old-source/css/images/ui-bg_flat_100_eeeeee_40x100.png create mode 100644 old-source/css/images/ui-bg_flat_10_000000_40x100.png create mode 100644 old-source/css/images/ui-bg_flat_15_cc0000_40x100.png create mode 100644 old-source/css/images/ui-bg_flat_65_ffffff_40x100.png create mode 100644 old-source/css/images/ui-bg_flat_75_ffffff_40x100.png create mode 100644 old-source/css/images/ui-bg_glass_100_f6f6f6_1x400.png create mode 100644 old-source/css/images/ui-bg_glass_100_fdf5ce_1x400.png create mode 100644 old-source/css/images/ui-bg_glass_55_fbf8ee_1x400.png create mode 100644 old-source/css/images/ui-bg_glass_65_ffffff_1x400.png create mode 100644 old-source/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png create mode 100644 old-source/css/images/ui-bg_highlight-hard_100_f6f6f6_1x100.png create mode 100644 old-source/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png create mode 100644 old-source/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png create mode 100644 old-source/css/images/ui-icons_004276_256x240.png create mode 100644 old-source/css/images/ui-icons_222222_256x240.png create mode 100644 old-source/css/images/ui-icons_228ef1_256x240.png create mode 100644 old-source/css/images/ui-icons_cc0000_256x240.png create mode 100644 old-source/css/images/ui-icons_ef8c08_256x240.png create mode 100644 old-source/css/images/ui-icons_ffd27a_256x240.png create mode 100644 old-source/css/images/ui-icons_ffffff_256x240.png create mode 100644 old-source/css/jqModal.css create mode 100644 old-source/css/jquery-ui.css create mode 100644 old-source/css/jquery.autocomplete.css create mode 100644 old-source/css/style.css create mode 100644 old-source/css/superfish.css create mode 100644 old-source/css/ui.all.css create mode 100644 old-source/daftarpelanggan.php create mode 100644 old-source/dlmpdk.php create mode 100644 old-source/footer.php create mode 100644 old-source/func_lib.php create mode 100644 old-source/getTempo.php create mode 100644 old-source/images/calendar.gif create mode 100644 old-source/images/close.gif create mode 100644 old-source/images/delete.png create mode 100644 old-source/images/edit.png create mode 100644 old-source/images/load.gif create mode 100644 old-source/images/logo.JPG create mode 100644 old-source/images/logocleo.jpg create mode 100644 old-source/index.php create mode 100644 old-source/js/barang.js create mode 100644 old-source/js/barcoding.js create mode 100644 old-source/js/dlmpdk.js create mode 100644 old-source/js/jqModal.js create mode 100644 old-source/js/jqSajax.class.php create mode 100644 old-source/js/jquery-1.2.6.js create mode 100644 old-source/js/jquery-ui.min.js create mode 100644 old-source/js/jquery.autocomplete.js create mode 100644 old-source/js/jquery.autocomplete.min.js create mode 100644 old-source/js/jquery.autocomplete.pack.js create mode 100644 old-source/js/jquery.form.js create mode 100644 old-source/js/jquery.hotkeys.js create mode 100644 old-source/js/jquery.js create mode 100644 old-source/js/jquery.ui.all.js create mode 100644 old-source/js/jquery.visibility.js create mode 100644 old-source/js/json2.js create mode 100644 old-source/js/karyawan.js create mode 100644 old-source/js/merk.js create mode 100644 old-source/js/pelanggan.js create mode 100644 old-source/js/pelanggan.js~ create mode 100644 old-source/js/plafon.js create mode 100644 old-source/js/rak.js create mode 100644 old-source/js/returnew.js create mode 100644 old-source/js/revisi_faktur.js create mode 100644 old-source/js/rpembelian.js create mode 100644 old-source/js/satuanbrg.js create mode 100644 old-source/js/shortcut.js create mode 100644 old-source/js/strip.js create mode 100644 old-source/js/superfish.js create mode 100644 old-source/js/suppbarang.js create mode 100644 old-source/js/supplier.js create mode 100644 old-source/js/supplier.js~ create mode 100644 old-source/js/transferbarang.js create mode 100644 old-source/js/transferbarangkembali.js create mode 100644 old-source/js/ubah_hp.js create mode 100644 old-source/js/ui.datepicker.js create mode 100644 old-source/karyawan.php create mode 100644 old-source/lap_cekpelanggangroup.php create mode 100644 old-source/lap_cekpoinplg.php create mode 100644 old-source/lap_historyplg.php create mode 100644 old-source/lap_profitperjnspekerjaan.php create mode 100644 old-source/lap_profitperplg.php create mode 100644 old-source/lap_transaksiperjnspekerjaan.php create mode 100644 old-source/lapbayar.php create mode 100644 old-source/lapbayarpersup.php create mode 100644 old-source/lapbayarpersupp.php create mode 100644 old-source/laprincbayarpersupp.php create mode 100644 old-source/login.php create mode 100644 old-source/logout.php create mode 100644 old-source/menu.php create mode 100644 old-source/pelanggan.php create mode 100644 old-source/plgjobkosong.php create mode 100644 old-source/plgperjnspekerjaan.php create mode 100644 old-source/poinplg.php create mode 100644 old-source/proses_lini.php create mode 100644 old-source/proses_negara.php create mode 100644 old-source/proses_supp.php create mode 100644 old-source/purchase.php create mode 100644 old-source/rak.php create mode 100644 old-source/report_profitperjnspekerjaan.php create mode 100644 old-source/report_profitperplg.php create mode 100644 old-source/report_transaksiperjnspekerjaan.php create mode 100644 old-source/retur_beli (copy)/ambil_barang.php create mode 100644 old-source/retur_beli (copy)/ambil_barang_kembali.php create mode 100644 old-source/retur_beli (copy)/ambil_kode_barang.php create mode 100644 old-source/retur_beli (copy)/ambil_nomor.php create mode 100644 old-source/retur_beli (copy)/cari_nota.php create mode 100644 old-source/retur_beli (copy)/fungsi_retur.php create mode 100644 old-source/retur_beli (copy)/hmenu.php~ create mode 100644 old-source/retur_beli (copy)/menu.php create mode 100644 old-source/retur_beli (copy)/retur_ambil_alasan.php create mode 100644 old-source/retur_beli (copy)/retur_ambil_barang.php create mode 100644 old-source/retur_beli (copy)/retur_ambil_keterangan.php create mode 100644 old-source/retur_beli (copy)/retur_cari_nota.php create mode 100644 old-source/retur_beli (copy)/retur_fbaru.php create mode 100644 old-source/retur_beli (copy)/retur_fedit.php create mode 100644 old-source/retur_beli (copy)/retur_fprint.php create mode 100644 old-source/retur_beli (copy)/retur_hapus.php create mode 100644 old-source/retur_beli (copy)/retur_print.php create mode 100644 old-source/retur_beli (copy)/retur_simpan.php create mode 100644 old-source/retur_beli (copy)/retur_update.php create mode 100644 old-source/retur_beli (copy)/retur_validasi.php create mode 100644 old-source/retur_beli/ambil_barang.php create mode 100644 old-source/retur_beli/ambil_barang_kembali.php create mode 100644 old-source/retur_beli/ambil_kode_barang.php create mode 100644 old-source/retur_beli/ambil_nomor.php create mode 100644 old-source/retur_beli/cari_nota.php create mode 100644 old-source/retur_beli/fungsi_retur.php create mode 100644 old-source/retur_beli/hmenu.php~ create mode 100644 old-source/retur_beli/menu.php create mode 100644 old-source/retur_beli/retur_ambil_alasan.php create mode 100644 old-source/retur_beli/retur_ambil_barang.php create mode 100644 old-source/retur_beli/retur_ambil_keterangan.php create mode 100644 old-source/retur_beli/retur_beli_fbaru.php create mode 100644 old-source/retur_beli/retur_beli_fedit.php create mode 100644 old-source/retur_beli/retur_beli_fprint.php create mode 100644 old-source/retur_beli/retur_cari_nota.php create mode 100644 old-source/retur_beli/retur_hapus.php create mode 100644 old-source/retur_beli/retur_print.php create mode 100644 old-source/retur_beli/retur_simpan.php create mode 100644 old-source/retur_beli/retur_update.php create mode 100644 old-source/retur_beli/retur_validasi.php create mode 100644 old-source/rincian_jual.php create mode 100644 old-source/rincitrans.php create mode 100644 old-source/satuanbrg.php create mode 100644 old-source/strip.php create mode 100644 old-source/supp_barang.php create mode 100644 old-source/supplier.php create mode 100644 old-source/tmplapbyrpersup.php create mode 100644 old-source/transfer_barang/ambil_barang.php create mode 100644 old-source/transfer_barang/ambil_barang_kembali.php create mode 100644 old-source/transfer_barang/ambil_kode_barang.php create mode 100644 old-source/transfer_barang/ambil_nomor.php create mode 100644 old-source/transfer_barang/ambil_nomor_kembali.php create mode 100644 old-source/transfer_barang/cari_nota.php create mode 100644 old-source/transfer_barang/fungsi_transfer.php create mode 100644 old-source/transfer_barang/hmenu.php~ create mode 100644 old-source/transfer_barang/menu.php create mode 100644 old-source/transfer_barang/transfer_ambil_barang.php create mode 100644 old-source/transfer_barang/transfer_cari_nota.php create mode 100644 old-source/transfer_barang/transfer_fbaru.php create mode 100644 old-source/transfer_barang/transfer_fedit.php create mode 100644 old-source/transfer_barang/transfer_fprint.php create mode 100644 old-source/transfer_barang/transfer_hapus.php create mode 100644 old-source/transfer_barang/transfer_kembali.php create mode 100644 old-source/transfer_barang/transfer_print.php create mode 100644 old-source/transfer_barang/transfer_simpan.php create mode 100644 old-source/transfer_barang/transfer_simpan_kembali.php create mode 100644 old-source/transfer_barang/transfer_update.php create mode 100644 old-source/transfer_barang/transfer_validasi.php create mode 100644 old-source/transfer_barang/transfer_validasi_kembali.php create mode 100644 old-source/ubah_hp/ajaxsupplier.php create mode 100644 old-source/ubah_hp/fungsi_ubah_hp.php create mode 100644 old-source/ubah_hp/fungsi_ubah_hp.php~ create mode 100644 old-source/ubah_hp/hmenu.php~ create mode 100644 old-source/ubah_hp/menu.php create mode 100644 old-source/ubah_hp/revisifaktur_fbaru.php create mode 100644 old-source/ubah_hp/revisifaktur_simpan.php create mode 100644 old-source/ubah_hp/ubahhp.php create mode 100644 old-source/umum/ambil_barang.php create mode 100644 old-source/umum/ambil_kode_barang.php create mode 100644 old-source/umum/ambil_nomor.php create mode 100644 old-source/umum/ambil_nota.php create mode 100644 old-source/umum/cari_nota.php create mode 100644 old-source/umum/cari_nota.php~ create mode 100644 old-source/update tabel d_retur_beli.txt create mode 100644 old-source/viewtmpbeli.php diff --git a/.gitignore b/.gitignore index 5ef6a52..e6e4404 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,6 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +# kredensial DB aplikasi PHP lama +/old-source/db_login.inc.php \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..4a2596a --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,118 @@ +@AGENTS.md + +# Cleo Minimarket + +Aplikasi Next.js 16 (App Router) untuk menggantikan aplikasi back-office minimarket lama berbasis +PHP di `old-source/`. Kode baru ditulis ulang dari nol; `old-source/` hanya referensi. + +## Stack + +- Next.js 16.4 + React 19, TypeScript strict, Tailwind CSS 4, pnpm 11. +- Drizzle ORM + `pg` untuk database aplikasi (Postgres). +- Better Auth untuk login (direncanakan, pakai Drizzle adapter ke Postgres). +- shadcn/ui untuk komponen UI (direncanakan). + +## Dua database + +| Env var | Database | Isi | +| -------------------- | --------------------------- | ------------------------------------------ | +| `DATABASE_URL` | Postgres (Docker lokal) | Milik aplikasi ini: user, session, auth. | +| `AMIGO_DATABASE_URL` | MariaDB 10.4 `cleo` (LAN) | Data bisnis lama: barang, transaksi, dll. | + +- Postgres dikelola penuh oleh Drizzle migration (`db:generate` lalu `db:migrate`). +- MariaDB `cleo` masih dipakai aplikasi PHP lama. **Jangan pernah** `generate`, `migrate`, atau + `push` ke database ini. Schema Drizzle-nya hanya boleh berasal dari `drizzle-kit pull` + (introspeksi), dengan config terpisah. +- Server MariaDB 10.4, bukan MySQL 8: hindari fitur yang tidak didukung (mis. sebagian fungsi + JSON dan CTE tertentu). Driver: `mysql2`. + +## Struktur folder + +Tanpa folder `src/`. Kode aplikasi di root, sejajar config. + +``` +app/ + (auth)/login/page.tsx halaman publik (belum login) + (dashboard)/layout.tsx cek session; semua halaman di dalamnya wajib login + (dashboard)// + page.tsx Server Component: ambil data lewat data/, render + actions.ts Server Actions fitur ini ('use server') + _components/ komponen khusus fitur ini + api/auth/[...all]/route.ts handler Better Auth (satu-satunya route handler yang wajar) +components/ + ui/ komponen shadcn (generated, jangan diedit manual kecuali perlu) + .tsx komponen yang dipakai lintas fitur +data/ Data Access Layer: fungsi baca/tulis DB, selalu 'server-only' +db/ + index.ts, schema.ts koneksi + schema Postgres + amigo/index.ts, amigo/schema.ts koneksi + schema MariaDB (hasil `drizzle-kit pull`) +lib/ + auth.ts config Better Auth (server) + auth-client.ts client Better Auth + utils.ts helper umum (dibuat shadcn) +drizzle/ file migrasi Postgres (generated, ikut di-commit) +proxy.ts pengganti middleware di Next 16; hanya cek ringan (redirect) +``` + +- Nama folder route dan file: kebab-case. Komponen React: PascalCase untuk nama fungsinya. +- Folder berawalan `_` tidak menjadi route; pakai untuk komponen yang dikolokasikan. +- Route group `(nama)` hanya untuk mengelompokkan layout, tidak muncul di URL. +- Import pakai alias `@/` (mis. `@/db`, `@/data/barang`). + +## Aturan data dan Server Actions + +- **Mutasi (create/update/delete, submit form) wajib lewat Server Action.** Tidak membuat + route handler `app/api/*` untuk hal yang bisa dikerjakan Server Action. +- **Membaca data tidak lewat Server Action.** Server Action adalah POST dan dijalankan berurutan, + jadi tidak cocok untuk fetch. Data dibaca di Server Component dengan memanggil fungsi di `data/`. +- Setiap file `actions.ts` diawali `'use server'`. Setiap action: + 1. Cek session dan hak akses di dalam action itu sendiri. Menyembunyikan tombol di UI bukan + pengaman, karena action bisa dipanggil langsung lewat POST. + 2. Validasi input (`FormData`/argumen) dengan zod sebelum menyentuh DB. + 3. Panggil fungsi di `data/`, bukan query langsung dari action. + 4. Kembalikan objek kecil yang dibutuhkan UI (mis. `{ ok: true }` atau + `{ ok: false, error: string }`), bukan baris DB mentah. + 5. Segarkan cache dengan `revalidatePath`/`updateTag` sebelum `redirect`, karena `redirect` + melempar exception dan kode sesudahnya tidak jalan. +- Form di client memakai `useActionState` untuk menampilkan error/pending dari action. +- File di `data/`, `db/`, dan `lib/auth.ts` diawali `import "server-only"` supaya tidak bisa + ter-import ke client component. Hanya lapisan ini yang membaca `process.env` untuk secret. +- `proxy.ts` hanya untuk redirect cepat berdasarkan ada/tidaknya cookie session. Pemeriksaan + session yang sebenarnya tetap di layout/page dan di setiap action. +- Query selalu lewat Drizzle query builder atau `sql` template tag (parameterized). Jangan + menyusun SQL dengan string concatenation. + +## Kode lama (`old-source/`) + +Read-only, jangan diedit dan jangan di-import. Dipakai untuk memahami fitur dan aturan bisnis. + +- PHP prosedural + jQuery, akses DB lewat `mysqli`/`mysql_*` langsung di tiap halaman. + Banyak query disusun dengan string concatenation (rentan SQL injection); jangan tiru polanya. +- Peta fitur ada di `old-source/menu.php`: Data Master (pelanggan, karyawan, group/sub group + product, rak, supplier, satuan), Barang, Pengadaan, Barcode, Retur Pembelian, Transfer Barang, + Revisi, Laporan Persediaan/Beli/Jual, BON, Pembayaran. +- Helper bisnis di `old-source/func_lib.php`. Hal yang tidak terlihat dari namanya: + - Login lama mencocokkan `karyawan.username` dan `karyawan.password` (hash MD5), lalu + mengisi session `useracc`, `nik`, `job` (`id_pekerjaan`), `namatoko`. + - Jabatan dibaca dari `karyawan.id_pekerjaan` berupa teks: `Pemimpin Toko`, + `Asisten Pemimpin Toko`, `Petugas Administrasi`. + - Harga pokok ditampilkan dalam kode huruf: `convHrgP`/`DeconvHrgP` memetakan angka 1-0 ke + `B R A W N F O X E S`; profit dipetakan `convProfit` ke `D J U N G K A R E T`. + - Format tanggal tampilan `dd-mm-yyyy` (`encTgl`), DB `yyyy-mm-dd` (`decTgl`). + - `bukaKoneksiPusat()` merujuk konstanta `*_PUSAT` yang tidak didefinisikan di + `db_login.inc.php`; fitur koneksi ke DB pusat kemungkinan sudah mati. +- File `*~` dan `(copy)` adalah sisa backup editor, abaikan. + +## Perintah + +``` +pnpm dev jalankan dev server +pnpm build build production +pnpm lint eslint +pnpm exec tsc --noEmit type-check +pnpm db:generate buat migrasi dari db/schema.ts (Postgres) +pnpm db:migrate jalankan migrasi ke Postgres +pnpm db:studio lihat isi Postgres di https://local.drizzle.studio +``` + +Postgres lokal: container Docker `cleo-postgres` (image `postgres:17`, port 5432). diff --git a/old-source/.sync.ffs_db b/old-source/.sync.ffs_db new file mode 100644 index 0000000000000000000000000000000000000000..591721ddae0fa674a378a7dc1281c0faa5cbfe7c GIT binary patch literal 2773 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 b0IWAG2euiu3AP3HGVCSTE5S|xIr=g$U{5~t literal 0 HcmV?d00001 diff --git a/old-source/LaporanBeli/ajaxsupplier.php b/old-source/LaporanBeli/ajaxsupplier.php new file mode 100644 index 0000000..6393c13 --- /dev/null +++ b/old-source/LaporanBeli/ajaxsupplier.php @@ -0,0 +1,134 @@ + +prepare($query); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function cari_supplier($nama) { + if($nama != "") { + $harray = array(); + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $nama = addslashes($nama); + $data = $mysqli->query("SELECT kd_supplier, nama_supplier, alamat1, lama_tempo FROM supplier WHERE nama_supplier LIKE '%".$nama."%'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_supplier' => $a['kd_supplier'], + 'nama_supplier' => stripcslashes($a['nama_supplier']), + 'alamat1' => $a['alamat1'], + 'lama_tempo' => $a['lama_tempo'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + }else{ + $harray = array(); + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $nama = addslashes($nama); + $data = $mysqli->query("SELECT kd_supplier, nama_supplier, alamat1, lama_tempo FROM supplier"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_supplier' => $a['kd_supplier'], + 'nama_supplier' => stripcslashes($a['nama_supplier']), + 'alamat1' => $a['alamat1'], + 'lama_tempo' => $a['lama_tempo'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + +function ambil_supplier($id_supplier) { + if ($id_supplier != "") { + $array_data = array(); + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT * FROM supplier WHERE kd_supplier = '".$id_supplier."'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $array_data[$idx] = array( + 'kd_supplier' => $a['kd_supplier'], + 'nama_supplier' => $a['nama_supplier'], + 'alamat1' => $a['alamat1'], + 'alamat2' => $a['alamat2'], + 'nama_rekening' => $a['nama_rekening'], + 'rekening1' => $a['rekening1'], + 'rekening2' => $a['rekening2'], + 'bank1' => $a['bank1'], + 'bank2' => $a['bank2'], + 'telp' => $a['telp'], + 'ponsel' => $a['ponsel'], + 'email' => $a['email'], + 'fax' => $a['fax'], + 'jns_pembayaran' => $a['jns_pembayaran'], + 'lama_tempo' => $a['lama_tempo'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($array_data); + } +} + + +?> \ No newline at end of file diff --git a/old-source/LaporanBeli/belidlmpdk.php b/old-source/LaporanBeli/belidlmpdk.php new file mode 100644 index 0000000..4177269 --- /dev/null +++ b/old-source/LaporanBeli/belidlmpdk.php @@ -0,0 +1,83 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan Pembelian Per Sub Group Product +
+
+
+ + + + +
Range Tanggal: s/d
+
+
+
+
+ +
+ + diff --git a/old-source/LaporanBeli/belikons.php b/old-source/LaporanBeli/belikons.php new file mode 100644 index 0000000..bc38564 --- /dev/null +++ b/old-source/LaporanBeli/belikons.php @@ -0,0 +1,82 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan Pembelian Konsinyasi +
+
+
+ + + +
Range Tanggal: s/d
+
+
+
+
+ +
+ + diff --git a/old-source/LaporanBeli/beliperfaktur.php b/old-source/LaporanBeli/beliperfaktur.php new file mode 100644 index 0000000..2c97de7 --- /dev/null +++ b/old-source/LaporanBeli/beliperfaktur.php @@ -0,0 +1,114 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan Pembelian Per Faktur +
+
+
+ + + +
Range Tanggal: s/d
Kode Supplier: + +
+
+
+
+
+ +
+
Cari Supplier
+
+ +
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + +
+ + + \ No newline at end of file diff --git a/old-source/LaporanBeli/beliperkategori.php b/old-source/LaporanBeli/beliperkategori.php new file mode 100644 index 0000000..3997a62 --- /dev/null +++ b/old-source/LaporanBeli/beliperkategori.php @@ -0,0 +1,81 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan Pembelian Per Kategori +
+
+
+ + +
Range Tanggal: s/d
+
+
+
+
+
+ +
+ + diff --git a/old-source/LaporanBeli/belipersupplier.php b/old-source/LaporanBeli/belipersupplier.php new file mode 100644 index 0000000..fc9d458 --- /dev/null +++ b/old-source/LaporanBeli/belipersupplier.php @@ -0,0 +1,158 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan Pembelian Per Supplier +
+ + + + + + + +
+
+
+ + + +
Range Tanggal: s/d
Kode Supplier: + +
+
+
+
+
+
+ + + +
Range Tanggal: s/d
+
+
+
+
+
+ + + + +
Tanggal Jatuh Tempo: s/d
Tanggal Nota: s/d
+
+
+
+
+
+ +
+
Cari Supplier
+
+ +
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + +
+ + \ No newline at end of file diff --git a/old-source/LaporanBeli/belirevisi.php b/old-source/LaporanBeli/belirevisi.php new file mode 100644 index 0000000..d701a3b --- /dev/null +++ b/old-source/LaporanBeli/belirevisi.php @@ -0,0 +1,81 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan Revisi Pembelian +
+
+
+ + +
Range Tanggal: s/d
+
+
+
+
+ +
+ + \ No newline at end of file diff --git a/old-source/LaporanBeli/brgexp.php b/old-source/LaporanBeli/brgexp.php new file mode 100644 index 0000000..d337237 --- /dev/null +++ b/old-source/LaporanBeli/brgexp.php @@ -0,0 +1,81 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Barang Expired +
+
+
+ + +
Range Tanggal Expired: s/d
+
+
+
+
+
+ +
+ + diff --git a/old-source/LaporanBeli/cetakPembelian.php b/old-source/LaporanBeli/cetakPembelian.php new file mode 100644 index 0000000..d72e52c --- /dev/null +++ b/old-source/LaporanBeli/cetakPembelian.php @@ -0,0 +1,130 @@ +"; + echo "div#divprint{width:100%; border:1px solid #000; padding:20px 0; margin-bottom:25px;font:14pt Gill Sans MT;}"; + echo "table.tbl {border-width:0 0 1px 1px;border-spacing:0;border-collapse:collapse;}"; + 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 ""; + +$noFaktur = $_GET['faktur']; + +print("
"); +if(isset($noFaktur)) +{ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT m.no_order, m.tgl_nota, m.tgl_masuk, m.tgl_jatuh_tempo, m.kd_supplier,s.nama_supplier,m.status,m.diskon, + m.nik,k.nama,m.keterangan,m.tgl_entry, d.kode_barang,d.nm_brg,d.nomor,d.harga_pokok,d.profit, + d.kode_asli,d.jum_fisik,d.lokasi,d.harga_satuan,d.hj_final,m.rp_beli + FROM m_pembelian m,d_pembelian d,supplier s,karyawan k + WHERE d.no_faktur = m.no_faktur + AND m.kd_supplier = s.kd_supplier + AND m.nik = k.nik + AND m.no_faktur = ? + ORDER BY d.kode_barang,d.nm_brg,d.nomor"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,"s",$noFaktur); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$noOrder,$tglNota,$tglMsk,$tglTmpo,$kdSup,$nmSup,$status,$disk, + $nik,$nm,$ket,$tglEntry,$kdBrg,$nmBrg,$no,$hrgP,$profit,$kdAsli,$jumF,$lok,$hrgS,$hjF,$rp_beli); + print("
"); + print("
"); + print("Laporan Penerimaan Barang toko ".$_SESSION['namatoko']."

"); + + $i=0; + $jBeli = 0; + $rpBeli = 0; + while(mysqli_stmt_fetch($stmt)){ + if($i==0){ + if($status=="T"){ + $status="Tunai"; + }else if($status=="H"){ + $status="Tempo"; + }else{ + $status="Konsinyasi"; + } + $disk .= "%"; + $tglNota = encTgl($tglNota); + $tglMsk = encTgl($tglMsk); + $tglTmpo = encTgl($tglTmpo); + $tglEntryS = substr($tglEntry,0,10); + $tglEntryS = encTgl($tglEntryS); + $time = substr($tglEntry,11,8); + + print("
"); + print(""); + print(" + "); + print(" + "); + print(" + "); + print(" + "); + print(" + "); + print(" + "); + + print("
Nomor Faktur : $noFakturTanggal Nota : $tglNota
Nomor Order : $noOrderTanggal Masuk : $tglMsk
Waktu Entry : $tglEntryS / $time Kode Supplier : $kdSup | $nmSup
NIK : $nik | $nmTanggal Jatuh Tempo : $tglTmpo
Status : $statusDiskon Pembelian : $disk
Keterangan : $ket
"); + print(" + + + + + + + + "); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + }else{ + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + } + $i++; + $jBeli += $jumF; + $rpBeli += $jumF * DeconvHrgP($hrgP); + } + print("
KODE ASLIKODE BRGNAMA BARANGKODE BRG LAMANOJUML FISIKHP LAMAPROFIT(%)HJ FINAL
$kdAsli$kdBrg$nmBrg$kdBrglama$no$jumF".DeconvHrgP($hrgP)."".convHrgP($profit)."".number_format($hjF)."
$kdAsli$kdBrg$nmBrg$kdBrglama$no$jumF".DeconvHrgP($hrgP)."".convHrgP($profit)."".number_format($hjF)."

+ + + +
Total Jumlah : $jBeli
Total Rupiah : Rp. ".number_format($rpBeli,2,',','.')."
Total Rupiah Nota : Rp. ".number_format($rp_beli,2,',','.')."
+
"); + } + } + } +} +print("
"); +?> diff --git a/old-source/LaporanBeli/hmenu.php~ b/old-source/LaporanBeli/hmenu.php~ new file mode 100644 index 0000000..a8c9fab --- /dev/null +++ b/old-source/LaporanBeli/hmenu.php~ @@ -0,0 +1,133 @@ + +
+ [ ] | [ Logout ] +
diff --git a/old-source/LaporanBeli/lap_rnc_and_order.php~ b/old-source/LaporanBeli/lap_rnc_and_order.php~ new file mode 100644 index 0000000..3d501e0 --- /dev/null +++ b/old-source/LaporanBeli/lap_rnc_and_order.php~ @@ -0,0 +1,441 @@ +"; + echo "div#divprint{width:1100px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:1000px;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:9pt;}"; + 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 ".warnaKolPisah{font-weight : bold; background-color: #595454;}"; //#413839 + echo ".master{text-align:left;}"; + echo ""; + + $startDate = $_POST['startDate']; //kd supp + $endDate = $_POST['endDate']; // lini + $bln = $_POST['bulan']; + $thn = $_POST['tahun']; + $thnR = substr($_POST['tahun'],2,2); + + if(bukaKoneksi()){ + global $conn; + + + $queryclear1= "DROP TABLE IF EXISTS tLaporan1"; + $queryclear2= "DROP TABLE IF EXISTS tLaporan2"; + $queryclear3= "DROP TABLE IF EXISTS tLaporan3"; + runQuery($queryclear1); + runQuery($queryclear2); + runQuery($queryclear3); + + if ($startDate != '' and $endDate != '' and $bln != '' and $thn != ''){ + $queryTable1 = "CREATE TABLE tLaporan1 AS + SELECT st.kel_jns kel_jns1, m.kode_strip kode_strip1, d.kode_supplier kode_supplier1, s.nama_supplier nama_supplier1, sum(d.vol_revisi) jml1, sum(d.rupiah_revisi) rp1 + FROM d_rencana_beli d, m_rencana_beli m, supplier s, strip st + WHERE m.bulanR = '$bln' AND m.tahunR = '$thnR' + and m.id=d.id + and d.kode_supplier = s.kd_supplier + and m.kode_strip = st.kd_strip + and d.kode_supplier = '$startDate' + and m.kode_strip = '$endDate' + GROUP BY m.kode_strip,d.kode_supplier "; + + $queryTable2 = "CREATE TABLE tLaporan2 AS + SELECT s.kel_jns kel_jns2,d.kode_strip kode_strip2,m.kd_supplier kode_supplier2, u.nama_supplier nama_supplier2,sum(d.jumlah) jml2,sum(d.harga_order) rp2 + FROM d_order d,m_order m,supplier u,strip s + WHERE d.no_order = m.no_order + AND s.kd_strip = d.kode_strip + AND u.kd_supplier = m.kd_supplier + AND m.kd_supplier = '$startDate' + AND d.kode_strip = '$endDate' + AND month(rencana_datang) = '$bln' AND year(rencana_datang) = '$thn' + GROUP BY d.kode_strip,m.kd_supplier "; + }else if ($startDate != '' and $bln != '' and $thn != ''){ + $queryTable1 = "CREATE TABLE tLaporan1 AS + SELECT st.kel_jns kel_jns1, m.kode_strip kode_strip1, d.kode_supplier kode_supplier1, s.nama_supplier nama_supplier1, sum(d.vol_revisi) jml1, sum(d.rupiah_revisi) rp1 + FROM d_rencana_beli d, m_rencana_beli m, supplier s, strip st + WHERE m.bulanR = '$bln' AND m.tahunR = '$thnR' + and m.id=d.id + and d.kode_supplier = s.kd_supplier + and m.kode_strip = st.kd_strip + and d.kode_supplier = '$startDate' + GROUP BY m.kode_strip,d.kode_supplier "; + + $queryTable2 = "CREATE TABLE tLaporan2 AS + SELECT s.kel_jns kel_jns2,d.kode_strip kode_strip2,m.kd_supplier kode_supplier2, u.nama_supplier nama_supplier2,sum(d.jumlah) jml2,sum(d.harga_order) rp2 + FROM d_order d,m_order m,supplier u,strip s + WHERE d.no_order = m.no_order + AND s.kd_strip = d.kode_strip + AND u.kd_supplier = m.kd_supplier + AND m.kd_supplier = '$startDate' + AND month(rencana_datang) = '$bln' AND year(rencana_datang) = '$thn' + GROUP BY d.kode_strip,m.kd_supplier "; + }else if ($endDate != '' and $bln != '' and $thn != ''){ + $queryTable1 = "CREATE TABLE tLaporan1 AS + SELECT st.kel_jns kel_jns1, m.kode_strip kode_strip1, d.kode_supplier kode_supplier1, s.nama_supplier nama_supplier1, sum(d.vol_revisi) jml1, sum(d.rupiah_revisi) rp1 + FROM d_rencana_beli d, m_rencana_beli m, supplier s, strip st + WHERE m.bulanR = '$bln' AND m.tahunR = '$thnR' + and m.id=d.id + and d.kode_supplier = s.kd_supplier + and m.kode_strip = st.kd_strip + and m.kode_strip = '$endDate' + GROUP BY m.kode_strip,d.kode_supplier "; + + $queryTable2 = "CREATE TABLE tLaporan2 AS + SELECT s.kel_jns kel_jns2,d.kode_strip kode_strip2,m.kd_supplier kode_supplier2, u.nama_supplier nama_supplier2,sum(d.jumlah) jml2,sum(d.harga_order) rp2 + FROM d_order d,m_order m,supplier u,strip s + WHERE d.no_order = m.no_order + AND s.kd_strip = d.kode_strip + AND u.kd_supplier = m.kd_supplier + AND d.kode_strip = '$endDate' + AND month(rencana_datang) = '$bln' AND year(rencana_datang) = '$thn' + GROUP BY d.kode_strip,m.kd_supplier "; + }else{ + $queryTable1 = "CREATE TABLE tLaporan1 AS + SELECT st.kel_jns kel_jns1, m.kode_strip kode_strip1, d.kode_supplier kode_supplier1, s.nama_supplier nama_supplier1, sum(d.vol_revisi) jml1, sum(d.rupiah_revisi) rp1 + FROM d_rencana_beli d, m_rencana_beli m, supplier s, strip st + WHERE m.bulanR = '$bln' AND m.tahunR = '$thnR' + and m.id=d.id + and d.kode_supplier = s.kd_supplier + and m.kode_strip = st.kd_strip + GROUP BY m.kode_strip,d.kode_supplier "; + + $queryTable2 = "CREATE TABLE tLaporan2 AS + SELECT s.kel_jns kel_jns2,d.kode_strip kode_strip2,m.kd_supplier kode_supplier2, u.nama_supplier nama_supplier2,sum(d.jumlah) jml2,sum(d.harga_order) rp2 + FROM d_order d,m_order m,supplier u,strip s + WHERE d.no_order = m.no_order + AND s.kd_strip = d.kode_strip + AND u.kd_supplier = m.kd_supplier + AND month(rencana_datang) = '$bln' AND year(rencana_datang) = '$thn' + GROUP BY d.kode_strip,m.kd_supplier "; + } + + $queryTable3 = "CREATE TABLE tLaporan3 AS + SELECT t3.kel_jns1,t3.kode_strip1,t3.kode_supplier1,t3.nama_supplier1,t3.jml1,t3.rp1,t3.kel_jns2,t3.kode_strip2,t3.kode_supplier2,t3.nama_supplier2,t3.jml2,t3.rp2 + FROM + (SELECT t1.*,t2.* + FROM tLaporan1 t1 LEFT OUTER JOIN tLaporan2 t2 ON + t1.kode_strip1 = t2.kode_strip2 AND t1.kode_supplier1 = t2.kode_supplier2 + UNION ALL + SELECT t1.*,t2.* + FROM tLaporan1 t1 RIGHT OUTER JOIN tLaporan2 t2 ON + t1.kode_strip1 = t2.kode_strip2 AND t1.kode_supplier1 = t2.kode_supplier2 + WHERE t1.kode_strip1 IS NULL) t3 "; + + $query = "SELECT * FROM tLaporan3 t3 ORDER BY t3.kel_jns2,t3.kel_jns1,t3.kode_strip2,t3.kode_strip1,t3.kode_supplier2,t3.kode_supplier1 "; + + runQuery($queryTable1); + runQuery($queryTable2); + runQuery($queryTable3); + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek >= 0){ + mysqli_stmt_bind_result($stmt,$kelJns,$strip,$kd,$nm,$vrenc,$hprenc,$kelJns2,$strip2,$kd2,$nm2,$vrev,$hprev); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['pria']['jmlRev'] = 0; + $ttJmlBeli['pria']['hpRev'] = 0; + + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['wanita']['jmlRev'] = 0; + $ttJmlBeli['wanita']['hpRev'] = 0; + + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['anak']['jmlRev'] = 0; + $ttJmlBeli['anak']['hpRev'] = 0; + + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + $ttJmlBeli['sepatu']['jmlRev'] = 0; + $ttJmlBeli['sepatu']['hpRev'] = 0; + + print("
"); + print("

Laporan Rencana & Realisasi Order



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."

"); + print("Bulan Order : ".$bln."
"); + print("Tahun Order : ".$_POST['tahun']."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $str = array(); + $jmlren = array(); + $rpren = array(); + $stsren = array(); + $jmlrev = array(); + $rprev = array(); + $stsrev = array(); + + while(mysqli_stmt_fetch($stmt)){ + if($kelJns == "P" OR $kelJns2 == "P"){ + $kelJns = "Pria"; + $ttJmlBeli['pria']['jml'] += $vrenc; + $ttJmlBeli['pria']['hp'] += $hprenc; + $ttJmlBeli['pria']['jmlRev'] += $vrev; + $ttJmlBeli['pria']['hpRev'] += $hprev; + $str[$pria]['pria'] = strtoupper($strip); + $str2[$pria]['pria'] = strtoupper($strip2); + $jmlren[$pria]['pria'] = $vrenc; + $rpren[$pria]['pria'] = $hprenc; + $jmlrev[$pria]['pria'] = $vrev; + $rprev[$pria]['pria'] = $hprev; + $kdSupp[$pria]['pria'] = $kd; + $nmSupp[$pria]['pria'] = $nm; + $kdSupp2[$pria]['pria'] = $kd2; + $nmSupp2[$pria]['pria'] = $nm2; + $noord[$pria]['pria'] = $noorder; + $pria++; + }elseif($kelJns == "W" OR $kelJns2 == "W"){ + $kelJns = "Wanita"; + $ttJmlBeli['wanita']['jml'] += $vrenc; + $ttJmlBeli['wanita']['hp'] += $hprenc; + $ttJmlBeli['wanita']['jmlRev'] += $vrev; + $ttJmlBeli['wanita']['hpRev'] += $hprev; + $str[$wanita]['wanita'] = strtoupper($strip); + $str2[$wanita]['wanita'] = strtoupper($strip2); + $jmlren[$wanita]['wanita'] = $vrenc; + $rpren[$wanita]['wanita'] = $hprenc; + $jmlrev[$wanita]['wanita'] = $vrev; + $rprev[$wanita]['wanita'] = $hprev; + $kdSupp[$wanita]['wanita'] = $kd; + $nmSupp[$wanita]['wanita'] = $nm; + $kdSupp2[$wanita]['wanita'] = $kd2; + $nmSupp2[$wanita]['wanita'] = $nm2; + $noord[$wanita]['wanita'] = $noorder; + $wanita++; + }elseif($kelJns == "A" OR $kelJns2 == "A"){ + $kelJns = "Anak"; + $ttJmlBeli['anak']['jml'] += $vrenc; + $ttJmlBeli['anak']['hp'] += $hprenc; + $ttJmlBeli['anak']['jmlRev'] += $vrev; + $ttJmlBeli['anak']['hpRev'] += $hprev; + $str[$anak]['anak'] = strtoupper($strip); + $str2[$anak]['anak'] = strtoupper($strip2); + $jmlren[$anak]['anak'] = $vrenc; + $rpren[$anak]['anak'] = $hprenc; + $jmlrev[$anak]['anak'] = $vrev; + $rprev[$anak]['anak'] = $hprev; + $kdSupp[$anak]['anak'] = $kd; + $nmSupp[$anak]['anak'] = $nm; + $kdSupp2[$anak]['anak'] = $kd2; + $nmSupp2[$anak]['anak'] = $nm2; + $noord[$anak]['anak'] = $noorder; + $anak++; + }else{ + $kelJns = "Sepatu"; + $ttJmlBeli['sepatu']['jml'] += $vrenc; + $ttJmlBeli['sepatu']['hp'] += $hprenc; + $ttJmlBeli['sepatu']['jmlRev'] += $vrev; + $ttJmlBeli['sepatu']['hpRev'] += $hprev; + $str[$sepatu]['sepatu'] = strtoupper($strip); + $str2[$sepatu]['sepatu'] = strtoupper($strip2); + $jmlren[$sepatu]['sepatu'] = $vrenc; + $rpren[$sepatu]['sepatu'] = $hprenc; + $jmlrev[$sepatu]['sepatu'] = $vrev; + $rprev[$sepatu]['sepatu'] = $hprev; + $kdSupp[$sepatu]['sepatu'] = $kd; + $nmSupp[$sepatu]['sepatu'] = $nm; + $kdSupp2[$sepatu]['sepatu'] = $kd2; + $nmSupp2[$sepatu]['sepatu'] = $nm2; + $noord[$sepatu]['sepatu'] = $noorder; + $sepatu++; + } + + } + print(""); + print(""); + print("
"); + +// PRIA ------------------------------------------------------------------------- + if($ttJmlBeli['pria']['jml']!=0 OR $ttJmlBeli['pria']['jmlRev']!=0){ + print("
"); + for($i=0;$i<$pria;$i++){ + if ($str[$i-1]['pria']==$str[$i]['pria'] AND !empty($str[$i]['pria'])){ + print(""); + }else if ($str[$i-1]['pria']==$str[$i]['pria'] AND empty($str[$i]['pria'])){ + if ($str2[$i-1]['pria']==$str2[$i]['pria']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlah1 = 0; + $temphp1 = 0; + $tempjumlah2 = 0; + $temphp2 = 0; + } + }else{ + if($str[$i-1]['pria']!=$str[$i]['pria'] AND empty($str[$i]['pria'])){ + print(""); + print(""); + }else{ + print(""); + print(""); + } + + $tempjumlah1 = 0; + $temphp1 = 0; + $tempjumlah2 = 0; + $temphp2 = 0; + } + $tempjumlah1 += $jmlren[$i]['pria']; + $temphp1 += $rpren[$i]['pria']; + $tempjumlah2 += $jmlrev[$i]['pria']; + $temphp2 += $rprev[$i]['pria']; + } + print(""); + } + + print(""); + +// WANITA ------------------------------------------------------------------------- + if($ttJmlBeli['wanita']['jml']!=0 OR $ttJmlBeli['wanita']['jmlRev']!=0){ + print(""); + for($i=0;$i<$wanita;$i++){ + if ($str[$i-1]['wanita']==$str[$i]['wanita'] AND !empty($str[$i]['wanita'])){ + print(""); + }else if ($str[$i-1]['wanita']==$str[$i]['wanita'] AND empty($str[$i]['wanita'])){ + if ($str2[$i-1]['wanita']==$str2[$i]['wanita']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlah3 = 0; + $temphp3 = 0; + $tempjumlah4 = 0; + $temphp4 = 0; + } + }else{ + if($str[$i-1]['wanita']!=$str[$i]['wanita'] AND empty($str[$i]['wanita'])){ + print(""); + print(""); + }else{ + print(""); + print(""); + } + $tempjumlah3 = 0; + $temphp3 = 0; + $tempjumlah4 = 0; + $temphp4 = 0; + } + $tempjumlah3 += $jmlren[$i]['wanita']; + $temphp3 += $rpren[$i]['wanita']; + $tempjumlah4 += $jmlrev[$i]['wanita']; + $temphp4 += $rprev[$i]['wanita']; + } + print(""); + } + + print(""); +// ANAK ------------------------------------------------------------------------- + if($ttJmlBeli['anak']['jml']!=0 OR $ttJmlBeli['anak']['jmlRev']!=0){ + print(""); + for($i=0;$i<$anak;$i++){ + if ($str[$i-1]['anak']==$str[$i]['anak'] AND !empty($str[$i]['anak'])){ + print(""); + }else if ($str[$i-1]['anak']==$str[$i]['anak'] AND empty($str[$i]['anak'])){ + if ($str2[$i-1]['anak']==$str2[$i]['anak']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlah5 = 0; + $temphp5 = 0; + $tempjumlah6 = 0; + $temphp6 = 0; + } + }else{ + if($str[$i-1]['anak']!=$str[$i]['anak'] AND empty($str[$i]['anak'])){ + print(""); + print(""); + }else{ + print(""); + print(""); + } + $tempjumlah5 = 0; + $temphp5 = 0; + $tempjumlah6 = 0; + $temphp6 = 0; + } + $tempjumlah5 += $jmlren[$i]['anak']; + $temphp5 += $rpren[$i]['anak']; + $tempjumlah6 += $jmlrev[$i]['anak']; + $temphp6 += $rprev[$i]['anak']; + } + print(""); + } + + print(""); +// SEPATU ------------------------------------------------------------------------- + if($ttJmlBeli['sepatu']['jml']!=0 OR $ttJmlBeli['sepatu']['jmlRev']!=0){ + print(""); + for($i=0;$i<$sepatu;$i++){ + if ($str[$i-1]['sepatu']==$str[$i]['sepatu'] AND !empty($str[$i]['sepatu'])){ + print(""); + }else if ($str[$i-1]['sepatu']==$str[$i]['sepatu'] AND empty($str[$i]['sepatu'])){ + if ($str2[$i-1]['sepatu']==$str2[$i]['sepatu']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlah7 = 0; + $temphp7 = 0; + $tempjumlah8 = 0; + $temphp8 = 0; + } + }else{ + print(""); + print(""); + + $tempjumlah7 = 0; + $temphp7 = 0; + $tempjumlah8 = 0; + $temphp8 = 0; + } + $tempjumlah7 += $jmlren[$i]['sepatu']; + $temphp7 += $rpren[$i]['sepatu']; + $tempjumlah8 += $jmlrev[$i]['sepatu']; + $temphp8 += $rprev[$i]['sepatu']; + } + print(""); + } + + print(""); + + $ttjml1 = $ttJmlBeli['pria']['jml'] + $ttJmlBeli['wanita']['jml'] + $ttJmlBeli['anak']['jml'] + $ttJmlBeli['sepatu']['jml']; + $ttrp1 = $ttJmlBeli['pria']['hp'] + $ttJmlBeli['wanita']['hp'] + $ttJmlBeli['anak']['hp'] + $ttJmlBeli['sepatu']['hp']; + $ttjml2 = $ttJmlBeli['pria']['jmlRev'] + $ttJmlBeli['wanita']['jmlRev'] + $ttJmlBeli['anak']['jmlRev'] + $ttJmlBeli['sepatu']['jmlRev']; + $ttrp2 = $ttJmlBeli['pria']['hpRev'] + $ttJmlBeli['wanita']['hpRev'] + $ttJmlBeli['anak']['hpRev'] + $ttJmlBeli['sepatu']['hpRev']; + + print(" + + + + "); + + print("
KategoriLiniKode SuppNama SuppJml RencTotal HP Renc Kode SuppNama SuppJml OrderTotal HP Order Jml SelisihTotal HP Selisih
Pria
~".$str[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlren[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria'], 0, ",", ".")." .".$kdSupp2[$i]['pria']."".$nmSupp2[$i]['pria']."".number_format($jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rprev[$i]['pria'], 0, ",", ".")." ".number_format($jmlren[$i]['pria']-$jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria']-$rprev[$i]['pria'], 0, ",", ".")."
~".$str2[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlren[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria'], 0, ",", ".")." .".$kdSupp2[$i]['pria']."".$nmSupp2[$i]['pria']."".number_format($jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rprev[$i]['pria'], 0, ",", ".")." ".number_format($jmlren[$i]['pria']-$jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria']-$rprev[$i]['pria'], 0, ",", ".")."
".number_format($tempjumlah1, 0, ",", ".")."".number_format($temphp1, 0, ",", ".")." ".number_format($tempjumlah2, 0, ",", ".")."".number_format($temphp2, 0, ",", ".")." ".number_format($tempjumlah1-$tempjumlah2, 0, ",", ".")."".number_format($temphp1-$temphp2, 0, ",", ".")."
~".$str2[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlren[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria'], 0, ",", ".")." .".$kdSupp2[$i]['pria']."".$nmSupp2[$i]['pria']."".number_format($jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rprev[$i]['pria'], 0, ",", ".")." ".number_format($jmlren[$i]['pria']-$jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria']-$rprev[$i]['pria'], 0, ",", ".")."
".number_format($tempjumlah1, 0, ",", ".")."".number_format($temphp1, 0, ",", ".")." ".number_format($tempjumlah2, 0, ",", ".")."".number_format($temphp2, 0, ",", ".")." ".number_format($tempjumlah1-$tempjumlah2, 0, ",", ".")."".number_format($temphp1-$temphp2, 0, ",", ".")."
~".$str2[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlren[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria'], 0, ",", ".")." .".$kdSupp2[$i]['pria']."".$nmSupp2[$i]['pria']."".number_format($jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rprev[$i]['pria'], 0, ",", ".")." ".number_format($jmlren[$i]['pria']-$jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria']-$rprev[$i]['pria'], 0, ",", ".")."
".number_format($tempjumlah1, 0, ",", ".")."".number_format($temphp1, 0, ",", ".")." ".number_format($tempjumlah2, 0, ",", ".")."".number_format($temphp2, 0, ",", ".")." ".number_format($tempjumlah1-$tempjumlah2, 0, ",", ".")."".number_format($temphp1-$temphp2, 0, ",", ".")."
~".$str[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlren[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria'], 0, ",", ".")." .".$kdSupp2[$i]['pria']."".$nmSupp2[$i]['pria']."".number_format($jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rprev[$i]['pria'], 0, ",", ".")." ".number_format($jmlren[$i]['pria']-$jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria']-$rprev[$i]['pria'], 0, ",", ".")."
".number_format($tempjumlah1, 0, ",", ".")."".number_format($temphp1, 0, ",", ".")." ".number_format($tempjumlah2, 0, ",", ".")."".number_format($temphp2, 0, ",", ".")." ".number_format($tempjumlah1-$tempjumlah2, 0, ",", ".")."".number_format($temphp1-$temphp2, 0, ",", ".")."
TOTAL PRIA".number_format($ttJmlBeli['pria']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['hp'], 0, ",", ".")." ".number_format($ttJmlBeli['pria']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['hpRev'], 0, ",", ".")." ".number_format($ttJmlBeli['pria']['jml']-$ttJmlBeli['pria']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['hp']-$ttJmlBeli['pria']['hpRev'], 0, ",", ".")."
Wanita
~".$str[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlren[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita'], 0, ",", ".")." .".$kdSupp2[$i]['wanita']."".$nmSupp2[$i]['wanita']."".number_format($jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rprev[$i]['wanita'], 0, ",", ".")."".number_format($jmlren[$i]['wanita']-$jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita']-$rprev[$i]['wanita'], 0, ",", ".")."
~".$str2[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlren[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita'], 0, ",", ".")." .".$kdSupp2[$i]['wanita']."".$nmSupp2[$i]['wanita']."".number_format($jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rprev[$i]['wanita'], 0, ",", ".")."".number_format($jmlren[$i]['wanita']-$jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita']-$rprev[$i]['wanita'], 0, ",", ".")."
".number_format($tempjumlah3, 0, ",", ".")."".number_format($temphp3, 0, ",", ".")." ".number_format($tempjumlah4, 0, ",", ".")."".number_format($temphp4, 0, ",", ".")."".number_format($tempjumlah3-$tempjumlah4, 0, ",", ".")."".number_format($temphp3-$temphp4, 0, ",", ".")."
~".$str2[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlren[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita'], 0, ",", ".")." .".$kdSupp2[$i]['wanita']."".$nmSupp2[$i]['wanita']."".number_format($jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rprev[$i]['wanita'], 0, ",", ".")."".number_format($jmlren[$i]['wanita']-$jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita']-$rprev[$i]['wanita'], 0, ",", ".")."
".number_format($tempjumlah1, 0, ",", ".")."".number_format($temphp1, 0, ",", ".")." ".number_format($tempjumlah2, 0, ",", ".")."".number_format($temphp2, 0, ",", ".")." ".number_format($tempjumlah1-$tempjumlah2, 0, ",", ".")."".number_format($temphp1-$temphp2, 0, ",", ".")."
~".$str2[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlren[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita'], 0, ",", ".")." .".$kdSupp2[$i]['wanita']."".$nmSupp2[$i]['wanita']."".number_format($jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rprev[$i]['wanita'], 0, ",", ".")." ".number_format($jmlren[$i]['wanita']-$jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita']-$rprev[$i]['wanita'], 0, ",", ".")."
".number_format($tempjumlah3, 0, ",", ".")."".number_format($temphp3, 0, ",", ".")." ".number_format($tempjumlah4, 0, ",", ".")."".number_format($temphp4, 0, ",", ".")."".number_format($tempjumlah3-$tempjumlah4, 0, ",", ".")."".number_format($temphp3-$temphp4, 0, ",", ".")."
~".$str[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlren[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita'], 0, ",", ".")." .".$kdSupp2[$i]['wanita']."".$nmSupp2[$i]['wanita']."".number_format($jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rprev[$i]['wanita'], 0, ",", ".")."".number_format($jmlren[$i]['wanita']-$jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita']-$rprev[$i]['wanita'], 0, ",", ".")."
".number_format($tempjumlah3, 0, ",", ".")."".number_format($temphp3, 0, ",", ".")." ".number_format($tempjumlah4, 0, ",", ".")."".number_format($temphp4, 0, ",", ".")."".number_format($tempjumlah3-$tempjumlah4, 0, ",", ".")."".number_format($temphp3-$temphp4, 0, ",", ".")."
TOTAL WANITA".number_format($ttJmlBeli['wanita']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['hp'], 0, ",", ".")." ".number_format($ttJmlBeli['wanita']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['hpRev'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['jml']-$ttJmlBeli['wanita']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['hp']-$ttJmlBeli['wanita']['hpRev'], 0, ",", ".")."
Anak
~".$str[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlren[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak'], 0, ",", ".")." .".$kdSupp2[$i]['anak']."".$nmSupp2[$i]['anak']."".number_format($jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rprev[$i]['anak'], 0, ",", ".")."".number_format($jmlren[$i]['anak']-$jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak']-$rprev[$i]['anak'], 0, ",", ".")."
~".$str2[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlren[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak'], 0, ",", ".")." .".$kdSupp2[$i]['anak']."".$nmSupp2[$i]['anak']."".number_format($jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rprev[$i]['anak'], 0, ",", ".")."".number_format($jmlren[$i]['anak']-$jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak']-$rprev[$i]['anak'], 0, ",", ".")."
".number_format($tempjumlah5, 0, ",", ".")."".number_format($temphp5, 0, ",", ".")." ".number_format($tempjumlah6, 0, ",", ".")."".number_format($temphp6, 0, ",", ".")."".number_format($tempjumlah5-$tempjumlah6, 0, ",", ".")."".number_format($temphp5-$temphp6, 0, ",", ".")."
~".$str2[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlren[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak'], 0, ",", ".")." .".$kdSupp2[$i]['anak']."".$nmSupp2[$i]['anak']."".number_format($jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rprev[$i]['anak'], 0, ",", ".")."".number_format($jmlren[$i]['anak']-$jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak']-$rprev[$i]['anak'], 0, ",", ".")."
".number_format($tempjumlah1, 0, ",", ".")."".number_format($temphp1, 0, ",", ".")." ".number_format($tempjumlah2, 0, ",", ".")."".number_format($temphp2, 0, ",", ".")." ".number_format($tempjumlah1-$tempjumlah2, 0, ",", ".")."".number_format($temphp1-$temphp2, 0, ",", ".")."
~".$str2[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlren[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak'], 0, ",", ".")." .".$kdSupp2[$i]['anak']."".$nmSupp2[$i]['anak']."".number_format($jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rprev[$i]['anak'], 0, ",", ".")." ".number_format($jmlren[$i]['anak']-$jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak']-$rprev[$i]['anak'], 0, ",", ".")."
".number_format($tempjumlah5, 0, ",", ".")."".number_format($temphp5, 0, ",", ".")." ".number_format($tempjumlah6, 0, ",", ".")."".number_format($temphp6, 0, ",", ".")."".number_format($tempjumlah5-$tempjumlah6, 0, ",", ".")."".number_format($temphp5-$temphp6, 0, ",", ".")."
~".$str[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlren[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak'], 0, ",", ".")." .".$kdSupp2[$i]['anak']."".$nmSupp2[$i]['anak']."".number_format($jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rprev[$i]['anak'], 0, ",", ".")."".number_format($jmlren[$i]['anak']-$jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak']-$rprev[$i]['anak'], 0, ",", ".")."
".number_format($tempjumlah5, 0, ",", ".")."".number_format($temphp5, 0, ",", ".")." ".number_format($tempjumlah6, 0, ",", ".")."".number_format($temphp6, 0, ",", ".")."".number_format($tempjumlah5-$tempjumlah6, 0, ",", ".")."".number_format($temphp5-$temphp6, 0, ",", ".")."
TOTAL ANAK".number_format($ttJmlBeli['anak']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['hp'], 0, ",", ".")." ".number_format($ttJmlBeli['anak']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['hpRev'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['jml']-$ttJmlBeli['anak']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['hp']-$ttJmlBeli['anak']['hpRev'], 0, ",", ".")."
Sepatu
~".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlren[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu'], 0, ",", ".")." .".$kdSupp2[$i]['sepatu']."".$nmSupp2[$i]['sepatu']."".number_format($jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rprev[$i]['sepatu'], 0, ",", ".")."".number_format($jmlren[$i]['sepatu']-$jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu']-$rprev[$i]['sepatu'], 0, ",", ".")."
~".$str2[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlren[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu'], 0, ",", ".")." .".$kdSupp2[$i]['sepatu']."".$nmSupp2[$i]['sepatu']."".number_format($jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rprev[$i]['sepatu'], 0, ",", ".")."".number_format($jmlren[$i]['sepatu']-$jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu']-$rprev[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlah7, 0, ",", ".")."".number_format($temphp7, 0, ",", ".")." ".number_format($tempjumlah8, 0, ",", ".")."".number_format($temphp8, 0, ",", ".")."".number_format($tempjumlah7-$tempjumlah8, 0, ",", ".")."".number_format($temphp7-$temphp8, 0, ",", ".")."
~".$str2[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlren[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu'], 0, ",", ".")." .".$kdSupp2[$i]['sepatu']."".$nmSupp2[$i]['sepatu']."".number_format($jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rprev[$i]['sepatu'], 0, ",", ".")."".number_format($jmlren[$i]['sepatu']-$jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu']-$rprev[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlah7, 0, ",", ".")."".number_format($temphp7, 0, ",", ".")." ".number_format($tempjumlah8, 0, ",", ".")."".number_format($temphp8, 0, ",", ".")."".number_format($tempjumlah7-$tempjumlah8, 0, ",", ".")."".number_format($temphp7-$temphp8, 0, ",", ".")."
~".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlren[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu'], 0, ",", ".")." .".$kdSupp2[$i]['sepatu']."".$nmSupp2[$i]['sepatu']."".number_format($jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rprev[$i]['sepatu'], 0, ",", ".")."".number_format($jmlren[$i]['sepatu']-$jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu']-$rprev[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlah7, 0, ",", ".")."".number_format($temphp7, 0, ",", ".")." ".number_format($tempjumlah8, 0, ",", ".")."".number_format($temphp8, 0, ",", ".")."".number_format($tempjumlah7-$tempjumlah8, 0, ",", ".")."".number_format($temphp7-$temphp8, 0, ",", ".")."
TOTAL SEPATU".number_format($ttJmlBeli['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp'], 0, ",", ".")." ".number_format($ttJmlBeli['sepatu']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hpRev'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['jml']-$ttJmlBeli['sepatu']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp']-$ttJmlBeli['sepatu']['hpRev'], 0, ",", ".")."
T O T A L : ".number_format($ttjml1, 0, ",", ".")."".number_format($ttrp1, 0, ",", ".")."".number_format($ttjml2, 0, ",", ".")."".number_format($ttrp2, 0, ",", ".")."".number_format($ttjml1-$ttjml2, 0, ",", ".")."".number_format($ttrp1-$ttrp2, 0, ",", ".")."

"); + }else{ + echo "Tidak ada data untuk tanggal tersebut!"; + } + } + + } +?> diff --git a/old-source/LaporanBeli/lap_rnc_order_brgdtg.php~ b/old-source/LaporanBeli/lap_rnc_order_brgdtg.php~ new file mode 100644 index 0000000..b903e62 --- /dev/null +++ b/old-source/LaporanBeli/lap_rnc_order_brgdtg.php~ @@ -0,0 +1,642 @@ +"; + echo "div#divprint{width:1100px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:1000px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ".ijo{font-weight : bold; background-color : #00FF00;}"; + echo ".warnaBarisStrip{font-weight : bold; background-color : #FFFF33;}"; + echo ".warnaBarisKategori{font-weight : bold; background-color: #FFCC00;}"; + echo ".warnaKolPisah{font-weight : bold; background-color: #595454;}"; //#413839 + echo ".master{text-align:left;}"; + echo ""; + + $startDate = $_POST['startDate']; //kd supp + $endDate = $_POST['endDate']; // lini + $bln = $_POST['bulan']; + $thn = $_POST['tahun']; + $thnR = substr($_POST['tahun'],2,2); + + if(bukaKoneksi()){ + global $conn; + + + $queryclear1= "DROP TABLE IF EXISTS tLaporan1"; + $queryclear2= "DROP TABLE IF EXISTS tLaporan2"; + $queryclear3= "DROP TABLE IF EXISTS tLaporan3"; + $queryclear4= "DROP TABLE IF EXISTS tLaporan4"; + $queryclear5= "DROP TABLE IF EXISTS tLaporan5"; + runQuery($queryclear1); + runQuery($queryclear2); + runQuery($queryclear3); + runQuery($queryclear4); + runQuery($queryclear5); + + if ($startDate != '' and $endDate != '' and $bln != '' and $thn != ''){ + $queryTable1 = "CREATE TABLE tLaporan1 AS + SELECT st.kel_jns kel_jns1, m.kode_strip kode_strip1, d.kode_supplier kode_supplier1, s.nama_supplier nama_supplier1, sum(d.vol_revisi) jml1, sum(d.rupiah_revisi) rp1 + FROM d_rencana_beli d, m_rencana_beli m, supplier s, strip st + WHERE m.bulanR = '$bln' AND m.tahunR = '$thnR' + and m.id=d.id + and d.kode_supplier = s.kd_supplier + and m.kode_strip = st.kd_strip + and d.kode_supplier = '$startDate' + and m.kode_strip = '$endDate' + GROUP BY m.kode_strip,d.kode_supplier "; + + $queryTable2 = "CREATE TABLE tLaporan2 AS + SELECT s.kel_jns kel_jns2,d.kode_strip kode_strip2,m.kd_supplier kode_supplier2, u.nama_supplier nama_supplier2,sum(d.jumlah) jml2,sum(d.harga_order) rp2 + FROM d_order d,m_order m,supplier u,strip s + WHERE d.no_order = m.no_order + AND s.kd_strip = d.kode_strip + AND u.kd_supplier = m.kd_supplier + AND m.kd_supplier = '$startDate' + AND d.kode_strip = '$endDate' + AND month(rencana_datang) = '$bln' AND year(rencana_datang) = '$thn' + GROUP BY d.kode_strip,m.kd_supplier "; + + $queryTable3 = "CREATE TABLE tLaporan3 AS + SELECT s.kel_jns kel_jns3,left(d.kode_barang,2) kode_strip3,m.kd_supplier kode_supplier3, u.nama_supplier nama_supplier3,sum(d.jum_fisik) jml3,sum(d.harga_satuan) rp3 + FROM d_pembelian d,m_pembelian m,supplier u,strip s + WHERE d.no_faktur = m.no_faktur + AND s.kd_strip = left(d.kode_barang,2) + AND u.kd_supplier = m.kd_supplier + AND m.kd_supplier = '$startDate' + AND s.kd_strip = '$endDate' + AND month(tgl_masuk) = '$bln' AND year(tgl_masuk) = '$thn' + GROUP BY s.kd_strip,m.kd_supplier"; + + }else if ($startDate != '' and $bln != '' and $thn != ''){ + $queryTable1 = "CREATE TABLE tLaporan1 AS + SELECT st.kel_jns kel_jns1, m.kode_strip kode_strip1, d.kode_supplier kode_supplier1, s.nama_supplier nama_supplier1, sum(d.vol_revisi) jml1, sum(d.rupiah_revisi) rp1 + FROM d_rencana_beli d, m_rencana_beli m, supplier s, strip st + WHERE m.bulanR = '$bln' AND m.tahunR = '$thnR' + and m.id=d.id + and d.kode_supplier = s.kd_supplier + and m.kode_strip = st.kd_strip + and d.kode_supplier = '$startDate' + GROUP BY m.kode_strip,d.kode_supplier "; + + $queryTable2 = "CREATE TABLE tLaporan2 AS + SELECT s.kel_jns kel_jns2,d.kode_strip kode_strip2,m.kd_supplier kode_supplier2, u.nama_supplier nama_supplier2,sum(d.jumlah) jml2,sum(d.harga_order) rp2 + FROM d_order d,m_order m,supplier u,strip s + WHERE d.no_order = m.no_order + AND s.kd_strip = d.kode_strip + AND u.kd_supplier = m.kd_supplier + AND m.kd_supplier = '$startDate' + AND month(rencana_datang) = '$bln' AND year(rencana_datang) = '$thn' + GROUP BY d.kode_strip,m.kd_supplier "; + + $queryTable3 = "CREATE TABLE tLaporan3 AS + SELECT s.kel_jns kel_jns3,left(d.kode_barang,2) kode_strip3,m.kd_supplier kode_supplier3, u.nama_supplier nama_supplier3,sum(d.jum_fisik) jml3,sum(d.harga_satuan) rp3 + FROM d_pembelian d,m_pembelian m,supplier u,strip s + WHERE d.no_faktur = m.no_faktur + AND s.kd_strip = left(d.kode_barang,2) + AND u.kd_supplier = m.kd_supplier + AND m.kd_supplier = '$startDate' + AND month(tgl_masuk) = '$bln' AND year(tgl_masuk) = '$thn' + GROUP BY s.kd_strip,m.kd_supplier"; + + }else if ($endDate != '' and $bln != '' and $thn != ''){ + $queryTable1 = "CREATE TABLE tLaporan1 AS + SELECT st.kel_jns kel_jns1, m.kode_strip kode_strip1, d.kode_supplier kode_supplier1, s.nama_supplier nama_supplier1, sum(d.vol_revisi) jml1, sum(d.rupiah_revisi) rp1 + FROM d_rencana_beli d, m_rencana_beli m, supplier s, strip st + WHERE m.bulanR = '$bln' AND m.tahunR = '$thnR' + and m.id=d.id + and d.kode_supplier = s.kd_supplier + and m.kode_strip = st.kd_strip + and m.kode_strip = '$endDate' + GROUP BY m.kode_strip,d.kode_supplier "; + + $queryTable2 = "CREATE TABLE tLaporan2 AS + SELECT s.kel_jns kel_jns2,d.kode_strip kode_strip2,m.kd_supplier kode_supplier2, u.nama_supplier nama_supplier2,sum(d.jumlah) jml2,sum(d.harga_order) rp2 + FROM d_order d,m_order m,supplier u,strip s + WHERE d.no_order = m.no_order + AND s.kd_strip = d.kode_strip + AND u.kd_supplier = m.kd_supplier + AND d.kode_strip = '$endDate' + AND month(rencana_datang) = '$bln' AND year(rencana_datang) = '$thn' + GROUP BY d.kode_strip,m.kd_supplier "; + + $queryTable3 = "CREATE TABLE tLaporan3 AS + SELECT s.kel_jns kel_jns3,left(d.kode_barang,2) kode_strip3,m.kd_supplier kode_supplier3, u.nama_supplier nama_supplier3,sum(d.jum_fisik) jml3,sum(d.harga_satuan) rp3 + FROM d_pembelian d,m_pembelian m,supplier u,strip s + WHERE d.no_faktur = m.no_faktur + AND s.kd_strip = left(d.kode_barang,2) + AND u.kd_supplier = m.kd_supplier + AND s.kd_strip = '$endDate' + AND month(tgl_masuk) = '$bln' AND year(tgl_masuk) = '$thn' + GROUP BY s.kd_strip,m.kd_supplier"; + + }else{ + $queryTable1 = "CREATE TABLE tLaporan1 AS + SELECT st.kel_jns kel_jns1, m.kode_strip kode_strip1, d.kode_supplier kode_supplier1, s.nama_supplier nama_supplier1, sum(d.vol_revisi) jml1, sum(d.rupiah_revisi) rp1 + FROM d_rencana_beli d, m_rencana_beli m, supplier s, strip st + WHERE m.bulanR = '$bln' AND m.tahunR = '$thnR' + and m.id=d.id + and d.kode_supplier = s.kd_supplier + and m.kode_strip = st.kd_strip + GROUP BY m.kode_strip,d.kode_supplier "; + + $queryTable2 = "CREATE TABLE tLaporan2 AS + SELECT s.kel_jns kel_jns2,d.kode_strip kode_strip2,m.kd_supplier kode_supplier2, u.nama_supplier nama_supplier2,sum(d.jumlah) jml2,sum(d.harga_order) rp2 + FROM d_order d,m_order m,supplier u,strip s + WHERE d.no_order = m.no_order + AND s.kd_strip = d.kode_strip + AND u.kd_supplier = m.kd_supplier + AND month(rencana_datang) = '$bln' AND year(rencana_datang) = '$thn' + GROUP BY d.kode_strip,m.kd_supplier "; + + $queryTable3 = "CREATE TABLE tLaporan3 AS + SELECT s.kel_jns kel_jns3,left(d.kode_barang,2) kode_strip3,m.kd_supplier kode_supplier3, u.nama_supplier nama_supplier3,sum(d.jum_fisik) jml3,sum(d.harga_satuan) rp3 + FROM d_pembelian d,m_pembelian m,supplier u,strip s + WHERE d.no_faktur = m.no_faktur + AND s.kd_strip = left(d.kode_barang,2) + AND u.kd_supplier = m.kd_supplier + AND month(tgl_masuk) = '$bln' AND year(tgl_masuk) = '$thn' + GROUP BY s.kd_strip,m.kd_supplier"; + } + + $queryTable4 = "CREATE TABLE tLaporan4 AS + SELECT t4.kel_jns1,t4.kode_strip1,t4.kode_supplier1,t4.nama_supplier1,t4.jml1,t4.rp1,t4.kel_jns2,t4.kode_strip2,t4.kode_supplier2,t4.nama_supplier2,t4.jml2,t4.rp2 + FROM + (SELECT t1.*,t2.* + FROM tLaporan1 t1 LEFT OUTER JOIN tLaporan2 t2 ON + t1.kode_strip1 = t2.kode_strip2 AND t1.kode_supplier1 = t2.kode_supplier2 + UNION ALL + SELECT t1.*,t2.* + FROM tLaporan1 t1 RIGHT OUTER JOIN tLaporan2 t2 ON + t1.kode_strip1 = t2.kode_strip2 AND t1.kode_supplier1 = t2.kode_supplier2 + WHERE t1.kode_strip1 IS NULL) t4 "; + + $queryTable5 = "CREATE TABLE tLaporan5 AS + SELECT * from tLaporan4 t4 LEFT JOIN tLaporan3 t3 + ON (t4.kode_strip2 = t3.kode_strip3 AND t4.kode_supplier2 = t3.kode_supplier3)"; + + $query = "SELECT * FROM tLaporan5 t ORDER BY t.kel_jns2,t.kel_jns1,t.kode_strip2,t.kode_strip1,t.kode_supplier2,t.kode_supplier1 "; + + runQuery($queryTable1); + runQuery($queryTable2); + runQuery($queryTable3); + runQuery($queryTable4); + runQuery($queryTable5); + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek >= 0){ + mysqli_stmt_bind_result($stmt,$kelJns,$strip,$kd,$nm,$vrenc,$hprenc,$kelJns2,$strip2,$kd2,$nm2,$vrev,$hprev,$kelJnsBeli,$stripBeli,$kdBeli,$nmBeli,$vBeli,$hpBeli); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['pria']['jmlRev'] = 0; + $ttJmlBeli['pria']['hpRev'] = 0; + $ttJmlBeli['pria']['jmlBeli'] = 0; + $ttJmlBeli['pria']['hpBeli'] = 0; + + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['wanita']['jmlRev'] = 0; + $ttJmlBeli['wanita']['hpRev'] = 0; + $ttJmlBeli['wanita']['jmlBeli'] = 0; + $ttJmlBeli['wanita']['hpBeli'] = 0; + + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['anak']['jmlRev'] = 0; + $ttJmlBeli['anak']['hpRev'] = 0; + $ttJmlBeli['anak']['jmlBeli'] = 0; + $ttJmlBeli['anak']['hpBeli'] = 0; + + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + $ttJmlBeli['sepatu']['jmlRev'] = 0; + $ttJmlBeli['sepatu']['hpRev'] = 0; + $ttJmlBeli['sepatu']['jmlBeli'] = 0; + $ttJmlBeli['sepatu']['hpBeli'] = 0; + + print("
"); + print("

Laporan Rencana, Realisasi Order & Barang Datang



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."

"); + print("Bulan Order : ".$bln."
"); + print("Tahun Order : ".$_POST['tahun']."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $str = array(); + $strOrd = array(); + $strBeli = array(); + $jmlren = array(); + $rpren = array(); + $jmlrev = array(); + $rprev = array(); + $jmlBeli = array(); + $rpBeli = array(); + + while(mysqli_stmt_fetch($stmt)){ + if($kelJns == "P" OR $kelJns2 == "P"){ + $kelJns = "Pria"; + $ttJmlBeli['pria']['jml'] += $vrenc; + $ttJmlBeli['pria']['hp'] += $hprenc; + $ttJmlBeli['pria']['jmlRev'] += $vrev; + $ttJmlBeli['pria']['hpRev'] += $hprev; + $ttJmlBeli['pria']['jmlBeli'] += $vBeli; + $ttJmlBeli['pria']['hpBeli'] += $hpBeli; + $str[$pria]['pria'] = strtoupper($strip); + $strOrd[$pria]['pria'] = strtoupper($strip2); + $strBeli[$pria]['pria'] = strtoupper($stripBeli); + $jmlren[$pria]['pria'] = $vrenc; + $rpren[$pria]['pria'] = $hprenc; + $jmlrev[$pria]['pria'] = $vrev; + $rprev[$pria]['pria'] = $hprev; + $jmlBeli[$pria]['pria'] = $vBeli; + $rpBeli[$pria]['pria'] = $hpBeli; + $kdSupp[$pria]['pria'] = $kd; + $nmSupp[$pria]['pria'] = $nm; + $kdSuppOrd[$pria]['pria'] = $kd2; + $nmSuppOrd[$pria]['pria'] = $nm2; + $kdSuppBeli[$pria]['pria'] = $kdBeli; + $nmSuppBeli[$pria]['pria'] = $nmBeli; + $pria++; + }elseif($kelJns == "W" OR $kelJns2 == "W"){ + $kelJns = "Wanita"; + $ttJmlBeli['wanita']['jml'] += $vrenc; + $ttJmlBeli['wanita']['hp'] += $hprenc; + $ttJmlBeli['wanita']['jmlRev'] += $vrev; + $ttJmlBeli['wanita']['hpRev'] += $hprev; + $ttJmlBeli['wanita']['jmlBeli'] += $vBeli; + $ttJmlBeli['wanita']['hpBeli'] += $hpBeli; + $str[$wanita]['wanita'] = strtoupper($strip); + $strOrd[$wanita]['wanita'] = strtoupper($strip2); + $strBeli[$wanita]['wanita'] = strtoupper($stripBeli); + $jmlren[$wanita]['wanita'] = $vrenc; + $rpren[$wanita]['wanita'] = $hprenc; + $jmlrev[$wanita]['wanita'] = $vrev; + $rprev[$wanita]['wanita'] = $hprev; + $jmlBeli[$wanita]['wanita'] = $vBeli; + $rpBeli[$wanita]['wanita'] = $hpBeli; + $kdSupp[$wanita]['wanita'] = $kd; + $nmSupp[$wanita]['wanita'] = $nm; + $kdSuppOrd[$wanita]['wanita'] = $kd2; + $nmSuppOrd[$wanita]['wanita'] = $nm2; + $kdSuppBeli[$wanita]['wanita'] = $kdBeli; + $nmSuppBeli[$wanita]['wanita'] = $nmBeli; + $wanita++; + }elseif($kelJns == "A" OR $kelJns2 == "A"){ + $kelJns = "Anak"; + $ttJmlBeli['anak']['jml'] += $vrenc; + $ttJmlBeli['anak']['hp'] += $hprenc; + $ttJmlBeli['anak']['jmlRev'] += $vrev; + $ttJmlBeli['anak']['hpRev'] += $hprev; + $ttJmlBeli['anak']['jmlBeli'] += $vBeli; + $ttJmlBeli['anak']['hpBeli'] += $hpBeli; + $str[$anak]['anak'] = strtoupper($strip); + $strOrd[$anak]['anak'] = strtoupper($strip2); + $strBeli[$anak]['anak'] = strtoupper($stripBeli); + $jmlren[$anak]['anak'] = $vrenc; + $rpren[$anak]['anak'] = $hprenc; + $jmlrev[$anak]['anak'] = $vrev; + $rprev[$anak]['anak'] = $hprev; + $jmlBeli[$anak]['anak'] = $vBeli; + $rpBeli[$anak]['anak'] = $hpBeli; + $kdSupp[$anak]['anak'] = $kd; + $nmSupp[$anak]['anak'] = $nm; + $kdSuppOrd[$anak]['anak'] = $kd2; + $nmSuppOrd[$anak]['anak'] = $nm2; + $kdSuppBeli[$anak]['anak'] = $kdBeli; + $nmSuppBeli[$anak]['anak'] = $nmBeli; + $anak++; + }else{ + $kelJns = "Sepatu"; + $ttJmlBeli['sepatu']['jml'] += $vrenc; + $ttJmlBeli['sepatu']['hp'] += $hprenc; + $ttJmlBeli['sepatu']['jmlRev'] += $vrev; + $ttJmlBeli['sepatu']['hpRev'] += $hprev; + $ttJmlBeli['sepatu']['jmlBeli'] += $vBeli; + $ttJmlBeli['sepatu']['hpBeli'] += $hpBeli; + $str[$sepatu]['sepatu'] = strtoupper($strip); + $strOrd[$sepatu]['sepatu'] = strtoupper($strip2); + $strBeli[$sepatu]['sepatu'] = strtoupper($stripBeli); + $jmlren[$sepatu]['sepatu'] = $vrenc; + $rpren[$sepatu]['sepatu'] = $hprenc; + $jmlrev[$sepatu]['sepatu'] = $vrev; + $rprev[$sepatu]['sepatu'] = $hprev; + $jmlBeli[$sepatu]['sepatu'] = $vBeli; + $rpBeli[$sepatu]['sepatu'] = $hpBeli; + $kdSupp[$sepatu]['sepatu'] = $kd; + $nmSupp[$sepatu]['sepatu'] = $nm; + $kdSuppOrd[$sepatu]['sepatu'] = $kd2; + $nmSuppOrd[$sepatu]['sepatu'] = $nm2; + $kdSuppBeli[$sepatu]['sepatu'] = $kdBeli; + $nmSuppBeli[$sepatu]['sepatu'] = $nmBeli; + $sepatu++; + } + + } + print(""); + print(""); + print("
"); + +// PRIA ------------------------------------------------------------------------- + if($ttJmlBeli['pria']['jml']!=0 OR $ttJmlBeli['pria']['jmlRev']!=0){ + print("
"); + for($i=0;$i<$pria;$i++){ + if ($str[$i-1]['pria']==$str[$i]['pria'] AND !empty($str[$i]['pria'])){ + if ($str[$i-1]['pria']==$str[$i]['pria'] AND empty($strOrd[$i]['pria'])){ + print(""); + }else{ + print(""); + } + + }else if ($str[$i-1]['pria']==$str[$i]['pria'] AND empty($str[$i]['pria'])){ + if ($strOrd[$i-1]['pria']==$strOrd[$i]['pria']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlahA = 0; + $temphpA = 0; + $tempjumlahB = 0; + $temphpB = 0; + $tempjumlahC = 0; + $temphpC = 0; + } + + }else{ + if (empty($strOrd[$i]['pria'])){ + print(""); + print(""); + }else if ($str[$i-1]['pria']!=$str[$i]['pria'] AND empty($str[$i]['pria'])){ + $tempjspria = 0; + $temprppria = 0; + print(""); + print(""); + }else{ + print(""); + print(""); + } + $tempjumlahA = 0; + $temphpA = 0; + $tempjumlahB = 0; + $temphpB = 0; + $tempjumlahC = 0; + $temphpC = 0; + } + $tempjumlahA += $jmlren[$i]['pria']; + $temphpA += $rpren[$i]['pria']; + $tempjumlahB += $jmlrev[$i]['pria']; + $temphpB += $rprev[$i]['pria']; + $tempjumlahC += $jmlBeli[$i]['pria']; + $temphpC += $rpBeli[$i]['pria']; + $tempjspria += ($jmlren[$i]['pria']-$jmlrev[$i]['pria']); + $temprppria += ($rpren[$i]['pria']-$rprev[$i]['pria']); + + } + print(""); + } + print(""); + if( ($ttJmlBeli['pria']['jmlRev']>$ttJmlBeli['pria']['jmlBeli']) OR ($ttJmlBeli['pria']['hpRev']>$ttJmlBeli['pria']['hpBeli']) ){ + $jmlSisaJthpria = $ttJmlBeli['pria']['jml']-$ttJmlBeli['pria']['jmlRev']; + $hpSisaJthpria = $ttJmlBeli['pria']['hp']-$ttJmlBeli['pria']['hpRev']; + }else{ + $jmlSisaJthpria = $ttJmlBeli['pria']['jml']-$ttJmlBeli['pria']['jmlBeli']; + $hpSisaJthpria = $ttJmlBeli['pria']['hp']-$ttJmlBeli['pria']['hpBeli']; + } + print(""); + +// WANITA ------------------------------------------------------------------------- + if($ttJmlBeli['wanita']['jml']!=0 OR $ttJmlBeli['wanita']['jmlRev']!=0){ + print(""); + for($i=0;$i<$wanita;$i++){ + if ($str[$i-1]['wanita']==$str[$i]['wanita'] AND !empty($str[$i]['wanita'])){ + if ($str[$i-1]['wanita']==$str[$i]['wanita'] AND empty($strOrd[$i]['wanita'])){ + print(""); + }else{ + print(""); + } + + }else if ($str[$i-1]['wanita']==$str[$i]['wanita'] AND empty($str[$i]['wanita'])){ + if ($strOrd[$i-1]['wanita']==$strOrd[$i]['wanita']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlahD = 0; + $temphpD = 0; + $tempjumlahE = 0; + $temphpE = 0; + $tempjumlahF = 0; + $temphpF = 0; + } + + }else{ + if (empty($strOrd[$i]['wanita'])){ + print(""); + print(""); + }else if ($str[$i-1]['wanita']!=$str[$i]['wanita'] AND empty($str[$i]['wanita'])){ + $tempjswanita = 0; + $temprpwanita = 0; + print(""); + print(""); + }else{ + print(""); + print(""); + } + $tempjumlahD = 0; + $temphpD = 0; + $tempjumlahE = 0; + $temphpE = 0; + $tempjumlahF = 0; + $temphpF = 0; + } + $tempjumlahD += $jmlren[$i]['wanita']; + $temphpD += $rpren[$i]['wanita']; + $tempjumlahE += $jmlrev[$i]['wanita']; + $temphpE += $rprev[$i]['wanita']; + $tempjumlahF += $jmlBeli[$i]['wanita']; + $temphpF += $rpBeli[$i]['wanita']; + $tempjswanita += ($jmlren[$i]['wanita']-$jmlrev[$i]['wanita']); + $temprpwanita += ($rpren[$i]['wanita']-$rprev[$i]['wanita']); + + } + print(""); + } + print(""); + if( ($ttJmlBeli['wanita']['jmlRev']>$ttJmlBeli['wanita']['jmlBeli']) OR ($ttJmlBeli['wanita']['hpRev']>$ttJmlBeli['wanita']['hpBeli']) ){ + $jmlSisaJthwanita = $ttJmlBeli['wanita']['jml']-$ttJmlBeli['wanita']['jmlRev']; + $hpSisaJthwanita = $ttJmlBeli['wanita']['hp']-$ttJmlBeli['wanita']['hpRev']; + }else{ + $jmlSisaJthwanita = $ttJmlBeli['wanita']['jml']-$ttJmlBeli['wanita']['jmlBeli']; + $hpSisaJthwanita = $ttJmlBeli['wanita']['hp']-$ttJmlBeli['wanita']['hpBeli']; + } + print(""); +// ANAK ------------------------------------------------------------------------- + if($ttJmlBeli['anak']['jml']!=0 OR $ttJmlBeli['anak']['jmlRev']!=0){ + print(""); + for($i=0;$i<$anak;$i++){ + if ($str[$i-1]['anak']==$str[$i]['anak'] AND !empty($str[$i]['anak'])){ + if ($str[$i-1]['anak']==$str[$i]['anak'] AND empty($strOrd[$i]['anak'])){ + print(""); + }else{ + print(""); + } + + }else if ($str[$i-1]['anak']==$str[$i]['anak'] AND empty($str[$i]['anak'])){ + if ($strOrd[$i-1]['anak']==$strOrd[$i]['anak']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlahG = 0; + $temphpG = 0; + $tempjumlahH = 0; + $temphpH = 0; + $tempjumlahI = 0; + $temphpI = 0; + } + + }else{ + if (empty($strOrd[$i]['anak'])){ + print(""); + print(""); + }else if ($str[$i-1]['anak']!=$str[$i]['anak'] AND empty($str[$i]['anak'])){ + $tempjsanak = 0; + $temprpanak = 0; + print(""); + print(""); + }else{ + print(""); + print(""); + } + $tempjumlahG = 0; + $temphpG = 0; + $tempjumlahH = 0; + $temphpH = 0; + $tempjumlahI = 0; + $temphpI = 0; + } + $tempjumlahG += $jmlren[$i]['anak']; + $temphpG += $rpren[$i]['anak']; + $tempjumlahH += $jmlrev[$i]['anak']; + $temphpH += $rprev[$i]['anak']; + $tempjumlahI += $jmlBeli[$i]['anak']; + $temphpI += $rpBeli[$i]['anak']; + $tempjsanak += ($jmlren[$i]['anak']-$jmlrev[$i]['anak']); + $temprpanak += ($rpren[$i]['anak']-$rprev[$i]['anak']); + + } + print(""); + } + print(""); + if( ($ttJmlBeli['anak']['jmlRev']>$ttJmlBeli['anak']['jmlBeli']) OR ($ttJmlBeli['anak']['hpRev']>$ttJmlBeli['anak']['hpBeli']) ){ + $jmlSisaJthanak = $ttJmlBeli['anak']['jml']-$ttJmlBeli['anak']['jmlRev']; + $hpSisaJthanak = $ttJmlBeli['anak']['hp']-$ttJmlBeli['anak']['hpRev']; + }else{ + $jmlSisaJthanak = $ttJmlBeli['anak']['jml']-$ttJmlBeli['anak']['jmlBeli']; + $hpSisaJthanak = $ttJmlBeli['anak']['hp']-$ttJmlBeli['anak']['hpBeli']; + } + print(""); +// SEPATU ------------------------------------------------------------------------- + if($ttJmlBeli['sepatu']['jml']!=0 OR $ttJmlBeli['sepatu']['jmlRev']!=0){ + print(""); + for($i=0;$i<$sepatu;$i++){ + if ($str[$i-1]['sepatu']==$str[$i]['sepatu'] AND !empty($str[$i]['sepatu'])){ + if ($str[$i-1]['sepatu']==$str[$i]['sepatu'] AND empty($strOrd[$i]['sepatu'])){ + print(""); + }else{ + print(""); + } + + }else if ($str[$i-1]['sepatu']==$str[$i]['sepatu'] AND empty($str[$i]['sepatu'])){ + if ($strOrd[$i-1]['sepatu']==$strOrd[$i]['sepatu']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlahJ = 0; + $temphpJ = 0; + $tempjumlahK = 0; + $temphpK = 0; + $tempjumlahL = 0; + $temphpL = 0; + } + + }else{ + if (empty($strOrd[$i]['sepatu'])){ + print(""); + print(""); + }else if ($str[$i-1]['sepatu']!=$str[$i]['sepatu'] AND empty($str[$i]['sepatu'])){ + $tempjssepatu = 0; + $temprpsepatu = 0; + print(""); + print(""); + }else{ + print(""); + print(""); + } + $tempjumlahJ = 0; + $temphpJ = 0; + $tempjumlahK = 0; + $temphpK = 0; + $tempjumlahL = 0; + $temphpL = 0; + } + $tempjumlahJ += $jmlren[$i]['sepatu']; + $temphpJ += $rpren[$i]['sepatu']; + $tempjumlahK += $jmlrev[$i]['sepatu']; + $temphpK += $rprev[$i]['sepatu']; + $tempjumlahL += $jmlBeli[$i]['sepatu']; + $temphpL += $rpBeli[$i]['sepatu']; + $tempjssepatu += ($jmlren[$i]['sepatu']-$jmlrev[$i]['sepatu']); + $temprpsepatu += ($rpren[$i]['sepatu']-$rprev[$i]['sepatu']); + + } + print(""); + } + print(""); + if( ($ttJmlBeli['sepatu']['jmlRev']>$ttJmlBeli['sepatu']['jmlBeli']) OR ($ttJmlBeli['sepatu']['hpRev']>$ttJmlBeli['sepatu']['hpBeli']) ){ + $jmlSisaJthsepatu = $ttJmlBeli['sepatu']['jml']-$ttJmlBeli['sepatu']['jmlRev']; + $hpSisaJthsepatu = $ttJmlBeli['sepatu']['hp']-$ttJmlBeli['sepatu']['hpRev']; + }else{ + $jmlSisaJthsepatu = $ttJmlBeli['sepatu']['jml']-$ttJmlBeli['sepatu']['jmlBeli']; + $hpSisaJthsepatu = $ttJmlBeli['sepatu']['hp']-$ttJmlBeli['sepatu']['hpBeli']; + } + print(""); + + $ttjml1 = $ttJmlBeli['pria']['jml'] + $ttJmlBeli['wanita']['jml'] + $ttJmlBeli['anak']['jml'] + $ttJmlBeli['sepatu']['jml']; + $ttrp1 = $ttJmlBeli['pria']['hp'] + $ttJmlBeli['wanita']['hp'] + $ttJmlBeli['anak']['hp'] + $ttJmlBeli['sepatu']['hp']; + $ttjml2 = $ttJmlBeli['pria']['jmlRev'] + $ttJmlBeli['wanita']['jmlRev'] + $ttJmlBeli['anak']['jmlRev'] + $ttJmlBeli['sepatu']['jmlRev']; + $ttrp2 = $ttJmlBeli['pria']['hpRev'] + $ttJmlBeli['wanita']['hpRev'] + $ttJmlBeli['anak']['hpRev'] + $ttJmlBeli['sepatu']['hpRev']; + $ttjselisih = $tempjspria + $tempjswanita + $tempjsanak + $tempjssepatu; + $ttrpselisih = $temprppria + $temprpwanita + $temprpanak + $temprpsepatu; + + print(" + + + + "); + + print("
KategoriLiniKode SuppNama SuppJml RencTotHP Renc Kode SuppNama SuppJml OrderTotHP Order Kode SuppNama SuppJml BeliTotHP Beli Jml PenyimpanganTotHP Penyimpangan
Pria
~".$str[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlren[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria'], 0, ",", ".")." .".$kdSuppOrd[$i]['pria']."".$nmSuppOrd[$i]['pria']."".number_format($jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rprev[$i]['pria'], 0, ",", ".")." .".$kdSuppBeli[$i]['pria']."".$nmSuppBeli[$i]['pria']."".number_format($jmlBeli[$i]['pria'], 0, ",", ".")."".number_format($rpBeli[$i]['pria'], 0, ",", ".")."
~".$str[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlren[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria'], 0, ",", ".")." .".$kdSuppOrd[$i]['pria']."".$nmSuppOrd[$i]['pria']."".number_format($jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rprev[$i]['pria'], 0, ",", ".")." .".$kdSuppBeli[$i]['pria']."".$nmSuppBeli[$i]['pria']."".number_format($jmlBeli[$i]['pria'], 0, ",", ".")."".number_format($rpBeli[$i]['pria'], 0, ",", ".")." ".number_format($jmlren[$i]['pria']-$jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria']-$rprev[$i]['pria'], 0, ",", ".")."
~".$strOrd[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlren[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria'], 0, ",", ".")." .".$kdSuppOrd[$i]['pria']."".$nmSuppOrd[$i]['pria']."".number_format($jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rprev[$i]['pria'], 0, ",", ".")." .".$kdSuppBeli[$i]['pria']."".$nmSuppBeli[$i]['pria']."".number_format($jmlBeli[$i]['pria'], 0, ",", ".")."".number_format($rpBeli[$i]['pria'], 0, ",", ".")." ".number_format($jmlren[$i]['pria']-$jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria']-$rprev[$i]['pria'], 0, ",", ".")."
".number_format($tempjumlahA, 0, ",", ".")."".number_format($temphpA, 0, ",", ".")." ".number_format($tempjumlahB, 0, ",", ".")."".number_format($temphpB, 0, ",", ".")." ".number_format($tempjumlahC, 0, ",", ".")."".number_format($temphpC, 0, ",", ".")." ".number_format($tempjumlahA-$tempjumlahB, 0, ",", ".")."".number_format($temphpA-$temphpB, 0, ",", ".")."
~".$strOrd[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlren[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria'], 0, ",", ".")." .".$kdSuppOrd[$i]['pria']."".$nmSuppOrd[$i]['pria']."".number_format($jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rprev[$i]['pria'], 0, ",", ".")." .".$kdSuppBeli[$i]['pria']."".$nmSuppBeli[$i]['pria']."".number_format($jmlBeli[$i]['pria'], 0, ",", ".")."".number_format($rpBeli[$i]['pria'], 0, ",", ".")." ".number_format($jmlren[$i]['pria']-$jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria']-$rprev[$i]['pria'], 0, ",", ".")."
".number_format($tempjumlahA, 0, ",", ".")."".number_format($temphpA, 0, ",", ".")." ".number_format($tempjumlahB, 0, ",", ".")."".number_format($temphpB, 0, ",", ".")." ".number_format($tempjumlahC, 0, ",", ".")."".number_format($temphpC, 0, ",", ".")."
~".$str[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlren[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria'], 0, ",", ".")." .".$kdSuppOrd[$i]['pria']."".$nmSuppOrd[$i]['pria']."".number_format($jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rprev[$i]['pria'], 0, ",", ".")." .".$kdSuppBeli[$i]['pria']."".$nmSuppBeli[$i]['pria']."".number_format($jmlBeli[$i]['pria'], 0, ",", ".")."".number_format($rpBeli[$i]['pria'], 0, ",", ".")."
".number_format($tempjumlahA, 0, ",", ".")."".number_format($temphpA, 0, ",", ".")." ".number_format($tempjumlahB, 0, ",", ".")."".number_format($temphpB, 0, ",", ".")." ".number_format($tempjumlahC, 0, ",", ".")."".number_format($temphpC, 0, ",", ".")."
~".$strOrd[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlren[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria'], 0, ",", ".")." .".$kdSuppOrd[$i]['pria']."".$nmSuppOrd[$i]['pria']."".number_format($jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rprev[$i]['pria'], 0, ",", ".")." .".$kdSuppBeli[$i]['pria']."".$nmSuppBeli[$i]['pria']."".number_format($jmlBeli[$i]['pria'], 0, ",", ".")."".number_format($rpBeli[$i]['pria'], 0, ",", ".")." ".number_format($jmlren[$i]['pria']-$jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria']-$rprev[$i]['pria'], 0, ",", ".")."
".number_format($tempjumlahA, 0, ",", ".")."".number_format($temphpA, 0, ",", ".")." ".number_format($tempjumlahB, 0, ",", ".")."".number_format($temphpB, 0, ",", ".")." ".number_format($tempjumlahC, 0, ",", ".")."".number_format($temphpC, 0, ",", ".")." ".number_format($tempjumlahA-$tempjumlahB, 0, ",", ".")."".number_format($temphpA-$temphpB, 0, ",", ".")."
~".$str[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlren[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria'], 0, ",", ".")." .".$kdSuppOrd[$i]['pria']."".$nmSuppOrd[$i]['pria']."".number_format($jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rprev[$i]['pria'], 0, ",", ".")." .".$kdSuppBeli[$i]['pria']."".$nmSuppBeli[$i]['pria']."".number_format($jmlBeli[$i]['pria'], 0, ",", ".")."".number_format($rpBeli[$i]['pria'], 0, ",", ".")." ".number_format($jmlren[$i]['pria']-$jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria']-$rprev[$i]['pria'], 0, ",", ".")."
".number_format($tempjumlahA, 0, ",", ".")."".number_format($temphpA, 0, ",", ".")." ".number_format($tempjumlahB, 0, ",", ".")."".number_format($temphpB, 0, ",", ".")." ".number_format($tempjumlahC, 0, ",", ".")."".number_format($temphpC, 0, ",", ".")." ".number_format($tempjumlahA-$tempjumlahB, 0, ",", ".")."".number_format($temphpA-$temphpB, 0, ",", ".")."
TOTAL Pria".number_format($ttJmlBeli['pria']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['hp'], 0, ",", ".")." ".number_format($ttJmlBeli['pria']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['hpRev'], 0, ",", ".")." ".number_format($ttJmlBeli['pria']['jmlBeli'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['hpBeli'], 0, ",", ".")." ".number_format($tempjspria, 0, ",", ".")."".number_format($temprppria, 0, ",", ".")."
SISA JATAH".number_format($jmlSisaJthpria, 0, ",", ".")." ".number_format($hpSisaJthpria, 0, ",", ".")."
Wanita
~".$str[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlren[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita'], 0, ",", ".")." .".$kdSuppOrd[$i]['wanita']."".$nmSuppOrd[$i]['wanita']."".number_format($jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rprev[$i]['wanita'], 0, ",", ".")." .".$kdSuppBeli[$i]['wanita']."".$nmSuppBeli[$i]['wanita']."".number_format($jmlBeli[$i]['wanita'], 0, ",", ".")."".number_format($rpBeli[$i]['wanita'], 0, ",", ".")."
~".$str[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlren[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita'], 0, ",", ".")." .".$kdSuppOrd[$i]['wanita']."".$nmSuppOrd[$i]['wanita']."".number_format($jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rprev[$i]['wanita'], 0, ",", ".")." .".$kdSuppBeli[$i]['wanita']."".$nmSuppBeli[$i]['wanita']."".number_format($jmlBeli[$i]['wanita'], 0, ",", ".")."".number_format($rpBeli[$i]['wanita'], 0, ",", ".")." ".number_format($jmlren[$i]['wanita']-$jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita']-$rprev[$i]['wanita'], 0, ",", ".")."
~".$strOrd[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlren[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita'], 0, ",", ".")." .".$kdSuppOrd[$i]['wanita']."".$nmSuppOrd[$i]['wanita']."".number_format($jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rprev[$i]['wanita'], 0, ",", ".")." .".$kdSuppBeli[$i]['wanita']."".$nmSuppBeli[$i]['wanita']."".number_format($jmlBeli[$i]['wanita'], 0, ",", ".")."".number_format($rpBeli[$i]['wanita'], 0, ",", ".")." ".number_format($jmlren[$i]['wanita']-$jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita']-$rprev[$i]['wanita'], 0, ",", ".")."
".number_format($tempjumlahD, 0, ",", ".")."".number_format($temphpD, 0, ",", ".")." ".number_format($tempjumlahE, 0, ",", ".")."".number_format($temphpE, 0, ",", ".")." ".number_format($tempjumlahF, 0, ",", ".")."".number_format($temphpF, 0, ",", ".")." ".number_format($tempjumlahD-$tempjumlahE, 0, ",", ".")."".number_format($temphpD-$temphpE, 0, ",", ".")."
~".$strOrd[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlren[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita'], 0, ",", ".")." .".$kdSuppOrd[$i]['wanita']."".$nmSuppOrd[$i]['wanita']."".number_format($jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rprev[$i]['wanita'], 0, ",", ".")." .".$kdSuppBeli[$i]['wanita']."".$nmSuppBeli[$i]['wanita']."".number_format($jmlBeli[$i]['wanita'], 0, ",", ".")."".number_format($rpBeli[$i]['wanita'], 0, ",", ".")." ".number_format($jmlren[$i]['wanita']-$jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita']-$rprev[$i]['wanita'], 0, ",", ".")."
".number_format($tempjumlahD, 0, ",", ".")."".number_format($temphpD, 0, ",", ".")." ".number_format($tempjumlahE, 0, ",", ".")."".number_format($temphpE, 0, ",", ".")." ".number_format($tempjumlahF, 0, ",", ".")."".number_format($temphpF, 0, ",", ".")."
~".$str[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlren[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita'], 0, ",", ".")." .".$kdSuppOrd[$i]['wanita']."".$nmSuppOrd[$i]['wanita']."".number_format($jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rprev[$i]['wanita'], 0, ",", ".")." .".$kdSuppBeli[$i]['wanita']."".$nmSuppBeli[$i]['wanita']."".number_format($jmlBeli[$i]['wanita'], 0, ",", ".")."".number_format($rpBeli[$i]['wanita'], 0, ",", ".")."
".number_format($tempjumlahD, 0, ",", ".")."".number_format($temphpD, 0, ",", ".")." ".number_format($tempjumlahE, 0, ",", ".")."".number_format($temphpE, 0, ",", ".")." ".number_format($tempjumlahF, 0, ",", ".")."".number_format($temphpF, 0, ",", ".")."
~".$strOrd[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlren[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita'], 0, ",", ".")." .".$kdSuppOrd[$i]['wanita']."".$nmSuppOrd[$i]['wanita']."".number_format($jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rprev[$i]['wanita'], 0, ",", ".")." .".$kdSuppBeli[$i]['wanita']."".$nmSuppBeli[$i]['wanita']."".number_format($jmlBeli[$i]['wanita'], 0, ",", ".")."".number_format($rpBeli[$i]['wanita'], 0, ",", ".")." ".number_format($jmlren[$i]['wanita']-$jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita']-$rprev[$i]['wanita'], 0, ",", ".")."
".number_format($tempjumlahD, 0, ",", ".")."".number_format($temphpD, 0, ",", ".")." ".number_format($tempjumlahE, 0, ",", ".")."".number_format($temphpE, 0, ",", ".")." ".number_format($tempjumlahF, 0, ",", ".")."".number_format($temphpF, 0, ",", ".")." ".number_format($tempjumlahD-$tempjumlahE, 0, ",", ".")."".number_format($temphpD-$temphpE, 0, ",", ".")."
~".$str[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlren[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita'], 0, ",", ".")." .".$kdSuppOrd[$i]['wanita']."".$nmSuppOrd[$i]['wanita']."".number_format($jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rprev[$i]['wanita'], 0, ",", ".")." .".$kdSuppBeli[$i]['wanita']."".$nmSuppBeli[$i]['wanita']."".number_format($jmlBeli[$i]['wanita'], 0, ",", ".")."".number_format($rpBeli[$i]['wanita'], 0, ",", ".")." ".number_format($jmlren[$i]['wanita']-$jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita']-$rprev[$i]['wanita'], 0, ",", ".")."
".number_format($tempjumlahD, 0, ",", ".")."".number_format($temphpD, 0, ",", ".")." ".number_format($tempjumlahE, 0, ",", ".")."".number_format($temphpE, 0, ",", ".")." ".number_format($tempjumlahF, 0, ",", ".")."".number_format($temphpF, 0, ",", ".")." ".number_format($tempjumlahD-$tempjumlahE, 0, ",", ".")."".number_format($temphpD-$temphpE, 0, ",", ".")."
TOTAL Wanita".number_format($ttJmlBeli['wanita']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['hp'], 0, ",", ".")." ".number_format($ttJmlBeli['wanita']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['hpRev'], 0, ",", ".")." ".number_format($ttJmlBeli['wanita']['jmlBeli'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['hpBeli'], 0, ",", ".")." ".number_format($tempjswanita, 0, ",", ".")."".number_format($temprpwanita, 0, ",", ".")."
SISA JATAH".number_format($jmlSisaJthwanita, 0, ",", ".")." ".number_format($hpSisaJthwanita, 0, ",", ".")."
Anak
~".$str[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlren[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak'], 0, ",", ".")." .".$kdSuppOrd[$i]['anak']."".$nmSuppOrd[$i]['anak']."".number_format($jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rprev[$i]['anak'], 0, ",", ".")." .".$kdSuppBeli[$i]['anak']."".$nmSuppBeli[$i]['anak']."".number_format($jmlBeli[$i]['anak'], 0, ",", ".")."".number_format($rpBeli[$i]['anak'], 0, ",", ".")."
~".$str[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlren[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak'], 0, ",", ".")." .".$kdSuppOrd[$i]['anak']."".$nmSuppOrd[$i]['anak']."".number_format($jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rprev[$i]['anak'], 0, ",", ".")." .".$kdSuppBeli[$i]['anak']."".$nmSuppBeli[$i]['anak']."".number_format($jmlBeli[$i]['anak'], 0, ",", ".")."".number_format($rpBeli[$i]['anak'], 0, ",", ".")." ".number_format($jmlren[$i]['anak']-$jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak']-$rprev[$i]['anak'], 0, ",", ".")."
~".$strOrd[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlren[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak'], 0, ",", ".")." .".$kdSuppOrd[$i]['anak']."".$nmSuppOrd[$i]['anak']."".number_format($jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rprev[$i]['anak'], 0, ",", ".")." .".$kdSuppBeli[$i]['anak']."".$nmSuppBeli[$i]['anak']."".number_format($jmlBeli[$i]['anak'], 0, ",", ".")."".number_format($rpBeli[$i]['anak'], 0, ",", ".")." ".number_format($jmlren[$i]['anak']-$jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak']-$rprev[$i]['anak'], 0, ",", ".")."
".number_format($tempjumlahG, 0, ",", ".")."".number_format($temphpG, 0, ",", ".")." ".number_format($tempjumlahH, 0, ",", ".")."".number_format($temphpH, 0, ",", ".")." ".number_format($tempjumlahI, 0, ",", ".")."".number_format($temphpI, 0, ",", ".")." ".number_format($tempjumlahG-$tempjumlahH, 0, ",", ".")."".number_format($temphpG-$temphpH, 0, ",", ".")."
~".$strOrd[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlren[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak'], 0, ",", ".")." .".$kdSuppOrd[$i]['anak']."".$nmSuppOrd[$i]['anak']."".number_format($jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rprev[$i]['anak'], 0, ",", ".")." .".$kdSuppBeli[$i]['anak']."".$nmSuppBeli[$i]['anak']."".number_format($jmlBeli[$i]['anak'], 0, ",", ".")."".number_format($rpBeli[$i]['anak'], 0, ",", ".")." ".number_format($jmlren[$i]['anak']-$jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak']-$rprev[$i]['anak'], 0, ",", ".")."
".number_format($tempjumlahG, 0, ",", ".")."".number_format($temphpG, 0, ",", ".")." ".number_format($tempjumlahH, 0, ",", ".")."".number_format($temphpH, 0, ",", ".")." ".number_format($tempjumlahI, 0, ",", ".")."".number_format($temphpI, 0, ",", ".")."
~".$str[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlren[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak'], 0, ",", ".")." .".$kdSuppOrd[$i]['anak']."".$nmSuppOrd[$i]['anak']."".number_format($jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rprev[$i]['anak'], 0, ",", ".")." .".$kdSuppBeli[$i]['anak']."".$nmSuppBeli[$i]['anak']."".number_format($jmlBeli[$i]['anak'], 0, ",", ".")."".number_format($rpBeli[$i]['anak'], 0, ",", ".")."
".number_format($tempjumlahG, 0, ",", ".")."".number_format($temphpG, 0, ",", ".")." ".number_format($tempjumlahH, 0, ",", ".")."".number_format($temphpH, 0, ",", ".")." ".number_format($tempjumlahI, 0, ",", ".")."".number_format($temphpI, 0, ",", ".")."
~".$strOrd[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlren[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak'], 0, ",", ".")." .".$kdSuppOrd[$i]['anak']."".$nmSuppOrd[$i]['anak']."".number_format($jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rprev[$i]['anak'], 0, ",", ".")." .".$kdSuppBeli[$i]['anak']."".$nmSuppBeli[$i]['anak']."".number_format($jmlBeli[$i]['anak'], 0, ",", ".")."".number_format($rpBeli[$i]['anak'], 0, ",", ".")." ".number_format($jmlren[$i]['anak']-$jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak']-$rprev[$i]['anak'], 0, ",", ".")."
".number_format($tempjumlahG, 0, ",", ".")."".number_format($temphpG, 0, ",", ".")." ".number_format($tempjumlahH, 0, ",", ".")."".number_format($temphpH, 0, ",", ".")." ".number_format($tempjumlahI, 0, ",", ".")."".number_format($temphpI, 0, ",", ".")." ".number_format($tempjumlahG-$tempjumlahH, 0, ",", ".")."".number_format($temphpG-$temphpH, 0, ",", ".")."
~".$str[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlren[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak'], 0, ",", ".")." .".$kdSuppOrd[$i]['anak']."".$nmSuppOrd[$i]['anak']."".number_format($jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rprev[$i]['anak'], 0, ",", ".")." .".$kdSuppBeli[$i]['anak']."".$nmSuppBeli[$i]['anak']."".number_format($jmlBeli[$i]['anak'], 0, ",", ".")."".number_format($rpBeli[$i]['anak'], 0, ",", ".")." ".number_format($jmlren[$i]['anak']-$jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak']-$rprev[$i]['anak'], 0, ",", ".")."
".number_format($tempjumlahG, 0, ",", ".")."".number_format($temphpG, 0, ",", ".")." ".number_format($tempjumlahH, 0, ",", ".")."".number_format($temphpH, 0, ",", ".")." ".number_format($tempjumlahI, 0, ",", ".")."".number_format($temphpI, 0, ",", ".")." ".number_format($tempjumlahG-$tempjumlahH, 0, ",", ".")."".number_format($temphpG-$temphpH, 0, ",", ".")."
TOTAL Anak".number_format($ttJmlBeli['anak']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['hp'], 0, ",", ".")." ".number_format($ttJmlBeli['anak']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['hpRev'], 0, ",", ".")." ".number_format($ttJmlBeli['anak']['jmlBeli'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['hpBeli'], 0, ",", ".")." ".number_format($tempjsanak, 0, ",", ".")."".number_format($temprpanak, 0, ",", ".")."
SISA JATAH".number_format($jmlSisaJthanak, 0, ",", ".")." ".number_format($hpSisaJthanak, 0, ",", ".")."
Sepatu
~".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlren[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu'], 0, ",", ".")." .".$kdSuppOrd[$i]['sepatu']."".$nmSuppOrd[$i]['sepatu']."".number_format($jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rprev[$i]['sepatu'], 0, ",", ".")." .".$kdSuppBeli[$i]['sepatu']."".$nmSuppBeli[$i]['sepatu']."".number_format($jmlBeli[$i]['sepatu'], 0, ",", ".")."".number_format($rpBeli[$i]['sepatu'], 0, ",", ".")."
~".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlren[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu'], 0, ",", ".")." .".$kdSuppOrd[$i]['sepatu']."".$nmSuppOrd[$i]['sepatu']."".number_format($jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rprev[$i]['sepatu'], 0, ",", ".")." .".$kdSuppBeli[$i]['sepatu']."".$nmSuppBeli[$i]['sepatu']."".number_format($jmlBeli[$i]['sepatu'], 0, ",", ".")."".number_format($rpBeli[$i]['sepatu'], 0, ",", ".")." ".number_format($jmlren[$i]['sepatu']-$jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu']-$rprev[$i]['sepatu'], 0, ",", ".")."
~".$strOrd[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlren[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu'], 0, ",", ".")." .".$kdSuppOrd[$i]['sepatu']."".$nmSuppOrd[$i]['sepatu']."".number_format($jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rprev[$i]['sepatu'], 0, ",", ".")." .".$kdSuppBeli[$i]['sepatu']."".$nmSuppBeli[$i]['sepatu']."".number_format($jmlBeli[$i]['sepatu'], 0, ",", ".")."".number_format($rpBeli[$i]['sepatu'], 0, ",", ".")." ".number_format($jmlren[$i]['sepatu']-$jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu']-$rprev[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlahJ, 0, ",", ".")."".number_format($temphpJ, 0, ",", ".")." ".number_format($tempjumlahK, 0, ",", ".")."".number_format($temphpK, 0, ",", ".")." ".number_format($tempjumlahL, 0, ",", ".")."".number_format($temphpL, 0, ",", ".")." ".number_format($tempjumlahJ-$tempjumlahK, 0, ",", ".")."".number_format($temphpJ-$temphpK, 0, ",", ".")."
~".$strOrd[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlren[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu'], 0, ",", ".")." .".$kdSuppOrd[$i]['sepatu']."".$nmSuppOrd[$i]['sepatu']."".number_format($jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rprev[$i]['sepatu'], 0, ",", ".")." .".$kdSuppBeli[$i]['sepatu']."".$nmSuppBeli[$i]['sepatu']."".number_format($jmlBeli[$i]['sepatu'], 0, ",", ".")."".number_format($rpBeli[$i]['sepatu'], 0, ",", ".")." ".number_format($jmlren[$i]['sepatu']-$jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu']-$rprev[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlahJ, 0, ",", ".")."".number_format($temphpJ, 0, ",", ".")." ".number_format($tempjumlahK, 0, ",", ".")."".number_format($temphpK, 0, ",", ".")." ".number_format($tempjumlahL, 0, ",", ".")."".number_format($temphpL, 0, ",", ".")."
~".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlren[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu'], 0, ",", ".")." .".$kdSuppOrd[$i]['sepatu']."".$nmSuppOrd[$i]['sepatu']."".number_format($jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rprev[$i]['sepatu'], 0, ",", ".")." .".$kdSuppBeli[$i]['sepatu']."".$nmSuppBeli[$i]['sepatu']."".number_format($jmlBeli[$i]['sepatu'], 0, ",", ".")."".number_format($rpBeli[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlahJ, 0, ",", ".")."".number_format($temphpJ, 0, ",", ".")." ".number_format($tempjumlahK, 0, ",", ".")."".number_format($temphpK, 0, ",", ".")." ".number_format($tempjumlahL, 0, ",", ".")."".number_format($temphpL, 0, ",", ".")."
~".$strOrd[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlren[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu'], 0, ",", ".")." .".$kdSuppOrd[$i]['sepatu']."".$nmSuppOrd[$i]['sepatu']."".number_format($jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rprev[$i]['sepatu'], 0, ",", ".")." .".$kdSuppBeli[$i]['sepatu']."".$nmSuppBeli[$i]['sepatu']."".number_format($jmlBeli[$i]['sepatu'], 0, ",", ".")."".number_format($rpBeli[$i]['sepatu'], 0, ",", ".")." ".number_format($jmlren[$i]['sepatu']-$jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu']-$rprev[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlahJ, 0, ",", ".")."".number_format($temphpJ, 0, ",", ".")." ".number_format($tempjumlahK, 0, ",", ".")."".number_format($temphpK, 0, ",", ".")." ".number_format($tempjumlahL, 0, ",", ".")."".number_format($temphpL, 0, ",", ".")." ".number_format($tempjumlahJ-$tempjumlahK, 0, ",", ".")."".number_format($temphpJ-$temphpK, 0, ",", ".")."
~".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlren[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu'], 0, ",", ".")." .".$kdSuppOrd[$i]['sepatu']."".$nmSuppOrd[$i]['sepatu']."".number_format($jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rprev[$i]['sepatu'], 0, ",", ".")." .".$kdSuppBeli[$i]['sepatu']."".$nmSuppBeli[$i]['sepatu']."".number_format($jmlBeli[$i]['sepatu'], 0, ",", ".")."".number_format($rpBeli[$i]['sepatu'], 0, ",", ".")." ".number_format($jmlren[$i]['sepatu']-$jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu']-$rprev[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlahJ, 0, ",", ".")."".number_format($temphpJ, 0, ",", ".")." ".number_format($tempjumlahK, 0, ",", ".")."".number_format($temphpK, 0, ",", ".")." ".number_format($tempjumlahL, 0, ",", ".")."".number_format($temphpL, 0, ",", ".")." ".number_format($tempjumlahJ-$tempjumlahK, 0, ",", ".")."".number_format($temphpJ-$temphpK, 0, ",", ".")."
TOTAL Sepatu".number_format($ttJmlBeli['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp'], 0, ",", ".")." ".number_format($ttJmlBeli['sepatu']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hpRev'], 0, ",", ".")." ".number_format($ttJmlBeli['sepatu']['jmlBeli'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hpBeli'], 0, ",", ".")." ".number_format($tempjssepatu, 0, ",", ".")."".number_format($temprpsepatu, 0, ",", ".")."
SISA JATAH".number_format($jmlSisaJthsepatu, 0, ",", ".")." ".number_format($hpSisaJthsepatu, 0, ",", ".")."
T O T A L : ".number_format($ttjml1, 0, ",", ".")."".number_format($ttrp1, 0, ",", ".")."".number_format($ttjml2, 0, ",", ".")."".number_format($ttrp2, 0, ",", ".")."".number_format($ttjselisih, 0, ",", ".")."".number_format($ttrpselisih, 0, ",", ".")."

"); + }else{ + echo "Tidak ada data untuk tanggal tersebut!"; + } + } + + } +?> diff --git a/old-source/LaporanBeli/lapbelidlmpdk.php b/old-source/LaporanBeli/lapbelidlmpdk.php new file mode 100644 index 0000000..b1767c5 --- /dev/null +++ b/old-source/LaporanBeli/lapbelidlmpdk.php @@ -0,0 +1,249 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:700px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ".master{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + + if(bukaKoneksi()){ + global $conn; + + $query = "SELECT s.kel_jns,s.nama_strip,k.ked_produk, + sum( d.jum_fisik) jum, + sum(d.jum_fisik*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + FROM d_pembelian d, m_pembelian m, strip s,kedalaman_produk k, barang b + WHERE d.no_faktur = m.no_faktur + AND b.kode_barang = d.kode_barang + AND s.kd_strip = b.kode_strip + AND (b.kode_strip = k.kode_strip and b.ked_produk = k.kode_ked_produk) + AND m.tgl_masuk BETWEEN '$startDate' AND '$endDate' + AND m.validasi = '1' + AND m.status_revisi = '1' + GROUP BY b.kode_strip,b.ked_produk"; + + $query2 ="SELECT s.kel_jns,s.nama_strip,k.ked_produk, + sum( d.jumlah ) jum,sum(d.jumlah*d.harga_satuan) hp + FROM d_retur_beli d, m_retur_beli m, kedalaman_produk k,strip s, barang b + WHERE d.id_retur = m.id_retur + AND b.kode_barang = d.kd_barang + AND s.kd_strip = b.kode_strip + AND (b.kode_strip = k.kode_strip and b.ked_produk = k.kode_ked_produk) + AND m.tgl_retur BETWEEN '$startDate' AND '$endDate' + AND m.validasi = '1' + GROUP BY b.kode_strip,b.ked_produk"; + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cekR = mysqli_stmt_num_rows($stmt2); + if($cekR >= 0){//jika ada retur + mysqli_stmt_bind_result($stmt2,$kel,$str,$kdsup,$jmlRetur,$rpRetur); + + $priaR = 0; + $wanitaR = 0; + $anakR = 0; + $sepatuR = 0; + $strRet = array(); + $jmlR = array(); + $rpR = array(); + + $ttJmlRetur = array(); + $ttJmlRetur['pria']['jml'] = 0; + $ttJmlRetur['pria']['rp'] = 0; + $ttJmlRetur['wanita']['jml'] = 0; + $ttJmlRetur['wanita']['rp'] = 0; + $ttJmlRetur['anak']['jml'] = 0; + $ttJmlRetur['anak']['rp'] = 0; + $ttJmlRetur['sepatu']['jml'] = 0; + $ttJmlRetur['sepatu']['rp'] = 0; + + + while(mysqli_stmt_fetch($stmt2)){ + if($kel == 'P'){ + $strRet[$priaR]['pria'] = $str; + $jmlR[$priaR]['pria'] = $jmlRetur; + $rpR[$priaR]['pria'] = $rpRetur; + $ttJmlRetur['pria']['jml'] += $jmlRetur; + $ttJmlRetur['pria']['rp'] += $rpRetur; + $kdSupplier[$priaR]['pria'] = $kdsup; + $nmSupplier[$priaR]['pria'] = $nmsup; + $priaR++; + }elseif($kel == 'W'){ + $strRet[$wanitaR]['wanita'] = $str; + $jmlR[$wanitaR]['wanita'] = $jmlRetur; + $rpR[$wanitaR]['wanita'] = $rpRetur; + $ttJmlRetur['wanita']['jml'] += $jmlRetur; + $ttJmlRetur['wanita']['rp'] += $rpRetur; + $kdSupplier[$wanitaR]['wanita'] = $kdsup; + $nmSupplier[$wanitaR]['wanita'] = $nmsup; + $wanitaR++; + }elseif($kel == 'A'){ + $strRet[$anakR]['anak'] = $str; + $jmlR[$anakR]['anak'] = $jmlRetur; + $rpR[$anakR]['anak'] = $rpRetur; + $ttJmlRetur['anak']['jml'] += $jmlRetur; + $ttJmlRetur['anak']['rp'] += $rpRetur; + $kdSupplier[$anakR]['anak'] = $kdsup; + $nmSupplier[$anakR]['anak'] = $nmsup; + $anakR++; + }else{ + $strRet[$sepatuR]['sepatu'] = $str; + $jmlR[$sepatuR]['sepatu'] = $jmlRetur; + $rpR[$sepatuR]['sepatu'] = $rpRetur; + $ttJmlRetur['sepatu']['jml'] += $jmlRetur; + $ttJmlRetur['sepatu']['rp'] += $rpRetur; + $kdSupplier[$sepatuR]['sepatu'] = $kdsup; + $nmSupplier[$sepatuR]['sepatu'] = $nmsup; + $sepatuR++; + } + } + + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_free_result($stmt2); + mysqli_stmt_close($stmt2); + } + } + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek >= 0){ + mysqli_stmt_bind_result($stmt,$kelJns,$strip,$kd,$jmlBeli,$hrgPokok); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + + print("
"); + print("

Laporan Pembelian Per Sub Group Product



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PADA TANGGAL : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $str = array(); + $jmlB = array(); + $rpB = array(); + $HP = array(); + + while(mysqli_stmt_fetch($stmt)){ + if($jmlRetur == ''){ + $jmlRetur = 0; + } + if($rpRetur == ''){ + $rpRetur = 0; + } + if($kelJns == "P"){ + $kelJns = "Pria"; + $ttJmlBeli['pria']['jml'] += $jmlBeli; + $ttJmlBeli['pria']['hp'] += $hrgPokok; + $str[$pria]['pria'] = $strip; + $jmlB[$pria]['pria'] = $jmlBeli; + $rpB[$pria]['pria'] = $rpBeli; + $HP[$pria]['pria'] = $hrgPokok; + $kdSupp[$pria]['pria'] = $kd; + $nmSupp[$pria]['pria'] = $nm; + $pria++; + }elseif($kelJns == "W"){ + $kelJns = "Wanita"; + $ttJmlBeli['wanita']['jml'] += $jmlBeli; + $ttJmlBeli['wanita']['hp'] += $hrgPokok; + $str[$wanita]['wanita'] = $strip; + $jmlB[$wanita]['wanita'] = $jmlBeli; + $rpB[$wanita]['wanita'] = $rpBeli; + $HP[$wanita]['wanita'] = $hrgPokok; + $kdSupp[$wanita]['wanita'] = $kd; + $nmSupp[$wanita]['wanita'] = $nm; + $wanita++; + }elseif($kelJns == "A"){ + $kelJns = "Anak"; + $ttJmlBeli['anak']['jml'] += $jmlBeli; + $ttJmlBeli['anak']['hp'] += $hrgPokok; + $str[$anak]['anak'] = $strip; + $jmlB[$anak]['anak'] = $jmlBeli; + $rpB[$anak]['anak'] = $rpBeli; + $HP[$anak]['anak'] = $hrgPokok; + $kdSupp[$anak]['anak'] = $kd; + $nmSupp[$anak]['anak'] = $nm; + $anak++; + }else{ + $kelJns = "Sepatu"; + $ttJmlBeli['sepatu']['jml'] += $jmlBeli; + $ttJmlBeli['sepatu']['hp'] += $hrgPokok; + $str[$sepatu]['sepatu'] = $strip; + $jmlB[$sepatu]['sepatu'] = $jmlBeli; + $rpB[$sepatu]['sepatu'] = $rpBeli; + $HP[$sepatu]['sepatu'] = $hrgPokok; + $kdSupp[$sepatu]['sepatu'] = $kd; + $nmSupp[$sepatu]['sepatu'] = $nm; + $sepatu++; + } + + } + print(""); + print(""); + print("
"); + +/* SEPATU -------------------------------------------------------------------------*/ + $jmlkatsepatu = $ttJmlBeli['sepatu']['jml']-$ttJmlRetur['sepatu']['jml']; + $hpkatsepatu = $ttJmlBeli['sepatu']['hp']-$ttJmlRetur['sepatu']['rp']; + + if($ttJmlBeli['sepatu']['jml']!=0){ + print("
"); + for($i=0;$i<$sepatu;$i++){ + print(""); + } + print(""); + } + + if($ttJmlRetur['sepatu']['jml']!= 0){ + print(""); + for($x=0;$x<$sepatuR;$x++){ + print(""); + } + print(""); + } + + print(""); + + $ttjml = $jmlkatpria + $jmlkatwanita + $jmlkatanak + $jmlkatsepatu; + $ttrp = $rpkatpria + $rpkatwanita + $rpkatanak + $rpkatsepatu; + $tthp = $hpkatpria + $hpkatwanita + $hpkatanak + $hpkatsepatu; + + print(" + + "); + + print("
Lini ProdukKedalaman Prod.Jumlah BeliTotal HP
".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($ttJmlBeli['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp'], 0, ",", ".")."
Data Retur
".$strRet[$x]['sepatu'].".".$kdSupplier[$x]['sepatu']."".number_format($jmlR[$x]['sepatu'], 0, ",", ".")."".number_format($rpR[$x]['sepatu'], 0, ",", ".")."
".number_format($ttJmlRetur['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlRetur['sepatu']['rp'], 0, ",", ".")."
Sub Total".number_format($jmlkatsepatu, 0, ",", ".")."".number_format($hpkatsepatu, 0, ",", ".")."
T O T A L : ".number_format($ttjml, 0, ",", ".")."".number_format($tthp, 0, ",", ".")."

"); + }else{ + echo "Belum ada data pembelian untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/lapbelidlmpdk.php~ b/old-source/LaporanBeli/lapbelidlmpdk.php~ new file mode 100644 index 0000000..1928860 --- /dev/null +++ b/old-source/LaporanBeli/lapbelidlmpdk.php~ @@ -0,0 +1,310 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:700px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ".master{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + + if(bukaKoneksi()){ + global $conn; + + $query = "SELECT s.kel_jns,substr( d.kode_barang, 1, 2 ) kdBrg, + substr( d.kode_barang, 5, 1 ) dlmpdk,k.ked_produk, + sum( d.jumlah ) jum, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + FROM d_pembelian d, m_pembelian m, strip s,kedalaman_produk k + WHERE d.no_faktur = m.no_faktur + AND s.kd_strip = substr( d.kode_barang, 1, 2 ) + AND k.kode_strip = substr( d.kode_barang, 1, 2 ) + AND k.kode_ked_produk = substr( d.kode_barang, 5, 1 ) + AND m.tgl_masuk BETWEEN '$startDate' AND '$endDate' AND m.validasi = '1' + GROUP BY substr( d.kode_barang, 1, 2 ),substr( d.kode_barang, 5, 1 )"; + $query2 ="SELECT s.kel_jns,substr( d.kd_barang, 1, 2 ) kdBrg, + substr( d.kd_barang, 5, 1 ) dlmpdk,k.ked_produk, + sum( d.jumlah ) jum,sum(d.jumlah*d.harga_satuan) hp + FROM d_retur_beli d, m_retur_beli m, kedalaman_produk k,strip s + WHERE d.id_retur = m.id_retur + AND s.kd_strip = substr( d.kd_barang, 1, 2 ) + AND k.kode_strip = substr( d.kd_barang, 1, 2 ) + AND k.kode_ked_produk = substr( d.kd_barang, 5, 1 ) + AND m.tgl_retur BETWEEN '$startDate' AND '$endDate' AND m.validasi = '1' + GROUP BY substr( d.kd_barang, 1, 2 ) , substr( d.kd_barang, 5, 1 )"; + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cekR = mysqli_stmt_num_rows($stmt2); + if($cekR >= 0){//jika ada retur + mysqli_stmt_bind_result($stmt2,$kel,$str,$kdsup,$nmsup,$jmlRetur,$rpRetur); + + $priaR = 0; + $wanitaR = 0; + $anakR = 0; + $sepatuR = 0; + $strRet = array(); + $jmlR = array(); + $rpR = array(); + + $ttJmlRetur = array(); + $ttJmlRetur['pria']['jml'] = 0; + $ttJmlRetur['pria']['rp'] = 0; + $ttJmlRetur['wanita']['jml'] = 0; + $ttJmlRetur['wanita']['rp'] = 0; + $ttJmlRetur['anak']['jml'] = 0; + $ttJmlRetur['anak']['rp'] = 0; + $ttJmlRetur['sepatu']['jml'] = 0; + $ttJmlRetur['sepatu']['rp'] = 0; + + + while(mysqli_stmt_fetch($stmt2)){ + if($kel == 'P'){ + $strRet[$priaR]['pria'] = $str; + $jmlR[$priaR]['pria'] = $jmlRetur; + $rpR[$priaR]['pria'] = $rpRetur; + $ttJmlRetur['pria']['jml'] += $jmlRetur; + $ttJmlRetur['pria']['rp'] += $rpRetur; + $kdSupplier[$priaR]['pria'] = $kdsup; + $nmSupplier[$priaR]['pria'] = $nmsup; + $priaR++; + }elseif($kel == 'W'){ + $strRet[$wanitaR]['wanita'] = $str; + $jmlR[$wanitaR]['wanita'] = $jmlRetur; + $rpR[$wanitaR]['wanita'] = $rpRetur; + $ttJmlRetur['wanita']['jml'] += $jmlRetur; + $ttJmlRetur['wanita']['rp'] += $rpRetur; + $kdSupplier[$wanitaR]['wanita'] = $kdsup; + $nmSupplier[$wanitaR]['wanita'] = $nmsup; + $wanitaR++; + }elseif($kel == 'A'){ + $strRet[$anakR]['anak'] = $str; + $jmlR[$anakR]['anak'] = $jmlRetur; + $rpR[$anakR]['anak'] = $rpRetur; + $ttJmlRetur['anak']['jml'] += $jmlRetur; + $ttJmlRetur['anak']['rp'] += $rpRetur; + $kdSupplier[$anakR]['anak'] = $kdsup; + $nmSupplier[$anakR]['anak'] = $nmsup; + $anakR++; + }else{ + $strRet[$sepatuR]['sepatu'] = $str; + $jmlR[$sepatuR]['sepatu'] = $jmlRetur; + $rpR[$sepatuR]['sepatu'] = $rpRetur; + $ttJmlRetur['sepatu']['jml'] += $jmlRetur; + $ttJmlRetur['sepatu']['rp'] += $rpRetur; + $kdSupplier[$sepatuR]['sepatu'] = $kdsup; + $nmSupplier[$sepatuR]['sepatu'] = $nmsup; + $sepatuR++; + } + } + + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_free_result($stmt2); + mysqli_stmt_close($stmt2); + } + } + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek >= 0){ + mysqli_stmt_bind_result($stmt,$kelJns,$strip,$kd,$nm,$jmlBeli,$hrgPokok); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + + print("
"); + print("

Laporan Pembelian Per Kedalaman Produk



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PADA TANGGAL : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $str = array(); + $jmlB = array(); + $rpB = array(); + $HP = array(); + + while(mysqli_stmt_fetch($stmt)){ + if($jmlRetur == ''){ + $jmlRetur = 0; + } + if($rpRetur == ''){ + $rpRetur = 0; + } + if($kelJns == "P"){ + $kelJns = "Pria"; + $ttJmlBeli['pria']['jml'] += $jmlBeli; + $ttJmlBeli['pria']['hp'] += $hrgPokok; + $str[$pria]['pria'] = $strip; + $jmlB[$pria]['pria'] = $jmlBeli; + $rpB[$pria]['pria'] = $rpBeli; + $HP[$pria]['pria'] = $hrgPokok; + $kdSupp[$pria]['pria'] = $kd; + $nmSupp[$pria]['pria'] = $nm; + $pria++; + }elseif($kelJns == "W"){ + $kelJns = "Wanita"; + $ttJmlBeli['wanita']['jml'] += $jmlBeli; + $ttJmlBeli['wanita']['hp'] += $hrgPokok; + $str[$wanita]['wanita'] = $strip; + $jmlB[$wanita]['wanita'] = $jmlBeli; + $rpB[$wanita]['wanita'] = $rpBeli; + $HP[$wanita]['wanita'] = $hrgPokok; + $kdSupp[$wanita]['wanita'] = $kd; + $nmSupp[$wanita]['wanita'] = $nm; + $wanita++; + }elseif($kelJns == "A"){ + $kelJns = "Anak"; + $ttJmlBeli['anak']['jml'] += $jmlBeli; + $ttJmlBeli['anak']['hp'] += $hrgPokok; + $str[$anak]['anak'] = $strip; + $jmlB[$anak]['anak'] = $jmlBeli; + $rpB[$anak]['anak'] = $rpBeli; + $HP[$anak]['anak'] = $hrgPokok; + $kdSupp[$anak]['anak'] = $kd; + $nmSupp[$anak]['anak'] = $nm; + $anak++; + }else{ + $kelJns = "Sepatu"; + $ttJmlBeli['sepatu']['jml'] += $jmlBeli; + $ttJmlBeli['sepatu']['hp'] += $hrgPokok; + $str[$sepatu]['sepatu'] = $strip; + $jmlB[$sepatu]['sepatu'] = $jmlBeli; + $rpB[$sepatu]['sepatu'] = $rpBeli; + $HP[$sepatu]['sepatu'] = $hrgPokok; + $kdSupp[$sepatu]['sepatu'] = $kd; + $nmSupp[$sepatu]['sepatu'] = $nm; + $sepatu++; + } + + } + print(""); + print(""); + print("
"); + +/* PRIA -------------------------------------------------------------------------*/ + $jmlkatpria = $ttJmlBeli['pria']['jml']-$ttJmlRetur['pria']['jml']; + $hpkatpria = $ttJmlBeli['pria']['hp']-$ttJmlRetur['pria']['rp']; + + if($ttJmlBeli['pria']['jml']!=0){ + print("
"); + for($i=0;$i<$pria;$i++){ + print(""); + } + print(""); + } + + if($ttJmlRetur['pria']['jml']!= 0){ + print(""); + for($x=0;$x<$priaR;$x++){ + print(""); + } + print(""); + } + + print(""); +/* WANITA -------------------------------------------------------------------------*/ + $jmlkatwanita = $ttJmlBeli['wanita']['jml']-$ttJmlRetur['wanita']['jml']; + $hpkatwanita = $ttJmlBeli['wanita']['hp']-$ttJmlRetur['wanita']['rp']; + + if($ttJmlBeli['wanita']['jml']!=0){ + print(""); + for($i=0;$i<$wanita;$i++){ + print(""); + } + print(""); + } + + if($ttJmlRetur['wanita']['jml']!= 0){ + print(""); + for($x=0;$x<$wanitaR;$x++){ + print(""); + } + print(""); + } + + print(""); +/* ANAK -------------------------------------------------------------------------*/ + $jmlkatanak = $ttJmlBeli['anak']['jml']-$ttJmlRetur['anak']['jml']; + $hpkatanak = $ttJmlBeli['anak']['hp']-$ttJmlRetur['anak']['rp']; + + if($ttJmlBeli['anak']['jml']!=0){ + print(""); + for($i=0;$i<$anak;$i++){ + print(""); + } + print(""); + } + + if($ttJmlRetur['anak']['jml']!= 0){ + print(""); + for($x=0;$x<$anakR;$x++){ + print(""); + } + print(""); + } + + print(""); +/* SEPATU -------------------------------------------------------------------------*/ + $jmlkatsepatu = $ttJmlBeli['sepatu']['jml']-$ttJmlRetur['sepatu']['jml']; + $hpkatsepatu = $ttJmlBeli['sepatu']['hp']-$ttJmlRetur['sepatu']['rp']; + + if($ttJmlBeli['sepatu']['jml']!=0){ + print(""); + for($i=0;$i<$sepatu;$i++){ + print(""); + } + print(""); + } + + if($ttJmlRetur['sepatu']['jml']!= 0){ + print(""); + for($x=0;$x<$sepatuR;$x++){ + print(""); + } + print(""); + } + + print(""); + + $ttjml = $jmlkatpria + $jmlkatwanita + $jmlkatanak + $jmlkatsepatu; + $ttrp = $rpkatpria + $rpkatwanita + $rpkatanak + $rpkatsepatu; + $tthp = $hpkatpria + $hpkatwanita + $hpkatanak + $hpkatsepatu; + + print(" + + "); + + print("
KategoriLini ProdukKedalaman Prod.NamaJumlah BeliTotal HP
Pria
~".$str[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlB[$i]['pria'], 0, ",", ".")."".number_format($HP[$i]['pria'], 0, ",", ".")."
".number_format($ttJmlBeli['pria']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['hp'], 0, ",", ".")."
Retur Pria
~".$strRet[$x]['pria'].".".$kdSupplier[$x]['pria']."".$nmSupplier[$x]['pria']."".number_format($jmlR[$x]['pria'], 0, ",", ".")."".number_format($rpR[$x]['pria'], 0, ",", ".")."
".number_format($ttJmlRetur['pria']['jml'], 0, ",", ".")."".number_format($ttJmlRetur['pria']['rp'], 0, ",", ".")."
TOTAL PRIA".number_format($jmlkatpria, 0, ",", ".")."".number_format($hpkatpria, 0, ",", ".")."
Wanita
~".$str[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlB[$i]['wanita'], 0, ",", ".")."".number_format($HP[$i]['wanita'], 0, ",", ".")."
".number_format($ttJmlBeli['wanita']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['hp'], 0, ",", ".")."
Retur Wanita
~".$strRet[$x]['wanita'].".".$kdSupplier[$x]['wanita']."".$nmSupplier[$x]['wanita']."".number_format($jmlR[$x]['wanita'], 0, ",", ".")."".number_format($rpR[$x]['wanita'], 0, ",", ".")."
".number_format($ttJmlRetur['wanita']['jml'], 0, ",", ".")."".number_format($ttJmlRetur['wanita']['rp'], 0, ",", ".")."
TOTAL Wanita".number_format($jmlkatwanita, 0, ",", ".")."".number_format($hpkatwanita, 0, ",", ".")."
Anak
~".$str[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlB[$i]['anak'], 0, ",", ".")."".number_format($HP[$i]['anak'], 0, ",", ".")."
".number_format($ttJmlBeli['anak']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['hp'], 0, ",", ".")."
Retur Anak
~".$strRet[$x]['anak'].".".$kdSupplier[$x]['anak']."".$nmSupplier[$x]['anak']."".number_format($jmlR[$x]['anak'], 0, ",", ".")."".number_format($rpR[$x]['anak'], 0, ",", ".")."
".number_format($ttJmlRetur['anak']['jml'], 0, ",", ".")."".number_format($ttJmlRetur['anak']['rp'], 0, ",", ".")."
TOTAL Anak".number_format($jmlkatanak, 0, ",", ".")."".number_format($hpkatanak, 0, ",", ".")."
Sepatu
~".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($ttJmlBeli['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp'], 0, ",", ".")."
Retur Sepatu
~".$strRet[$x]['sepatu'].".".$kdSupplier[$x]['sepatu']."".$nmSupplier[$x]['sepatu']."".number_format($jmlR[$x]['sepatu'], 0, ",", ".")."".number_format($rpR[$x]['sepatu'], 0, ",", ".")."
".number_format($ttJmlRetur['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlRetur['sepatu']['rp'], 0, ",", ".")."
TOTAL Sepatu".number_format($jmlkatsepatu, 0, ",", ".")."".number_format($hpkatsepatu, 0, ",", ".")."
T O T A L : ".number_format($ttjml, 0, ",", ".")."".number_format($tthp, 0, ",", ".")."

"); + }else{ + echo "Belum ada data pembelian untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/lapbelikons.php b/old-source/LaporanBeli/lapbelikons.php new file mode 100644 index 0000000..5f5b4fa --- /dev/null +++ b/old-source/LaporanBeli/lapbelikons.php @@ -0,0 +1,273 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:700px;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:9pt;}"; + 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 ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + + if(bukaKoneksi()){ + global $conn; + + $query = "SELECT s.kel_jns,s.nama_strip lini, m.kd_supplier, u.nama_supplier, + sum( d.jum_fisik ) jum, + sum(d.jum_fisik*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + FROM d_pembelian d, m_pembelian m, supplier u,strip s,barang b + WHERE d.no_faktur = m.no_faktur + AND left(m.no_faktur,4) <> 'RVB-' + AND b.kode_barang = d.kode_barang + AND s.kd_strip = b.kode_strip + AND u.kd_supplier = m.kd_supplier + AND m.status = 'K' + AND m.tgl_masuk BETWEEN '$startDate' AND '$endDate' + AND m.validasi = '1' + GROUP BY b.kode_strip , m.kd_supplier"; + $query2 ="SELECT s.kel_jns,s.nama_strip lini, m.kd_supplier, u.nama_supplier, + sum( d.jumlah ) jum,sum(d.jumlah*d.harga_satuan) hp + FROM d_retur_beli d, m_retur_beli m, supplier u,strip s,m_pembelian b,barang br + WHERE d.id_retur = m.id_retur + AND br.kode_barang = d.kd_barang + AND s.kd_strip = br.kode_strip + AND u.kd_supplier = m.kd_supplier + AND m.no_nota = b.no_faktur + AND b.status = 'K' + AND m.tgl_retur BETWEEN '$startDate' AND '$endDate' + AND m.validasi = '1' + GROUP BY br.kode_strip , m.kd_supplier"; + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cekR = mysqli_stmt_num_rows($stmt2); + if($cekR >= 0){//jika ada retur + mysqli_stmt_bind_result($stmt2,$kel,$str,$kdsup,$nmsup,$jmlRetur,$rpRetur); + + $priaR = 0; + $wanitaR = 0; + $anakR = 0; + $sepatuR = 0; + $strRet = array(); + $jmlR = array(); + $rpR = array(); + + $ttJmlRetur = array(); + $ttJmlRetur['pria']['jml'] = 0; + $ttJmlRetur['pria']['rp'] = 0; + $ttJmlRetur['wanita']['jml'] = 0; + $ttJmlRetur['wanita']['rp'] = 0; + $ttJmlRetur['anak']['jml'] = 0; + $ttJmlRetur['anak']['rp'] = 0; + $ttJmlRetur['sepatu']['jml'] = 0; + $ttJmlRetur['sepatu']['rp'] = 0; + + + while(mysqli_stmt_fetch($stmt2)){ + if($kel == 'P'){ + $strRet[$priaR]['pria'] = $str; + $jmlR[$priaR]['pria'] = $jmlRetur; + $rpR[$priaR]['pria'] = $rpRetur; + $ttJmlRetur['pria']['jml'] += $jmlRetur; + $ttJmlRetur['pria']['rp'] += $rpRetur; + $kdSupplier[$priaR]['pria'] = $kdsup; + $nmSupplier[$priaR]['pria'] = $nmsup; + $priaR++; + }elseif($kel == 'W'){ + $strRet[$wanitaR]['wanita'] = $str; + $jmlR[$wanitaR]['wanita'] = $jmlRetur; + $rpR[$wanitaR]['wanita'] = $rpRetur; + $ttJmlRetur['wanita']['jml'] += $jmlRetur; + $ttJmlRetur['wanita']['rp'] += $rpRetur; + $kdSupplier[$wanitaR]['wanita'] = $kdsup; + $nmSupplier[$wanitaR]['wanita'] = $nmsup; + $wanitaR++; + }elseif($kel == 'A'){ + $strRet[$anakR]['anak'] = $str; + $jmlR[$anakR]['anak'] = $jmlRetur; + $rpR[$anakR]['anak'] = $rpRetur; + $ttJmlRetur['anak']['jml'] += $jmlRetur; + $ttJmlRetur['anak']['rp'] += $rpRetur; + $kdSupplier[$anakR]['anak'] = $kdsup; + $nmSupplier[$anakR]['anak'] = $nmsup; + $anakR++; + }else{ + $strRet[$sepatuR]['sepatu'] = $str; + $jmlR[$sepatuR]['sepatu'] = $jmlRetur; + $rpR[$sepatuR]['sepatu'] = $rpRetur; + $ttJmlRetur['sepatu']['jml'] += $jmlRetur; + $ttJmlRetur['sepatu']['rp'] += $rpRetur; + $kdSupplier[$sepatuR]['sepatu'] = $kdsup; + $nmSupplier[$sepatuR]['sepatu'] = $nmsup; + $sepatuR++; + } + } + + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_free_result($stmt2); + mysqli_stmt_close($stmt2); + } + } + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek >= 0){ + mysqli_stmt_bind_result($stmt,$kelJns,$strip,$kd,$nm,$jmlBeli,$hrgPokok); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + + print("
"); + print("

Laporan Pembelian Konsinyasi Per Supllier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PADA TANGGAL : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $str = array(); + $jmlB = array(); + $rpB = array(); + $HP = array(); + + while(mysqli_stmt_fetch($stmt)){ + if($jmlRetur == ''){ + $jmlRetur = 0; + } + if($rpRetur == ''){ + $rpRetur = 0; + } + if($kelJns == "P"){ + $kelJns = "Pria"; + $ttJmlBeli['pria']['jml'] += $jmlBeli; + $ttJmlBeli['pria']['hp'] += $hrgPokok; + $str[$pria]['pria'] = $strip; + $jmlB[$pria]['pria'] = $jmlBeli; + $rpB[$pria]['pria'] = $rpBeli; + $HP[$pria]['pria'] = $hrgPokok; + $kdSupp[$pria]['pria'] = $kd; + $nmSupp[$pria]['pria'] = $nm; + $pria++; + }elseif($kelJns == "W"){ + $kelJns = "Wanita"; + $ttJmlBeli['wanita']['jml'] += $jmlBeli; + $ttJmlBeli['wanita']['hp'] += $hrgPokok; + $str[$wanita]['wanita'] = $strip; + $jmlB[$wanita]['wanita'] = $jmlBeli; + $rpB[$wanita]['wanita'] = $rpBeli; + $HP[$wanita]['wanita'] = $hrgPokok; + $kdSupp[$wanita]['wanita'] = $kd; + $nmSupp[$wanita]['wanita'] = $nm; + $wanita++; + }elseif($kelJns == "A"){ + $kelJns = "Anak"; + $ttJmlBeli['anak']['jml'] += $jmlBeli; + $ttJmlBeli['anak']['hp'] += $hrgPokok; + $str[$anak]['anak'] = $strip; + $jmlB[$anak]['anak'] = $jmlBeli; + $rpB[$anak]['anak'] = $rpBeli; + $HP[$anak]['anak'] = $hrgPokok; + $kdSupp[$anak]['anak'] = $kd; + $nmSupp[$anak]['anak'] = $nm; + $anak++; + }else{ + $kelJns = "Sepatu"; + $ttJmlBeli['sepatu']['jml'] += $jmlBeli; + $ttJmlBeli['sepatu']['hp'] += $hrgPokok; + $str[$sepatu]['sepatu'] = $strip; + $jmlB[$sepatu]['sepatu'] = $jmlBeli; + $rpB[$sepatu]['sepatu'] = $rpBeli; + $HP[$sepatu]['sepatu'] = $hrgPokok; + $kdSupp[$sepatu]['sepatu'] = $kd; + $nmSupp[$sepatu]['sepatu'] = $nm; + $sepatu++; + } + + } + print(""); + print(""); + print("
"); + +// SEPATU ------------------------------------------------------------------------- + $jmlkatsepatu = $ttJmlBeli['sepatu']['jml']-$ttJmlRetur['sepatu']['jml']; + $hpkatsepatu = $ttJmlBeli['sepatu']['hp']-$ttJmlRetur['sepatu']['rp']; + + if($ttJmlBeli['sepatu']['jml']!=0){ + print("
"); + for($i=0;$i<$sepatu;$i++){ + if ($str[$i-1]['sepatu']==$str[$i]['sepatu']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlah4 = 0; + $temphp4 = 0; + } + $tempjumlah4 += $jmlB[$i]['sepatu']; + $temphp4 += $HP[$i]['sepatu']; + } + print(""); + print(""); + } + + if($ttJmlRetur['sepatu']['jml']!= 0){ + print(""); + for($x=0;$x<$sepatuR;$x++){ + if ($strRet[$x-1]['sepatu']==$strRet[$x]['sepatu']){ + print(""); + }else{ + print(""); + print(""); + + $tmpjmlR4 = 0; + $tmprpR4 = 0; + } + $tmpjmlR4 += $jmlR[$x]['sepatu']; + $tmprpR4 += $rpR[$x]['sepatu']; + } + print(""); + print(""); + } + print(""); +//---------------------------------------------------------------------------- + $ttjml = $jmlkatpria + $jmlkatwanita + $jmlkatanak + $jmlkatsepatu; + $ttrp = $rpkatpria + $rpkatwanita + $rpkatanak + $rpkatsepatu; + $tthp = $hpkatpria + $hpkatwanita + $hpkatanak + $hpkatsepatu; + + print(" + + "); + + print("
Lini ProdukKode SupplierNama SupplierJumlah BeliTotal HP
".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlah4, 0, ",", ".")."".number_format($temphp4, 0, ",", ".")."
".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlah4, 0, ",", ".")."".number_format($temphp4, 0, ",", ".")."
SUB TOTAL".number_format($ttJmlBeli['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp'], 0, ",", ".")."
Data Retur
".$strRet[$x]['sepatu'].".".$kdSupplier[$x]['sepatu']."".$nmSupplier[$x]['sepatu']."".number_format($jmlR[$x]['sepatu'], 0, ",", ".")."".number_format($rpR[$x]['sepatu'], 0, ",", ".")."
".number_format($tmpjmlR4, 0, ",", ".")."".number_format($tmprpR4, 0, ",", ".")."
".$strRet[$x]['sepatu'].".".$kdSupplier[$x]['sepatu']."".$nmSupplier[$x]['sepatu']."".number_format($jmlR[$x]['sepatu'], 0, ",", ".")."".number_format($rpR[$x]['sepatu'], 0, ",", ".")."
".number_format($tmpjmlR4, 0, ",", ".")."".number_format($tmprpR4, 0, ",", ".")."
SUB TOTAL".number_format($ttJmlRetur['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlRetur['sepatu']['rp'], 0, ",", ".")."
Sub Total".number_format($jmlkatsepatu, 0, ",", ".")."".number_format($hpkatsepatu, 0, ",", ".")."
T O T A L : ".number_format($ttjml, 0, ",", ".")."".number_format($tthp, 0, ",", ".")."

"); + }else{ + echo "Belum ada data pembelian untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/lapbelikons.php~ b/old-source/LaporanBeli/lapbelikons.php~ new file mode 100644 index 0000000..7012f90 --- /dev/null +++ b/old-source/LaporanBeli/lapbelikons.php~ @@ -0,0 +1,309 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:700px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ".master{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + + if(bukaKoneksi()){ + global $conn; + + $query = "SELECT s.kel_jns,substr( d.kode_barang, 1, 2 ) kdBrg, m.kd_supplier, u.nama_supplier, + sum( d.jumlah ) jum, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + FROM d_pembelian d, m_pembelian m, supplier u,strip s + WHERE d.no_faktur = m.no_faktur + AND s.kd_strip = substr( d.kode_barang, 1, 2 ) + AND u.kd_supplier = m.kd_supplier + AND m.status = 'K' + AND m.tgl_masuk BETWEEN '$startDate' AND '$endDate' AND m.validasi = '1' + GROUP BY substr( d.kode_barang, 1, 2 ) , m.kd_supplier"; + $query2 ="SELECT s.kel_jns,substr( d.kd_barang, 1, 2 ) kdBrg, m.kd_supplier, u.nama_supplier, + sum( d.jumlah ) jum,sum(d.jumlah*d.harga_satuan) hp + FROM d_retur_beli d, m_retur_beli m, supplier u,strip s,m_pembelian b + WHERE d.id_retur = m.id_retur + AND s.kd_strip = substr( d.kd_barang, 1, 2 ) + AND u.kd_supplier = m.kd_supplier + AND m.no_nota = b.no_faktur + AND b.status = 'K' + AND m.tgl_retur BETWEEN '$startDate' AND '$endDate' AND m.validasi = '1' + GROUP BY substr( d.kd_barang, 1, 2 ) , m.kd_supplier"; + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cekR = mysqli_stmt_num_rows($stmt2); + if($cekR >= 0){//jika ada retur + mysqli_stmt_bind_result($stmt2,$kel,$str,$kdsup,$nmsup,$jmlRetur,$rpRetur); + + $priaR = 0; + $wanitaR = 0; + $anakR = 0; + $sepatuR = 0; + $strRet = array(); + $jmlR = array(); + $rpR = array(); + + $ttJmlRetur = array(); + $ttJmlRetur['pria']['jml'] = 0; + $ttJmlRetur['pria']['rp'] = 0; + $ttJmlRetur['wanita']['jml'] = 0; + $ttJmlRetur['wanita']['rp'] = 0; + $ttJmlRetur['anak']['jml'] = 0; + $ttJmlRetur['anak']['rp'] = 0; + $ttJmlRetur['sepatu']['jml'] = 0; + $ttJmlRetur['sepatu']['rp'] = 0; + + + while(mysqli_stmt_fetch($stmt2)){ + if($kel == 'P'){ + $strRet[$priaR]['pria'] = $str; + $jmlR[$priaR]['pria'] = $jmlRetur; + $rpR[$priaR]['pria'] = $rpRetur; + $ttJmlRetur['pria']['jml'] += $jmlRetur; + $ttJmlRetur['pria']['rp'] += $rpRetur; + $kdSupplier[$priaR]['pria'] = $kdsup; + $nmSupplier[$priaR]['pria'] = $nmsup; + $priaR++; + }elseif($kel == 'W'){ + $strRet[$wanitaR]['wanita'] = $str; + $jmlR[$wanitaR]['wanita'] = $jmlRetur; + $rpR[$wanitaR]['wanita'] = $rpRetur; + $ttJmlRetur['wanita']['jml'] += $jmlRetur; + $ttJmlRetur['wanita']['rp'] += $rpRetur; + $kdSupplier[$wanitaR]['wanita'] = $kdsup; + $nmSupplier[$wanitaR]['wanita'] = $nmsup; + $wanitaR++; + }elseif($kel == 'A'){ + $strRet[$anakR]['anak'] = $str; + $jmlR[$anakR]['anak'] = $jmlRetur; + $rpR[$anakR]['anak'] = $rpRetur; + $ttJmlRetur['anak']['jml'] += $jmlRetur; + $ttJmlRetur['anak']['rp'] += $rpRetur; + $kdSupplier[$anakR]['anak'] = $kdsup; + $nmSupplier[$anakR]['anak'] = $nmsup; + $anakR++; + }else{ + $strRet[$sepatuR]['sepatu'] = $str; + $jmlR[$sepatuR]['sepatu'] = $jmlRetur; + $rpR[$sepatuR]['sepatu'] = $rpRetur; + $ttJmlRetur['sepatu']['jml'] += $jmlRetur; + $ttJmlRetur['sepatu']['rp'] += $rpRetur; + $kdSupplier[$sepatuR]['sepatu'] = $kdsup; + $nmSupplier[$sepatuR]['sepatu'] = $nmsup; + $sepatuR++; + } + } + + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_free_result($stmt2); + mysqli_stmt_close($stmt2); + } + } + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek >= 0){ + mysqli_stmt_bind_result($stmt,$kelJns,$strip,$kd,$nm,$jmlBeli,$hrgPokok); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + + print("
"); + print("

Laporan Pembelian Per Supllier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PADA TANGGAL : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $str = array(); + $jmlB = array(); + $rpB = array(); + $HP = array(); + + while(mysqli_stmt_fetch($stmt)){ + if($jmlRetur == ''){ + $jmlRetur = 0; + } + if($rpRetur == ''){ + $rpRetur = 0; + } + if($kelJns == "P"){ + $kelJns = "Pria"; + $ttJmlBeli['pria']['jml'] += $jmlBeli; + $ttJmlBeli['pria']['hp'] += $hrgPokok; + $str[$pria]['pria'] = $strip; + $jmlB[$pria]['pria'] = $jmlBeli; + $rpB[$pria]['pria'] = $rpBeli; + $HP[$pria]['pria'] = $hrgPokok; + $kdSupp[$pria]['pria'] = $kd; + $nmSupp[$pria]['pria'] = $nm; + $pria++; + }elseif($kelJns == "W"){ + $kelJns = "Wanita"; + $ttJmlBeli['wanita']['jml'] += $jmlBeli; + $ttJmlBeli['wanita']['hp'] += $hrgPokok; + $str[$wanita]['wanita'] = $strip; + $jmlB[$wanita]['wanita'] = $jmlBeli; + $rpB[$wanita]['wanita'] = $rpBeli; + $HP[$wanita]['wanita'] = $hrgPokok; + $kdSupp[$wanita]['wanita'] = $kd; + $nmSupp[$wanita]['wanita'] = $nm; + $wanita++; + }elseif($kelJns == "A"){ + $kelJns = "Anak"; + $ttJmlBeli['anak']['jml'] += $jmlBeli; + $ttJmlBeli['anak']['hp'] += $hrgPokok; + $str[$anak]['anak'] = $strip; + $jmlB[$anak]['anak'] = $jmlBeli; + $rpB[$anak]['anak'] = $rpBeli; + $HP[$anak]['anak'] = $hrgPokok; + $kdSupp[$anak]['anak'] = $kd; + $nmSupp[$anak]['anak'] = $nm; + $anak++; + }else{ + $kelJns = "Sepatu"; + $ttJmlBeli['sepatu']['jml'] += $jmlBeli; + $ttJmlBeli['sepatu']['hp'] += $hrgPokok; + $str[$sepatu]['sepatu'] = $strip; + $jmlB[$sepatu]['sepatu'] = $jmlBeli; + $rpB[$sepatu]['sepatu'] = $rpBeli; + $HP[$sepatu]['sepatu'] = $hrgPokok; + $kdSupp[$sepatu]['sepatu'] = $kd; + $nmSupp[$sepatu]['sepatu'] = $nm; + $sepatu++; + } + + } + print(""); + print(""); + print("
"); + +/* PRIA -------------------------------------------------------------------------*/ + $jmlkatpria = $ttJmlBeli['pria']['jml']-$ttJmlRetur['pria']['jml']; + $hpkatpria = $ttJmlBeli['pria']['hp']-$ttJmlRetur['pria']['rp']; + + if($ttJmlBeli['pria']['jml']!=0){ + print("
"); + for($i=0;$i<$pria;$i++){ + print(""); + } + print(""); + } + + if($ttJmlRetur['pria']['jml']!= 0){ + print(""); + for($x=0;$x<$priaR;$x++){ + print(""); + } + print(""); + } + + print(""); +/* WANITA -------------------------------------------------------------------------*/ + $jmlkatwanita = $ttJmlBeli['wanita']['jml']-$ttJmlRetur['wanita']['jml']; + $hpkatwanita = $ttJmlBeli['wanita']['hp']-$ttJmlRetur['wanita']['rp']; + + if($ttJmlBeli['wanita']['jml']!=0){ + print(""); + for($i=0;$i<$wanita;$i++){ + print(""); + } + print(""); + } + + if($ttJmlRetur['wanita']['jml']!= 0){ + print(""); + for($x=0;$x<$wanitaR;$x++){ + print(""); + } + print(""); + } + + print(""); +/* ANAK -------------------------------------------------------------------------*/ + $jmlkatanak = $ttJmlBeli['anak']['jml']-$ttJmlRetur['anak']['jml']; + $hpkatanak = $ttJmlBeli['anak']['hp']-$ttJmlRetur['anak']['rp']; + + if($ttJmlBeli['anak']['jml']!=0){ + print(""); + for($i=0;$i<$anak;$i++){ + print(""); + } + print(""); + } + + if($ttJmlRetur['anak']['jml']!= 0){ + print(""); + for($x=0;$x<$anakR;$x++){ + print(""); + } + print(""); + } + + print(""); +/* SEPATU -------------------------------------------------------------------------*/ + $jmlkatsepatu = $ttJmlBeli['sepatu']['jml']-$ttJmlRetur['sepatu']['jml']; + $hpkatsepatu = $ttJmlBeli['sepatu']['hp']-$ttJmlRetur['sepatu']['rp']; + + if($ttJmlBeli['sepatu']['jml']!=0){ + print(""); + for($i=0;$i<$sepatu;$i++){ + print(""); + } + print(""); + } + + if($ttJmlRetur['sepatu']['jml']!= 0){ + print(""); + for($x=0;$x<$sepatuR;$x++){ + print(""); + } + print(""); + } + + print(""); + + $ttjml = $jmlkatpria + $jmlkatwanita + $jmlkatanak + $jmlkatsepatu; + $ttrp = $rpkatpria + $rpkatwanita + $rpkatanak + $rpkatsepatu; + $tthp = $hpkatpria + $hpkatwanita + $hpkatanak + $hpkatsepatu; + + print(" + + "); + + print("
KategoriLini ProdukKode SupplierNama SupplierJumlah BeliTotal HP
Pria
~".$str[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlB[$i]['pria'], 0, ",", ".")."".number_format($HP[$i]['pria'], 0, ",", ".")."
".number_format($ttJmlBeli['pria']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['hp'], 0, ",", ".")."
Retur Pria
~".$strRet[$x]['pria'].".".$kdSupplier[$x]['pria']."".$nmSupplier[$x]['pria']."".number_format($jmlR[$x]['pria'], 0, ",", ".")."".number_format($rpR[$x]['pria'], 0, ",", ".")."
".number_format($ttJmlRetur['pria']['jml'], 0, ",", ".")."".number_format($ttJmlRetur['pria']['rp'], 0, ",", ".")."
TOTAL PRIA".number_format($jmlkatpria, 0, ",", ".")."".number_format($hpkatpria, 0, ",", ".")."
Wanita
~".$str[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlB[$i]['wanita'], 0, ",", ".")."".number_format($HP[$i]['wanita'], 0, ",", ".")."
".number_format($ttJmlBeli['wanita']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['hp'], 0, ",", ".")."
Retur Wanita
~".$strRet[$x]['wanita'].".".$kdSupplier[$x]['wanita']."".$nmSupplier[$x]['wanita']."".number_format($jmlR[$x]['wanita'], 0, ",", ".")."".number_format($rpR[$x]['wanita'], 0, ",", ".")."
".number_format($ttJmlRetur['wanita']['jml'], 0, ",", ".")."".number_format($ttJmlRetur['wanita']['rp'], 0, ",", ".")."
TOTAL Wanita".number_format($jmlkatwanita, 0, ",", ".")."".number_format($hpkatwanita, 0, ",", ".")."
Anak
~".$str[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlB[$i]['anak'], 0, ",", ".")."".number_format($HP[$i]['anak'], 0, ",", ".")."
".number_format($ttJmlBeli['anak']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['hp'], 0, ",", ".")."
Retur Anak
~".$strRet[$x]['anak'].".".$kdSupplier[$x]['anak']."".$nmSupplier[$x]['anak']."".number_format($jmlR[$x]['anak'], 0, ",", ".")."".number_format($rpR[$x]['anak'], 0, ",", ".")."
".number_format($ttJmlRetur['anak']['jml'], 0, ",", ".")."".number_format($ttJmlRetur['anak']['rp'], 0, ",", ".")."
TOTAL Anak".number_format($jmlkatanak, 0, ",", ".")."".number_format($hpkatanak, 0, ",", ".")."
Sepatu
~".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($ttJmlBeli['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp'], 0, ",", ".")."
Retur Sepatu
~".$strRet[$x]['sepatu'].".".$kdSupplier[$x]['sepatu']."".$nmSupplier[$x]['sepatu']."".number_format($jmlR[$x]['sepatu'], 0, ",", ".")."".number_format($rpR[$x]['sepatu'], 0, ",", ".")."
".number_format($ttJmlRetur['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlRetur['sepatu']['rp'], 0, ",", ".")."
TOTAL Sepatu".number_format($jmlkatsepatu, 0, ",", ".")."".number_format($hpkatsepatu, 0, ",", ".")."
T O T A L : ".number_format($ttjml, 0, ",", ".")."".number_format($tthp, 0, ",", ".")."

"); + }else{ + echo "Belum ada data pembelian untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/lapbeliperfak.php b/old-source/LaporanBeli/lapbeliperfak.php new file mode 100644 index 0000000..9d5e582 --- /dev/null +++ b/old-source/LaporanBeli/lapbeliperfak.php @@ -0,0 +1,109 @@ +"; + echo "div#divprint{width:1024px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:950px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:50px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $kdsupp = $_POST['kdsupp']; + + + if(bukaKoneksi()){ + global $conn; + + if($kdsupp != ""){ + $query = "SELECT m.no_faktur, m.tgl_masuk, m.tgl_nota, m.tgl_jatuh_tempo, m.kd_supplier, s.nama_supplier, sum( d.jum_fisik ) total_beli, + m.rp_beli, + m.keterangan, k.nama + FROM d_pembelian d, m_pembelian m, supplier s, karyawan k + WHERE d.no_faktur = m.no_faktur + AND s.kd_supplier = m.kd_supplier + AND m.tgl_masuk + BETWEEN '$startDate' AND '$endDate' + AND m.validasi = '1' + AND m.status_revisi = '1' + AND m.nik = k.nik + AND s.kd_supplier = '$kdsupp' + GROUP BY m.no_faktur + ORDER BY m.tgl_masuk, m.kd_supplier"; + + }else{ //sum(d.jum_fisik*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) rp_beli, + $query = "SELECT m.no_faktur, m.tgl_masuk, m.tgl_nota, m.tgl_jatuh_tempo, m.kd_supplier, s.nama_supplier, sum( d.jum_fisik ) total_beli, + m.rp_beli, + m.keterangan, k.nama + FROM d_pembelian d, m_pembelian m, supplier s, karyawan k + WHERE d.no_faktur = m.no_faktur + AND s.kd_supplier = m.kd_supplier + AND m.tgl_masuk + BETWEEN '$startDate' AND '$endDate' + AND m.validasi = '1' + AND m.status_revisi = '1' + AND m.nik = k.nik + GROUP BY m.no_faktur + ORDER BY m.tgl_masuk, m.kd_supplier"; + + } + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$faktur,$tglMsk,$tglNota,$tglTmp,$kdSup,$nmSup,$ttBeli,$ttRp,$ket,$name); + $ttJumlah = array(); + $ttJumlah['faktur'] = 0; + $ttJumlah['jml'] = 0; + $ttJumlah['rp'] = 0; + + + print("
"); + print("

Laporan Pembelian Barang Per Nomor Faktur



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("*** PM.5 ***
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['faktur']++; + $ttJumlah['jml'] += $ttBeli; + $ttJumlah['rp'] += $ttRp; + + print(" + + + + + "); + } + + print("
No. FakturTanggal MasukTanggal NotaTanggal Jt TempoKode Supp.Nama SupplierJumlah PembelianTotal PembelianKeteranganNama Assko
.$faktur".encTgl($tglMsk)."".encTgl($tglNota)."".encTgl($tglTmp).".$kdSup$nmSup".number_format($ttBeli,0,',','.')."".number_format($ttRp,0,',','.')."$ket$name

"); + print("
"); + print(""); + print(""); + print(""); + + print("
Total Lembar Nota : ".number_format($ttJumlah['faktur'],0,',','.')."
Total Jumlah Beli : ".number_format($ttJumlah['jml'],0,',','.')."
Total Pembelian : ".number_format($ttJumlah['rp'],0,',','.')."
"); + }else{ + echo "Belum ada data pembelian untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/lapbeliperfak.php~ b/old-source/LaporanBeli/lapbeliperfak.php~ new file mode 100644 index 0000000..a1b6d28 --- /dev/null +++ b/old-source/LaporanBeli/lapbeliperfak.php~ @@ -0,0 +1,70 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + + if(bukaKoneksi()){ + global $conn; + $query = "SELECT m.no_faktur, m.tgl_masuk, m.tgl_nota, m.tgl_jatuh_tempo, + m.kd_supplier, s.nama_supplier, m.total_beli, m.rp_beli + FROM m_pembelian m, supplier s + WHERE s.kd_supplier = m.kd_supplier AND m.tgl_masuk between '$startDate' AND '$endDate' AND m.validasi = '1' + ORDER BY m.tgl_masuk,m.kd_supplier"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$faktur,$tglMsk,$tglNota,$tglTmp,$kdSup,$nmSup,$ttBeli,$ttRp); + $ttJumlah = array(); + $ttJumlah['jml'] = 0; + $ttJumlah['rp'] = 0; + + print("
"); + print("

Laporan Pembelian Barang Per Nomor Faktur



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("*** PM.5 ***
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['jml'] += $ttBeli; + $ttJumlah['rp'] += $ttRp; + print(""); + } + + print("
No. FakturTanggal MasukTanggal NotaTanggal Jt TempoKode Supp.Nama SupplierJumlah PembelianTotal Pembelian
.$faktur".encTgl($tglMsk)."".encTgl($tglNota)."".encTgl($tglTmp).".$kdSup$nmSup".number_format($ttBeli,0,',','.')."".number_format($ttRp,0,',','.')."

"); + print("
"); + + print(""); + print(""); + + print("
Total Jumlah Beli : ".number_format($ttJumlah['jml'],0,',','.')."
Total Pembelian : ".number_format($ttJumlah['rp'],0,',','.')."
"); + }else{ + echo "Belum ada data pembelian untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/lapbeliperkat.php b/old-source/LaporanBeli/lapbeliperkat.php new file mode 100644 index 0000000..1257c94 --- /dev/null +++ b/old-source/LaporanBeli/lapbeliperkat.php @@ -0,0 +1,233 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:700px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ".master{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + if(bukaKoneksi()){ + global $conn; + + $query = "SELECT s.kel_jns,s.nama_strip lini,k.ked_produk, sum( d.jum_fisik ) jum, + sum(d.jum_fisik*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + FROM d_pembelian d, m_pembelian m,strip s,barang b,kedalaman_produk k + WHERE d.no_faktur = m.no_faktur + AND b.kode_barang = d.kode_barang + AND s.kd_strip = b.kode_strip + and (b.kode_strip = k.kode_strip and b.ked_produk = k.kode_ked_produk) + AND m.tgl_masuk BETWEEN '$startDate' AND '$endDate' + AND m.validasi = '1' + AND m.status_revisi = '1' + GROUP BY s.kel_jns,b.kode_strip,b.ked_produk"; + $query2 = "SELECT s.kel_jns, s.nama_strip lini,k.ked_produk, sum( r.jumlah ) jum, + sum( r.jumlah*r.harga_satuan ) hp + FROM d_retur_beli r,strip s,m_retur_beli m, barang b,kedalaman_produk k + WHERE m.tgl_retur BETWEEN '$startDate' AND '$endDate' + AND m.validasi = '1' + AND b.kode_barang = r.kd_barang + and (b.kode_strip = k.kode_strip and b.ked_produk = k.kode_ked_produk) + AND s.kd_strip = b.kode_strip + AND m.id_retur = r.id_retur + GROUP BY s.kel_jns, b.kode_strip,b.ked_produk"; + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cekR = mysqli_stmt_num_rows($stmt2); + if($cekR >= 0){//jika ada retur + mysqli_stmt_bind_result($stmt2,$kel,$str,$subprod,$jmlRetur,$rpRetur); + echo $kel,$str,$jmlRetur,$rpRetur; + $priaR = 0; + $wanitaR = 0; + $anakR = 0; + $sepatuR = 0; + $strRet = array(); + $sub = array(); + $jmlR = array(); + $rpR = array(); + + $ttJmlRetur = array(); + $ttJmlRetur['pria']['jml'] = 0; + $ttJmlRetur['pria']['rp'] = 0; + $ttJmlRetur['wanita']['jml'] = 0; + $ttJmlRetur['wanita']['rp'] = 0; + $ttJmlRetur['anak']['jml'] = 0; + $ttJmlRetur['anak']['rp'] = 0; + $ttJmlRetur['sepatu']['jml'] = 0; + $ttJmlRetur['sepatu']['rp'] = 0; + + + while(mysqli_stmt_fetch($stmt2)){ + if($kel == 'P'){ + $strRet[$priaR]['pria'] = $str; + $jmlR[$priaR]['pria'] = $jmlRetur; + $rpR[$priaR]['pria'] = $rpRetur; + $ttJmlRetur['pria']['jml'] += $jmlRetur; + $ttJmlRetur['pria']['rp'] += $rpRetur; + $priaR++; + }elseif($kel == 'W'){ + $strRet[$wanitaR]['wanita'] = $str; + $jmlR[$wanitaR]['wanita'] = $jmlRetur; + $rpR[$wanitaR]['wanita'] = $rpRetur; + $ttJmlRetur['wanita']['jml'] += $jmlRetur; + $ttJmlRetur['wanita']['rp'] += $rpRetur; + $wanitaR++; + }elseif($kel == 'A'){ + $strRet[$anakR]['anak'] = $str; + $jmlR[$anakR]['anak'] = $jmlRetur; + $rpR[$anakR]['anak'] = $rpRetur; + $ttJmlRetur['anak']['jml'] += $jmlRetur; + $ttJmlRetur['anak']['rp'] += $rpRetur; + $anakR++; + }else{ + $strRet[$sepatuR]['sepatu'] = $str; + $sub[$sepatuR]['sepatu'] = $subprod; + $jmlR[$sepatuR]['sepatu'] = $jmlRetur; + $rpR[$sepatuR]['sepatu'] = $rpRetur; + $ttJmlRetur['sepatu']['jml'] += $jmlRetur; + $ttJmlRetur['sepatu']['rp'] += $rpRetur; + $sepatuR++; + } + } + mysqli_stmt_free_result($stmt2); + mysqli_stmt_close($stmt2); + } + } + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek >= 0){ + mysqli_stmt_bind_result($stmt,$kelJns,$strip,$subprod,$jmlBeli,$hrgPokok); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + + print("
"); + print("

Laporan Pembelian Per Kelompok Kategori



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PADA TANGGAL : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $str = array(); + $sub = array(); + $jmlB = array(); + $rpB = array(); + $HP = array(); + + while(mysqli_stmt_fetch($stmt)){ + if($jmlRetur == ''){ + $jmlRetur = 0; + } + if($rpRetur == ''){ + $rpRetur = 0; + } + if($kelJns == "P"){ + $kelJns = "Pria"; + $ttJmlBeli['pria']['jml'] += $jmlBeli; + $ttJmlBeli['pria']['hp'] += $hrgPokok; + $str[$pria]['pria'] = $strip; + $jmlB[$pria]['pria'] = $jmlBeli; + $rpB[$pria]['pria'] = $rpBeli; + $HP[$pria]['pria'] = $hrgPokok; + $pria++; + }elseif($kelJns == "W"){ + $kelJns = "Wanita"; + $ttJmlBeli['wanita']['jml'] += $jmlBeli; + $ttJmlBeli['wanita']['hp'] += $hrgPokok; + $str[$wanita]['wanita'] = $strip; + $jmlB[$wanita]['wanita'] = $jmlBeli; + $rpB[$wanita]['wanita'] = $rpBeli; + $HP[$wanita]['wanita'] = $hrgPokok; + $wanita++; + }elseif($kelJns == "A"){ + $kelJns = "Anak"; + $ttJmlBeli['anak']['jml'] += $jmlBeli; + $ttJmlBeli['anak']['hp'] += $hrgPokok; + $str[$anak]['anak'] = $strip; + $jmlB[$anak]['anak'] = $jmlBeli; + $rpB[$anak]['anak'] = $rpBeli; + $HP[$anak]['anak'] = $hrgPokok; + $anak++; + }else{ + $kelJns = "Sepatu"; + $ttJmlBeli['sepatu']['jml'] += $jmlBeli; + $ttJmlBeli['sepatu']['hp'] += $hrgPokok; + $str[$sepatu]['sepatu'] = $strip; + $sub[$sepatu]['sepatu'] = $subprod; + $jmlB[$sepatu]['sepatu'] = $jmlBeli; + $rpB[$sepatu]['sepatu'] = $rpBeli; + $HP[$sepatu]['sepatu'] = $hrgPokok; + $sepatu++; + } + + } + print(""); + print(""); + print("
"); + + +/* SEPATU -------------------------------------------------------------------------*/ + $jmlkatsepatu = $ttJmlBeli['sepatu']['jml']-$ttJmlRetur['sepatu']['jml']; + $hpkatsepatu = $ttJmlBeli['sepatu']['hp']-$ttJmlRetur['sepatu']['rp']; + + if($ttJmlBeli['sepatu']['jml']!=0){ + print("
"); + for($i=0;$i<$sepatu;$i++){ + print(""); + } + print(""); + } + + if($ttJmlRetur['sepatu']['jml']!= 0){ + print(""); + for($x=0;$x<$sepatuR;$x++){ + print(""); + } + print(""); + } + + print(""); + + $ttjml = $jmlkatpria + $jmlkatwanita + $jmlkatanak + $jmlkatsepatu; + $ttrp = $rpkatpria + $rpkatwanita + $rpkatanak + $rpkatsepatu; + $tthp = $hpkatpria + $hpkatwanita + $hpkatanak + $hpkatsepatu; + + print(" + + "); + + print("
Lini ProdukKedalaman ProdukJumlah BeliTotal HP
".$str[$i]['sepatu']."".$sub[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($ttJmlBeli['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp'], 0, ",", ".")."
Data Retur
".$strRet[$x]['sepatu']."".$sub[$x]['sepatu']."".number_format($jmlR[$x]['sepatu'], 0, ",", ".")."".number_format($rpR[$x]['sepatu'], 0, ",", ".")."
".number_format($ttJmlRetur['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlRetur['sepatu']['rp'], 0, ",", ".")."
Sub Total".number_format($jmlkatsepatu, 0, ",", ".")."".number_format($hpkatsepatu, 0, ",", ".")."
T O T A L : ".number_format($ttjml, 0, ",", ".")."".number_format($tthp, 0, ",", ".")."

"); + }else{ + echo "Belum ada data pembelian untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/lapbeliperkat.php~ b/old-source/LaporanBeli/lapbeliperkat.php~ new file mode 100644 index 0000000..c124f6d --- /dev/null +++ b/old-source/LaporanBeli/lapbeliperkat.php~ @@ -0,0 +1,306 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:700px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ".master{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + + if(bukaKoneksi()){ + global $conn; + +// $query = "SELECT s.kel_jns, substr( d.kode_barang, 1, 2 ) lini, sum( d.jumlah ) jum , +// sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp +// FROM d_pembelian d +// INNER JOIN strip s ON ( s.kd_strip = substr( d.kode_barang, 1, 2 ) ) +// INNER JOIN m_pembelian m ON ( m.no_faktur = d.no_faktur ) +// WHERE m.no_faktur +// IN ( +// SELECT no_faktur +// FROM m_pembelian +// WHERE tgl_masuk +// BETWEEN '$startDate' AND '$endDate' +// )AND m.validasi = '1' +// GROUP BY s.kel_jns, substr( d.kode_barang, 1, 2 )"; + $query = "SELECT s.kel_jns,substr( d.kode_barang, 1, 2 ) lini,sum( d.jum_fisik ) jum, + sum(d.jum_fisik*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + FROM d_pembelian d, m_pembelian m,strip s + WHERE d.no_faktur = m.no_faktur + AND s.kd_strip = substr( d.kode_barang, 1, 2 ) + AND m.tgl_masuk BETWEEN '$startDate' AND '$endDate' AND m.validasi = '1' + GROUP BY s.kel_jns,substr( d.kode_barang, 1, 2 )"; +// $query2 ="SELECT s.kel_jns, substr( r.kd_barang, 1, 2 ) lini, sum( r.jumlah ) jum, sum( r.jumlah*r.harga_satuan ) hp +// FROM d_retur_beli r +// INNER JOIN strip s ON ( s.kd_strip = substr( r.kd_barang, 1, 2 ) ) +// INNER JOIN m_retur_beli m ON ( m.id_retur = r.id_retur ) +// WHERE m.tgl_retur +// BETWEEN '$startDate' AND '$endDate' AND m.validasi = '1' +// GROUP BY s.kel_jns, substr( r.kd_barang, 1, 2 )"; + $query2 = "SELECT s.kel_jns, substr( r.kd_barang, 1, 2 ) lini, sum( r.jumlah ) jum, + sum( r.jumlah*r.harga_satuan ) hp + FROM d_retur_beli r,strip s,m_retur_beli m + WHERE m.tgl_retur BETWEEN '$startDate' AND '$endDate' AND m.validasi = '1' + AND s.kd_strip = substr( r.kd_barang, 1, 2 ) + AND m.id_retur = r.id_retur + GROUP BY s.kel_jns, substr( r.kd_barang, 1, 2 )"; + + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cekR = mysqli_stmt_num_rows($stmt2); + if($cekR >= 0){//jika ada retur + mysqli_stmt_bind_result($stmt2,$kel,$str,$jmlRetur,$rpRetur); + + $priaR = 0; + $wanitaR = 0; + $anakR = 0; + $sepatuR = 0; + $strRet = array(); + $jmlR = array(); + $rpR = array(); + + $ttJmlRetur = array(); + $ttJmlRetur['pria']['jml'] = 0; + $ttJmlRetur['pria']['rp'] = 0; + $ttJmlRetur['wanita']['jml'] = 0; + $ttJmlRetur['wanita']['rp'] = 0; + $ttJmlRetur['anak']['jml'] = 0; + $ttJmlRetur['anak']['rp'] = 0; + $ttJmlRetur['sepatu']['jml'] = 0; + $ttJmlRetur['sepatu']['rp'] = 0; + + + while(mysqli_stmt_fetch($stmt2)){ + if($kel == 'P'){ + $strRet[$priaR]['pria'] = $str; + $jmlR[$priaR]['pria'] = $jmlRetur; + $rpR[$priaR]['pria'] = $rpRetur; + $ttJmlRetur['pria']['jml'] += $jmlRetur; + $ttJmlRetur['pria']['rp'] += $rpRetur; + $priaR++; + }elseif($kel == 'W'){ + $strRet[$wanitaR]['wanita'] = $str; + $jmlR[$wanitaR]['wanita'] = $jmlRetur; + $rpR[$wanitaR]['wanita'] = $rpRetur; + $ttJmlRetur['wanita']['jml'] += $jmlRetur; + $ttJmlRetur['wanita']['rp'] += $rpRetur; + $wanitaR++; + }elseif($kel == 'A'){ + $strRet[$anakR]['anak'] = $str; + $jmlR[$anakR]['anak'] = $jmlRetur; + $rpR[$anakR]['anak'] = $rpRetur; + $ttJmlRetur['anak']['jml'] += $jmlRetur; + $ttJmlRetur['anak']['rp'] += $rpRetur; + $anakR++; + }else{ + $strRet[$sepatuR]['sepatu'] = $str; + $jmlR[$sepatuR]['sepatu'] = $jmlRetur; + $rpR[$sepatuR]['sepatu'] = $rpRetur; + $ttJmlRetur['sepatu']['jml'] += $jmlRetur; + $ttJmlRetur['sepatu']['rp'] += $rpRetur; + $sepatuR++; + } + } + mysqli_stmt_free_result($stmt2); + mysqli_stmt_close($stmt2); + } + } + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek >= 0){ + mysqli_stmt_bind_result($stmt,$kelJns,$strip,$jmlBeli,$hrgPokok); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + + print("
"); + print("

Laporan Pembelian Per Kelompok Kategori



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PADA TANGGAL : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $str = array(); + $jmlB = array(); + $rpB = array(); + $HP = array(); + + while(mysqli_stmt_fetch($stmt)){ + if($jmlRetur == ''){ + $jmlRetur = 0; + } + if($rpRetur == ''){ + $rpRetur = 0; + } + if($kelJns == "P"){ + $kelJns = "Pria"; + $ttJmlBeli['pria']['jml'] += $jmlBeli; + $ttJmlBeli['pria']['hp'] += $hrgPokok; + $str[$pria]['pria'] = $strip; + $jmlB[$pria]['pria'] = $jmlBeli; + $rpB[$pria]['pria'] = $rpBeli; + $HP[$pria]['pria'] = $hrgPokok; + $pria++; + }elseif($kelJns == "W"){ + $kelJns = "Wanita"; + $ttJmlBeli['wanita']['jml'] += $jmlBeli; + $ttJmlBeli['wanita']['hp'] += $hrgPokok; + $str[$wanita]['wanita'] = $strip; + $jmlB[$wanita]['wanita'] = $jmlBeli; + $rpB[$wanita]['wanita'] = $rpBeli; + $HP[$wanita]['wanita'] = $hrgPokok; + $wanita++; + }elseif($kelJns == "A"){ + $kelJns = "Anak"; + $ttJmlBeli['anak']['jml'] += $jmlBeli; + $ttJmlBeli['anak']['hp'] += $hrgPokok; + $str[$anak]['anak'] = $strip; + $jmlB[$anak]['anak'] = $jmlBeli; + $rpB[$anak]['anak'] = $rpBeli; + $HP[$anak]['anak'] = $hrgPokok; + $anak++; + }else{ + $kelJns = "Sepatu"; + $ttJmlBeli['sepatu']['jml'] += $jmlBeli; + $ttJmlBeli['sepatu']['hp'] += $hrgPokok; + $str[$sepatu]['sepatu'] = $strip; + $jmlB[$sepatu]['sepatu'] = $jmlBeli; + $rpB[$sepatu]['sepatu'] = $rpBeli; + $HP[$sepatu]['sepatu'] = $hrgPokok; + $sepatu++; + } + + } + print(""); + print(""); + print("
"); + +/* PRIA -------------------------------------------------------------------------*/ + $jmlkatpria = $ttJmlBeli['pria']['jml']-$ttJmlRetur['pria']['jml']; + $hpkatpria = $ttJmlBeli['pria']['hp']-$ttJmlRetur['pria']['rp']; + + if($ttJmlBeli['pria']['jml']!=0){ + print("
"); + for($i=0;$i<$pria;$i++){ + print(""); + } + print(""); + } + + if($ttJmlRetur['pria']['jml']!= 0){ + print(""); + for($x=0;$x<$priaR;$x++){ + print(""); + } + print(""); + } + + print(""); +/* WANITA -------------------------------------------------------------------------*/ + $jmlkatwanita = $ttJmlBeli['wanita']['jml']-$ttJmlRetur['wanita']['jml']; + $hpkatwanita = $ttJmlBeli['wanita']['hp']-$ttJmlRetur['wanita']['rp']; + + if($ttJmlBeli['wanita']['jml']!=0){ + print(""); + for($i=0;$i<$wanita;$i++){ + print(""); + } + print(""); + } + + if($ttJmlRetur['wanita']['jml']!= 0){ + print(""); + for($x=0;$x<$wanitaR;$x++){ + print(""); + } + print(""); + } + + print(""); +/* ANAK -------------------------------------------------------------------------*/ + $jmlkatanak = $ttJmlBeli['anak']['jml']-$ttJmlRetur['anak']['jml']; + $hpkatanak = $ttJmlBeli['anak']['hp']-$ttJmlRetur['anak']['rp']; + + if($ttJmlBeli['anak']['jml']!=0){ + print(""); + for($i=0;$i<$anak;$i++){ + print(""); + } + print(""); + } + + if($ttJmlRetur['anak']['jml']!= 0){ + print(""); + for($x=0;$x<$anakR;$x++){ + print(""); + } + print(""); + } + + print(""); +/* SEPATU -------------------------------------------------------------------------*/ + $jmlkatsepatu = $ttJmlBeli['sepatu']['jml']-$ttJmlRetur['sepatu']['jml']; + $hpkatsepatu = $ttJmlBeli['sepatu']['hp']-$ttJmlRetur['sepatu']['rp']; + + if($ttJmlBeli['sepatu']['jml']!=0){ + print(""); + for($i=0;$i<$sepatu;$i++){ + print(""); + } + print(""); + } + + if($ttJmlRetur['sepatu']['jml']!= 0){ + print(""); + for($x=0;$x<$sepatuR;$x++){ + print(""); + } + print(""); + } + + print(""); + + $ttjml = $jmlkatpria + $jmlkatwanita + $jmlkatanak + $jmlkatsepatu; + $ttrp = $rpkatpria + $rpkatwanita + $rpkatanak + $rpkatsepatu; + $tthp = $hpkatpria + $hpkatwanita + $hpkatanak + $hpkatsepatu; + + print(" + + "); + + print("
KategoriLini ProdukJumlah BeliTotal HP
Pria
~".$str[$i]['pria']."".number_format($jmlB[$i]['pria'], 0, ",", ".")."".number_format($HP[$i]['pria'], 0, ",", ".")."
".number_format($ttJmlBeli['pria']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['hp'], 0, ",", ".")."
Retur Pria
~".$strRet[$x]['pria']."".number_format($jmlR[$x]['pria'], 0, ",", ".")."".number_format($rpR[$x]['pria'], 0, ",", ".")."
".number_format($ttJmlRetur['pria']['jml'], 0, ",", ".")."".number_format($ttJmlRetur['pria']['rp'], 0, ",", ".")."
TOTAL PRIA".number_format($jmlkatpria, 0, ",", ".")."".number_format($hpkatpria, 0, ",", ".")."
Wanita
~".$str[$i]['wanita']."".number_format($jmlB[$i]['wanita'], 0, ",", ".")."".number_format($HP[$i]['wanita'], 0, ",", ".")."
".number_format($ttJmlBeli['wanita']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['hp'], 0, ",", ".")."
Retur Wanita
~".$strRet[$x]['wanita']."".number_format($jmlR[$x]['wanita'], 0, ",", ".")."".number_format($rpR[$x]['wanita'], 0, ",", ".")."
".number_format($ttJmlRetur['wanita']['jml'], 0, ",", ".")."".number_format($ttJmlRetur['wanita']['rp'], 0, ",", ".")."
TOTAL wanita".number_format($jmlkatwanita, 0, ",", ".")."".number_format($hpkatwanita, 0, ",", ".")."
Anak
~".$str[$i]['anak']."".number_format($jmlB[$i]['anak'], 0, ",", ".")."".number_format($HP[$i]['anak'], 0, ",", ".")."
".number_format($ttJmlBeli['anak']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['hp'], 0, ",", ".")."
Retur Anak
~".$strRet[$x]['anak']."".number_format($jmlR[$x]['anak'], 0, ",", ".")."".number_format($rpR[$x]['anak'], 0, ",", ".")."
".number_format($ttJmlRetur['anak']['jml'], 0, ",", ".")."".number_format($ttJmlRetur['anak']['rp'], 0, ",", ".")."
TOTAL Anak".number_format($jmlkatanak, 0, ",", ".")."".number_format($hpkatanak, 0, ",", ".")."
Sepatu
~".$str[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($ttJmlBeli['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp'], 0, ",", ".")."
Retur Sepatu
~".$strRet[$x]['sepatu']."".number_format($jmlR[$x]['sepatu'], 0, ",", ".")."".number_format($rpR[$x]['sepatu'], 0, ",", ".")."
".number_format($ttJmlRetur['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlRetur['sepatu']['rp'], 0, ",", ".")."
TOTAL Sepatu".number_format($jmlkatsepatu, 0, ",", ".")."".number_format($hpkatsepatu, 0, ",", ".")."
T O T A L : ".number_format($ttjml, 0, ",", ".")."".number_format($tthp, 0, ",", ".")."

"); + }else{ + echo "Belum ada data pembelian untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/lapbelipersup.php b/old-source/LaporanBeli/lapbelipersup.php new file mode 100644 index 0000000..ef5275b --- /dev/null +++ b/old-source/LaporanBeli/lapbelipersup.php @@ -0,0 +1,297 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:700px;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:9pt;}"; + 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 ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $kdsupp = ($_POST['kdsupp']); + + if(bukaKoneksi()){ + global $conn; + if ($kdsupp!=""){ + $query ="SELECT s.kel_jns,s.nama_strip, m.kd_supplier, u.nama_supplier, + sum( d.jum_fisik ) jum, + sum(d.jum_fisik*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + FROM d_pembelian d, m_pembelian m, supplier u,strip s, barang b + WHERE d.no_faktur = m.no_faktur + AND b.kode_barang = d.kode_barang + AND s.kd_strip = b.kode_strip + AND u.kd_supplier = m.kd_supplier + AND m.tgl_masuk BETWEEN '$startDate' AND '$endDate' + AND u.kd_supplier = '$kdsupp' + AND m.validasi = '1' + AND m.status_revisi = '1' + GROUP BY b.kode_strip , m.kd_supplier"; + + $query2 ="SELECT s.kel_jns,s.nama_strip, m.kd_supplier, u.nama_supplier, + sum( d.jumlah ) jum,sum(d.jumlah*d.harga_satuan) hp + FROM d_retur_beli d, m_retur_beli m, supplier u,strip s , barang b + WHERE d.id_retur = m.id_retur + AND b.kode_barang = d.kd_barang + AND s.kd_strip = b.kode_strip + AND u.kd_supplier = m.kd_supplier + AND m.tgl_retur BETWEEN '$startDate' AND '$endDate' + AND u.kd_supplier = '$kdsupp' + AND m.validasi = '1' + GROUP BY b.kode_strip , m.kd_supplier"; + + }else { + $query ="SELECT s.kel_jns,s.nama_strip, m.kd_supplier, u.nama_supplier, + sum( d.jum_fisik ) jum, + sum(d.jum_fisik*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + FROM d_pembelian d, m_pembelian m, supplier u,strip s, barang b + WHERE d.no_faktur = m.no_faktur + AND b.kode_barang = d.kode_barang + AND s.kd_strip = b.kode_strip + AND u.kd_supplier = m.kd_supplier + AND m.tgl_masuk BETWEEN '$startDate' AND '$endDate' + AND m.validasi = '1' + AND m.status_revisi = '1' + GROUP BY b.kode_strip , m.kd_supplier"; + + $query2 ="SELECT s.kel_jns,s.nama_strip, m.kd_supplier, u.nama_supplier, + sum( d.jumlah ) jum,sum(d.jumlah*d.harga_satuan) hp + FROM d_retur_beli d, m_retur_beli m, supplier u,strip s, barang b + WHERE d.id_retur = m.id_retur + AND b.kode_barang = d.kd_barang + AND s.kd_strip = b.kode_strip + AND u.kd_supplier = m.kd_supplier + AND m.tgl_retur BETWEEN '$startDate' AND '$endDate' AND m.validasi = '1' + GROUP BY b.kode_strip , m.kd_supplier"; + } + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cekR = mysqli_stmt_num_rows($stmt2); + if($cekR >= 0){//jika ada retur + mysqli_stmt_bind_result($stmt2,$kel,$str,$kdsup,$nmsup,$jmlRetur,$rpRetur); + + $priaR = 0; + $wanitaR = 0; + $anakR = 0; + $sepatuR = 0; + $strRet = array(); + $jmlR = array(); + $rpR = array(); + + $ttJmlRetur = array(); + $ttJmlRetur['pria']['jml'] = 0; + $ttJmlRetur['pria']['rp'] = 0; + $ttJmlRetur['wanita']['jml'] = 0; + $ttJmlRetur['wanita']['rp'] = 0; + $ttJmlRetur['anak']['jml'] = 0; + $ttJmlRetur['anak']['rp'] = 0; + $ttJmlRetur['sepatu']['jml'] = 0; + $ttJmlRetur['sepatu']['rp'] = 0; + + + while(mysqli_stmt_fetch($stmt2)){ + if($kel == 'P'){ + $strRet[$priaR]['pria'] = $str; + $jmlR[$priaR]['pria'] = $jmlRetur; + $rpR[$priaR]['pria'] = $rpRetur; + $ttJmlRetur['pria']['jml'] += $jmlRetur; + $ttJmlRetur['pria']['rp'] += $rpRetur; + $kdSupplier[$priaR]['pria'] = $kdsup; + $nmSupplier[$priaR]['pria'] = $nmsup; + $priaR++; + }elseif($kel == 'W'){ + $strRet[$wanitaR]['wanita'] = $str; + $jmlR[$wanitaR]['wanita'] = $jmlRetur; + $rpR[$wanitaR]['wanita'] = $rpRetur; + $ttJmlRetur['wanita']['jml'] += $jmlRetur; + $ttJmlRetur['wanita']['rp'] += $rpRetur; + $kdSupplier[$wanitaR]['wanita'] = $kdsup; + $nmSupplier[$wanitaR]['wanita'] = $nmsup; + $wanitaR++; + }elseif($kel == 'A'){ + $strRet[$anakR]['anak'] = $str; + $jmlR[$anakR]['anak'] = $jmlRetur; + $rpR[$anakR]['anak'] = $rpRetur; + $ttJmlRetur['anak']['jml'] += $jmlRetur; + $ttJmlRetur['anak']['rp'] += $rpRetur; + $kdSupplier[$anakR]['anak'] = $kdsup; + $nmSupplier[$anakR]['anak'] = $nmsup; + $anakR++; + }else{ + $strRet[$sepatuR]['sepatu'] = $str; + $jmlR[$sepatuR]['sepatu'] = $jmlRetur; + $rpR[$sepatuR]['sepatu'] = $rpRetur; + $ttJmlRetur['sepatu']['jml'] += $jmlRetur; + $ttJmlRetur['sepatu']['rp'] += $rpRetur; + $kdSupplier[$sepatuR]['sepatu'] = $kdsup; + $nmSupplier[$sepatuR]['sepatu'] = $nmsup; + $sepatuR++; + } + } + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_free_result($stmt2); + mysqli_stmt_close($stmt2); + } + } + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek >= 0){ + mysqli_stmt_bind_result($stmt,$kelJns,$strip,$kd,$nm,$jmlBeli,$hrgPokok); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + + print("
"); + print("

Laporan Pembelian Per Supllier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PADA TANGGAL : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $str = array(); + $jmlB = array(); + $rpB = array(); + $HP = array(); + + while(mysqli_stmt_fetch($stmt)){ + if($jmlRetur == ''){ + $jmlRetur = 0; + } + if($rpRetur == ''){ + $rpRetur = 0; + } + if($kelJns == "P"){ + $kelJns = "Pria"; + $ttJmlBeli['pria']['jml'] += $jmlBeli; + $ttJmlBeli['pria']['hp'] += $hrgPokok; + $str[$pria]['pria'] = $strip; + $jmlB[$pria]['pria'] = $jmlBeli; + $rpB[$pria]['pria'] = $rpBeli; + $HP[$pria]['pria'] = $hrgPokok; + $kdSupp[$pria]['pria'] = $kd; + $nmSupp[$pria]['pria'] = $nm; + $pria++; + }elseif($kelJns == "W"){ + $kelJns = "Wanita"; + $ttJmlBeli['wanita']['jml'] += $jmlBeli; + $ttJmlBeli['wanita']['hp'] += $hrgPokok; + $str[$wanita]['wanita'] = $strip; + $jmlB[$wanita]['wanita'] = $jmlBeli; + $rpB[$wanita]['wanita'] = $rpBeli; + $HP[$wanita]['wanita'] = $hrgPokok; + $kdSupp[$wanita]['wanita'] = $kd; + $nmSupp[$wanita]['wanita'] = $nm; + $wanita++; + }elseif($kelJns == "A"){ + $kelJns = "Anak"; + $ttJmlBeli['anak']['jml'] += $jmlBeli; + $ttJmlBeli['anak']['hp'] += $hrgPokok; + $str[$anak]['anak'] = $strip; + $jmlB[$anak]['anak'] = $jmlBeli; + $rpB[$anak]['anak'] = $rpBeli; + $HP[$anak]['anak'] = $hrgPokok; + $kdSupp[$anak]['anak'] = $kd; + $nmSupp[$anak]['anak'] = $nm; + $anak++; + }else{ + $kelJns = "Sepatu"; + $ttJmlBeli['sepatu']['jml'] += $jmlBeli; + $ttJmlBeli['sepatu']['hp'] += $hrgPokok; + $str[$sepatu]['sepatu'] = $strip; + $jmlB[$sepatu]['sepatu'] = $jmlBeli; + $rpB[$sepatu]['sepatu'] = $rpBeli; + $HP[$sepatu]['sepatu'] = $hrgPokok; + $kdSupp[$sepatu]['sepatu'] = $kd; + $nmSupp[$sepatu]['sepatu'] = $nm; + $sepatu++; + } + + } + print(""); + print(""); + print("
"); + +/* SEPATU -------------------------------------------------------------------------*/ + $jmlkatsepatu = $ttJmlBeli['sepatu']['jml']-$ttJmlRetur['sepatu']['jml']; + $hpkatsepatu = $ttJmlBeli['sepatu']['hp']-$ttJmlRetur['sepatu']['rp']; + + if($ttJmlBeli['sepatu']['jml']!=0){ + print("
"); + for($i=0;$i<$sepatu;$i++){ + if ($str[$i-1]['sepatu']==$str[$i]['sepatu']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlah4 = 0; + $temphp4 = 0; + } + $tempjumlah4 += $jmlB[$i]['sepatu']; + $temphp4 += $HP[$i]['sepatu']; + } + print(""); + print(""); + } + + if($ttJmlRetur['sepatu']['jml']!= 0){ + print(""); + for($x=0;$x<$sepatuR;$x++){ + if ($strRet[$x-1]['sepatu']==$strRet[$x]['sepatu']){ + print(""); + }else{ + print(""); + print(""); + + $tmpjmlR4 = 0; + $tmprpR4 = 0; + } + $tmpjmlR4 += $jmlR[$x]['sepatu']; + $tmprpR4 += $rpR[$x]['sepatu']; + } + print(""); + print(""); + } + print(""); + + $ttjml = $jmlkatpria + $jmlkatwanita + $jmlkatanak + $jmlkatsepatu; + $ttrp = $rpkatpria + $rpkatwanita + $rpkatanak + $rpkatsepatu; + $tthp = $hpkatpria + $hpkatwanita + $hpkatanak + $hpkatsepatu; + + print(" + + "); + + print("
Lini ProdukKode SupplierNama SupplierJumlah BeliTotal HP
".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlah4, 0, ",", ".")."".number_format($temphp4, 0, ",", ".")."
".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlah4, 0, ",", ".")."".number_format($temphp4, 0, ",", ".")."
SUB TOTAL".number_format($ttJmlBeli['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp'], 0, ",", ".")."
Data Retur
".$strRet[$x]['sepatu'].".".$kdSupplier[$x]['sepatu']."".$nmSupplier[$x]['sepatu']."".number_format($jmlR[$x]['sepatu'], 0, ",", ".")."".number_format($rpR[$x]['sepatu'], 0, ",", ".")."
".number_format($tmpjmlR4, 0, ",", ".")."".number_format($tmprpR4, 0, ",", ".")."
".$strRet[$x]['sepatu'].".".$kdSupplier[$x]['sepatu']."".$nmSupplier[$x]['sepatu']."".number_format($jmlR[$x]['sepatu'], 0, ",", ".")."".number_format($rpR[$x]['sepatu'], 0, ",", ".")."
".number_format($tmpjmlR4, 0, ",", ".")."".number_format($tmprpR4, 0, ",", ".")."
SUB TOTAL".number_format($ttJmlRetur['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlRetur['sepatu']['rp'], 0, ",", ".")."
Sub Total".number_format($jmlkatsepatu, 0, ",", ".")."".number_format($hpkatsepatu, 0, ",", ".")."
T O T A L : ".number_format($ttjml, 0, ",", ".")."".number_format($tthp, 0, ",", ".")."

"); + }else{ + echo "Tidak ada data pembelian untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/lapbelirevisi.php b/old-source/LaporanBeli/lapbelirevisi.php new file mode 100644 index 0000000..d77ac99 --- /dev/null +++ b/old-source/LaporanBeli/lapbelirevisi.php @@ -0,0 +1,74 @@ +"; + echo "div#divprint{width:900px; border:1px 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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + + if(bukaKoneksi()){ + global $conn; + $query = "SELECT m.no_faktur, m.tgl_masuk, m.kd_supplier, s.nama_supplier, m.total_beli, m.rp_beli,k.nama,m.referensi,m.keterangan + FROM m_pembelian m, supplier s, karyawan k + WHERE s.kd_supplier = m.kd_supplier + AND m.nik = k.nik + AND m.validasi = '1' + AND left(m.no_faktur,4) = 'RVB-' + AND m.status_revisi = 0 + AND m.tgl_masuk between '$startDate' AND '$endDate' + ORDER BY m.tgl_masuk,m.kd_supplier"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$faktur,$tglMsk,$kdSup,$nmSup,$ttBeli,$ttRp,$nama,$nota_asl,$ket); + $ttJumlah = array(); + $ttJumlah['jml'] = 0; + $ttJumlah['rp'] = 0; + + print("
"); + print("

Laporan Revisi Pembelian



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['jml'] += $ttBeli; + $ttJumlah['rp'] += $ttRp; + print(""); + } + + print("
No. FakturTanggal RevisiKode Supp.Nama SupplierJumlah BeliTotal BeliNamaNota AsliAlasan Revisi
.$faktur".encTgl($tglMsk).".$kdSup$nmSup".number_format($ttBeli,0,',','.')."".number_format($ttRp,0,',','.')."$nama$nota_asl$ket

"); + print("
"); + + print(""); + print(""); + + print("
Total Jumlah Revisi Pembelian : ".number_format($ttJumlah['jml'],0,',','.')."
Total Rupiah Revisi Pembelian : ".number_format($ttJumlah['rp'],0,',','.')."
"); + }else{ + echo "Belum ada data revisi-an untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/lapexpdate.php b/old-source/LaporanBeli/lapexpdate.php new file mode 100644 index 0000000..5716589 --- /dev/null +++ b/old-source/LaporanBeli/lapexpdate.php @@ -0,0 +1,71 @@ +"; + echo "div#divprint{width:1024px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:950px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:50px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + if(bukaKoneksi()){ + global $conn; + + + $query = "SELECT s.nama_strip,k.ked_produk,d.exp_date,m.`tgl_nota`,d.no_faktur,sp.nama_supplier,d.kode_barang,d.kode_asli,d.nm_brg, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp,d.jum_fisik,n.stok + FROM m_pembelian m, d_pembelian d, strip s, barang b, no_barang n, kedalaman_produk k, supplier sp + WHERE + d.no_faktur = m.no_faktur + AND d.kode_barang = b.kode_barang + AND b.id_gabungan = n.id_gabungan + AND b.kode_strip = s.kd_strip + AND b.kode_supplier = sp.kd_supplier + AND (b.kode_strip = k.kode_strip AND b.ked_produk = k.kode_ked_produk) + AND d.exp_date between '$startDate' and '$endDate' + ORDER BY b.kode_strip,b.ked_produk,d.exp_date"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$str,$ked,$exp,$tglnota,$faktur,$nmsupp,$kdbrg,$barcode,$nmbrg,$hp,$jbeli,$stok); + + print("
"); + print("

Laporan Barang Expired



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE EXPIRED: ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(" + + "); + + while(mysqli_stmt_fetch($stmt)){ + print(" + "); + } + + print("
GroupSub GroupTgl.ExpiredTgl.NotaNo.FakturNama SupplierKode BrgBarcodeNama BrgHPJum BeliStok
$str$ked".encTgl($exp)."".encTgl($tglnota).".$faktur$nmsupp$kdbrg$barcode$nmbrg".number_format($hp,0,",",".")."$jbeli$stok

"); + print("
"); + }else{ + echo "Belum ada data barang expired untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/lapgrouppersup.php b/old-source/LaporanBeli/lapgrouppersup.php new file mode 100644 index 0000000..b83a894 --- /dev/null +++ b/old-source/LaporanBeli/lapgrouppersup.php @@ -0,0 +1,115 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:700px;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:9pt;}"; + 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 ""; + + $startDate = decTgl($_POST['startDate2']); + $endDate = decTgl($_POST['endDate2']); + + + if(bukaKoneksi()){ + global $conn; + + /*----------------------------------------Pembelian grouping per supplier*/ + $query = "SELECT m.kd_supplier, u.nama_supplier, + sum( d.jum_fisik ) jum, + sum(d.jum_fisik*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + FROM d_pembelian d, m_pembelian m, barang b, supplier u,strip s + WHERE d.no_faktur = m.no_faktur + AND d.kode_barang = b.kode_barang + AND s.kd_strip = b.kode_strip + AND u.kd_supplier = m.kd_supplier + AND m.tgl_masuk BETWEEN '$startDate' AND '$endDate' + AND m.validasi = '1' + AND m.status_revisi = '1' + GROUP BY m.kd_supplier"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdsupp,$supp,$jml,$hp); + + print("
"); + print("

Rekap Pembelian Per Supplier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("TANGGAL MASUK : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."


"); + print(""); + print(" + "); + + $ttHP = 0; + while(mysqli_stmt_fetch($stmt)){ + $ttHP += $hp; + print(""); + } + print(""); + print("
Kode SupplierNama SupplierJumlHarga Pokok
.$kdsupp$supp$jml".number_format($hp,0,',','.')."
Total HP Beli".number_format($ttHP,0,',','.')."

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + /*----------------------------------------Retur grouping per supplier*/ + $query2 = "SELECT m.kd_supplier, u.nama_supplier, + sum( d.jumlah ) jum,sum(d.jumlah*d.harga_satuan) hp + FROM d_retur_beli d, m_retur_beli m, supplier u,strip s + WHERE d.id_retur = m.id_retur + AND s.kd_strip = substr( d.kd_barang, 1, 2 ) + AND u.kd_supplier = m.kd_supplier + AND m.tgl_retur BETWEEN '$startDate' AND '$endDate' + AND m.validasi = '1' + GROUP BY m.kd_supplier"; + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$kdsupp2,$supp2,$jml2,$hp2); + + print("
"); + print("

Rekap Retur Per Supplier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("TANGGAL MASUK : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."


"); + print(""); + print(" + "); + + $ttHP2 = 0; + while(mysqli_stmt_fetch($stmt2)){ + $ttHP2 += $hp2; + print(""); + } + print(""); + print("
Kode SupplierNama SupplierJumlHarga Pokok
.$kdsupp2$supp2$jml2".number_format($hp2,0,',','.')."
Total HP Retur".number_format($ttHP2,0,',','.')."

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + print("

"); + } + +?> diff --git a/old-source/LaporanBeli/lapobd.php~ b/old-source/LaporanBeli/lapobd.php~ new file mode 100644 index 0000000..0962aad --- /dev/null +++ b/old-source/LaporanBeli/lapobd.php~ @@ -0,0 +1,356 @@ +"; + echo "div#divprint{width:1024px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:950px;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:9pt;}"; + 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 ".warnaKolPisah{font-weight : bold; background-color: #595454;}"; //#413839 + echo ".master{text-align:left;}"; + echo ""; + + $startDate = $_POST['startDate']; //kd supp + $endDate = $_POST['endDate']; // lini + $bln = $_POST['bulan']; + $thn = $_POST['tahun']; + + if(bukaKoneksi()){ + global $conn; + + if ($startDate != '' and $endDate != '' and $bln != '' and $thn != ''){ + $query = "SELECT A.kel_jns,A.kode_strip,A.kd_supplier,A.nama_supplier,A.jml jmlOrder,A.rp rpOrder,B.jml jmlBeli,B.rp rpBeli + FROM + (SELECT s.kel_jns,d.kode_strip,m.kd_supplier, u.nama_supplier,sum(d.jumlah) jml,sum(d.harga_order) rp + from d_order d,m_order m,supplier u,strip s + where d.no_order = m.no_order + AND s.kd_strip = d.kode_strip + AND u.kd_supplier = m.kd_supplier + AND month(rencana_datang) = '$bln' AND year(rencana_datang) = '$thn' + group by d.kode_strip,m.kd_supplier) A + LEFT JOIN + (SELECT s.kel_jns,left(d.kode_barang,2) lini,m.kd_supplier, u.nama_supplier,sum(d.jum_fisik) jml,sum(d.harga_satuan) rp + from d_pembelian d,m_pembelian m,supplier u,strip s + where d.no_faktur = m.no_faktur + AND s.kd_strip = left(d.kode_barang,2) + AND u.kd_supplier = m.kd_supplier + AND month(tgl_masuk) = '$bln' AND year(tgl_masuk) = '$thn' + group by left(d.kode_barang,2),m.kd_supplier) B + ON A.kode_strip = B.lini + AND A.kd_supplier = B.kd_supplier + WHERE A.kd_supplier = '$startDate' AND A.kode_strip = '$endDate' "; + }else if ($startDate != '' and $bln != '' and $thn != ''){ + $query = "SELECT A.kel_jns,A.kode_strip,A.kd_supplier,A.nama_supplier,A.jml jmlOrder,A.rp rpOrder,B.jml jmlBeli,B.rp rpBeli + FROM + (SELECT s.kel_jns,d.kode_strip,m.kd_supplier, u.nama_supplier,sum(d.jumlah) jml,sum(d.harga_order) rp + from d_order d,m_order m,supplier u,strip s + where d.no_order = m.no_order + AND s.kd_strip = d.kode_strip + AND u.kd_supplier = m.kd_supplier + AND month(rencana_datang) = '$bln' AND year(rencana_datang) = '$thn' + group by d.kode_strip,m.kd_supplier) A + LEFT JOIN + (SELECT s.kel_jns,left(d.kode_barang,2) lini,m.kd_supplier, u.nama_supplier,sum(d.jum_fisik) jml,sum(d.harga_satuan) rp + from d_pembelian d,m_pembelian m,supplier u,strip s + where d.no_faktur = m.no_faktur + AND s.kd_strip = left(d.kode_barang,2) + AND u.kd_supplier = m.kd_supplier + AND month(tgl_masuk) = '$bln' AND year(tgl_masuk) = '$thn' + group by left(d.kode_barang,2),m.kd_supplier) B + ON A.kode_strip = B.lini + AND A.kd_supplier = B.kd_supplier + WHERE A.kd_supplier = '$startDate' "; + }else if ($endDate != '' and $bln != '' and $thn != ''){ + $query = "SELECT A.kel_jns,A.kode_strip,A.kd_supplier,A.nama_supplier,A.jml jmlOrder,A.rp rpOrder,B.jml jmlBeli,B.rp rpBeli + FROM + (SELECT s.kel_jns,d.kode_strip,m.kd_supplier, u.nama_supplier,sum(d.jumlah) jml,sum(d.harga_order) rp + from d_order d,m_order m,supplier u,strip s + where d.no_order = m.no_order + AND s.kd_strip = d.kode_strip + AND u.kd_supplier = m.kd_supplier + AND month(rencana_datang) = '$bln' AND year(rencana_datang) = '$thn' + group by d.kode_strip,m.kd_supplier) A + LEFT JOIN + (SELECT s.kel_jns,left(d.kode_barang,2) lini,m.kd_supplier, u.nama_supplier,sum(d.jum_fisik) jml,sum(d.harga_satuan) rp + from d_pembelian d,m_pembelian m,supplier u,strip s + where d.no_faktur = m.no_faktur + AND s.kd_strip = left(d.kode_barang,2) + AND u.kd_supplier = m.kd_supplier + AND month(tgl_masuk) = '$bln' AND year(tgl_masuk) = '$thn' + group by left(d.kode_barang,2),m.kd_supplier) B + ON A.kode_strip = B.lini + AND A.kd_supplier = B.kd_supplier + WHERE A.kode_strip = '$endDate' "; + }else{ + $query = "SELECT A.kel_jns,A.kode_strip,A.kd_supplier,A.nama_supplier,A.jml jmlOrder,A.rp rpOrder,B.jml jmlBeli,B.rp rpBeli + FROM + (SELECT s.kel_jns,d.kode_strip,m.kd_supplier, u.nama_supplier,sum(d.jumlah) jml,sum(d.harga_order) rp + from d_order d,m_order m,supplier u,strip s + where d.no_order = m.no_order + AND s.kd_strip = d.kode_strip + AND u.kd_supplier = m.kd_supplier + AND month(rencana_datang) = '$bln' AND year(rencana_datang) = '$thn' + group by d.kode_strip,m.kd_supplier) A + LEFT JOIN + (SELECT s.kel_jns,left(d.kode_barang,2) lini,m.kd_supplier, u.nama_supplier,sum(d.jum_fisik) jml,sum(d.harga_satuan) rp + from d_pembelian d,m_pembelian m,supplier u,strip s + where d.no_faktur = m.no_faktur + AND s.kd_strip = left(d.kode_barang,2) + AND u.kd_supplier = m.kd_supplier + AND month(tgl_masuk) = '$bln' AND year(tgl_masuk) = '$thn' + group by left(d.kode_barang,2),m.kd_supplier) B + ON A.kode_strip = B.lini + AND A.kd_supplier = B.kd_supplier "; + } + + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek >= 0){ + mysqli_stmt_bind_result($stmt,$kelJns,$strip,$kd,$nm,$vrenc,$hprenc,$vrev,$hprev); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['pria']['jmlRev'] = 0; + $ttJmlBeli['pria']['hpRev'] = 0; + + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['wanita']['jmlRev'] = 0; + $ttJmlBeli['wanita']['hpRev'] = 0; + + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['anak']['jmlRev'] = 0; + $ttJmlBeli['anak']['hpRev'] = 0; + + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + $ttJmlBeli['sepatu']['jmlRev'] = 0; + $ttJmlBeli['sepatu']['hpRev'] = 0; + + print("
"); + print("

Laporan Order Belum Datang



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."

"); + print("Bulan Order : ".$bln."
"); + print("Tahun Order : ".$_POST['tahun']."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $str = array(); + $jmlren = array(); + $rpren = array(); + $stsren = array(); + $jmlrev = array(); + $rprev = array(); + $stsrev = array(); + + while(mysqli_stmt_fetch($stmt)){ + if($kelJns == "P"){ + $kelJns = "Pria"; + $ttJmlBeli['pria']['jml'] += $vrenc; + $ttJmlBeli['pria']['hp'] += $hprenc; + $ttJmlBeli['pria']['jmlRev'] += $vrev; + $ttJmlBeli['pria']['hpRev'] += $hprev; + $str[$pria]['pria'] = $strip; + $jmlren[$pria]['pria'] = $vrenc; + $rpren[$pria]['pria'] = $hprenc; + $stsren[$pria]['pria'] = $statrenc; + $jmlrev[$pria]['pria'] = $vrev; + $rprev[$pria]['pria'] = $hprev; + $stsrev[$pria]['pria'] = $statrev; + $kdSupp[$pria]['pria'] = $kd; + $nmSupp[$pria]['pria'] = $nm; + $noord[$pria]['pria'] = $noorder; + $pria++; + }elseif($kelJns == "W"){ + $kelJns = "Wanita"; + $ttJmlBeli['wanita']['jml'] += $vrenc; + $ttJmlBeli['wanita']['hp'] += $hprenc; + $ttJmlBeli['wanita']['jmlRev'] += $vrev; + $ttJmlBeli['wanita']['hpRev'] += $hprev; + $str[$wanita]['wanita'] = $strip; + $jmlren[$wanita]['wanita'] = $vrenc; + $rpren[$wanita]['wanita'] = $hprenc; + $stsren[$wanita]['wanita'] = $statrenc; + $jmlrev[$wanita]['wanita'] = $vrev; + $rprev[$wanita]['wanita'] = $hprev; + $stsrev[$wanita]['wanita'] = $statrev; + $kdSupp[$wanita]['wanita'] = $kd; + $nmSupp[$wanita]['wanita'] = $nm; + $noord[$wanita]['wanita'] = $noorder; + $wanita++; + }elseif($kelJns == "A"){ + $kelJns = "Anak"; + $ttJmlBeli['anak']['jml'] += $vrenc; + $ttJmlBeli['anak']['hp'] += $hprenc; + $ttJmlBeli['anak']['jmlRev'] += $vrev; + $ttJmlBeli['anak']['hpRev'] += $hprev; + $str[$anak]['anak'] = $strip; + $jmlren[$anak]['anak'] = $vrenc; + $rpren[$anak]['anak'] = $hprenc; + $stsren[$anak]['anak'] = $statrenc; + $jmlrev[$anak]['anak'] = $vrev; + $rprev[$anak]['anak'] = $hprev; + $stsrev[$anak]['anak'] = $statrev; + $kdSupp[$anak]['anak'] = $kd; + $nmSupp[$anak]['anak'] = $nm; + $noord[$anak]['anak'] = $noorder; + $anak++; + }else{ + $kelJns = "Sepatu"; + $ttJmlBeli['sepatu']['jml'] += $vrenc; + $ttJmlBeli['sepatu']['hp'] += $hprenc; + $ttJmlBeli['sepatu']['jmlRev'] += $vrev; + $ttJmlBeli['sepatu']['hpRev'] += $hprev; + $str[$sepatu]['sepatu'] = $strip; + $jmlren[$sepatu]['sepatu'] = $vrenc; + $rpren[$sepatu]['sepatu'] = $hprenc; + $stsren[$sepatu]['sepatu'] = $statrenc; + $jmlrev[$sepatu]['sepatu'] = $vrev; + $rprev[$sepatu]['sepatu'] = $hprev; + $stsrev[$sepatu]['sepatu'] = $statrev; + $kdSupp[$sepatu]['sepatu'] = $kd; + $nmSupp[$sepatu]['sepatu'] = $nm; + $noord[$sepatu]['sepatu'] = $noorder; + $sepatu++; + } + + } + print(""); + print(""); + print("
"); + +/* PRIA -------------------------------------------------------------------------*/ + if($ttJmlBeli['pria']['jml']!=0){ + print("
"); + for($i=0;$i<$pria;$i++){ + if ($str[$i-1]['pria']==$str[$i]['pria']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlah1 = 0; + $temphp1 = 0; + $tempjumlah2 = 0; + $temphp2 = 0; + } + $tempjumlah1 += $jmlren[$i]['pria']; + $temphp1 += $rpren[$i]['pria']; + $tempjumlah2 += $jmlrev[$i]['pria']; + $temphp2 += $rprev[$i]['pria']; + + } + print(""); + } + + print(""); + +/* WANITA -------------------------------------------------------------------------*/ + if($ttJmlBeli['wanita']['jml']!=0){ + print(""); + for($i=0;$i<$wanita;$i++){ + if ($str[$i-1]['wanita']==$str[$i]['wanita']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlah3 = 0; + $temphp3 = 0; + $tempjumlah4 = 0; + $temphp4 = 0; + } + $tempjumlah3 += $jmlren[$i]['wanita']; + $temphp3 += $rpren[$i]['wanita']; + $tempjumlah4 += $jmlrev[$i]['wanita']; + $temphp4 += $rprev[$i]['wanita']; + + } + print(""); + } + + print(""); +/* ANAK -------------------------------------------------------------------------*/ + if($ttJmlBeli['anak']['jml']!=0){ + print(""); + for($i=0;$i<$anak;$i++){ + if ($str[$i-1]['anak']==$str[$i]['anak']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlah5 = 0; + $temphp5 = 0; + $tempjumlah6 = 0; + $temphp6 = 0; + } + $tempjumlah5 += $jmlren[$i]['anak']; + $temphp5 += $rpren[$i]['anak']; + $tempjumlah6 += $jmlrev[$i]['anak']; + $temphp6 += $rprev[$i]['anak']; + + } + print(""); + } + + print(""); +/* SEPATU -------------------------------------------------------------------------*/ + if($ttJmlBeli['sepatu']['jml']!=0){ + print(""); + for($i=0;$i<$sepatu;$i++){ + if ($str[$i-1]['sepatu']==$str[$i]['sepatu']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlah7 = 0; + $temphp7 = 0; + $tempjumlah8 = 0; + $temphp8 = 0; + } + $tempjumlah7 += $jmlren[$i]['sepatu']; + $temphp7 += $rpren[$i]['sepatu']; + $tempjumlah8 += $jmlrev[$i]['sepatu']; + $temphp8 += $rprev[$i]['sepatu']; + + } + print(""); + } + + print(""); + + $ttjml1 = $ttJmlBeli['pria']['jml'] + $ttJmlBeli['wanita']['jml'] + $ttJmlBeli['anak']['jml'] + $ttJmlBeli['sepatu']['jml']; + $ttrp1 = $ttJmlBeli['pria']['hp'] + $ttJmlBeli['wanita']['hp'] + $ttJmlBeli['anak']['hp'] + $ttJmlBeli['sepatu']['hp']; + $ttjml2 = $ttJmlBeli['pria']['jmlRev'] + $ttJmlBeli['wanita']['jmlRev'] + $ttJmlBeli['anak']['jmlRev'] + $ttJmlBeli['sepatu']['jmlRev']; + $ttrp2 = $ttJmlBeli['pria']['hpRev'] + $ttJmlBeli['wanita']['hpRev'] + $ttJmlBeli['anak']['hpRev'] + $ttJmlBeli['sepatu']['hpRev']; + + print(" + + + + "); + + print("
KategoriLini ProdukKode SupplierNama SupplierJumlah OrderTotal HP Order Jml PenerimaanTotal HP PenerimaanJml OBDTotal HP OBD
Pria
~".$str[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlren[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria'], 0, ",", ".")."".number_format($jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rprev[$i]['pria'], 0, ",", ".")."".number_format($jmlren[$i]['pria']-$jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria']-$rprev[$i]['pria'], 0, ",", ".")."
".number_format($tempjumlah1, 0, ",", ".")."".number_format($temphp1, 0, ",", ".")."".number_format($tempjumlah2, 0, ",", ".")."".number_format($temphp2, 0, ",", ".")."".number_format($tempjumlah1-$tempjumlah2, 0, ",", ".")."".number_format($temphp1-$temphp2, 0, ",", ".")."
~".$str[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlren[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria'], 0, ",", ".")."".number_format($jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rprev[$i]['pria'], 0, ",", ".")."".number_format($jmlren[$i]['pria']-$jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria']-$rprev[$i]['pria'], 0, ",", ".")."
".number_format($tempjumlah1, 0, ",", ".")."".number_format($temphp1, 0, ",", ".")."".number_format($tempjumlah2, 0, ",", ".")."".number_format($temphp2, 0, ",", ".")."".number_format($tempjumlah1-$tempjumlah2, 0, ",", ".")."".number_format($temphp1-$temphp2, 0, ",", ".")."
TOTAL PRIA".number_format($ttJmlBeli['pria']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['hp'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['hpRev'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['jml']-$ttJmlBeli['pria']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['hp']-$ttJmlBeli['pria']['hpRev'], 0, ",", ".")."
Wanita
~".$str[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlren[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita'], 0, ",", ".")."".number_format($jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rprev[$i]['wanita'], 0, ",", ".")."".number_format($jmlren[$i]['wanita']-$jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita']-$rprev[$i]['wanita'], 0, ",", ".")."
".number_format($tempjumlah3, 0, ",", ".")."".number_format($temphp3, 0, ",", ".")."".number_format($tempjumlah4, 0, ",", ".")."".number_format($temphp4, 0, ",", ".")."".number_format($tempjumlah3-$tempjumlah4, 0, ",", ".")."".number_format($temphp3-$temphp4, 0, ",", ".")."
~".$str[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlren[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita'], 0, ",", ".")."".number_format($jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rprev[$i]['wanita'], 0, ",", ".")."".number_format($jmlren[$i]['wanita']-$jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita']-$rprev[$i]['wanita'], 0, ",", ".")."
".number_format($tempjumlah3, 0, ",", ".")."".number_format($temphp3, 0, ",", ".")."".number_format($tempjumlah4, 0, ",", ".")."".number_format($temphp4, 0, ",", ".")."".number_format($tempjumlah3-$tempjumlah4, 0, ",", ".")."".number_format($temphp3-$temphp4, 0, ",", ".")."
TOTAL WANITA".number_format($ttJmlBeli['wanita']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['hp'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['hpRev'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['jml']-$ttJmlBeli['wanita']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['hp']-$ttJmlBeli['wanita']['hpRev'], 0, ",", ".")."
Anak
~".$str[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlren[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak'], 0, ",", ".")."".number_format($jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rprev[$i]['anak'], 0, ",", ".")."".number_format($jmlren[$i]['anak']-$jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak']-$rprev[$i]['anak'], 0, ",", ".")."
".number_format($tempjumlah5, 0, ",", ".")."".number_format($temphp5, 0, ",", ".")."".number_format($tempjumlah6, 0, ",", ".")."".number_format($temphp6, 0, ",", ".")."".number_format($tempjumlah5-$tempjumlah6, 0, ",", ".")."".number_format($temphp5-$temphp6, 0, ",", ".")."
~".$str[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlren[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak'], 0, ",", ".")."".number_format($jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rprev[$i]['anak'], 0, ",", ".")."".number_format($jmlren[$i]['anak']-$jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak']-$rprev[$i]['anak'], 0, ",", ".")."
".number_format($tempjumlah5, 0, ",", ".")."".number_format($temphp5, 0, ",", ".")."".number_format($tempjumlah6, 0, ",", ".")."".number_format($temphp6, 0, ",", ".")."".number_format($tempjumlah5-$tempjumlah6, 0, ",", ".")."".number_format($temphp5-$temphp6, 0, ",", ".")."
TOTAL ANAK".number_format($ttJmlBeli['anak']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['hp'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['hpRev'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['jml']-$ttJmlBeli['anak']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['hp']-$ttJmlBeli['anak']['hpRev'], 0, ",", ".")."
Sepatu
~".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlren[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu'], 0, ",", ".")."".number_format($jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rprev[$i]['sepatu'], 0, ",", ".")."".number_format($jmlren[$i]['sepatu']-$jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu']-$rprev[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlah7, 0, ",", ".")."".number_format($temphp7, 0, ",", ".")."".number_format($tempjumlah8, 0, ",", ".")."".number_format($temphp8, 0, ",", ".")."".number_format($tempjumlah7-$tempjumlah8, 0, ",", ".")."".number_format($temphp7-$temphp8, 0, ",", ".")."
~".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlren[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu'], 0, ",", ".")."".number_format($jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rprev[$i]['sepatu'], 0, ",", ".")."".number_format($jmlren[$i]['sepatu']-$jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu']-$rprev[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlah7, 0, ",", ".")."".number_format($temphp7, 0, ",", ".")."".number_format($tempjumlah8, 0, ",", ".")."".number_format($temphp8, 0, ",", ".")."".number_format($tempjumlah7-$tempjumlah8, 0, ",", ".")."".number_format($temphp7-$temphp8, 0, ",", ".")."
TOTAL SEPATU".number_format($ttJmlBeli['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hpRev'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['jml']-$ttJmlBeli['sepatu']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp']-$ttJmlBeli['sepatu']['hpRev'], 0, ",", ".")."
T O T A L : ".number_format($ttjml1, 0, ",", ".")."".number_format($ttrp1, 0, ",", ".")."".number_format($ttjml2, 0, ",", ".")."".number_format($ttrp2, 0, ",", ".")."".number_format($ttjml1-$ttjml2, 0, ",", ".")."".number_format($ttrp1-$ttrp2, 0, ",", ".")."

"); + }else{ + echo "Tidak ada data untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/laprekapretbeli.php b/old-source/LaporanBeli/laprekapretbeli.php new file mode 100644 index 0000000..b600623 --- /dev/null +++ b/old-source/LaporanBeli/laprekapretbeli.php @@ -0,0 +1,71 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + + if(bukaKoneksi()){ + global $conn; + $query = "select r.`tgl_retur`, r.`no_nota`, r.`kd_supplier`,s.nama_supplier, d.jum, d.tot, k.nama, r.`keterangan` + from m_retur_beli r,supplier s,karyawan k, + (select id_retur,sum(jumlah) jum,sum(jumlah*harga_satuan) tot from d_retur_beli group by id_retur) d + where tgl_retur between '$startDate' and '$endDate' + and r.kd_supplier = s.kd_supplier + and r.id_retur = d.id_retur + and r.nik = k.nik + and r.validasi = '1'"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tgl,$nota,$kdsup,$nama,$jum,$tot,$kary,$als); + $ttJumlah = array(); + $ttJumlah['jml'] = 0; + $ttJumlah['rp'] = 0; + + print("
"); + print("

Laporan Rekap Retur Pembelian



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['jml'] += $jum; + $ttJumlah['rp'] += $tot; + print(""); + } + + print("
TanggalNo.NotaKode Supp.Nama Supp.Jumlah Brg.TotalAsskoAlasan
".encTgl($tgl).".$nota.$kdsup$nama$jum".number_format($tot,0,',','.')."$kary$als

"); + print("
"); + + print(""); + print(""); + + print("
Total Jumlah Retur : ".number_format($ttJumlah['jml'],0,',','.')."
Total Rp Retur : ".number_format($ttJumlah['rp'],0,',','.')."
"); + }else{ + echo "Tidak ada data retur untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/laprekapretbeli.php~ b/old-source/LaporanBeli/laprekapretbeli.php~ new file mode 100644 index 0000000..e1c9603 --- /dev/null +++ b/old-source/LaporanBeli/laprekapretbeli.php~ @@ -0,0 +1,72 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + + if(bukaKoneksi()){ + global $conn; + $query = "select r.`tgl_retur`, r.`no_nota`, r.`kd_supplier`,s.nama_supplier, d.jum, d.tot, k.nama, r.`keterangan` + from m_retur_beli r,supplier s,karyawan k, + (select id_retur,sum(jumlah) jum,sum(jumlah*harga_satuan) tot from d_retur_beli group by id_retur) d + where tgl_retur between '$startDate' and '$endDate' + and r.kd_supplier = s.kd_supplier + and r.id_retur = d.id_retur + and r.nik = k.nik + and r.validasi = '1'"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tgl,$nota,$kdsup,$nama,$jum,$tot,$kary,$als); + $ttJumlah = array(); + $ttJumlah['jml'] = 0; + $ttJumlah['rp'] = 0; + + print("
"); + print("

Laporan Rekap Retur Pembelian



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['jml'] += $jum; + $ttJumlah['rp'] += $tot; + print(""); + } + + print("
TanggalNo.NotaKode Supp.Nama Supp.Jumlah Brg.TotalAsskoAlasan
".encTgl($tgl).".$nota.$kdsup$nama$jum".number_format($tot,0,',','.')."$kary$als

"); + print("
"); + + print(""); + print(""); + + print("
Total Jumlah Retur : ".number_format($ttJumlah['jml'],0,',','.')."
Total Rp Retur : ".number_format($ttJumlah['rp'],0,',','.')."
"); + }else{ + echo "Tidak ada data retur untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/lapreturperasko.php~ b/old-source/LaporanBeli/lapreturperasko.php~ new file mode 100644 index 0000000..63d4f6e --- /dev/null +++ b/old-source/LaporanBeli/lapreturperasko.php~ @@ -0,0 +1,92 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + + if(bukaKoneksi()){ + global $conn; + $query = "select r.tgl_retur,m.tgl_nota,r.no_nota,r.kd_supplier,s.nama_supplier,sum(d.jumlah),r.total_retur,r.nik,k.nama + from m_retur_beli r, d_retur_beli d, m_pembelian m, supplier s,karyawan k + where r.validasi = 1 + and r.id_retur = d.id_retur + and r.no_nota = m.no_faktur + and r.kd_supplier = s.kd_supplier + and r.nik = k.nik + and date(r.tgl_retur) between '$startDate' and '$endDate' + group by r.id_retur"; + $query2 ="select A.nik,A.nama,count(*) + from + (select r.tgl_retur,r.no_nota,r.kd_supplier,r.total_retur,r.nik,k.nama + from + m_retur_beli r, d_retur_beli d,karyawan k + where r.validasi = 1 + and r.id_retur = d.id_retur + and r.nik = k.nik + and date(r.tgl_retur) between '$startDate' and '$endDate' + group by r.id_retur) A + group by A.nik"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tglret,$tglnota,$nota,$kdsup,$nama,$jum,$tot,$nik,$kary); + $ttJumlah = array(); + $ttJumlah['jml'] = 0; + $ttJumlah['rp'] = 0; + + print("
"); + print("

Laporan Rekap Retur Per Assko



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['jml'] += $jum; + $ttJumlah['rp'] += $tot; + print(""); + } + + print("
Tgl ReturTgl NotaNo.NotaKode Supp.Nama Supp.Jumlah Brg.TotalAssko
".encTgl($tglret)."".encTgl($tglnota).".$nota.$kdsup$nama$jum".number_format($tot,0,',','.')."$kary

"); + print("
"); + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$nik,$kary,$count); + while(mysqli_stmt_fetch($stmt2)){ + print(""); + } + } + } + print("
$nik$kary : $countkali.
"); + }else{ + echo "Tidak ada data retur untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/laprncordersupp.php~ b/old-source/LaporanBeli/laprncordersupp.php~ new file mode 100644 index 0000000..cfe4cb0 --- /dev/null +++ b/old-source/LaporanBeli/laprncordersupp.php~ @@ -0,0 +1,95 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = $_POST['startDate']; + $endDate = $_POST['endDate']; + $bulan = $_POST['bulan']; + $tahun = substr($_POST['tahun'],2,2); + + if(bukaKoneksi()){ + global $conn; + if ($startDate != '' and $endDate != '' and $bulan != '' and $tahun != ''){ + $query = "select m.kode_strip, d.vol_revisi,d.artikel_revisi,d.nomor_revisi + from m_rencana_beli m inner join d_rencana_beli d on (m.id=d.id) + where m.status_revisi = '1' + and d.kode_supplier = '$startDate' + and m.kode_strip = '$endDate' + and m.bulanR = '$bulan' + and m.tahunR = '$tahun'"; + }else{ + $query = "select m.kode_strip, d.vol_revisi,d.artikel_revisi,d.nomor_revisi + from m_rencana_beli m inner join d_rencana_beli d on (m.id=d.id) + where m.status_revisi = '1' + and d.kode_supplier = '$startDate' + and m.bulanR = '$bulan' + and m.tahunR = '$tahun'"; + } + $query2 = "select s.nama_supplier + from supplier s + where s.kd_supplier = '$startDate'"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdstrip,$vol,$artikel,$nomor); + $ttJumlah = array(); + $ttJumlah['jml'] = 0; + + print("
"); + print("

Rekap Rencana Order Per Supplier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')."

"); + print("Bulan : ".$bulan."
"); + print("Tahun : ".$_POST['tahun']."
"); + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$namasupp); + while(mysqli_stmt_fetch($stmt2)){ + print("Kode Supplier : ".$startDate."
"); + print("Nama Supplier : ".$namasupp."


"); + + } + } + } + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['jml'] += $vol; + print(""); + } + + print("
Lini ProdukJuml BarangArtikelNomor Brg
$kdstrip$vol$artikel$nomor

"); + print("
"); + + print(""); + print("
Total Jumlah Beli : ".number_format($ttJumlah['jml'],0,',','.')."
"); + }else{ + echo "Tidak ada data rencana order untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/laprncpersupp.php~ b/old-source/LaporanBeli/laprncpersupp.php~ new file mode 100644 index 0000000..5681e6d --- /dev/null +++ b/old-source/LaporanBeli/laprncpersupp.php~ @@ -0,0 +1,312 @@ +"; + echo "div#divprint{width:900px; border:1px 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:9pt;}"; + 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 ""; + + $startDate = $_POST['startDate']; //kd supp + $endDate = $_POST['endDate']; // lini + $bln = $_POST['bulan']; + $thn = substr($_POST['tahun'],2,2); + + if(bukaKoneksi()){ + global $conn; + + if ($startDate != '' and $endDate != '' and $bulan != '' and $tahun != ''){ + $query = "SELECT st.kel_jns, m.kode_strip, d.kode_supplier, s.nama_supplier, sum(d.vol_rencana), sum(d.rupiah_rencana), m.status_rencana, + sum(d.vol_revisi), sum(d.rupiah_revisi), m.status_revisi + FROM d_rencana_beli d, m_rencana_beli m, supplier s, strip st + WHERE m.tahunR = '$thn' and m.bulanR = '$bln' + and m.id=d.id + and d.kode_supplier = s.kd_supplier + and m.kode_strip = st.kd_strip + and d.kode_supplier = '$startDate' + and m.kode_strip = '$endDate' + GROUP BY d.kode_supplier, m.kode_strip + ORDER BY m.kode_strip"; + }else if ($startDate != '' and $bulan != '' and $tahun != ''){ + $query = "SELECT st.kel_jns, m.kode_strip, d.kode_supplier, s.nama_supplier, sum(d.vol_rencana), sum(d.rupiah_rencana), m.status_rencana, + sum(d.vol_revisi), sum(d.rupiah_revisi), m.status_revisi + FROM d_rencana_beli d, m_rencana_beli m, supplier s, strip st + WHERE m.tahunR = '$thn' and m.bulanR = '$bln' + and m.id=d.id + and d.kode_supplier = s.kd_supplier + and m.kode_strip = st.kd_strip + and d.kode_supplier = '$startDate' + GROUP BY d.kode_supplier, m.kode_strip + ORDER BY m.kode_strip"; + }else if ($endDate != '' and $bulan != '' and $tahun != ''){ + $query = "SELECT st.kel_jns, m.kode_strip, d.kode_supplier, s.nama_supplier, sum(d.vol_rencana), sum(d.rupiah_rencana), m.status_rencana, + sum(d.vol_revisi), sum(d.rupiah_revisi), m.status_revisi + FROM d_rencana_beli d, m_rencana_beli m, supplier s, strip st + WHERE m.tahunR = '$thn' and m.bulanR = '$bln' + and m.id=d.id + and d.kode_supplier = s.kd_supplier + and m.kode_strip = st.kd_strip + and m.kode_strip = '$endDate' + GROUP BY d.kode_supplier, m.kode_strip + ORDER BY m.kode_strip"; + }else{ + $query = "SELECT st.kel_jns, m.kode_strip, d.kode_supplier, s.nama_supplier, sum(d.vol_rencana), sum(d.rupiah_rencana), m.status_rencana, + sum(d.vol_revisi), sum(d.rupiah_revisi), m.status_revisi + FROM d_rencana_beli d, m_rencana_beli m, supplier s, strip st + WHERE m.tahunR = '$thn' and m.bulanR = '$bln' + and m.id=d.id + and d.kode_supplier=s.kd_supplier + and m.kode_strip = st.kd_strip + GROUP BY d.kode_supplier, m.kode_strip + ORDER BY m.kode_strip"; + } + + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek >= 0){ + mysqli_stmt_bind_result($stmt,$kelJns,$strip,$kd,$nm,$vrenc,$hprenc,$statrenc,$vrev,$hprev,$statrev); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['pria']['jmlRev'] = 0; + $ttJmlBeli['pria']['hpRev'] = 0; + + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['wanita']['jmlRev'] = 0; + $ttJmlBeli['wanita']['hpRev'] = 0; + + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['anak']['jmlRev'] = 0; + $ttJmlBeli['anak']['hpRev'] = 0; + + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + $ttJmlBeli['sepatu']['jmlRev'] = 0; + $ttJmlBeli['sepatu']['hpRev'] = 0; + + print("
"); + print("

Laporan Rencana Belanja Per Supllier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."

"); + print("Bulan Rencana : ".$bln."
"); + print("Tahun Rencana : ".$_POST['tahun']."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $str = array(); + $jmlren = array(); + $rpren = array(); + $stsren = array(); + $jmlrev = array(); + $rprev = array(); + $stsrev = array(); + + while(mysqli_stmt_fetch($stmt)){ + if($kelJns == "P"){ + $kelJns = "Pria"; + $ttJmlBeli['pria']['jml'] += $vrenc; + $ttJmlBeli['pria']['hp'] += $hprenc; + $ttJmlBeli['pria']['jmlRev'] += $vrev; + $ttJmlBeli['pria']['hpRev'] += $hprev; + $str[$pria]['pria'] = $strip; + $jmlren[$pria]['pria'] = $vrenc; + $rpren[$pria]['pria'] = $hprenc; + $stsren[$pria]['pria'] = $statrenc; + $jmlrev[$pria]['pria'] = $vrev; + $rprev[$pria]['pria'] = $hprev; + $stsrev[$pria]['pria'] = $statrev; + $kdSupp[$pria]['pria'] = $kd; + $nmSupp[$pria]['pria'] = $nm; + $pria++; + }elseif($kelJns == "W"){ + $kelJns = "Wanita"; + $ttJmlBeli['wanita']['jml'] += $vrenc; + $ttJmlBeli['wanita']['hp'] += $hprenc; + $ttJmlBeli['wanita']['jmlRev'] += $vrev; + $ttJmlBeli['wanita']['hpRev'] += $hprev; + $str[$wanita]['wanita'] = $strip; + $jmlren[$wanita]['wanita'] = $vrenc; + $rpren[$wanita]['wanita'] = $hprenc; + $stsren[$wanita]['wanita'] = $statrenc; + $jmlrev[$wanita]['wanita'] = $vrev; + $rprev[$wanita]['wanita'] = $hprev; + $stsrev[$wanita]['wanita'] = $statrev; + $kdSupp[$wanita]['wanita'] = $kd; + $nmSupp[$wanita]['wanita'] = $nm; + $wanita++; + }elseif($kelJns == "A"){ + $kelJns = "Anak"; + $ttJmlBeli['anak']['jml'] += $vrenc; + $ttJmlBeli['anak']['hp'] += $hprenc; + $ttJmlBeli['anak']['jmlRev'] += $vrev; + $ttJmlBeli['anak']['hpRev'] += $hprev; + $str[$anak]['anak'] = $strip; + $jmlren[$anak]['anak'] = $vrenc; + $rpren[$anak]['anak'] = $hprenc; + $stsren[$anak]['anak'] = $statrenc; + $jmlrev[$anak]['anak'] = $vrev; + $rprev[$anak]['anak'] = $hprev; + $stsrev[$anak]['anak'] = $statrev; + $kdSupp[$anak]['anak'] = $kd; + $nmSupp[$anak]['anak'] = $nm; + $anak++; + }else{ + $kelJns = "Sepatu"; + $ttJmlBeli['sepatu']['jml'] += $vrenc; + $ttJmlBeli['sepatu']['hp'] += $hprenc; + $ttJmlBeli['sepatu']['jmlRev'] += $vrev; + $ttJmlBeli['sepatu']['hpRev'] += $hprev; + $str[$sepatu]['sepatu'] = $strip; + $jmlren[$sepatu]['sepatu'] = $vrenc; + $rpren[$sepatu]['sepatu'] = $hprenc; + $stsren[$sepatu]['sepatu'] = $statrenc; + $jmlrev[$sepatu]['sepatu'] = $vrev; + $rprev[$sepatu]['sepatu'] = $hprev; + $stsrev[$sepatu]['sepatu'] = $statrev; + $kdSupp[$sepatu]['sepatu'] = $kd; + $nmSupp[$sepatu]['sepatu'] = $nm; + $sepatu++; + } + + } + print(""); + print(""); + print("
"); + +/* PRIA -------------------------------------------------------------------------*/ + if($ttJmlBeli['pria']['jml']!=0){ + print("
"); + for($i=0;$i<$pria;$i++){ + if ($str[$i-1]['pria']==$str[$i]['pria']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlah1 = 0; + $temphp1 = 0; + $tempjumlah2 = 0; + $temphp2 = 0; + } + $tempjumlah1 += $jmlren[$i]['pria']; + $temphp1 += $rpren[$i]['pria']; + $tempjumlah2 += $jmlrev[$i]['pria']; + $temphp2 += $rprev[$i]['pria']; + + } + print(""); + } + + print(""); + +/* WANITA -------------------------------------------------------------------------*/ + if($ttJmlBeli['wanita']['jml']!=0){ + print(""); + for($i=0;$i<$wanita;$i++){ + if ($str[$i-1]['wanita']==$str[$i]['wanita']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlah3 = 0; + $temphp3 = 0; + $tempjumlah4 = 0; + $temphp4 = 0; + } + $tempjumlah3 += $jmlren[$i]['wanita']; + $temphp3 += $rpren[$i]['wanita']; + $tempjumlah4 += $jmlrev[$i]['wanita']; + $temphp4 += $rprev[$i]['wanita']; + + } + print(""); + } + + print(""); +/* ANAK -------------------------------------------------------------------------*/ + if($ttJmlBeli['anak']['jml']!=0){ + print(""); + for($i=0;$i<$anak;$i++){ + if ($str[$i-1]['anak']==$str[$i]['anak']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlah5 = 0; + $temphp5 = 0; + $tempjumlah6 = 0; + $temphp6 = 0; + } + $tempjumlah5 += $jmlren[$i]['anak']; + $temphp5 += $rpren[$i]['anak']; + $tempjumlah6 += $jmlrev[$i]['anak']; + $temphp6 += $rprev[$i]['anak']; + + } + print(""); + } + + print(""); +/* SEPATU -------------------------------------------------------------------------*/ + if($ttJmlBeli['sepatu']['jml']!=0){ + print(""); + for($i=0;$i<$sepatu;$i++){ + if ($str[$i-1]['sepatu']==$str[$i]['sepatu']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlah7 = 0; + $temphp7 = 0; + $tempjumlah8 = 0; + $temphp8 = 0; + } + $tempjumlah7 += $jmlren[$i]['sepatu']; + $temphp7 += $rpren[$i]['sepatu']; + $tempjumlah8 += $jmlrev[$i]['sepatu']; + $temphp8 += $rprev[$i]['sepatu']; + + } + print(""); + } + + print(""); + + $ttjml1 = $ttJmlBeli['pria']['jml'] + $ttJmlBeli['wanita']['jml'] + $ttJmlBeli['anak']['jml'] + $ttJmlBeli['sepatu']['jml']; + $ttrp1 = $ttJmlBeli['pria']['hp'] + $ttJmlBeli['wanita']['hp'] + $ttJmlBeli['anak']['hp'] + $ttJmlBeli['sepatu']['hp']; + $ttjml2 = $ttJmlBeli['pria']['jmlRev'] + $ttJmlBeli['wanita']['jmlRev'] + $ttJmlBeli['anak']['jmlRev'] + $ttJmlBeli['sepatu']['jmlRev']; + $ttrp2 = $ttJmlBeli['pria']['hpRev'] + $ttJmlBeli['wanita']['hpRev'] + $ttJmlBeli['anak']['hpRev'] + $ttJmlBeli['sepatu']['hpRev']; + + print(" + + + + "); + + print("
KategoriLini ProdukKode SupplierNama SupplierJumlah RencTotal HP RencValid RencJumlah Rev.Total HP Rev.Valid Rev.
Pria
~".$str[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlren[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria'], 0, ",", ".")."".$stsren[$i]['pria']."".number_format($jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rprev[$i]['pria'], 0, ",", ".")."".$stsrev[$i]['pria']."
".number_format($tempjumlah1, 0, ",", ".")."".number_format($temphp1, 0, ",", ".")."".number_format($tempjumlah2, 0, ",", ".")."".number_format($temphp2, 0, ",", ".")."
~".$str[$i]['pria'].".".$kdSupp[$i]['pria']."".$nmSupp[$i]['pria']."".number_format($jmlren[$i]['pria'], 0, ",", ".")."".number_format($rpren[$i]['pria'], 0, ",", ".")."".$stsren[$i]['pria']."".number_format($jmlrev[$i]['pria'], 0, ",", ".")."".number_format($rprev[$i]['pria'], 0, ",", ".")."".$stsrev[$i]['pria']."
".number_format($tempjumlah1, 0, ",", ".")."".number_format($temphp1, 0, ",", ".")."".number_format($tempjumlah2, 0, ",", ".")."".number_format($temphp2, 0, ",", ".")."
TOTAL PRIA".number_format($ttJmlBeli['pria']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['hp'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['pria']['hpRev'], 0, ",", ".")."
Wanita
~".$str[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlren[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita'], 0, ",", ".")."".$stsren[$i]['wanita']."".number_format($jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rprev[$i]['wanita'], 0, ",", ".")."".$stsrev[$i]['wanita']."
".number_format($tempjumlah3, 0, ",", ".")."".number_format($temphp3, 0, ",", ".")."".number_format($tempjumlah4, 0, ",", ".")."".number_format($temphp4, 0, ",", ".")."
~".$str[$i]['wanita'].".".$kdSupp[$i]['wanita']."".$nmSupp[$i]['wanita']."".number_format($jmlren[$i]['wanita'], 0, ",", ".")."".number_format($rpren[$i]['wanita'], 0, ",", ".")."".$stsren[$i]['wanita']."".number_format($jmlrev[$i]['wanita'], 0, ",", ".")."".number_format($rprev[$i]['wanita'], 0, ",", ".")."".$stsrev[$i]['wanita']."
".number_format($tempjumlah3, 0, ",", ".")."".number_format($temphp3, 0, ",", ".")."".number_format($tempjumlah4, 0, ",", ".")."".number_format($temphp4, 0, ",", ".")."
TOTAL WANITA".number_format($ttJmlBeli['wanita']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['hp'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['wanita']['hpRev'], 0, ",", ".")."
Anak
~".$str[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlren[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak'], 0, ",", ".")."".$stsren[$i]['anak']."".number_format($jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rprev[$i]['anak'], 0, ",", ".")."".$stsrev[$i]['anak']."
".number_format($tempjumlah5, 0, ",", ".")."".number_format($temphp5, 0, ",", ".")."".number_format($tempjumlah6, 0, ",", ".")."".number_format($temphp6, 0, ",", ".")."
~".$str[$i]['anak'].".".$kdSupp[$i]['anak']."".$nmSupp[$i]['anak']."".number_format($jmlren[$i]['anak'], 0, ",", ".")."".number_format($rpren[$i]['anak'], 0, ",", ".")."".$stsren[$i]['anak']."".number_format($jmlrev[$i]['anak'], 0, ",", ".")."".number_format($rprev[$i]['anak'], 0, ",", ".")."".$stsrev[$i]['anak']."
".number_format($tempjumlah5, 0, ",", ".")."".number_format($temphp5, 0, ",", ".")."".number_format($tempjumlah6, 0, ",", ".")."".number_format($temphp6, 0, ",", ".")."
TOTAL ANAK".number_format($ttJmlBeli['anak']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['hp'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['anak']['hpRev'], 0, ",", ".")."
Sepatu
~".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlren[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu'], 0, ",", ".")."".$stsren[$i]['sepatu']."".number_format($jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rprev[$i]['sepatu'], 0, ",", ".")."".$stsrev[$i]['sepatu']."
".number_format($tempjumlah7, 0, ",", ".")."".number_format($temphp7, 0, ",", ".")."".number_format($tempjumlah8, 0, ",", ".")."".number_format($temphp8, 0, ",", ".")."
~".$str[$i]['sepatu'].".".$kdSupp[$i]['sepatu']."".$nmSupp[$i]['sepatu']."".number_format($jmlren[$i]['sepatu'], 0, ",", ".")."".number_format($rpren[$i]['sepatu'], 0, ",", ".")."".$stsren[$i]['sepatu']."".number_format($jmlrev[$i]['sepatu'], 0, ",", ".")."".number_format($rprev[$i]['sepatu'], 0, ",", ".")."".$stsrev[$i]['sepatu']."
".number_format($tempjumlah7, 0, ",", ".")."".number_format($temphp7, 0, ",", ".")."".number_format($tempjumlah8, 0, ",", ".")."".number_format($temphp8, 0, ",", ".")."
TOTAL SEPATU".number_format($ttJmlBeli['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['jmlRev'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hpRev'], 0, ",", ".")."
T O T A L : ".number_format($ttjml1, 0, ",", ".")."".number_format($ttrp1, 0, ",", ".")."".number_format($ttjml2, 0, ",", ".")."".number_format($ttrp2, 0, ",", ".")."

"); + }else{ + echo "Tidak ada data order untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/lapsuppjtempo.php b/old-source/LaporanBeli/lapsuppjtempo.php new file mode 100644 index 0000000..3682e33 --- /dev/null +++ b/old-source/LaporanBeli/lapsuppjtempo.php @@ -0,0 +1,91 @@ +"; + echo "div#divprint{width:1024px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:950px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:50px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDateJtempo = decTgl($_POST['startDate3']); + $endDateJtempo = decTgl($_POST['endDate3']); + $startDateNota = decTgl($_POST['startDate4']); + $endDateNota = decTgl($_POST['endDate4']); + + if(bukaKoneksi()){ + global $conn; + if(strlen($startDateNota) <= 2 && strlen($endDateNota) <= 2){ + $query = "SELECT m.no_faktur, m.tgl_masuk, m.tgl_nota, m.tgl_jatuh_tempo, m.kd_supplier, s.nama_supplier, m.total_beli, m.rp_beli, m.keterangan, k.nama + FROM m_pembelian m, supplier s, karyawan k + WHERE s.kd_supplier = m.kd_supplier + AND m.tgl_jatuh_tempo BETWEEN '$startDateJtempo' AND '$endDateJtempo' + AND m.validasi = '1' + AND m.status_revisi = '1' + AND m.nik = k.nik + ORDER BY m.tgl_jatuh_tempo,m.tgl_nota,m.kd_supplier"; + }elseif(strlen($startDateNota) > 2 && strlen($endDateNota) > 2 ){ + $query = "SELECT m.no_faktur, m.tgl_masuk, m.tgl_nota, m.tgl_jatuh_tempo, m.kd_supplier, s.nama_supplier, m.total_beli, m.rp_beli, m.keterangan, k.nama + FROM m_pembelian m, supplier s, karyawan k + WHERE s.kd_supplier = m.kd_supplier + AND m.tgl_jatuh_tempo BETWEEN '$startDateJtempo' AND '$endDateJtempo' + AND m.tgl_nota BETWEEN '$startDateNota' AND '$endDateNota' + AND m.validasi = '1' + AND m.status_revisi = '1' + AND m.nik = k.nik + ORDER BY m.tgl_jatuh_tempo,m.tgl_nota,m.kd_supplier"; + + } + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$faktur,$tglMsk,$tglNota,$tglTmp,$kdSup,$nmSup,$ttBeli,$ttRp,$ket,$name); + $ttJumlah = array(); + $ttJumlah['faktur'] = 0; + $ttJumlah['jml'] = 0; + $ttJumlah['rp'] = 0; + + + print("
"); + print("

Laporan Pembelian Per Supplier Berdasarkan Tanggal Jatuh Tempo



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("Periode Jatuh Tempo : ".encTgl($startDateJtempo) ." s/d ".encTgl($endDateJtempo)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['faktur']++; + $ttJumlah['jml'] += $ttBeli; + $ttJumlah['rp'] += $ttRp; + + print(""); + } + + print("
No. FakturTanggal MasukTanggal NotaTanggal Jt TempoKode Supp.Nama SupplierJumlah PembelianTotal PembelianKeteranganNama Assko
.$faktur".encTgl($tglMsk)."".encTgl($tglNota)."".encTgl($tglTmp).".$kdSup$nmSup".number_format($ttBeli,0,',','.')."".number_format($ttRp,0,',','.')."$ket$name

"); + print("
"); + print(""); + print(""); + print(""); + + print("
Total Lembar Nota : ".number_format($ttJumlah['faktur'],0,',','.')."
Total Jumlah Beli : ".number_format($ttJumlah['jml'],0,',','.')."
Total Pembelian : ".number_format($ttJumlah['rp'],0,',','.')."
"); + }else{ + echo "Belum ada data pembelian untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanBeli/menu.php b/old-source/LaporanBeli/menu.php new file mode 100644 index 0000000..1f41549 --- /dev/null +++ b/old-source/LaporanBeli/menu.php @@ -0,0 +1,129 @@ + + + + + +
+ +
diff --git a/old-source/LaporanBeli/orderblmdtg.php~ b/old-source/LaporanBeli/orderblmdtg.php~ new file mode 100644 index 0000000..4b3e9c3 --- /dev/null +++ b/old-source/LaporanBeli/orderblmdtg.php~ @@ -0,0 +1,96 @@ + + + + + Amigo Group :: Pengadaan Barang + + + + + + + + + + + + + + + + + +
+
+ +
+
+
Rekap Order Belum Datang
+
+
+
+ + +
Kode Supplier: +
Lini Produk : +
Bulan : [01,02,dst]* +
Tahun : * +
+
+ tanda (*) = kolom harus diisi +
+
+
+
+ +
+
Cari Supplier
+
+ +
+
+ + + + +
Nama: +
+
+
+ Hasil pencarian +
+
+
+
+ + + + + + diff --git a/old-source/LaporanBeli/rekapretbeli.php b/old-source/LaporanBeli/rekapretbeli.php new file mode 100644 index 0000000..754b972 --- /dev/null +++ b/old-source/LaporanBeli/rekapretbeli.php @@ -0,0 +1,82 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan Rekap Retur Pembelian +
+
+
+ + + +
Range Tanggal: s/d
+
+
+
+
+ +
+ + diff --git a/old-source/LaporanBeli/rnc_and_order.php~ b/old-source/LaporanBeli/rnc_and_order.php~ new file mode 100644 index 0000000..84ce1e1 --- /dev/null +++ b/old-source/LaporanBeli/rnc_and_order.php~ @@ -0,0 +1,96 @@ + + + + + Amigo Group :: Pengadaan Barang + + + + + + + + + + + + + + + + + +
+
+ +
+
+
Rekap Rencana & Realisasi Order
+
+
+
+ + +
Kode Supplier: +
Lini Produk : +
Bulan : [01,02,dst]* +
Tahun : * +
+
+ tanda (*) = kolom harus diisi +
+
+
+
+ +
+
Cari Supplier
+
+ +
+
+ + + + +
Nama: +
+
+
+ Hasil pencarian +
+
+
+
+ + + + + + diff --git a/old-source/LaporanBeli/rnc_order_brgdtg.php~ b/old-source/LaporanBeli/rnc_order_brgdtg.php~ new file mode 100644 index 0000000..4026812 --- /dev/null +++ b/old-source/LaporanBeli/rnc_order_brgdtg.php~ @@ -0,0 +1,96 @@ + + + + + Amigo Group :: Pengadaan Barang + + + + + + + + + + + + + + + + + +
+
+ +
+
+
Rekap Rencana,Realisasi Order & Barang Datang
+
+
+
+ + +
Kode Supplier: +
Lini Produk : +
Bulan : [01,02,dst]* +
Tahun : * +
+
+ tanda (*) = kolom harus diisi +
+
+
+
+ +
+
Cari Supplier
+
+ +
+
+ + + + +
Nama: +
+
+
+ Hasil pencarian +
+
+
+
+ + + + + + diff --git a/old-source/LaporanBeli/rncordersupp.php~ b/old-source/LaporanBeli/rncordersupp.php~ new file mode 100644 index 0000000..4e5cb9b --- /dev/null +++ b/old-source/LaporanBeli/rncordersupp.php~ @@ -0,0 +1,95 @@ + + + + + Amigo Group :: Pengadaan Barang + + + + + + + + + + + + + + + + + +
+
+ +
+
+
Rekap Rencana Order Per Supplier
+
+
+
+ + +
Kode Supplier: * +
Lini Produk : +
Bulan : [01,02,dst]* +
Tahun : * +
+
+
+
+
+
+ +
+
Cari Supplier
+
+ +
+
+ + + + +
Nama: +
+
+
+ Hasil pencarian +
+
+
+
+ + + + + + diff --git a/old-source/LaporanBeli/rncpersupp.php~ b/old-source/LaporanBeli/rncpersupp.php~ new file mode 100644 index 0000000..2e3005a --- /dev/null +++ b/old-source/LaporanBeli/rncpersupp.php~ @@ -0,0 +1,96 @@ + + + + + Amigo Group :: Pengadaan Barang + + + + + + + + + + + + + + + + + +
+
+ +
+
+
Rekap Rencana Per Supplier
+
+
+
+ + + tanda (*) = kolom harus diisi +
Kode Supplier: +
Lini Produk : +
Bulan : [01,02,dst]* +
Tahun : * +
+
+
+
+
+
+ +
+
Cari Supplier
+
+ +
+
+ + + + +
Nama: +
+
+
+ Hasil pencarian +
+
+
+
+ + + + + + diff --git a/old-source/LaporanJual/ajaxpelanggan.php b/old-source/LaporanJual/ajaxpelanggan.php new file mode 100644 index 0000000..4e8eced --- /dev/null +++ b/old-source/LaporanJual/ajaxpelanggan.php @@ -0,0 +1,173 @@ + +prepare($query); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + + +function cek_pelanggan($id_pelanggan) +{ + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT COUNT(*) FROM pelanggan WHERE kd_customer = '{$id_pelanggan}'")->fetch_array(); + if ($data[0] > 0) + { + return true; + } else + { + return false; + } +} + +function cari_pelanggan($nama) { + if($nama != "") { + $harray = array(); + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT kd_customer, nama, alamat, nilai_bon, bts_bon FROM pelanggan WHERE nama LIKE '%".$nama."%'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_customer' => $a['kd_customer'], + 'nama' => $a['nama'], + 'alamat' => $a['alamat'], + 'nilai_bon' => number_format($a['nilai_bon'],0,',','.'), + 'bts_bon' => number_format($a['bts_bon'],0,',','.') + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + +function cari_upline($nama) { + if($nama != "") { + $harray = array(); + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT kd_customer, nama, alamat, nilai_bon, bts_bon FROM pelanggan WHERE nama LIKE '%".$nama."%' AND upline = '#'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_customer' => $a['kd_customer'], + 'nama' => $a['nama'], + 'alamat' => $a['alamat'], + 'nilai_bon' => number_format($a['nilai_bon'],0,',','.'), + 'bts_bon' => number_format($a['bts_bon'],0,',','.') + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + +function ambil_pelanggan($id_pelanggan) { + if ($id_pelanggan != "") { + $array_data = array(); + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT * FROM pelanggan WHERE kd_customer = '".$id_pelanggan."'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $tgl_lahir = ''; + + if($a['tgl_lahir'] != "") { + $tgl_lahir = substr($a['tgl_lahir'],8,2)."-".substr($a['tgl_lahir'],5,2)."-".substr($a['tgl_lahir'],0,4); + } else { + $tgl_lahir = $a['tgl_lahir']; + } + + $array_data[$idx] = array( + 'kd_customer' => $a['kd_customer'], + 'alias' => $a['alias'], + 'member' => $a['member'], + 'ktp' => $a['ktp'], + 'nama' => $a['nama'], + 'alamat' => $a['alamat'], + 'kd_lokasi' => $a['kd_lokasi'], + 'wilayah' => $a['wilayah'], + 'tempat_lahir' => $a['tempat_lahir'], + 'tgl_lahir' => $tgl_lahir, + 'jns_kelamin' => $a['jns_kelamin'], + 'agama' => $a['agama'], + 'kd_lokasi' => $a['kd_lokasi'], + 'pekerjaan' => $a['pekerjaan'], + 'status_nikah' => $a['status_nikah'], + 'telp' => $a['telp'], + 'ponsel' => $a['ponsel'], + 'email' => $a['email'], + 'status' => $a['status'], + 'upline' => $a['upline'], + 'bts_bon' => $a['bts_bon'], + 'nilai_bon' => $a['nilai_bon'], + 'bts_bon_istimewa' => $a['bts_bon_istimewa'], + 'nilai_komisi' => $a['nilai_komisi'], + 'komisi_diambil' => $a['komisi_diambil'], + 'jenis_customer' => $a['jenis_customer'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($array_data); + } +} + +?> \ No newline at end of file diff --git a/old-source/LaporanJual/ajaxsupplier.php b/old-source/LaporanJual/ajaxsupplier.php new file mode 100644 index 0000000..6393c13 --- /dev/null +++ b/old-source/LaporanJual/ajaxsupplier.php @@ -0,0 +1,134 @@ + +prepare($query); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function cari_supplier($nama) { + if($nama != "") { + $harray = array(); + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $nama = addslashes($nama); + $data = $mysqli->query("SELECT kd_supplier, nama_supplier, alamat1, lama_tempo FROM supplier WHERE nama_supplier LIKE '%".$nama."%'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_supplier' => $a['kd_supplier'], + 'nama_supplier' => stripcslashes($a['nama_supplier']), + 'alamat1' => $a['alamat1'], + 'lama_tempo' => $a['lama_tempo'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + }else{ + $harray = array(); + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $nama = addslashes($nama); + $data = $mysqli->query("SELECT kd_supplier, nama_supplier, alamat1, lama_tempo FROM supplier"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_supplier' => $a['kd_supplier'], + 'nama_supplier' => stripcslashes($a['nama_supplier']), + 'alamat1' => $a['alamat1'], + 'lama_tempo' => $a['lama_tempo'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + +function ambil_supplier($id_supplier) { + if ($id_supplier != "") { + $array_data = array(); + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT * FROM supplier WHERE kd_supplier = '".$id_supplier."'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $array_data[$idx] = array( + 'kd_supplier' => $a['kd_supplier'], + 'nama_supplier' => $a['nama_supplier'], + 'alamat1' => $a['alamat1'], + 'alamat2' => $a['alamat2'], + 'nama_rekening' => $a['nama_rekening'], + 'rekening1' => $a['rekening1'], + 'rekening2' => $a['rekening2'], + 'bank1' => $a['bank1'], + 'bank2' => $a['bank2'], + 'telp' => $a['telp'], + 'ponsel' => $a['ponsel'], + 'email' => $a['email'], + 'fax' => $a['fax'], + 'jns_pembayaran' => $a['jns_pembayaran'], + 'lama_tempo' => $a['lama_tempo'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($array_data); + } +} + + +?> \ No newline at end of file diff --git a/old-source/LaporanJual/ak7.php b/old-source/LaporanJual/ak7.php new file mode 100644 index 0000000..9857e05 --- /dev/null +++ b/old-source/LaporanJual/ak7.php @@ -0,0 +1,86 @@ + + + + + :: Pengadaan Barang + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan AK.7 (Pantauan Persediaan) +
+ 1.Pastikan tanggal di komputer server benar sebelum menjalankan laporan ini
+ 2.Laporan harus dijalankan setiap hari, terutama setelah semua proses entry data selesai + +
+
+ + + +
Bulan : [1,2,3,dst] *
Tahun : * +
+ * kolom harus diisi +
+
+
+
+ +
+ + diff --git a/old-source/LaporanJual/bawa.php b/old-source/LaporanJual/bawa.php new file mode 100644 index 0000000..a19a6b8 --- /dev/null +++ b/old-source/LaporanJual/bawa.php @@ -0,0 +1,125 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Rekap Transaksi Bawa +
+ + + + + +
+
+
+ + + + +
Rentang Tanggal: -
Kode Pelanggan : + +
+
+
+
+
+
+ + + + +
Rentang Tanggal: -
Kode Pelanggan : + +
+
+
+
+
+
+ + +
+
Cari Pelanggan
+
+
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+
+ +
+ +
+ + diff --git a/old-source/LaporanJual/detailjual.php b/old-source/LaporanJual/detailjual.php new file mode 100644 index 0000000..b6a123e --- /dev/null +++ b/old-source/LaporanJual/detailjual.php @@ -0,0 +1,80 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan Detail Penjualan Per Kategori +
+
+
+ + +
Range Tanggal: s/d
+
+
+
+
+ +
+ + diff --git a/old-source/LaporanJual/fast_move.php b/old-source/LaporanJual/fast_move.php new file mode 100644 index 0000000..17f3bbb --- /dev/null +++ b/old-source/LaporanJual/fast_move.php @@ -0,0 +1,112 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan Barang Fast Moving +
+
+
+ + +
Kode Supplier: +
Lini Produk : +
Tgl Pembelian : + s/d * +
+ * kolom harus diisi +
+
+
+
+ +
+
Cari Supplier
+
+ +
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + +
+ + \ No newline at end of file diff --git a/old-source/LaporanJual/jualdlmpdk.php b/old-source/LaporanJual/jualdlmpdk.php new file mode 100644 index 0000000..9cc40f1 --- /dev/null +++ b/old-source/LaporanJual/jualdlmpdk.php @@ -0,0 +1,81 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan Penjualan Per Sub Group Product +
+
+
+ + + +
Range Tanggal: s/d
+
+
+
+
+ +
+ + diff --git a/old-source/LaporanJual/jualperkategori.php b/old-source/LaporanJual/jualperkategori.php new file mode 100644 index 0000000..602d901 --- /dev/null +++ b/old-source/LaporanJual/jualperkategori.php @@ -0,0 +1,80 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan Penjualan Per Kategori +
+
+
+ + +
Range Tanggal: s/d
+
+
+
+
+ +
+ + diff --git a/old-source/LaporanJual/jualpersupplier.php b/old-source/LaporanJual/jualpersupplier.php new file mode 100644 index 0000000..05675f5 --- /dev/null +++ b/old-source/LaporanJual/jualpersupplier.php @@ -0,0 +1,142 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan Penjualan Per Supplier +
+
+
+ + + +
Range Tanggal: s/d
Kode Supplier:
+
+
+
+
+
+ + + +
Range Tanggal: s/d
+
+
+
+ +
+
+ +
+
Cari Supplier
+
+ +
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + +
+ + \ No newline at end of file diff --git a/old-source/LaporanJual/kartu.php b/old-source/LaporanJual/kartu.php new file mode 100644 index 0000000..0eb5b13 --- /dev/null +++ b/old-source/LaporanJual/kartu.php @@ -0,0 +1,81 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Rekap Transaksi Kartu +
+
+
+ + + +
Range Tanggal: s/d
+
+
+
+
+ +
+ + diff --git a/old-source/LaporanJual/kembalibawa.php b/old-source/LaporanJual/kembalibawa.php new file mode 100644 index 0000000..6303acc --- /dev/null +++ b/old-source/LaporanJual/kembalibawa.php @@ -0,0 +1,74 @@ +"; + echo "div#divprint{width:1024px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:950px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $tgl = left($_GET['tgllini'],10); + $lini = right($_GET['tgllini'],2); + + if(bukaKoneksi()){ + global $conn; + $query = "SELECT ((year(curdate()) - b.tahun) * 12) + month(curdate()) - b.bulan usia,DATEDIFF( DATE( m.tgl_kembali ) , DATE( m.tgl_nota ) ) lama_bawa, p.nama, d.no_nota, m.tgl_nota, m.tgl_kembali, d.kd_barang, b.nama_barang, d.no_barang, SUM( d.jumlah ) , SUM( d.jumlah * d.harga_satuan ) rp, SUM( d.jumlah * REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( n.harga_pokok, 'B', '1' ) , 'R', '2' ) , 'A', '3' ) , 'W', '4' ) , 'N', '5' ) , 'F', '6' ) , 'O', '7' ) , 'X', '8' ) , 'E', '9' ) , 'S', '0' ) ) hp, status_barang + FROM d_nota_bawa d, m_nota_bawa m, pelanggan p, barang b, no_barang n + WHERE m.no_nota = d.no_nota + AND b.id_gabungan = n.id_gabungan + AND m.kd_customer = p.kd_customer + AND (d.kd_barang = b.kode_barang AND d.no_barang = n.nomor) + AND b.kode_strip = '$lini' + AND DATE( m.tgl_kembali ) = '$tgl' + GROUP BY CONCAT( d.kd_barang, d.no_barang ) , d.no_nota + ORDER BY DATE( tgl_nota ) , d.no_nota, p.nama, status_barang"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$usia,$lama,$nama,$nota,$tgl,$tglkembali,$brg,$nmbrg,$nobrg,$jml,$rp,$hp,$statusTransaksi); + + print("
"); + print("

Rekap Bawa Barang yang Kembali



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $tthargapokok += $hp; + print(" + + + + "); + } + + print("
Lama Bawa (hari)NamaNo.NotaTgl.NotaTgl.KembaliKode BarangNama BarangNo.BarangJumlahHPHJUsia Brg (bln)Status Transaksi
$lama$nama$nota$tgl$tglkembali$brg$nmbrg$nobrg$jml".number_format($hp, 0, ",", ".")."".number_format($rp, 0, ",", ".")."$usia$statusTransaksi

"); + print(""); + print(""); + print("
Total Harga Pokok : ".number_format($tthargapokok, 0, ",", ".")."
"); + print("
"); + + }else{ + echo "Data tidak ditemukan!"; + } + } + } +?> + diff --git a/old-source/LaporanJual/komposisi.php b/old-source/LaporanJual/komposisi.php new file mode 100644 index 0000000..00033e6 --- /dev/null +++ b/old-source/LaporanJual/komposisi.php @@ -0,0 +1,81 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Rekap Penjualan Komposisi +
+
+
+ + + +
Range Tanggal: s/d
+
+
+
+
+ +
+ + diff --git a/old-source/LaporanJual/konsinyasibawa.php b/old-source/LaporanJual/konsinyasibawa.php new file mode 100644 index 0000000..77ec40d --- /dev/null +++ b/old-source/LaporanJual/konsinyasibawa.php @@ -0,0 +1,295 @@ +"; + echo "div#divprint{width:1024px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:950px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:50px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate3']); + $endDate = decTgl($_POST['endDate3']); + $kodeplg = $_POST['kdplg3']; + + if(bukaKoneksi()){ + global $conn; + IF (strlen($startDate) > 2 && strlen($endDate) > 2 && $kodeplg !=''){ + $query = "select b.kode_supplier, s.nama_supplier, d.no_nota, m.tgl_nota, m.kd_customer, + d.kd_barang,d.no_barang,dp.nm_brg,sum(d.jumlah), + sum(d.jumlah*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp, + sum(d.jumlah*d.harga_satuan) hj,d.kode_pram + from m_nota_bawa m,d_nota_bawa d,no_barang n, barang b, d_pembelian dp, m_pembelian mp, supplier s + where m.status_nota = 'S' + and b.id_gabungan = n.id_gabungan + and b.kode_supplier = s.kd_supplier + and m.no_nota = d.no_nota + and dp.no_faktur = mp.no_faktur + AND left(mp.no_faktur,4) <> 'RVB-' + AND mp.status = 'K' + AND mp.validasi = '1' + AND d.status_barang is NULL + AND (dp.kode_barang = d.kd_barang AND dp.nomor = d.no_barang) + and (d.kd_barang = b.kode_barang and d.no_barang = n.nomor) + and date(m.tgl_nota) BETWEEN '$startDate' and '$endDate' + and m.kd_customer = '$kodeplg' + group by m.no_nota,concat(d.kd_barang,d.no_barang) + order by b.kode_supplier,m.tgl_nota,m.no_nota"; + }elseif ($startDate != '' && $endDate != '' && $kodeplg =='' ){ + $query = "select b.kode_supplier, s.nama_supplier, d.no_nota, m.tgl_nota, m.kd_customer, + d.kd_barang,d.no_barang,dp.nm_brg,sum(d.jumlah), + sum(d.jumlah*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp, + sum(d.jumlah*d.harga_satuan) hj,d.kode_pram + from m_nota_bawa m,d_nota_bawa d,no_barang n, barang b, d_pembelian dp, m_pembelian mp, supplier s + where m.status_nota = 'S' + and b.id_gabungan = n.id_gabungan + and b.kode_supplier = s.kd_supplier + and m.no_nota = d.no_nota + and dp.no_faktur = mp.no_faktur + AND left(mp.no_faktur,4) <> 'RVB-' + AND mp.status = 'K' + AND mp.validasi = '1' + AND d.status_barang is NULL + AND (dp.kode_barang = d.kd_barang AND dp.nomor = d.no_barang) + and (d.kd_barang = b.kode_barang and d.no_barang = n.nomor) + and date(m.tgl_nota) BETWEEN '$startDate' and '$endDate' + group by m.no_nota,concat(d.kd_barang,d.no_barang) + order by b.kode_supplier,m.tgl_nota,m.no_nota"; + }elseif (strlen($startDate) <= 2 && strlen($endDate) <= 2 && $kodeplg !='') { + $query = "select b.kode_supplier, s.nama_supplier, d.no_nota, m.tgl_nota, m.kd_customer, + d.kd_barang,d.no_barang,dp.nm_brg,sum(d.jumlah), + sum(d.jumlah*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp, + sum(d.jumlah*d.harga_satuan) hj,d.kode_pram + from m_nota_bawa m,d_nota_bawa d,no_barang n, barang b, d_pembelian dp, m_pembelian mp, supplier s + where m.status_nota = 'S' + and b.id_gabungan = n.id_gabungan + and b.kode_supplier = s.kd_supplier + and m.no_nota = d.no_nota + and dp.no_faktur = mp.no_faktur + AND left(mp.no_faktur,4) <> 'RVB-' + AND mp.status = 'K' + AND mp.validasi = '1' + AND d.status_barang is NULL + AND (dp.kode_barang = d.kd_barang AND dp.nomor = d.no_barang) + and (d.kd_barang = b.kode_barang and d.no_barang = n.nomor) + and m.kd_customer = '$kodeplg' + group by m.no_nota,concat(d.kd_barang,d.no_barang) + order by b.kode_supplier,m.tgl_nota,m.no_nota"; + } + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdsupp,$namasupp,$nota,$tgl,$kdcust,$kdbrg,$nomor,$namabrg,$jumlah,$hp,$hj,$kasir); + $ttJumlah = array(); + + $ttJumlah['hp'] = 0; + $ttJumlah['hj'] = 0; + print("
"); + print("

Laporan Penjualan - Bawa Barang Konsinyasi



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['hp'] += $hp; + $ttJumlah['hj'] += $hj; + print(" + + "); + } + + print("
Kode SuppNama SuppNo.NotaTgl.NotaKd.PlgKd.BarangNomorNama BrgJumlahHPHJKasir
.$kdsupp$namasupp$nota$tgl.$kdcust$kdbrg$nomor$namabrg$jumlah".number_format($hp, 0, ",", ".")."".number_format($hj, 0, ",", ".")."$kasir

"); + print("
"); + print(""); + print(""); + print("
Total Harga Pokok : ".number_format($ttJumlah['hp'],0,',','.')."
Total Harga Jual : ".number_format($ttJumlah['hj'],0,',','.')."
"); + }else{ + echo "Data tidak ada"; + echo "
"; + } + } + + /*----------------------------------------Penjualan grouping per konveksi per supplier*/ + $query = "SELECT CASE s.kel_jns when 'A' then 'Konveksi' + when 'P' then 'Konveksi' + when 'W' then 'Konveksi' + END kategori, mp.kd_supplier, sp.nama_supplier, sum(d.jumlah) jml, + sum(d.jumlah*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp, + sum(d.jumlah*d.harga_satuan) hj + FROM m_nota_bawa m,d_nota_bawa d,no_barang n, barang b, d_pembelian dp, m_pembelian mp,strip s, supplier sp + WHERE m.status_nota = 'S' + and b.id_gabungan = n.id_gabungan + and mp.kd_supplier = sp.kd_supplier + and s.kd_strip = b.kode_strip + and m.no_nota = d.no_nota + and dp.no_faktur = mp.no_faktur + AND left(mp.no_faktur,4) <> 'RVB-' + AND mp.status = 'K' + AND mp.validasi = '1' + AND s.kel_jns != 'S' + AND d.status_barang is NULL + AND (dp.kode_barang = d.kd_barang AND dp.nomor = d.no_barang) + and (d.kd_barang = b.kode_barang and d.no_barang = n.nomor) + and date(m.tgl_nota) BETWEEN '$startDate' and '$endDate' + GROUP BY kategori,mp.kd_supplier + "; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kat,$kdsupp,$supp,$jml,$hp,$hj); + + print("
"); + print("

Rekap Penjualan Bawa Barang Konsinyasi Kelp.Kategori Konveksi Per Supplier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("Periode Tanggal : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."


"); + print(""); + print(""); + + $ttHJ = 0; + $ttHP = 0; + $profit = 0; + while(mysqli_stmt_fetch($stmt)){ + $ttHJ += $hj; + $ttHP += $hp; + $profit = ($hj-$hp)/$hj*100; + print(" + "); + } + print(""); + print("
Kelp.KategoriKode SupplierNama SupplierJumlHarga JualHarga PokokProfit[%]
$kat.$kdsupp$supp$jml".number_format($hj,0,',','.')."".number_format($hp,0,',','.')."".number_format($profit,2,',','.')."
T O T A L".number_format($ttHJ,0,',','.')."".number_format($ttHP,0,',','.')."

"); + print("
"); + }else{ + echo "data tdk ada"; + echo "
"; + } + } + /*----------------------------------------Penjualan grouping per sepatu per supplier*/ + $query = "SELECT CASE s.kel_jns when 'S' then 'Sepatu' + END kategori, mp.kd_supplier, sp.nama_supplier, sum(d.jumlah) jml, + sum(d.jumlah*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp, + sum(d.jumlah*d.harga_satuan) hj + FROM m_nota_bawa m,d_nota_bawa d,no_barang n, barang b, d_pembelian dp, m_pembelian mp,strip s, supplier sp + where m.status_nota = 'S' + and b.id_gabungan = n.id_gabungan + and mp.kd_supplier = sp.kd_supplier + and s.kd_strip = b.kode_strip + and m.no_nota = d.no_nota + and dp.no_faktur = mp.no_faktur + AND left(mp.no_faktur,4) <> 'RVB-' + AND mp.status = 'K' + AND mp.validasi = '1' + AND s.kel_jns = 'S' + AND d.status_barang is NULL + AND (dp.kode_barang = d.kd_barang AND dp.nomor = d.no_barang) + and (d.kd_barang = b.kode_barang and d.no_barang = n.nomor) + and date(m.tgl_nota) BETWEEN '$startDate' and '$endDate' + group by kategori,mp.kd_supplier + "; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kat,$kdsupp,$supp,$jml,$hp,$hj); + + print("
"); + print("

Rekap Penjualan Bawa Barang Konsinyasi Kelp.Kategori Sepatu Per Supplier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("Periode Tanggal : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."


"); + print(""); + print(""); + + $ttHJ = 0; + $ttHP = 0; + $profit = 0; + while(mysqli_stmt_fetch($stmt)){ + $ttHJ += $hj; + $ttHP += $hp; + $profit = ($hj-$hp)/$hj*100; + print(" + "); + } + print(""); + print("
Kelp.KategoriKode SupplierNama SupplierJumlHarga JualHarga PokokProfit[%]
$kat.$kdsupp$supp$jml".number_format($hj,0,',','.')."".number_format($hp,0,',','.')."".number_format($profit,2,',','.')."
T O T A L".number_format($ttHJ,0,',','.')."".number_format($ttHP,0,',','.')."

"); + print("
"); + }else{ + echo "data tdk ada"; + echo "
"; + } + } + /*----------------------------------------Penjualan grouping per supplier*/ + $query = "select mp.kd_supplier, sp.nama_supplier, sum(d.jumlah) jml, + sum(d.jumlah*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp, + sum(d.jumlah*d.harga_satuan) hj + FROM m_nota_bawa m,d_nota_bawa d,no_barang n, barang b, d_pembelian dp, m_pembelian mp,strip s, supplier sp + where m.status_nota = 'S' + and b.id_gabungan = n.id_gabungan + and mp.kd_supplier = sp.kd_supplier + and s.kd_strip = b.kode_strip + and m.no_nota = d.no_nota + and dp.no_faktur = mp.no_faktur + AND left(mp.no_faktur,4) <> 'RVB-' + AND mp.status = 'K' + AND mp.validasi = '1' + AND d.status_barang is NULL + AND (dp.kode_barang = d.kd_barang AND dp.nomor = d.no_barang) + and (d.kd_barang = b.kode_barang and d.no_barang = n.nomor) + and date(m.tgl_nota) BETWEEN '$startDate' and '$endDate' + group by mp.kd_supplier + "; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdsupp,$supp,$jml,$hp,$hj); + + print("
"); + print("

Rekap Penjualan Bawa Barang Konsinyasi Per Supplier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("Periode Tanggal : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."


"); + print(""); + print(""); + + $ttHJ = 0; + $ttHP = 0; + $profit = 0; + while(mysqli_stmt_fetch($stmt)){ + $ttHJ += $hj; + $ttHP += $hp; + $profit = ($hj-$hp)/$hj*100; + print(" + "); + } + print(""); + print("
Kode SupplierNama SupplierJumlHarga JualHarga PokokProfit[%]
.$kdsupp$supp$jml".number_format($hj,0,',','.')."".number_format($hp,0,',','.')."".number_format($profit,2,',','.')."
T O T A L".number_format($ttHJ,0,',','.')."".number_format($ttHP,0,',','.')."

"); + print("
"); + }else{ + echo "data tdk ada"; + echo "
"; + } + } + } +?> + diff --git a/old-source/LaporanJual/lap_ak7.php b/old-source/LaporanJual/lap_ak7.php new file mode 100644 index 0000000..76fdf57 --- /dev/null +++ b/old-source/LaporanJual/lap_ak7.php @@ -0,0 +1,758 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:100%;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:50px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ".warnaBarisKategori{font-weight : bold; background-color: #FFFF33;}"; + echo ".warnaBarisTot{font-weight : bold; background-color: #FFCC00;}"; + echo ".master{text-align:left;}"; + echo ""; + + $bulan = $_POST['bulan']; + $tahun = $_POST['tahun']; + $d=cal_days_in_month(CAL_GREGORIAN,$bulan,$tahun); + if ($bulan < 10){ + $startDate = $tahun."-"."0".$bulan."-"."01"; + $endDate = $tahun."-"."0".$bulan."-"."31"; + }else{ + $startDate = $tahun."-".$bulan."-"."01"; + $endDate = $tahun."-".$bulan."-"."31"; + } + + +if(bukaKoneksi()){ + global $conn; + + print("
"); + print("

Laporan AK.7



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".$startDate." s/d ".$endDate."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."

"); + print(" *) Stock Minus : Hanya sebagai notifikasi, tidak turut dalam proses perhitungan apapun "); + print("
"); + print(""); + print(" + + + + + + + + + + + + + + + + "); + //looping untuk insert tanggal ke tabel AK7 + for ($n = 1; $n <= $d; $n++){ + if ($bulan < 10){ + $bln = "0".$bulan; + }else{ + $bln = $bulan; + } + if ($n < 10){ + $tgl = "0".$n; + }else{ + $tgl = $n; + } + $tanggal = $tahun."-".$bln."-".$tgl; + $queryCekTanggal = "Select tanggal From tempAK7 WHERE tanggal = '$tanggal'"; + $resultCekTanggal = runningQuery($queryCekTanggal); + if($resultCekTanggal->num_rows > 0){ + $queryUpdateTanggal = "UPDATE tempAK7 SET tanggal = '$tanggal' WHERE tanggal = '$tanggal'"; + runningQuery($queryUpdateTanggal); + }else{ + $queryInsertTanggal = "INSERT INTO `tempAK7` ( + `tanggal` , + `stockawal` , + `pembelian` , + `revisi` , + `transfer` , + `transferkembali` , + `penjualan` , + `bawa` , + `kembalibawa` , + `stockopname` , + `stockminus` , + `stockakhir` + ) + VALUES ( + '$tanggal', NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL + );"; + runningQuery($queryInsertTanggal); + } + } //end of looping untuk insert tanggal ke tabel AK7 +/*****************************************************************************************************************************************************/ +//cek tgl hari ini utk tabel AK7 +$querycektgl = "Select tanggal From tempAK7 WHERE tanggal = CURDATE()"; +$resultcektgl = runningQuery($querycektgl); +if($resultcektgl->num_rows > 0){ + //kolom pembelian + $querypembelian = "SELECT CURDATE() tgl_masuk, + sum(d.jum_fisik*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + FROM d_pembelian d, m_pembelian m,strip s,barang b + WHERE d.no_faktur = m.no_faktur + AND d.kode_barang = b.kode_barang + AND s.kd_strip = b.kode_strip + AND m.tgl_masuk = CURDATE() + AND m.validasi = '1' + AND m.status_revisi = '1' + GROUP BY m.tgl_masuk"; + $resultpembelian = runningQuery($querypembelian); + if($resultpembelian->num_rows > 0){ + while($pembelian = $resultpembelian->fetch_array(MYSQLI_ASSOC)){ + $tgl_masuk = $pembelian['tgl_masuk']; + $hp = $pembelian['hp']; + $queryUpdatePembelian = "UPDATE tempAK7 SET pembelian = '$hp' WHERE tanggal = '$tgl_masuk'"; + runningQuery($queryUpdatePembelian); + } + } + //kolom Revisi + $queryRevisi = "SELECT CURDATE() tgl_masuk,sum(m.rp_beli) hp + FROM m_pembelian m + WHERE m.validasi = '1' + AND left(m.no_faktur,4) = 'RVB-' + AND m.status_revisi = 0 + AND m.tgl_masuk = CURDATE() + GROUP BY m.tgl_masuk"; + $resultRevisi = runningQuery($queryRevisi); + if($resultRevisi->num_rows > 0){ + while($Revisi = $resultRevisi->fetch_array(MYSQLI_ASSOC)){ + $tgl_masuk = $Revisi['tgl_masuk']; + $hp = $Revisi['hp']; + $queryUpdateRevisi = "UPDATE tempAK7 SET revisi = '$hp' WHERE tanggal = '$tgl_masuk'"; + runningQuery($queryUpdateRevisi); + } + } + //kolom Retur + $queryRetur = "SELECT CURDATE() tgl_retur,sum(d.tot) hp + FROM m_retur_beli r, + (SELECT id_retur,sum(jumlah) jum,sum(jumlah*harga_satuan) tot from d_retur_beli group by id_retur) d + where tgl_retur = CURDATE() + and r.id_retur = d.id_retur + and r.validasi = '1' + GROUP BY r.`tgl_retur`"; + $resultRetur = runningQuery($queryRetur); + if($resultRetur->num_rows > 0){ + while($Retur = $resultRetur->fetch_array(MYSQLI_ASSOC)){ + $tgl_retur = $Retur['tgl_retur']; + $hp = $Retur['hp']; + $queryUpdateRetur = "UPDATE tempAK7 SET retur = '$hp' WHERE tanggal = '$tgl_retur'"; + runningQuery($queryUpdateRetur); + } + } + //kolom Transfer + $queryTransfer = "SELECT CURDATE() tgl_transfer, sum(m.total_transfer) hp + FROM m_transfer m + where date(m.tgl_transfer) = CURDATE() + and m.validasi = '1' + GROUP BY m.`tgl_transfer`"; + $resultTransfer = runningQuery($queryTransfer); + if($resultTransfer->num_rows > 0){ + while($Transfer = $resultTransfer->fetch_array(MYSQLI_ASSOC)){ + $tgl_Transfer = $Transfer['tgl_transfer']; + $hp = $Transfer['hp']; + $queryUpdateTransfer = "UPDATE tempAK7 SET transfer = '$hp' WHERE tanggal = '$tgl_Transfer'"; + runningQuery($queryUpdateTransfer); + } + } + //kolom Transfer kembali + $queryTransferKembali = "SELECT CURDATE() tgl_kembali, sum(m.total_transfer) hp + FROM m_transfer_kembali m + where date(m.tgl_kembali) = CURDATE() + and m.validasi = '1' + GROUP BY m.`tgl_kembali`"; + $resultTransferKembali = runningQuery($queryTransferKembali); + if($resultTransferKembali->num_rows > 0){ + while($TransferKembali = $resultTransferKembali->fetch_array(MYSQLI_ASSOC)){ + $tgl_TransferKembali = $TransferKembali['tgl_kembali']; + $hp = $TransferKembali['hp']; + $queryUpdateTransferKembali = "UPDATE tempAK7 SET transferkembali = '$hp' WHERE tanggal = '$tgl_TransferKembali'"; + runningQuery($queryUpdateTransferKembali); + } + } + //kolom penjualan + $querypenjualan = "SELECT CURDATE() tanggal,sum(hp) totHP + from ( + select date(m.tgl_nota) tanggal, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_tunai d,m_nota_tunai m + where d.no_nota = m.no_nota + and d.harga_pokok IS NOT NULL + and m.status_nota = 'S' + and date(tgl_nota) = CURDATE() + group by m.tgl_nota + UNION ALL + select date(m.tgl_bon) tanggal, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_bon d,m_bon m + where d.no_bon = m.no_bon + and d.harga_pokok IS NOT NULL + and date(tgl_bon) = CURDATE() + group by m.tgl_bon + UNION ALL + select date(m.tgl_nota) tanggal, + (-1*sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp + from d_nota_retur d,m_nota_retur m + where d.no_nota = m.no_nota + and d.harga_pokok IS NOT NULL + and date(tgl_nota) = CURDATE() + group by m.tgl_nota + ) vlini + group by tanggal"; + $resultpenjualan = runningQuery($querypenjualan); + if($resultpenjualan->num_rows > 0){ + while($penjualan = $resultpenjualan->fetch_array(MYSQLI_ASSOC)){ + $tgl_penjualan = $penjualan['tanggal']; + $hp = $penjualan['totHP']; + $queryUpdatepenjualan = "UPDATE tempAK7 SET penjualan = '$hp' WHERE tanggal = '$tgl_penjualan'"; + runningQuery($queryUpdatepenjualan); + } + } + //kolom bawa + $querybawa = "SELECT CURDATE() tanggal, sum(d.jumlah*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp + from m_nota_bawa m,d_nota_bawa d,no_barang n, barang b + where m.status_nota = 'S' + and m.no_nota = d.no_nota + and b.id_gabungan = n.id_gabungan + and (d.kd_barang = b.kode_barang and d.no_barang = n.nomor) + and date(m.tgl_nota) = CURDATE() + group by date(m.tgl_nota)"; + $resultbawa = runningQuery($querybawa); + if($resultbawa->num_rows > 0){ + while($bawa = $resultbawa->fetch_array(MYSQLI_ASSOC)){ + $tgl_bawa = $bawa['tanggal']; + $hp = $bawa['hp']; + $queryUpdatebawa = "UPDATE tempAK7 SET bawa = '$hp' WHERE tanggal = '$tgl_bawa'"; + runningQuery($queryUpdatebawa); + } + } + //kolom kembalibawa + $querykembalibawa = "SELECT CURDATE() tgl_kembali, SUM( d.jumlah * REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( n.harga_pokok, 'B', '1' ) , 'R', '2' ) , 'A', '3' ) , 'W', '4' ) , 'N', '5' ) , 'F', '6' ) , 'O', '7' ) , 'X', '8' ) , 'E', '9' ) , 'S', '0' ) ) hp + FROM d_nota_bawa d, m_nota_bawa m, pelanggan p, barang b, no_barang n + WHERE m.no_nota = d.no_nota + AND b.id_gabungan = n.id_gabungan + AND m.kd_customer = p.kd_customer + AND (d.kd_barang = b.kode_barang AND d.no_barang = n.nomor) + AND DATE( m.tgl_kembali ) = CURDATE() + GROUP BY DATE(m.tgl_kembali)"; + $resultkembalibawa = runningQuery($querykembalibawa); + if($resultkembalibawa->num_rows > 0){ + while($kembalibawa = $resultkembalibawa->fetch_array(MYSQLI_ASSOC)){ + $tgl_kembalibawa = $kembalibawa['tgl_kembali']; + $hp = $kembalibawa['hp']; + $queryUpdatekembalibawa = "UPDATE tempAK7 SET kembalibawa = '$hp' WHERE tanggal = '$tgl_kembalibawa'"; + runningQuery($queryUpdatekembalibawa); + } + } + //kolom stockopname + $querystockopname = "SELECT CURDATE() tanggal,SUM(d.jumlah_asli*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) - + SUM(d.jumlah_stok_sebelum*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) selisih + from barang b inner join no_barang n on b.id_gabungan = n.id_gabungan + left join d_stock_opname d on (d.kode_barang = b.kode_barang and d.nomor=n.nomor) + inner join m_stock_opname m on (d.no_nota = m.no_nota and b.kode_strip = m.strip) + WHERE DATE(m.tanggal) = CURDATE() + AND m.konfirmasi = '1' + GROUP BY m.tanggal"; + $resultstockopname = runningQuery($querystockopname); + if($resultstockopname->num_rows > 0){ + while($stockopname = $resultstockopname->fetch_array(MYSQLI_ASSOC)){ + $tgl_stockopname = $stockopname['tanggal']; + $hp = $stockopname['selisih']; + $queryUpdatestockopname = "UPDATE tempAK7 SET stockopname = '$hp' WHERE tanggal = '$tgl_stockopname'"; + runningQuery($queryUpdatestockopname); + } + } + //kolom stokmin + $querystokmin = "SELECT CURDATE() tanggal,SUM(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok) + totalHP + from barang b,no_barang n,strip s + WHERE n.stok<0 + and b.id_gabungan = n.id_gabungan + and s.kd_strip = b.kode_strip + "; + $resultstokmin = runningQuery($querystokmin); + if($resultstokmin->num_rows > 0){ + while($stokmin = $resultstokmin->fetch_array(MYSQLI_ASSOC)){ + $tgl_stokmin = $stokmin['tanggal']; + $hp = $stokmin['totalHP']; + $queryUpdatestokmin = "UPDATE tempAK7 SET stockminus = '$hp' WHERE tanggal = '$tgl_stokmin'"; + runningQuery($queryUpdatestokmin); + } + } + //kolom persediaan + $querypersediaan = "SELECT CURDATE() tanggal, + SUM(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok) + totalHP + from barang b,no_barang n,strip s + WHERE n.stok>0 + and b.id_gabungan = n.id_gabungan + and s.kd_strip = b.kode_strip + "; + $resultpersediaan = runningQuery($querypersediaan); + if($resultpersediaan->num_rows > 0){ + while($persediaan = $resultpersediaan->fetch_array(MYSQLI_ASSOC)){ + $tgl_masuk = $persediaan['tanggal']; + $hp = $persediaan['totalHP']; + $queryUpdatepersediaan = "UPDATE tempAK7 SET stockakhir = '$hp' WHERE tanggal = '$tgl_masuk'"; + runningQuery($queryUpdatepersediaan); + } + } + //kolom persediaan awal + $querystokawal = "SELECT DATE_ADD(CURDATE(), INTERVAL -1 DAY) kemarin, stockakhir + FROM tempAK7 + WHERE tanggal = DATE_ADD(CURDATE(), INTERVAL -1 DAY)"; + $resultstokawal = runningQuery($querystokawal); //ambil stockakhir hari kemarin + if($resultstokawal->num_rows > 0){ + while($stokawal = $resultstokawal->fetch_array(MYSQLI_ASSOC)){ + $kemarin = $stokawal['kemarin']; + $hp = $stokawal['stockakhir']; + $queryUpdatestokawal = "UPDATE tempAK7 SET stockawal = '$hp' WHERE tanggal = CURDATE()"; + runningQuery($queryUpdatestokawal); //update stockawal hari ini dengan stockahir hari kemarin + } + } + +}//end of cek tgl hari ini utk tabel AK7 + +/***************************************************************************************************************************************************/ +//URUSAN AK7Rinci +//cek tgl hari ini di AK7rinci + $querycektanggalrinci = "Select tanggal From tempAK7rinci WHERE tanggal = CURDATE()"; + $resultcektanggalrinci = runningQuery($querycektanggalrinci); + if($resultcektanggalrinci->num_rows > 0){ //kalo ada di update + updateData(); + }else{ //kalo ga ada => diInsert + $queryAmbilStrip = "SELECT CURDATE() hariini, s.kd_strip FROM strip s"; + $resultAmbilStrip = runningQuery($queryAmbilStrip); + if($resultAmbilStrip->num_rows > 0){ + while($strip = $resultAmbilStrip->fetch_array(MYSQLI_ASSOC)){ + $hariini = $strip['hariini']; + $lini = $strip['kd_strip']; + $queryInsertTanggal = "INSERT INTO `tempAK7rinci` ( + `tanggal` , + `lini`, + `stockawal` , + `pembelian` , + `revisi` , + `transfer` , + `transferkembali` , + `penjualan` , + `bawa` , + `kembalibawa` , + `stockopname` , + `stockminus` , + `stockakhir` + ) + VALUES ( + '$hariini', '$lini', NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL + );"; + runningQuery($queryInsertTanggal); + } + } + //lalu diUpdate + updateData(); + } + + +/***************************************************************************************************************************************************/ + //Tampilkan AK7 + $queryView = "SELECT * FROM tempAK7 WHERE tanggal BETWEEN '$startDate' AND '$endDate' ORDER BY id"; + $resultView = runningQuery($queryView); + if($resultView->num_rows > 0){ + $ttstockawal = 0; + $ttpembelian = 0; + $ttrevisi = 0; + $ttretur = 0; + $tttransfer = 0; + $tttransferkembali = 0; + $ttpenjualan = 0; + $ttbawa = 0; + $ttkembalibawa = 0; + $ttstockopname = 0; + $ttperhitungan = 0; + $ttstockakhir = 0; + $ttselisih = 0; + + while($View = $resultView->fetch_array(MYSQLI_ASSOC)){ + $tanggal = $View['tanggal']; + $stockawal = $View['stockawal']; + $pembelian = $View['pembelian']; + $revisi = $View['revisi']; + $retur = $View['retur']; + $transfer = $View['transfer']; + $transferkembali = $View['transferkembali']; + $penjualan = $View['penjualan']; + $bawa = $View['bawa']; + $kembalibawa = $View['kembalibawa']; + $stockopname = $View['stockopname']; + $stockmin = $View['stockminus']; + $perhitungan = $stockawal + $pembelian + $revisi - $retur - $transfer + $transferkembali - $penjualan - $bawa + $kembalibawa + $stockopname ; + $stockakhir = $View['stockakhir']; + $selisih = $perhitungan - $stockakhir; + + $ttstockawal += $stockawal; + $ttpembelian += $pembelian; + $ttrevisi += $revisi; + $ttretur += $retur; + $tttransfer += $transfer; + $tttransferkembali += $transferkembali; + $ttpenjualan += $penjualan; + $ttbawa += $bawa; + $ttkembalibawa += $kembalibawa; + $ttstockopname += $stockopname; + $ttperhitungan += $perhitungan; + $ttstockakhir += $stockakhir; + $ttselisih += $selisih; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + } + print(" + + + + + + + + + + + + + + + "); + //end of tampilkan + + print("
TanggalStock AwalPembelianRevisiReturTransferTransfer KembaliPenjualanBawa DuluKembali Bawa DuluStock OpnameStock Minus*)Stock(hsl perhitungan)Stock(komp)Selisih
$tanggal".number_format( $stockawal,0,",",".")."".number_format( $pembelian,0,",",".")."".number_format( $revisi,0,",",".")."".number_format( $retur,0,",",".")."".number_format( $transfer,0,",",".")."".number_format( $transferkembali,0,",",".")."".number_format( $penjualan,0,",",".")."".number_format( $bawa,0,",",".")."".number_format( $kembalibawa,0,",",".")."".number_format( $stockopname,0,",",".")."".number_format( $stockmin,0,",",".")."".number_format( $perhitungan,0,",",".")."".number_format( $stockakhir,0,",",".")."".number_format( $selisih,0,",",".")."
T O T A L".number_format( $ttstockawal,0,",",".")."".number_format( $ttpembelian,0,",",".")."".number_format( $ttrevisi,0,",",".")."".number_format( $ttretur,0,",",".")."".number_format( $tttransfer,0,",",".")."".number_format( $tttransferkembali,0,",",".")."".number_format( $ttpenjualan,0,",",".")."".number_format( $ttbawa,0,",",".")."".number_format( $ttkembalibawa,0,",",".")."".number_format( $ttstockopname,0,",",".")."".number_format( $ttperhitungan,0,",",".")."".number_format( $ttstockakhir,0,",",".")."".number_format( $ttselisih,0,",",".")."

"); + print("
"); +} + + +function updateData(){ //update data di tabel AK7rinci + //ak7rinci stockakhir + $querypersediaan2 = "SELECT CURDATE() tanggal,b.kode_strip, + SUM(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok) + totalHP + from barang b,no_barang n,strip s + WHERE n.stok>0 + and b.id_gabungan = n.id_gabungan + and s.kd_strip = b.kode_strip + GROUP BY b.kode_strip + "; + $resultpersediaan2 = runningQuery($querypersediaan2); + if($resultpersediaan2->num_rows > 0){ + while($persediaan = $resultpersediaan2->fetch_array(MYSQLI_ASSOC)){ + $tanggal = $persediaan['tanggal']; + $lini = $persediaan['kode_strip']; + $hp = $persediaan['totalHP']; + $queryUpdatestokakhir = "UPDATE tempAK7rinci SET stockakhir = '$hp' WHERE tanggal = '$tanggal' AND lini = '$lini'"; + runningQuery($queryUpdatestokakhir); + + } + } + //ak7rinci pembelian + $querypembelian2 = "SELECT CURDATE() tanggal,s.kd_strip, + sum(d.jum_fisik*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + FROM d_pembelian d, m_pembelian m,strip s,barang b + WHERE d.no_faktur = m.no_faktur + AND d.kode_barang = b.kode_barang + AND s.kd_strip = b.kode_strip + AND m.tgl_masuk = CURDATE() + AND m.validasi = '1' + AND m.status_revisi = '1' + GROUP BY s.kd_strip"; + $resultpembelian2 = runningQuery($querypembelian2); + if($resultpembelian2->num_rows > 0){ + while($pembelian2 = $resultpembelian2->fetch_array(MYSQLI_ASSOC)){ + $tanggal = $pembelian2['tanggal']; + $lini = $pembelian2['kd_strip']; + $hp = $pembelian2['hp']; + $queryUpdatePembelian2 = "UPDATE tempAK7rinci SET pembelian = '$hp' WHERE tanggal = '$tanggal' AND lini = '$lini'"; + runningQuery($queryUpdatePembelian2); + + } + } + //ak7rinci revisi + $queryrevisi2 = "SELECT CURDATE() tanggal,s.kd_strip, + sum(d.jum_fisik*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + FROM d_pembelian d, m_pembelian m,strip s,barang b + WHERE d.no_faktur = m.no_faktur + AND d.kode_barang = b.kode_barang + AND s.kd_strip = b.kode_strip + AND m.validasi = '1' + AND m.status_revisi = 0 + AND left(m.no_faktur,4) = 'RVB-' + AND m.tgl_masuk = CURDATE() + GROUP BY s.kd_strip + "; + $resultrevisi2 = runningQuery($queryrevisi2); + if($resultrevisi2->num_rows > 0){ + while($revisi2 = $resultrevisi2->fetch_array(MYSQLI_ASSOC)){ + $tanggal = $revisi2['tanggal']; + $lini = $revisi2['kd_strip']; + $hp = $revisi2['hp']; + $queryUpdaterevisi2 = "UPDATE tempAK7rinci SET revisi = '$hp' WHERE tanggal = '$tanggal' AND lini = '$lini'"; + runningQuery($queryUpdaterevisi2); + + } + } + //ak7rinci retur beli + $queryretur2 = "SELECT CURDATE() tanggal, s.kd_strip,sum(dr.jumlah*dr.harga_satuan) hp + from m_retur_beli r,d_retur_beli dr,strip s, barang b + where r.tgl_retur = CURDATE() + and dr.kd_barang = b.kode_barang + and r.id_retur = dr.id_retur + and b.kode_strip = s.kd_strip + and r.validasi = '1' + GROUP BY s.kd_strip + "; + $resultretur2 = runningQuery($queryretur2); + if($resultretur2->num_rows > 0){ + while($retur2 = $resultretur2->fetch_array(MYSQLI_ASSOC)){ + $tanggal = $retur2['tanggal']; + $lini = $retur2['kd_strip']; + $hp = $retur2['hp']; + $queryUpdateretur2 = "UPDATE tempAK7rinci SET retur = '$hp' WHERE tanggal = '$tanggal' AND lini = '$lini'"; + runningQuery($queryUpdateretur2); + + } + } + //ak7rinci transfer + $querytransfer2 = "SELECT CURDATE() tanggal, s.kd_strip, sum(d.jumlah*d.harga_satuan) hp + FROM m_transfer m, d_transfer d, strip s, barang b + where + m.id_transfer = d.id_transfer + AND d.kode_barang_nota = b.kode_barang + AND s.kd_strip = b.kode_strip + and date(m.tgl_transfer) = CURDATE() + and m.validasi = '1' + GROUP BY s.kd_strip + "; + $resulttransfer2 = runningQuery($querytransfer2); + if($resulttransfer2->num_rows > 0){ + while($transfer2 = $resulttransfer2->fetch_array(MYSQLI_ASSOC)){ + $tanggal = $transfer2['tanggal']; + $lini = $transfer2['kd_strip']; + $hp = $transfer2['hp']; + $queryUpdatetransfer2 = "UPDATE tempAK7rinci SET transfer = '$hp' WHERE tanggal = '$tanggal' AND lini = '$lini'"; + runningQuery($queryUpdatetransfer2); + + } + } + //ak7rinci transfer kembali + $querytransferkembali2 = "SELECT CURDATE() tanggal, s.kd_strip, sum(d.jumlah*d.harga_satuan) hp + FROM m_transfer_kembali m, d_transfer_kembali d, strip s, barang b + where + m.id_transfer = d.id_transfer + AND d.kode_barang_nota = b.kode_barang + AND s.kd_strip = b.kode_strip + and date(m.tgl_kembali) = CURDATE() + and m.validasi = '1' + GROUP BY s.kd_strip + "; + $resulttransferkembali2 = runningQuery($querytransferkembali2); + if($resulttransferkembali2->num_rows > 0){ + while($transferkembali2 = $resulttransferkembali2->fetch_array(MYSQLI_ASSOC)){ + $tanggal = $transferkembali2['tanggal']; + $lini = $transferkembali2['kd_strip']; + $hp = $transferkembali2['hp']; + $queryUpdatetransferkembali2 = "UPDATE tempAK7rinci SET transferkembali = '$hp' WHERE tanggal = '$tanggal' AND lini = '$lini'"; + runningQuery($queryUpdatetransferkembali2); + + } + } + //ak7rinci penjualan + $querypenjualan2 = "select CURDATE() tanggal, lini, sum(hp) totHP + from ( + select b.kode_strip lini,sum(jumlah) juml, + sum(d.harga_jual * d.jumlah) hjbruto, + sum(d.harga_jual * d.jumlah * d.diskon / 100) disc, + sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_tunai d,m_nota_tunai m, barang b + where d.no_nota = m.no_nota + and d.kd_barang = b.kode_barang + and d.harga_pokok IS NOT NULL + and m.status_nota = 'S' + and date(tgl_nota) = CURDATE() + group by b.kode_strip + UNION ALL + select b.kode_strip lini,sum(jumlah) juml, + sum(d.hrg_satuan * d.jumlah) hjbruto, + sum(d.hrg_satuan * d.jumlah * d.diskon / 100) disc, + sum((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_bon d,m_bon m, barang b + where d.no_bon = m.no_bon + and d.kd_brg = b.kode_barang + and d.harga_pokok IS NOT NULL + and date(tgl_bon) = CURDATE() + group by b.kode_strip + UNION ALL + select b.kode_strip lini,(-1*sum(jumlah)) juml, + (-1*sum(d.harga_jual * d.jumlah)) hjbruto, + (-1*sum(d.harga_jual * d.jumlah * d.diskon / 100)) disc, + (-1*sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100))) tot, + (-1*sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp + from d_nota_retur d,m_nota_retur m, barang b + where d.no_nota = m.no_nota + and d.kd_barang = b.kode_barang + and d.harga_pokok IS NOT NULL + and date(tgl_nota) = CURDATE() + group by b.kode_strip + ) vlini,strip s + where s.kd_strip = lini + group by lini + "; + $resultpenjualan2 = runningQuery($querypenjualan2); + if($resultpenjualan2->num_rows > 0){ + while($penjualan2 = $resultpenjualan2->fetch_array(MYSQLI_ASSOC)){ + $tanggal = $penjualan2['tanggal']; + $lini = $penjualan2['lini']; + $hp = $penjualan2['totHP']; + $queryUpdatepenjualan2 = "UPDATE tempAK7rinci SET penjualan = '$hp' WHERE tanggal = '$tanggal' AND lini = '$lini'"; + runningQuery($queryUpdatepenjualan2); + + } + } + //ak7rinci bawa dulu + $querybawa2 = "SELECT CURDATE() tanggal, s.kd_strip, + sum(d.jumlah*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp + from m_nota_bawa m,d_nota_bawa d,no_barang n, barang b, strip s + where m.status_nota = 'S' + and m.no_nota = d.no_nota + and b.kode_strip = s.kd_strip + and b.id_gabungan = n.id_gabungan + and (d.kd_barang = b.kode_barang and d.no_barang = n.nomor) + and date(m.tgl_nota) = CURDATE() + group by s.kd_strip + "; + $resultbawa2 = runningQuery($querybawa2); + if($resultbawa2->num_rows > 0){ + while($bawa2 = $resultbawa2->fetch_array(MYSQLI_ASSOC)){ + $tanggal = $bawa2['tanggal']; + $lini = $bawa2['kd_strip']; + $hp = $bawa2['hp']; + $queryUpdatebawa2 = "UPDATE tempAK7rinci SET bawa = '$hp' WHERE tanggal = '$tanggal' AND lini = '$lini'"; + runningQuery($queryUpdatebawa2); + + } + } + //ak7rinci kembali bawa dulu + $querykembalibawa2 = "SELECT CURDATE() tanggal, s.kd_strip, + SUM( d.jumlah * REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( n.harga_pokok, 'B', '1' ) , 'R', '2' ) , 'A', '3' ) , 'W', '4' ) , 'N', '5' ) , 'F', '6' ) , 'O', '7' ) , 'X', '8' ) , 'E', '9' ) , 'S', '0' ) ) hp + FROM d_nota_bawa d, m_nota_bawa m, pelanggan p, barang b, no_barang n, strip s + WHERE m.no_nota = d.no_nota + AND b.id_gabungan = n.id_gabungan + AND m.kd_customer = p.kd_customer + AND b.kode_strip = s.kd_strip + AND (d.kd_barang = b.kode_barang AND d.no_barang = n.nomor) + AND DATE( m.tgl_kembali ) = CURDATE() + GROUP BY s.kd_strip + "; + $resultkembalibawa2 = runningQuery($querykembalibawa2); + if($resultkembalibawa2->num_rows > 0){ + while($kembalibawa2 = $resultkembalibawa2->fetch_array(MYSQLI_ASSOC)){ + $tanggal = $kembalibawa2['tanggal']; + $lini = $kembalibawa2['kd_strip']; + $hp = $kembalibawa2['hp']; + $queryUpdatekembalibawa2 = "UPDATE tempAK7rinci SET kembalibawa = '$hp' WHERE tanggal = '$tanggal' AND lini = '$lini'"; + runningQuery($queryUpdatekembalibawa2); + + } + } + //ak7rinci stockopname + $querystockopname2 = "SELECT CURDATE() tanggal, s.kd_strip, SUM(d.jumlah_asli*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) - + SUM(d.jumlah_stok_sebelum*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) selisih + from barang b inner join no_barang n on b.id_gabungan = n.id_gabungan + left join d_stock_opname d on (d.kode_barang = b.kode_barang and d.nomor=n.nomor) + inner join m_stock_opname m on (d.no_nota = m.no_nota and left(d.kode_barang,2) = m.strip) + inner join strip s on (m.strip = s.kd_strip) + WHERE DATE(m.tanggal) = CURDATE() + AND m.konfirmasi = '1' + GROUP BY s.kd_strip + "; + $resultstockopname2 = runningQuery($querystockopname2); + if($resultstockopname2->num_rows > 0){ + while($stockopname2 = $resultstockopname2->fetch_array(MYSQLI_ASSOC)){ + $tanggal = $stockopname2['tanggal']; + $lini = $stockopname2['kd_strip']; + $hp = $stockopname2['selisih']; + $queryUpdatestockopname2 = "UPDATE tempAK7rinci SET stockopname = '$hp' WHERE tanggal = '$tanggal' AND lini = '$lini'"; + runningQuery($queryUpdatestockopname2); + + } + } + //ak7rinci stockmin + $querystockmin2 = "SELECT CURDATE() tanggal, b.kode_strip, + SUM(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok) + totalHP + from barang b,no_barang n,strip s + WHERE n.stok<0 + and b.id_gabungan = n.id_gabungan + and s.kd_strip = b.kode_strip + GROUP BY b.kode_strip + "; + $resultstockmin2 = runningQuery($querystockmin2); + if($resultstockmin2->num_rows > 0){ + while($stockmin2 = $resultstockmin2->fetch_array(MYSQLI_ASSOC)){ + $tanggal = $stockmin2['tanggal']; + $lini = $stockmin2['kode_strip']; + $hp = $stockmin2['totalHP']; + $queryUpdatestockmin2 = "UPDATE tempAK7rinci SET stockminus = '$hp' WHERE tanggal = '$tanggal' AND lini = '$lini'"; + runningQuery($queryUpdatestockmin2); + + } + } + //ak7rinci stockawal + $querystokawal = "SELECT DATE_ADD(CURDATE(), INTERVAL -1 DAY) kemarin, lini, stockakhir + FROM tempAK7rinci + WHERE tanggal = DATE_ADD(CURDATE(), INTERVAL -1 DAY)"; + $resultstokawal = runningQuery($querystokawal); //ambil stockakhir hari kemarin + if($resultstokawal->num_rows > 0){ + while($stokawal = $resultstokawal->fetch_array(MYSQLI_ASSOC)){ + $kemarin = $stokawal['kemarin']; + $lini = $stokawal['lini']; + $hp = $stokawal['stockakhir']; + $queryUpdatestokawal = "UPDATE tempAK7rinci SET stockawal = '$hp' WHERE tanggal = CURDATE() and lini = '$lini'"; + runningQuery($queryUpdatestokawal); //update stockawal hari ini dg stockakhir hari kemarin + } + } + +} +?> diff --git a/old-source/LaporanJual/lap_ak7rinci.php b/old-source/LaporanJual/lap_ak7rinci.php new file mode 100644 index 0000000..a1543e9 --- /dev/null +++ b/old-source/LaporanJual/lap_ak7rinci.php @@ -0,0 +1,148 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:100%;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:50px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ".warnaBarisKategori{font-weight : bold; background-color: #FFFF33;}"; + echo ".warnaBarisTot{font-weight : bold; background-color: #FFCC00;}"; + echo ".master{text-align:left;}"; + echo ""; + + $tgl = $_GET['tgl']; + +if(bukaKoneksi()){ + global $conn; + + print("
"); + print("

Laporan AK.7 Rinci



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("Tanggal : ".$tgl."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."

"); + print(" *) Stock Minus : Hanya sebagai notifikasi, tidak turut dalam proses perhitungan apapun "); + print("
"); + print(""); + print(" + + + + + + + + + + + + + + + + "); + + + //Tampilkan AK7rinci + $queryView = "SELECT * FROM tempAK7rinci WHERE tanggal = '$tgl' order by id"; + $resultView = runningQuery($queryView); + if($resultView->num_rows > 0){ + $ttstockawal = 0; + $ttpembelian = 0; + $ttrevisi = 0; + $ttretur = 0; + $tttransfer = 0; + $tttransferkembali = 0; + $ttpenjualan = 0; + $ttbawa = 0; + $ttkembalibawa = 0; + $ttstockopname = 0; + $ttstockminus = 0; + $ttperhitungan = 0; + $ttstockakhir = 0; + $ttselisih = 0; + + while($View = $resultView->fetch_array(MYSQLI_ASSOC)){ + $tanggal = $View['tanggal']; + $lini = $View['lini']; + $stockawal = $View['stockawal']; + $pembelian = $View['pembelian']; + $revisi = $View['revisi']; + $retur = $View['retur']; + $transfer = $View['transfer']; + $transferkembali = $View['transferkembali']; + $penjualan = $View['penjualan']; + $bawa = $View['bawa']; + $kembalibawa = $View['kembalibawa']; + $stockopname = $View['stockopname']; + $stockmin = $View['stockminus']; + $perhitungan = $stockawal + $pembelian + $revisi - $retur - $transfer + $transferkembali - $penjualan - $bawa + $kembalibawa + $stockopname ; + $stockakhir = $View['stockakhir']; + $selisih = $perhitungan - $stockakhir; + + $ttstockawal += $stockawal; + $ttpembelian += $pembelian; + $ttrevisi += $revisi; + $ttretur += $retur; + $tttransfer += $transfer; + $tttransferkembali += $transferkembali; + $ttpenjualan += $penjualan; + $ttbawa += $bawa; + $ttkembalibawa += $kembalibawa; + $ttstockopname += $stockopname; + $ttstockmin += $stockmin; + $ttperhitungan += $perhitungan; + $ttstockakhir += $stockakhir; + $ttselisih += $selisih; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + } + } + print(" + + + + + + + + + + + + + + + "); + + print("
LiniStock AwalPembelianRevisiReturTransferTransfer KembaliPenjualanBawa DuluKembali Bawa DuluStock OpnameStock Minus*)Stock(hsl perhitungan)Stock(komp)Selisih
$lini".number_format( $stockawal,0,",",".")."".number_format($pembelian,0,",",".")."".number_format($revisi,0,",",".")."".number_format($retur,0,",",".")."".number_format($transfer,0,",",".")."".number_format($transferkembali,0,",",".")."".number_format($penjualan,0,",",".")."".number_format($bawa,0,",",".")."".number_format($kembalibawa,0,",",".")."".number_format($stockopname,0,",",".")."".number_format($stockmin,0,",",".")."".number_format( $perhitungan,0,",",".")."".number_format( $stockakhir,0,",",".")."".number_format( $selisih,0,",",".")."
T O T A L".number_format( $ttstockawal,0,",",".")."".number_format( $ttpembelian,0,",",".")."".number_format( $ttrevisi,0,",",".")."".number_format( $ttretur,0,",",".")."".number_format( $tttransfer,0,",",".")."".number_format( $tttransferkembali,0,",",".")."".number_format( $ttpenjualan,0,",",".")."".number_format( $ttbawa,0,",",".")."".number_format( $ttkembalibawa,0,",",".")."".number_format( $ttstockopname,0,",",".")."".number_format( $ttstockmin,0,",",".")."".number_format( $ttperhitungan,0,",",".")."".number_format( $ttstockakhir,0,",",".")."".number_format( $ttselisih,0,",",".")."

"); + print("
"); + +} +?> \ No newline at end of file diff --git a/old-source/LaporanJual/lap_fastmoving.php b/old-source/LaporanJual/lap_fastmoving.php new file mode 100644 index 0000000..1d7986e --- /dev/null +++ b/old-source/LaporanJual/lap_fastmoving.php @@ -0,0 +1,215 @@ +"; + echo "div#divprint{width:1100px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:1000px;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:9pt;}"; + 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 ".warnaKolPisah{font-weight : bold; background-color: #595454;}"; //#413839 + echo ".master{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $curdate = date('Y-m-d'); + $supp = $_POST['kdsupp']; + $lini = $_POST['lini']; + + if(bukaKoneksi()){ + global $conn; + + print("
"); + print("

Rekap Barang Fast Moving (B.2)



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("Periode Pembelian : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + $kelJenis[0] = 'MURAH'; + $kelJenis[1] = 'SEDANG'; + $kelJenis[2] = 'MAHAL'; + + $queryclear1 ="DROP TABLE IF EXISTS vLaporan1"; + $queryclear2 ="DROP TABLE IF EXISTS vLaporan2"; + $queryclear3 ="DROP TABLE IF EXISTS vLaporan3"; + + runQuery($queryclear1); + runQuery($queryclear2); + runQuery($queryclear3); + + $qry_filter1 = "CREATE TABLE vLaporan1 AS + SELECT m.kd_supplier,s.nama_supplier,d.kode_barang,d.nm_brg,sum(d.jum_fisik) jmlbeli + FROM d_pembelian d,m_pembelian m,supplier s + WHERE d.no_faktur = m.no_faktur + AND left(m.no_faktur,4) <> 'RVB-' + AND m.kd_supplier = s.kd_supplier + AND date(m.tgl_masuk) between '$startDate' and '$endDate' + GROUP BY d.kode_barang "; + + $qry_filter2 = "CREATE TABLE vLaporan2 AS + SELECT + CASE + WHEN nb.harga_jual >= st.murah1 AND nb.harga_jual <= st.murah2 THEN 'MURAH' + WHEN nb.harga_jual >= st.sedang1 AND nb.harga_jual <= st.sedang2 THEN 'SEDANG' + WHEN nb.harga_jual >= st.mahal1 AND nb.harga_jual <= st.mahal2 THEN 'MAHAL' ELSE 'UNKNOWN' END as komposisi, + b.kode_barang, sum(nb.stok) stokakh, nb.harga_jual hj, b.kode_strip + FROM barang b,no_barang nb,strip st + WHERE + b.id_gabungan = nb.id_gabungan + AND st.kd_strip = b.kode_strip + AND b.kode_barang IN + (select distinct d.kode_barang + from d_pembelian d,m_pembelian m + where d.no_faktur = m.no_faktur + AND left(m.no_faktur,4) <> 'RVB-' + and date(m.tgl_masuk) between '$startDate' and '$endDate') + GROUP BY b.kode_barang "; + + $qry_filter3 = "CREATE TABLE vLaporan3 AS + SELECT vJual.kd_barang,sum(vJual.jumlah) jmljual + FROM + (SELECT d.kd_barang kd_barang,sum(d.jumlah) jumlah + FROM d_nota_tunai d,m_nota_tunai m + WHERE d.no_nota = m.no_nota + AND m.status_nota = 'S' + AND d.kd_barang IN + (select distinct d.kode_barang + from d_pembelian d,m_pembelian m + where d.no_faktur = m.no_faktur + AND left(m.no_faktur,4) <> 'RVB-' + and date(m.tgl_masuk) between '$startDate' and '$endDate') + AND date(m.tgl_nota) BETWEEN '$startDate' AND '$curdate' + GROUP BY d.kd_barang + UNION ALL + SELECT d.kd_brg kd_barang,sum(d.jumlah) jumlah + FROM d_bon d,m_bon m + WHERE d.no_bon = m.no_bon + AND d.kd_brg IN + (select distinct d.kode_barang + from d_pembelian d,m_pembelian m + where d.no_faktur = m.no_faktur + AND left(m.no_faktur,4) <> 'RVB-' + and date(m.tgl_masuk) between '$startDate' and '$endDate') + AND date(m.tgl_bon) BETWEEN '$startDate' AND '$curdate' + GROUP BY d.kd_brg + UNION ALL + SELECT d.kd_barang kd_barang,(-1*sum(d.jumlah)) jumlah + FROM d_nota_retur d,m_nota_retur m + WHERE d.no_nota = m.no_nota + AND d.kd_barang IN + (select distinct d.kode_barang + from d_pembelian d,m_pembelian m + where d.no_faktur = m.no_faktur + AND left(m.no_faktur,4) <> 'RVB-' + and date(m.tgl_masuk) between '$startDate' and '$endDate') + AND date(m.tgl_nota) BETWEEN '$startDate' AND '$curdate' + GROUP BY d.kd_barang) vJual + GROUP BY vJual.kd_barang "; + $qry_index1 = "ALTER TABLE vLaporan1 ADD INDEX brg_supp ( kd_supplier , kode_barang )"; + $qry_index2 = "ALTER TABLE vLaporan2 ADD INDEX kdbrg ( kode_barang )"; + $qry_index3 = "ALTER TABLE vLaporan3 ADD INDEX kdbrg( kd_barang )"; + + runQuery($qry_filter1); + runQuery($qry_index1); + runQuery($qry_filter2); + runQuery($qry_index2); + runQuery($qry_filter3); + runQuery($qry_index3); + + for ($n = 0; $n < 3; $n++){ + + $queryclear ="DROP TABLE IF EXISTS vLaporan"; + runQuery($queryclear); + + + $qry_filter = "CREATE TABLE vLaporan AS + SELECT v1.kd_supplier,v1.nama_supplier,v1.kode_barang,v1.nm_brg,v1.jmlbeli,v3.jmljual,v2.stokakh,v2.hj,v2.kode_strip + FROM vLaporan1 v1 + INNER JOIN vLaporan2 v2 + ON v1.kode_barang = v2.kode_barang + INNER JOIN vLaporan3 v3 + ON v1.kode_barang = v3.kd_barang + WHERE v2.komposisi = '$kelJenis[$n]' + ORDER BY v1.kd_supplier,v1.kode_barang"; + runQuery($qry_filter); + + $qry_index = "ALTER TABLE vLaporan ADD INDEX brg_supp ( kd_supplier , kode_barang )"; + runQuery($qry_index); + + if($supp!= "" AND $lini != "" AND $startDate!= ""){ + $query = "SELECT v.kd_supplier,v.nama_supplier,v.kode_barang,v.nm_brg,v.jmlbeli,v.jmljual,v.stokakh,v.hj,v.kode_strip + FROM vLaporan v + WHERE v.kd_supplier = '$supp' + AND v.kode_strip = '$lini'"; + }else if($supp!= "" AND $startDate!= ""){ + $query = "SELECT v.kd_supplier,v.nama_supplier,v.kode_barang,v.nm_brg,v.jmlbeli,v.jmljual,v.stokakh,v.hj,v.kode_strip + FROM vLaporan v + WHERE v.kd_supplier = '$supp'"; + }else if($lini!= "" AND $startDate!= ""){ + $query = "SELECT v.kd_supplier,v.nama_supplier,v.kode_barang,v.nm_brg,v.jmlbeli,v.jmljual,v.stokakh,v.hj,v.kode_strip + FROM vLaporan v + WHERE v.kode_strip = '$lini'"; + }else{ + $query = "SELECT v.kd_supplier,v.nama_supplier,v.kode_barang,v.nm_brg,v.jmlbeli,v.jmljual,v.stokakh,v.hj,v.kode_strip + FROM vLaporan v"; + } + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdSup,$nmSup,$kdbrg,$nmbrg,$jmlbeli,$jmljual,$stok,$hj,$kdstrip); + + echo ""; + $stripPrev = ""; + $awal = TRUE; + + while(mysqli_stmt_fetch($stmt)){ + $tmpshow = 0.10 * $jmlbeli; + $show = round($tmpshow); + if($jmljual>=$show){ + echo ""; + if ($awal){ + $stripPrev = $kdSup; + } + if ($stripPrev == $kdSup){ + if ($awal){ + echo ""; + }else{ + echo ""; + } + }else{ + echo ""; + } + $awal = FALSE; + $stripPrev = $kdSup; + + print(""); + } + + } + } + } + } + + print("
Kode Supp.Nama SupplierLini ProdukKd.barangNama BarangJml BeliJml JualStok AkhirHJ Satuan

$kelJenis[$n]
" .$kdSup. "" .$nmSup. "
" .$kdSup. "" .$nmSup. "".$kdstrip."".$kdbrg."".$nmbrg."".$jmlbeli."".$jmljual."".$stok."".number_format($hj, 0, ",", ".")."

"); + print("
"); + + } +?> diff --git a/old-source/LaporanJual/lapdetailjual.php b/old-source/LaporanJual/lapdetailjual.php new file mode 100644 index 0000000..bd89cbc --- /dev/null +++ b/old-source/LaporanJual/lapdetailjual.php @@ -0,0 +1,437 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:700px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ".warnaBarisKategori{font-weight : bold; background-color: #FFFF33;}"; + echo ".warnaBarisTot{font-weight : bold; background-color: #FFCC00;}"; + echo ".master{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $tanggal = encTgl($startDate); + $bulan = substr($tanggal,3,2); + $tmpbulan = left($bulan,1); + if($tmpbulan == '0'){ + $bln = right($bulan,1); + }else{ + $bln = $bulan; + } + $thn = substr($tanggal,6,4); + + + if(bukaKoneksi()){ + global $conn; +/*------------------------------------------------------------------------------------ tunai -----------------------------------------------------*/ + $query="select s.nama_strip,sum(hp) totHP,sum(hj) totHJ,sum(disc) totDisc,sum(hjnet) totHJnet + from (select b.kode_strip lini,sum(d.harga_jual * d.jumlah) hj,sum(d.harga_jual * d.jumlah * d.diskon / 100) disc,sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) hjnet, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_tunai d,m_nota_tunai m, barang b + where d.no_nota = m.no_nota + and d.kd_barang = b.kode_barang + and d.harga_pokok IS NOT NULL + and m.status_nota = 'S' + and m.status_bayar != 'K' + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip + ) vtunai, strip s + where s.kd_strip = lini + group by s.kd_strip"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$keljns,$hp,$hj,$disc,$hjnet); + $ttJumlah = array(); + $ttJumlah['hp1'] = 0; + $ttJumlah['hj1'] = 0; + $ttJumlah['disc1'] = 0; + $ttJumlah['hjnet1'] = 0; + + print("
"); + print("

Transaksi Tunai



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); ?> + +"); + print("KategoriTotal HPTotal HJTotal DiscTotal HJnet"); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['hp1'] += $hp ; + $ttJumlah['hj1'] += $hj; + $ttJumlah['disc1'] += $disc; + $ttJumlah['hjnet1'] += $hjnet; + print("$keljns".number_format($hp,0,',','.')."".number_format($hj,0,',','.')."".number_format($disc,0,',','.')."".number_format($hjnet,0,',','.').""); + } + print("".number_format($ttJumlah['hp1'],0,',','.')."".number_format($ttJumlah['hj1'],0,',','.')."".number_format($ttJumlah['disc1'],0,',','.')."".number_format($ttJumlah['hjnet1'],0,',','.').""); + print("
"); + print("
"); + print("
"); + }else{ + echo "Belum ada penjualan tunai untuk tanggal tersebut!"; + echo "
"; + } + } +/*------------------------------------------------------------------------------------ retur tunai -----------------------------------------------------*/ + $query2="select s.nama_strip,sum(hp) totHP,sum(hj) totHJ,sum(disc) totDisc,sum(hjnet) totHJnet + from (select b.kode_strip lini,sum(d.harga_jual * d.jumlah) hj,sum(d.harga_jual * d.jumlah * d.diskon / 100) disc,sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) hjnet,sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_retur d,m_nota_retur m,m_nota_tunai mt, barang b + where d.no_nota = m.no_nota + and d.no_nota_tunai = mt.no_nota + and d.kd_barang = b.kode_barang + and d.harga_pokok IS NOT NULL + and (m.status_nota != 'B') + and mt.status_bayar = 'T' + and date(m.tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip + ) vretur, strip s + where s.kd_strip = lini + group by s.kd_strip"; + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$keljns2,$hp2,$hj2,$disc2,$hjnet2); + $ttJumlah2 = array(); + $ttJumlah2['hp2'] = 0; + $ttJumlah2['hj2'] = 0; + $ttJumlah2['disc2'] = 0; + $ttJumlah2['hjnet2'] = 0; + + print("
"); + print("

Retur Tunai



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt2)){ + $ttJumlah2['hp2'] += $hp2 ; + $ttJumlah2['hj2'] += $hj2; + $ttJumlah2['disc2'] += $disc2; + $ttJumlah2['hjnet2'] += $hjnet2; + print(""); + } + print(""); + print(""); + print("
KategoriTotal HPTotal HJTotal DiscTotal HJnet
$keljns2".number_format($hp2,0,',','.')."".number_format($hj2,0,',','.')."".number_format($disc2,0,',','.')."".number_format($hjnet2,0,',','.')."
".number_format($ttJumlah2['hp2'],0,',','.')."".number_format($ttJumlah2['hj2'],0,',','.')."".number_format($ttJumlah2['disc2'],0,',','.')."".number_format($ttJumlah2['hjnet2'],0,',','.')."
NETT TUNAI".number_format($ttJumlah['hp1']-$ttJumlah2['hp2'],0,',','.')."".number_format($ttJumlah['hj1']-$ttJumlah2['hj2'],0,',','.')."".number_format($ttJumlah['disc1']-$ttJumlah2['disc2'],0,',','.')."".number_format($ttJumlah['hjnet1']-$ttJumlah2['hjnet2'],0,',','.')."

"); + print("
"); + print("
"); + }else{ + echo "Tidak ada retur tunai untuk tanggal tersebut!"; + echo "
"; + } + } +$nett_tunai = $ttJumlah['hjnet1']-$ttJumlah2['hjnet2']; +/*------------------------------------------------------------------------------------ kartu -----------------------------------------------------*/ + $query3="select s.nama_strip,sum(hp) totHP,sum(hj) totHJ,sum(disc) totDisc,sum(hjnet) totHJnet + from (select b.kode_strip lini,sum(d.harga_jual * d.jumlah) hj,sum(d.harga_jual * d.jumlah * d.diskon / 100) disc,sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) hjnet, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_tunai d,m_nota_tunai m, barang b + where d.no_nota = m.no_nota + and d.kd_barang = b.kode_barang + and d.harga_pokok IS NOT NULL + and m.status_nota = 'S' + and m.status_bayar = 'K' + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip + ) vtunai, strip s + where s.kd_strip = lini + group by s.kd_strip"; + + if($stmt3 = mysqli_prepare($conn,$query3)){ + mysqli_stmt_execute($stmt3); + mysqli_stmt_store_result($stmt3); + $cek3 = mysqli_stmt_num_rows($stmt3); + if($cek3 > 0){ + mysqli_stmt_bind_result($stmt3,$keljns3,$hp3,$hj3,$disc3,$hjnet3); + $ttJumlah3 = array(); + $ttJumlah3['hp3'] = 0; + $ttJumlah3['hj3'] = 0; + $ttJumlah3['disc3'] = 0; + $ttJumlah3['hjnet3'] = 0; + + print("
"); + print("

Transaksi Kartu



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt3)){ + $ttJumlah3['hp3'] += $hp3 ; + $ttJumlah3['hj3'] += $hj3; + $ttJumlah3['disc3'] += $disc3; + $ttJumlah3['hjnet3'] += $hjnet3; + print(""); + } + print(""); + print("
KategoriTotal HPTotal HJTotal DiscTotal HJnet
$keljns3".number_format($hp3,0,',','.')."".number_format($hj3,0,',','.')."".number_format($disc3,0,',','.')."".number_format($hjnet3,0,',','.')."
".number_format($ttJumlah3['hp3'],0,',','.')."".number_format($ttJumlah3['hj3'],0,',','.')."".number_format($ttJumlah3['disc3'],0,',','.')."".number_format($ttJumlah3['hjnet3'],0,',','.')."

"); + print("
"); + print("
"); + }else{ + echo "Belum ada transaksi kartu untuk tanggal tersebut!"; + echo "
"; + } + } +/*------------------------------------------------------------------------------------ retur kartu -----------------------------------------------------*/ + $query4="select s.nama_strip,sum(hp) totHP,sum(hj) totHJ,sum(disc) totDisc,sum(hjnet) totHJnet + from (select b.kode_strip lini,sum(d.harga_jual * d.jumlah) hj,sum(d.harga_jual * d.jumlah * d.diskon / 100) disc,sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) hjnet,sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_retur d,m_nota_retur m,m_nota_tunai mt, barang b + where d.no_nota = m.no_nota + and d.no_nota_tunai = mt.no_nota + and d.kd_barang = b.kode_barang + and d.harga_pokok IS NOT NULL + and (m.status_nota != 'B') + and mt.status_bayar = 'K' + and date(m.tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip + ) vretur, strip s + where s.kd_strip = lini + group by s.kd_strip"; + + if($stmt4 = mysqli_prepare($conn,$query4)){ + mysqli_stmt_execute($stmt4); + mysqli_stmt_store_result($stmt4); + $cek4 = mysqli_stmt_num_rows($stmt4); + if($cek4 > 0){ + mysqli_stmt_bind_result($stmt4,$keljns4,$hp4,$hj4,$disc4,$hjnet4); + $ttJumlah4 = array(); + $ttJumlah4['hp4'] = 0; + $ttJumlah4['hj4'] = 0; + $ttJumlah4['disc4'] = 0; + $ttJumlah4['hjnet4'] = 0; + + print("
"); + print("

Retur Kartu



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt4)){ + $ttJumlah4['hp4'] += $hp4 ; + $ttJumlah4['hj4'] += $hj4; + $ttJumlah4['disc4'] += $disc4; + $ttJumlah4['hjnet4'] += $hjnet4; + print(""); + } + print(""); + print(""); + print("
KategoriTotal HPTotal HJTotal DiscTotal HJnet
$keljns4".number_format($hp4,0,',','.')."".number_format($hj4,0,',','.')."".number_format($disc4,0,',','.')."".number_format($hjnet4,0,',','.')."
".number_format($ttJumlah4['hp4'],0,',','.')."".number_format($ttJumlah4['hj4'],0,',','.')."".number_format($ttJumlah4['disc4'],0,',','.')."".number_format($ttJumlah4['hjnet4'],0,',','.')."
NETT KARTU".number_format($ttJumlah3['hp3']-$ttJumlah4['hp4'],0,',','.')."".number_format($ttJumlah3['hj3']-$ttJumlah4['hj4'],0,',','.')."".number_format($ttJumlah3['disc3']-$ttJumlah4['disc4'],0,',','.')."".number_format($ttJumlah3['hjnet3']-$ttJumlah4['hjnet4'],0,',','.')."

"); + print("
"); + print("
"); + }else{ + echo "Tidak ada retur kartu untuk tanggal tersebut!"; + echo "
"; + } + } + +$nett_kartu = $ttJumlah3['hjnet3']-$ttJumlah4['hjnet4']; + +/*------------------------------------------------------------------------------------ bon -----------------------------------------------------*/ + $query5="select s.nama_strip,sum(hp) totHP,sum(hj) totHJ,sum(disc) totDisc,sum(hjnet) totHJnet + from (select b.kode_strip lini,sum(d.hrg_satuan * d.jumlah) hj,sum(d.hrg_satuan * d.jumlah * d.diskon / 100) disc, + sum((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) hjnet, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_bon d,m_bon m, barang b + where d.no_bon = m.no_bon + and d.kd_brg = b.kode_barang + and d.harga_pokok IS NOT NULL + and date(tgl_bon) between '$startDate' and '$endDate' + group by b.kode_strip + )vretur, strip s + where s.kd_strip = lini + group by s.kd_strip"; + + if($stmt5 = mysqli_prepare($conn,$query5)){ + mysqli_stmt_execute($stmt5); + mysqli_stmt_store_result($stmt5); + $cek5 = mysqli_stmt_num_rows($stmt5); + if($cek5 > 0){ + mysqli_stmt_bind_result($stmt5,$keljns5,$hp5,$hj5,$disc5,$hjnet5); + $ttJumlah5 = array(); + $ttJumlah5['hp5'] = 0; + $ttJumlah5['hj5'] = 0; + $ttJumlah5['disc5'] = 0; + $ttJumlah5['hjnet5'] = 0; + + print("
"); + print("

Transaksi Bon



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt5)){ + $ttJumlah5['hp5'] += $hp5 ; + $ttJumlah5['hj5'] += $hj5; + $ttJumlah5['disc5'] += $disc5; + $ttJumlah5['hjnet5'] += $hjnet5; + print(""); + } + print(""); + print("
KategoriTotal HPTotal HJTotal DiscTotal HJnet
$keljns5".number_format($hp5,0,',','.')."".number_format($hj5,0,',','.')."".number_format($disc5,0,',','.')."".number_format($hjnet5,0,',','.')."
".number_format($ttJumlah5['hp5'],0,',','.')."".number_format($ttJumlah5['hj5'],0,',','.')."".number_format($ttJumlah5['disc5'],0,',','.')."".number_format($ttJumlah5['hjnet5'],0,',','.')."

"); + print("
"); + print("
"); + }else{ + echo "Belum ada transaksi bon untuk tanggal tersebut!"; + echo "
"; + } + } +/*------------------------------------------------------------------------------------ retur kartu -----------------------------------------------------*/ + $query6="select s.nama_strip,sum(hp) totHP,sum(hj) totHJ,sum(disc) totDisc,sum(hjnet) totHJnet + from (select b.kode_strip lini,sum(d.harga_jual * d.jumlah) hj,sum(d.harga_jual * d.jumlah * d.diskon / 100) disc,sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) hjnet,sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_retur d,m_nota_retur m,m_bon mt, barang b + where d.no_nota = m.no_nota + and d.kd_barang = b.kode_barang + and d.no_nota_tunai = mt.no_bon + and d.harga_pokok IS NOT NULL + and (m.status_nota != 'T') + and date(m.tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip + ) vretur, strip s + where s.kd_strip = lini + group by s.kd_strip"; + + if($stmt6 = mysqli_prepare($conn,$query6)){ + mysqli_stmt_execute($stmt6); + mysqli_stmt_store_result($stmt6); + $cek6 = mysqli_stmt_num_rows($stmt6); + if($cek6 > 0){ + mysqli_stmt_bind_result($stmt6,$keljns6,$hp6,$hj6,$disc6,$hjnet6); + $ttJumlah6 = array(); + $ttJumlah6['hp6'] = 0; + $ttJumlah6['hj6'] = 0; + $ttJumlah6['disc6'] = 0; + $ttJumlah6['hjnet6'] = 0; + + print("
"); + print("

Retur Bon



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt6)){ + $ttJumlah6['hp6'] += $hp6 ; + $ttJumlah6['hj6'] += $hj6; + $ttJumlah6['disc6'] += $disc6; + $ttJumlah6['hjnet6'] += $hjnet6; + print(""); + } + print(""); + print(""); + print("
KategoriTotal HPTotal HJTotal DiscTotal HJnet
$keljns6".number_format($hp6,0,',','.')."".number_format($hj6,0,',','.')."".number_format($disc6,0,',','.')."".number_format($hjnet6,0,',','.')."
".number_format($ttJumlah6['hp6'],0,',','.')."".number_format($ttJumlah6['hj6'],0,',','.')."".number_format($ttJumlah6['disc6'],0,',','.')."".number_format($ttJumlah6['hjnet6'],0,',','.')."
NETT BON".number_format($ttJumlah5['hp5']-$ttJumlah6['hp6'],0,',','.')."".number_format($ttJumlah5['hj5']-$ttJumlah6['hj6'],0,',','.')."".number_format($ttJumlah5['disc5']-$ttJumlah6['disc6'],0,',','.')."".number_format($ttJumlah5['hjnet5']-$ttJumlah6['hjnet6'],0,',','.')."

"); + print("
"); + print("
"); + }else{ + echo "Tidak ada retur bon untuk tanggal tersebut!"; + echo "
"; + } + } + +$nett_bon = $ttJumlah5['hjnet5']-$ttJumlah6['hjnet6']; + + /*----------------------------------------Rekap TITIPAN */ + $query7 = "select sum(t.bayar_bon) + from bayar_bon t + where date(t.tgl_byr) between '$startDate' AND '$endDate'"; + if($stmt7 = mysqli_prepare($conn,$query7)){ + mysqli_stmt_execute($stmt7); + mysqli_stmt_store_result($stmt7); + $cek7 = mysqli_stmt_num_rows($stmt7); + if($cek7 > 0){ + mysqli_stmt_bind_result($stmt7,$total); + $ttJumlah7 = array(); + $ttJumlah7['rp7'] = 0; + + while(mysqli_stmt_fetch($stmt7)){ + $ttJumlah7['rp7'] += $total; + } + }else{ + echo "Belum ada data titipan untuk tanggal tersebut!"; + echo "
"; + } + } + + /*----------------------------------------Rekap Komisi */ + $query8 = "select sum(k.jumlah) + from komisi k + where date(k.tgl_ambil) between '$startDate' AND '$endDate'"; + if($stmt8 = mysqli_prepare($conn,$query8)){ + mysqli_stmt_execute($stmt8); + mysqli_stmt_store_result($stmt8); + $cek8 = mysqli_stmt_num_rows($stmt8); + if($cek8 > 0){ + mysqli_stmt_bind_result($stmt8,$total1); + $ttJumlah8 = array(); + $ttJumlah8['rp8'] = 0; + + while(mysqli_stmt_fetch($stmt8)){ + $ttJumlah8['rp8'] += $total1; + } + }else{ + echo "Belum ada data komisi untuk tanggal tersebut!"; + echo "
"; + } + } + print("
"); + print(""); + print(""); + print(" + + + + "); + + $nett_total_tunai = ceil($nett_tunai) + ceil($nett_kartu); + $nett_total_omset = ceil($nett_tunai) + ceil($nett_kartu) + ceil($nett_bon); + $andil_tunai = ($nett_total_tunai/$nett_total_omset*100); + + $qry_createtmp = "CREATE TABLE IF NOT EXISTS `tmp_lapdetailjual` ( + `total_tunai` bigint(20) NOT NULL, + `total_omset` bigint(20) NOT NULL, + `andil` decimal(10,2) NOT NULL + ) ENGINE=MyISAM DEFAULT CHARSET=latin1;"; + runQuery($qry_createtmp); + $qry_ins = "INSERT INTO `tmp_lapdetailjual` ( + `total_tunai`, + `total_omset`, + `andil` + ) VALUE($nett_total_tunai,$nett_total_omset,$andil_tunai)"; + runQuery($qry_ins); + + print(""); + print(""); + print("
Total HPTotal HJTotal DiscTotal HJnet
GRAND TOTAL".number_format(($ttJumlah['hp1']-$ttJumlah2['hp2'])+($ttJumlah3['hp3']-$ttJumlah4['hp4'])+($ttJumlah5['hp5']-$ttJumlah6['hp6']),0,',','.')."".number_format(($ttJumlah['hj1']-$ttJumlah2['hj2'])+($ttJumlah3['hj3']-$ttJumlah4['hj4'])+($ttJumlah5['hj5']-$ttJumlah6['hj6']),0,',','.')."".number_format(($ttJumlah['disc1']-$ttJumlah2['disc2'])+($ttJumlah3['disc3']-$ttJumlah4['disc4'])+($ttJumlah5['disc5']-$ttJumlah6['disc6']),0,',','.')."".number_format(($ttJumlah['hjnet1']-$ttJumlah2['hjnet2'])+($ttJumlah3['hjnet3']-$ttJumlah4['hjnet4'])+($ttJumlah5['hjnet5']-$ttJumlah6['hjnet6']),0,',','.')."
Total Titipan".number_format($ttJumlah7['rp7'],0,',','.')."
Total Komisi".number_format($ttJumlah8['rp8'],0,',','.')."

"); + print("
"); + print("
"); + + } +?> diff --git a/old-source/LaporanJual/lapdisp.php b/old-source/LaporanJual/lapdisp.php new file mode 100644 index 0000000..8e5b203 --- /dev/null +++ b/old-source/LaporanJual/lapdisp.php @@ -0,0 +1,139 @@ +"; + echo "div#divprint{width:1024px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:950px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:50px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = $_POST['kdsupp']; + $endDate = $_POST['endDate']; + + + if(bukaKoneksi()){ + global $conn; + IF ($startDate != '' && $endDate != ''){ + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ, m.status + FROM barang b,no_barang n, d_pembelian d, m_pembelian m + WHERE n.stok > 0 + and b.id_gabungan = n.id_gabungan + and m.no_faktur = d.no_faktur + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_supplier = '$startDate' + and b.kode_strip = '$endDate' + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + }elseif ($startDate == '' && $endDate != ''){ + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ, m.status + FROM barang b,no_barang n, d_pembelian d, m_pembelian m + WHERE n.stok > 0 + and b.id_gabungan = n.id_gabungan + and m.no_faktur = d.no_faktur + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_strip = '$endDate' + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + }else { + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ, m.status + FROM barang b,no_barang n, d_pembelian d, m_pembelian m + WHERE n.stok > 0 + and b.id_gabungan = n.id_gabungan + and m.no_faktur = d.no_faktur + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_supplier = '$startDate' + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + + } + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tahun,$bln,$strip,$kdasli,$nofaktur,$kdbrg,$nmbrg,$nomor,$akhir,$pokok,$hp,$jual,$hj,$status); + + $lebar_label = 200; + $tinggi_label = 115; + $label_per_baris = 3; + $baris_per_halaman = 7; + + $total = $cek; + $baris=1; $kolom=1; + + for ($i = 1; $i <= $total; $i++) { + + $r = mysqli_stmt_fetch($stmt); + $clear = ""; + $barcode = strtoupper($kdbrg); + // cek posisi saat ini + if ($kolom > $label_per_baris) { + $kolom = 1; + $baris++; + $clear = " clear:left; "; + }; + if ($baris > $baris_per_halaman) { + $baris = 1; + echo '

'; + }; + + $namaBarang = $nmbrg; + // cetak label + echo "\n + +

+

+ +

+

+ ".strtoupper($namaBarang)." +

+

+ ".number_format($jual,0,',','.')."

+
+ "; + + $kolom++; + } // end for + }else{ + echo "Data tidak ada!"; + } + } + } +?> diff --git a/old-source/LaporanJual/lapjualdlmpdk.php b/old-source/LaporanJual/lapjualdlmpdk.php new file mode 100644 index 0000000..465c3e3 --- /dev/null +++ b/old-source/LaporanJual/lapjualdlmpdk.php @@ -0,0 +1,208 @@ +"; + echo "div#divprint{width:900px; border:1px 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:9pt;}"; + 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 ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + + if(bukaKoneksi()){ + global $conn; + $query = "select s.kel_jns,s.nama_strip,dlm,ked_produk,sum(juml) vol,sum(tot) totHJ,sum(hp) totHP + from ( + select b.kode_strip lini,b.ked_produk dlm,k.ked_produk,sum(jumlah) juml, + sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_tunai d,m_nota_tunai m, kedalaman_produk k, barang b + where d.no_nota = m.no_nota + and d.kd_barang = b.kode_barang + and (b.kode_strip = k.kode_strip and b.ked_produk = k.kode_ked_produk) + and d.harga_pokok IS NOT NULL + and m.status_nota = 'S' + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip,b.ked_produk + UNION ALL + select b.kode_strip lini,b.ked_produk dlm,k.ked_produk,(-1*sum(jumlah)) juml, + (-1*sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100))) tot, + (-1*sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp + from d_nota_retur d,m_nota_retur m, kedalaman_produk k, barang b + where d.no_nota = m.no_nota + and d.kd_barang = b.kode_barang + and (b.kode_strip = k.kode_strip and b.ked_produk = k.kode_ked_produk) + and d.harga_pokok IS NOT NULL + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip,b.ked_produk + UNION ALL + select b.kode_strip lini,b.ked_produk dlm,k.ked_produk,sum(jumlah) juml, + sum((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_bon d,m_bon m, kedalaman_produk k, barang b + where d.no_bon = m.no_bon + and d.kd_brg = b.kode_barang + and (b.kode_strip = k.kode_strip and b.ked_produk = k.kode_ked_produk) + and d.harga_pokok IS NOT NULL + and date(tgl_bon) between '$startDate' and '$endDate' + group by b.kode_strip,b.ked_produk + ) vdlmpdk,strip s + where s.kd_strip = lini + group by s.kd_strip,dlm"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kelJns,$strip,$kdSuppl,$nmSuppl,$jmlBeli,$rpBeli,$hrgPokok); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['rp'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['rp'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['rp'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['rp'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + + print("
"); + print("

Laporan Penjualan Per Sub Group Product



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PADA TANGGAL : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $str = array(); + $jmlB = array(); + $rpB = array(); + $HP = array(); + $kdSupplier = array(); + $nmSupplier = array(); + + while(mysqli_stmt_fetch($stmt)){ + if($jmlRetur == ''){ + $jmlRetur = 0; + } + if($rpRetur == ''){ + $rpRetur = 0; + } + if($kelJns == "P"){ + $kelJns = "Pria"; + $ttJmlBeli['pria']['jml'] += $jmlBeli; + $ttJmlBeli['pria']['rp'] += $rpBeli; + $ttJmlBeli['pria']['hp'] += $hrgPokok; + $str[$pria]['pria'] = $strip; + $jmlB[$pria]['pria'] = $jmlBeli; + $rpB[$pria]['pria'] = $rpBeli; + $HP[$pria]['pria'] = $hrgPokok; + $kdSupplier[$pria]['pria'] = $kdSuppl; + $nmSupplier[$pria]['pria'] = $nmSuppl; + $pria++; + }elseif($kelJns == "W"){ + $kelJns = "Wanita"; + $ttJmlBeli['wanita']['jml'] += $jmlBeli; + $ttJmlBeli['wanita']['rp'] += $rpBeli; + $ttJmlBeli['wanita']['hp'] += $hrgPokok; + $str[$wanita]['wanita'] = $strip; + $jmlB[$wanita]['wanita'] = $jmlBeli; + $rpB[$wanita]['wanita'] = $rpBeli; + $HP[$wanita]['wanita'] = $hrgPokok; + $kdSupplier[$wanita]['wanita'] = $kdSuppl; + $nmSupplier[$wanita]['wanita'] = $nmSuppl; + $wanita++; + }elseif($kelJns == "A"){ + $kelJns = "Anak"; + $ttJmlBeli['anak']['jml'] += $jmlBeli; + $ttJmlBeli['anak']['rp'] += $rpBeli; + $ttJmlBeli['anak']['hp'] += $hrgPokok; + $str[$anak]['anak'] = $strip; + $jmlB[$anak]['anak'] = $jmlBeli; + $rpB[$anak]['anak'] = $rpBeli; + $HP[$anak]['anak'] = $hrgPokok; + $kdSupplier[$anak]['anak'] = $kdSuppl; + $nmSupplier[$anak]['anak'] = $nmSuppl; + $anak++; + }else{ + $kelJns = "Sepatu"; + $ttJmlBeli['sepatu']['jml'] += $jmlBeli; + $ttJmlBeli['sepatu']['rp'] += $rpBeli; + $ttJmlBeli['sepatu']['hp'] += $hrgPokok; + $str[$sepatu]['sepatu'] = $strip; + $jmlB[$sepatu]['sepatu'] = $jmlBeli; + $rpB[$sepatu]['sepatu'] = $rpBeli; + $HP[$sepatu]['sepatu'] = $hrgPokok; + $kdSupplier[$sepatu]['sepatu'] = $kdSuppl; + $nmSupplier[$sepatu]['sepatu'] = $nmSuppl; + $sepatu++; + } + + } + print(""); + print(""); + print("
"); + + +/* SEPATU -------------------------------------------------------------------------*/ + $jmlkatsepatu = $ttJmlBeli['sepatu']['jml']; + $rpkatsepatu = $ttJmlBeli['sepatu']['rp']; + $hpkatsepatu = $ttJmlBeli['sepatu']['hp']; + + if($ttJmlBeli['sepatu']['jml']!=0){ + print("
"); + for($i=0;$i<$sepatu;$i++){ + if ($str[$i-1]['sepatu']==$str[$i]['sepatu']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlahrugi4 = 0; + $temphprugi4 = 0; + $temprprugi4 = 0; + } + $tempjumlahrugi4 += $jmlB[$i]['sepatu']; + $temphprugi4 += $HP[$i]['sepatu']; + $temprprugi4 += $rpB[$i]['sepatu']; + } + print(""); + } + + $ttjml = $jmlkatpria + $jmlkatwanita + $jmlkatanak + $jmlkatsepatu; + $ttrp = $rpkatpria + $rpkatwanita + $rpkatanak + $rpkatsepatu; + $tthp = $hpkatpria + $hpkatwanita + $hpkatanak + $hpkatsepatu; + + print(" + + + "); + + print("
Lini ProdukKode Sub GroupSub Group ProductJumlah JualTotal JualTotal HP Jual
".$str[$i]['sepatu'].".".$kdSupplier[$i]['sepatu']."".$nmSupplier[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($rpB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlahrugi4, 0, ",", ".")."".number_format($temprprugi4, 0, ",", ".")."".number_format($temphprugi4, 0, ",", ".")."
".$str[$i]['sepatu'].".".$kdSupplier[$i]['sepatu']."".$nmSupplier[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($rpB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlahrugi4, 0, ",", ".")."".number_format($temprprugi4, 0, ",", ".")."".number_format($temphprugi4, 0, ",", ".")."
T O T A L : ".number_format($ttjml, 0, ",", ".")."".number_format($ttrp, 0, ",", ".")."".number_format($tthp, 0, ",", ".")."

"); + }else{ + echo "Belum ada data pembelian untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanJual/lapjualgrouppersupp.php b/old-source/LaporanJual/lapjualgrouppersupp.php new file mode 100644 index 0000000..d677c99 --- /dev/null +++ b/old-source/LaporanJual/lapjualgrouppersupp.php @@ -0,0 +1,251 @@ +"; + echo "table.tbl {width:950px;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}"; + echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}"; + echo "body {font-size:9pt;}"; + echo "div.luar{text-align:left;margin-left:100px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate2']); + $endDate = decTgl($_POST['endDate2']); + + + if(bukaKoneksi()){ + global $conn; +// /*----------------------------------------Penjualan grouping per konveksi per supplier*/ +// $query = "select CASE s.kel_jns when 'A' then 'Konveksi' +// when 'P' then 'Konveksi' +// when 'W' then 'Konveksi' +// END kategori,kode_supplier,nama_supplier,sum(juml) vol,sum(tot) totHJ,sum(hp) totHP +// from ( +// select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, +// sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) tot, +// sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp +// from d_nota_tunai d,m_nota_tunai m, barang b,supplier u +// where d.no_nota = m.no_nota +// AND d.kd_barang = b.kode_barang +// AND b.kode_supplier = u.kd_supplier +// and d.harga_pokok IS NOT NULL +// and m.status_nota = 'S' +// and date(tgl_nota) between '$startDate' AND '$endDate' +// group by b.kode_strip,b.kode_supplier +// UNION ALL +// select b.kode_strip lini,b.kode_supplier, u.nama_supplier,(-1*sum(jumlah)) juml, +// (-1*sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100))) tot, +// (-1*sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp +// from d_nota_retur d,m_nota_retur m, barang b,supplier u +// where d.no_nota = m.no_nota +// AND d.kd_barang = b.kode_barang +// AND b.kode_supplier = u.kd_supplier +// and d.harga_pokok IS NOT NULL +// and date(tgl_nota) between '$startDate' AND '$endDate' +// group by b.kode_strip,b.kode_supplier +// UNION ALL +// select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, +// sum((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) tot, +// sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp +// from d_bon d,m_bon m, barang b,supplier u +// where d.no_bon = m.no_bon +// AND d.kd_brg = b.kode_barang +// AND b.kode_supplier = u.kd_supplier +// and d.harga_pokok IS NOT NULL +// and date(tgl_bon) between '$startDate' AND '$endDate' +// group by b.kode_strip,b.kode_supplier +// ) vlini,strip s +// where s.kd_strip = lini +// AND s.kel_jns != 'S' +// group by kode_supplier"; +// if($stmt = mysqli_prepare($conn,$query)){ +// mysqli_stmt_execute($stmt); +// mysqli_stmt_store_result($stmt); +// $cek = mysqli_stmt_num_rows($stmt); +// if($cek > 0){ +// mysqli_stmt_bind_result($stmt,$kat,$kdsupp,$supp,$jml,$hj,$hp); +// +// print("
"); +// print("

Rekap Penjualan Kelp.Kategori Konveksi Per Supplier



"); +// print("
TOKO ".$_SESSION['namatoko']."
"); +// print("TANGGAL MASUK : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); +// print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."


"); +// print(""); +// print(""); +// +// $ttHJ = 0; +// $ttHP = 0; +// $profit = 0; +// while(mysqli_stmt_fetch($stmt)){ +// $ttHJ += $hj; +// $ttHP += $hp; +// $profit = ($hj-$hp)/$hj*100; +// print(" +// "); +// } +// print(""); +// print("
Kelp.KategoriKode SupplierNama SupplierJumlHarga JualHarga PokokProfit[%]
$kat.$kdsupp$supp$jml".number_format($hj,0,',','.')."".number_format($hp,0,',','.')."".number_format($profit,2,',','.')."
T O T A L".number_format($ttHJ,0,',','.')."".number_format($ttHP,0,',','.')."

"); +// print("
"); +// }else{ +// echo "data tdk ada!"; +// echo "
"; +// } +// } +// /*----------------------------------------Penjualan grouping per sepatu per supplier*/ +// $query = "select CASE s.kel_jns when 'S' then 'Sepatu' +// END kategori,kode_supplier,nama_supplier,sum(juml) vol,sum(tot) totHJ,sum(hp) totHP +// from ( +// select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, +// sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) tot, +// sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp +// from d_nota_tunai d,m_nota_tunai m, barang b,supplier u +// where d.no_nota = m.no_nota +// AND d.kd_barang = b.kode_barang +// AND b.kode_supplier = u.kd_supplier +// and d.harga_pokok IS NOT NULL +// and m.status_nota = 'S' +// and date(tgl_nota) between '$startDate' AND '$endDate' +// group by b.kode_strip,b.kode_supplier +// UNION ALL +// select b.kode_strip lini,b.kode_supplier, u.nama_supplier,(-1*sum(jumlah)) juml, +// (-1*sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100))) tot, +// (-1*sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp +// from d_nota_retur d,m_nota_retur m, barang b,supplier u +// where d.no_nota = m.no_nota +// AND d.kd_barang = b.kode_barang +// AND b.kode_supplier = u.kd_supplier +// and d.harga_pokok IS NOT NULL +// and date(tgl_nota) between '$startDate' AND '$endDate' +// group by b.kode_strip,b.kode_supplier +// UNION ALL +// select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, +// sum((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) tot, +// sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp +// from d_bon d,m_bon m, barang b,supplier u +// where d.no_bon = m.no_bon +// AND d.kd_brg = b.kode_barang +// AND b.kode_supplier = u.kd_supplier +// and d.harga_pokok IS NOT NULL +// and date(tgl_bon) between '$startDate' AND '$endDate' +// group by b.kode_strip,b.kode_supplier +// ) vlini,strip s +// where s.kd_strip = lini +// AND s.kel_jns = 'S' +// group by kode_supplier"; +// if($stmt = mysqli_prepare($conn,$query)){ +// mysqli_stmt_execute($stmt); +// mysqli_stmt_store_result($stmt); +// $cek = mysqli_stmt_num_rows($stmt); +// if($cek > 0){ +// mysqli_stmt_bind_result($stmt,$kat,$kdsupp,$supp,$jml,$hj,$hp); +// +// print("
"); +// print("

Rekap Penjualan Kelp.Kategori Sepatu Per Supplier



"); +// print("
TOKO ".$_SESSION['namatoko']."
"); +// print("TANGGAL MASUK : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); +// print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."


"); +// print(""); +// print(""); +// +// $ttHJ = 0; +// $ttHP = 0; +// $profit = 0; +// while(mysqli_stmt_fetch($stmt)){ +// $ttHJ += $hj; +// $ttHP += $hp; +// $profit = ($hj-$hp)/$hj*100; +// print(" +// "); +// } +// print(""); +// print("
Kelp.KategoriKode SupplierNama SupplierJumlHarga JualHarga PokokProfit[%]
$kat.$kdsupp$supp$jml".number_format($hj,0,',','.')."".number_format($hp,0,',','.')."".number_format($profit,2,',','.')."
T O T A L".number_format($ttHJ,0,',','.')."".number_format($ttHP,0,',','.')."

"); +// print("
"); +// }else{ +// echo "data tdk ada!"; +// echo "
"; +// } +// } + /*----------------------------------------Penjualan grouping per supplier*/ + $query = "select kode_supplier,nama_supplier,sum(juml) vol,sum(tot) totHJ,sum(hp) totHP + from ( + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, + sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_tunai d,m_nota_tunai m, barang b,supplier u + where d.no_nota = m.no_nota + AND d.kd_barang = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and d.harga_pokok IS NOT NULL + and m.status_nota = 'S' + and date(tgl_nota) between '$startDate' AND '$endDate' + group by b.kode_strip,b.kode_supplier + UNION ALL + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,(-1*sum(jumlah)) juml, + (-1*sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100))) tot, + (-1*sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp + from d_nota_retur d,m_nota_retur m, barang b,supplier u + where d.no_nota = m.no_nota + AND d.kd_barang = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and d.harga_pokok IS NOT NULL + and date(tgl_nota) between '$startDate' AND '$endDate' + group by b.kode_strip,b.kode_supplier + UNION ALL + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, + sum((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_bon d,m_bon m, barang b,supplier u + where d.no_bon = m.no_bon + AND d.kd_brg = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and d.harga_pokok IS NOT NULL + and date(tgl_bon) between '$startDate' AND '$endDate' + group by b.kode_strip,b.kode_supplier + ) vlini,strip s + where s.kd_strip = lini + group by kode_supplier"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdsupp,$supp,$jml,$hj,$hp); + + print("
"); + print("

Rekap Penjualan Per Supplier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("Pada Tanggal : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."


"); + print(""); + print(""); + + $ttHJ = 0; + $ttHP = 0; + $profit = 0; + while(mysqli_stmt_fetch($stmt)){ + $ttHJ += $hj; + $ttHP += $hp; + $profit = ($hj-$hp)/$hj*100; + print(" + "); + } + print(""); + print("
Kode SupplierNama SupplierJumlHarga JualHarga PokokProfit[%]
.$kdsupp$supp$jml".number_format($hj,0,',','.')."".number_format($hp,0,',','.')."".number_format($profit,2,',','.')."
T O T A L".number_format($ttHJ,0,',','.')."".number_format($ttHP,0,',','.')."

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + print("

"); + } + +?> diff --git a/old-source/LaporanJual/lapjualperkat.php b/old-source/LaporanJual/lapjualperkat.php new file mode 100644 index 0000000..71af21d --- /dev/null +++ b/old-source/LaporanJual/lapjualperkat.php @@ -0,0 +1,275 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:700px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ".master{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $tanggal = encTgl($startDate); + $bulan = substr($tanggal,3,2); + $tmpbulan = left($bulan,1); + if($tmpbulan == '0'){ + $bln = right($bulan,1); + }else{ + $bln = $bulan; + } + $thn = substr($tanggal,6,4); + + if(bukaKoneksi()){ + global $conn; + $qry_tmp = "CREATE TABLE tmp_lapjualperkat AS + select s.kel_jns, s.nama_strip, k.ked_produk, sum(juml) vol, sum(hjbruto) HJbruto, sum(disc) Disc, sum(tot) totHJ,sum(hp) totHP,(sum(tot)-sum(hp))/sum(tot)*100 nettprofit + from ( + select b.kode_strip lini,sum(jumlah) juml, + sum(d.harga_jual * d.jumlah) hjbruto, + sum(d.harga_jual * d.jumlah * d.diskon / 100) disc, + sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_tunai d,m_nota_tunai m, barang b + where d.no_nota = m.no_nota + AND d.kd_barang = b.kode_barang + and d.harga_pokok IS NOT NULL + and m.status_nota = 'S' + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip + UNION ALL + select b.kode_strip lini,sum(jumlah) juml, + sum(d.hrg_satuan * d.jumlah) hjbruto, + sum(d.hrg_satuan * d.jumlah * d.diskon / 100) disc, + sum((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_bon d,m_bon m,barang b + where d.no_bon = m.no_bon + and d.kd_brg = b.kode_barang + and d.harga_pokok IS NOT NULL + and date(tgl_bon) between '$startDate' and '$endDate' + group by b.kode_strip + UNION ALL + select b.kode_strip lini,(-1*sum(jumlah)) juml, + (-1*sum(d.harga_jual * d.jumlah)) hjbruto, + (-1*sum(d.harga_jual * d.jumlah * d.diskon / 100)) disc, + (-1*sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100))) tot, + (-1*sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp + from d_nota_retur d,m_nota_retur m,barang b + where d.no_nota = m.no_nota + and d.kd_barang = b.kode_barang + and d.harga_pokok IS NOT NULL + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip + ) vlini,strip s + where s.kd_strip = lini + group by kd_strip"; + runQuery($qry_tmp); + + $query = "select s.kel_jns, s.nama_strip, sum(juml) vol, sum(hjbruto) HJbruto, sum(disc) Disc, sum(tot) totHJ,sum(hp) totHP,(sum(tot)-sum(hp))/sum(tot)*100 nettprofit + from ( + select b.kode_strip lini,sum(jumlah) juml, + sum(d.harga_jual * d.jumlah) hjbruto, + sum(d.harga_jual * d.jumlah * d.diskon / 100) disc, + sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_tunai d,m_nota_tunai m,barang b + where d.no_nota = m.no_nota + and d.kd_barang = b.kode_barang + and d.harga_pokok IS NOT NULL + and m.status_nota = 'S' + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip + UNION ALL + select b.kode_strip lini,sum(jumlah) juml, + sum(d.hrg_satuan * d.jumlah) hjbruto, + sum(d.hrg_satuan * d.jumlah * d.diskon / 100) disc, + sum((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_bon d,m_bon m,barang b + where d.no_bon = m.no_bon + and d.kd_brg = b.kode_barang + and d.harga_pokok IS NOT NULL + and date(tgl_bon) between '$startDate' and '$endDate' + group by b.kode_strip + UNION ALL + select b.kode_strip lini,(-1*sum(jumlah)) juml, + (-1*sum(d.harga_jual * d.jumlah)) hjbruto, + (-1*sum(d.harga_jual * d.jumlah * d.diskon / 100)) disc, + (-1*sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100))) tot, + (-1*sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp + from d_nota_retur d,m_nota_retur m,barang b + where d.no_nota = m.no_nota + and d.kd_barang = b.kode_barang + and d.harga_pokok IS NOT NULL + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip + ) vlini,strip s + where s.kd_strip = lini + group by s.kd_strip "; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kelJns,$strip,$jmlBeli,$HJBrut,$discount,$rpBeli,$hrgPokok,$nettprofit); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['rp'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['pria']['HJbruto'] = 0; + $ttJmlBeli['pria']['disc'] = 0; + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['rp'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['wanita']['HJbruto'] = 0; + $ttJmlBeli['wanita']['disc'] = 0; + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['rp'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['anak']['HJbruto'] = 0; + $ttJmlBeli['anak']['disc'] = 0; + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['rp'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + $ttJmlBeli['sepatu']['HJbruto'] = 0; + $ttJmlBeli['sepatu']['disc'] = 0; + + print("
"); + print("

Laporan Penjualan Per Kelompok Kategori



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PADA TANGGAL : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + ?> + + + "); + print("Lini ProdukVolumeTot HJ BrutoTot DiscTot HJTot HPNettProfit(%)Profit Bruto(%)"); + print("
"); + +// SEPATU ------------------------------------------------------------------------- + $jmlkatsepatu = $ttJmlBeli['sepatu']['jml']; + $rpkatsepatu = $ttJmlBeli['sepatu']['rp']; + $hpkatsepatu = $ttJmlBeli['sepatu']['hp']; + $hjbrutsepatu = $ttJmlBeli['sepatu']['HJbruto']; + $discsepatu = $ttJmlBeli['sepatu']['disc']; + + if($ttJmlBeli['sepatu']['jml']!=0){ + print(""); + for($i=0;$i<$sepatu;$i++){ + print("".$str[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($HJb[$i]['sepatu'], 0, ",", ".")."".number_format($disc[$i]['sepatu'], 0, ",", ".")."".number_format($rpB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."".number_format( (($rpB[$i]['sepatu']-$HP[$i]['sepatu'])/$rpB[$i]['sepatu']*100),2)."".number_format( (($HJb[$i]['sepatu']-$HP[$i]['sepatu'])/$HJb[$i]['sepatu']*100),2).""); + } + print("Sub Total".number_format($jmlkatsepatu, 0, ",", ".")."".number_format($hjbrutsepatu, 0, ",", ".")."".number_format($discsepatu, 0, ",", ".")."".number_format($rpkatsepatu, 0, ",", ".")."".number_format($hpkatsepatu, 0, ",", ".")."".number_format(($rpkatsepatu-$hpkatsepatu)/$rpkatsepatu*100, 2)."".number_format(($hjbrutsepatu-$hpkatsepatu)/$hjbrutsepatu*100, 2).""); + } +//---------------------------------------------------------------------------------- + $ttjml = $jmlkatpria + $jmlkatwanita + $jmlkatanak + $jmlkatsepatu; + $ttrp = $rpkatpria + $rpkatwanita + $rpkatanak + $rpkatsepatu; + $tthp = $hpkatpria + $hpkatwanita + $hpkatanak + $hpkatsepatu; + $ttHJb = $hjbrutpria + $hjbrutwanita + $hjbrutanak + $hjbrutsepatu; + $ttdisc = $discpria + $discwanita + $discanak + $discsepatu; + + + print("T O T A L : + ".number_format($ttjml, 0, ",", ".")." + ".number_format($ttHJb, 0, ",", ".")." + ".number_format($ttdisc, 0, ",", ".")." + ".number_format($ttrp, 0, ",", ".")." + ".number_format($tthp, 0, ",", ".")." + ".number_format(($ttrp-$tthp)/$ttrp*100, 2)." + ".number_format(($ttHJb-$tthp)/$ttHJb*100, 2).""); + + print("
"); + }else{ + echo "Belum ada data penjualan untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanJual/lapjualpersup.php b/old-source/LaporanJual/lapjualpersup.php new file mode 100644 index 0000000..399695e --- /dev/null +++ b/old-source/LaporanJual/lapjualpersup.php @@ -0,0 +1,726 @@ +"; + echo "div#divprint{width:900px; border:1px 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:9pt;}"; + 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 ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $kdsupp = $_POST['kdsupp']; + + if(bukaKoneksi()){ + global $conn; + if ($kdsupp!=""){ + $query = "select s.kel_jns,s.nama_strip,kode_supplier,nama_supplier,sum(juml) vol,sum(tot) totHJ,sum(hp) totHP + from ( + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, + sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_tunai d,m_nota_tunai m, barang b,supplier u + where d.no_nota = m.no_nota + AND d.kd_barang = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and u.kd_supplier = '$kdsupp' + and d.harga_pokok IS NOT NULL + and m.status_nota = 'S' + and d.diskon <> 100 + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + UNION ALL + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,(-1*sum(jumlah)) juml, + (-1*sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100))) tot, + (-1*sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp + from d_nota_retur d,m_nota_retur m, barang b,supplier u + where d.no_nota = m.no_nota + AND d.kd_barang = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and u.kd_supplier = '$kdsupp' + and d.harga_pokok IS NOT NULL + and d.diskon <> 100 + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + UNION ALL + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, + sum((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_bon d,m_bon m, barang b,supplier u + where d.no_bon = m.no_bon + AND d.kd_brg = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and u.kd_supplier = '$kdsupp' + and d.harga_pokok IS NOT NULL + and d.diskon <> 100 + and date(tgl_bon) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + ) vlini,strip s + where s.kd_strip = lini + group by s.kd_strip,kode_supplier + order by s.kd_strip,vol desc"; + }else{ + $query = "select s.kel_jns,s.nama_strip,kode_supplier,nama_supplier,sum(juml) vol,sum(tot) totHJ,sum(hp) totHP + from ( + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, + sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_tunai d,m_nota_tunai m, barang b,supplier u + where d.no_nota = m.no_nota + AND d.kd_barang = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and d.harga_pokok IS NOT NULL + and m.status_nota = 'S' + and d.diskon <> 100 + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + UNION ALL + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,(-1*sum(jumlah)) juml, + (-1*sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100))) tot, + (-1*sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp + from d_nota_retur d,m_nota_retur m, barang b,supplier u + where d.no_nota = m.no_nota + AND d.kd_barang = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and d.harga_pokok IS NOT NULL + and d.diskon <> 100 + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + UNION ALL + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, + sum((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_bon d,m_bon m, barang b,supplier u + where d.no_bon = m.no_bon + AND d.kd_brg = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and d.harga_pokok IS NOT NULL + and d.diskon <> 100 + and date(tgl_bon) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + ) vlini,strip s + where s.kd_strip = lini + group by s.kd_strip,kode_supplier + order by s.kd_strip,vol desc"; + } + + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kelJns,$strip,$kdSuppl,$nmSuppl,$jmlBeli,$rpBeli,$hrgPokok); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['rp'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['rp'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['rp'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['rp'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + + print("
"); + print("

Laporan Penjualan Per Supplier


"); + print("(sudah dipisah dari penjualan diskon 100%)

"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PADA TANGGAL : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $str = array(); + $jmlB = array(); + $rpB = array(); + $HP = array(); + $kdSupplier = array(); + $nmSupplier = array(); + + while(mysqli_stmt_fetch($stmt)){ + if($jmlRetur == ''){ + $jmlRetur = 0; + } + if($rpRetur == ''){ + $rpRetur = 0; + } + if($kelJns == "P"){ + $kelJns = "Pria"; + $ttJmlBeli['pria']['jml'] += $jmlBeli; + $ttJmlBeli['pria']['rp'] += $rpBeli; + $ttJmlBeli['pria']['hp'] += $hrgPokok; + $str[$pria]['pria'] = $strip; + $jmlB[$pria]['pria'] = $jmlBeli; + $rpB[$pria]['pria'] = $rpBeli; + $HP[$pria]['pria'] = $hrgPokok; + $kdSupplier[$pria]['pria'] = $kdSuppl; + $nmSupplier[$pria]['pria'] = $nmSuppl; + $pria++; + }elseif($kelJns == "W"){ + $kelJns = "Wanita"; + $ttJmlBeli['wanita']['jml'] += $jmlBeli; + $ttJmlBeli['wanita']['rp'] += $rpBeli; + $ttJmlBeli['wanita']['hp'] += $hrgPokok; + $str[$wanita]['wanita'] = $strip; + $jmlB[$wanita]['wanita'] = $jmlBeli; + $rpB[$wanita]['wanita'] = $rpBeli; + $HP[$wanita]['wanita'] = $hrgPokok; + $kdSupplier[$wanita]['wanita'] = $kdSuppl; + $nmSupplier[$wanita]['wanita'] = $nmSuppl; + $wanita++; + }elseif($kelJns == "A"){ + $kelJns = "Anak"; + $ttJmlBeli['anak']['jml'] += $jmlBeli; + $ttJmlBeli['anak']['rp'] += $rpBeli; + $ttJmlBeli['anak']['hp'] += $hrgPokok; + $str[$anak]['anak'] = $strip; + $jmlB[$anak]['anak'] = $jmlBeli; + $rpB[$anak]['anak'] = $rpBeli; + $HP[$anak]['anak'] = $hrgPokok; + $kdSupplier[$anak]['anak'] = $kdSuppl; + $nmSupplier[$anak]['anak'] = $nmSuppl; + $anak++; + }else{ + $kelJns = "Sepatu"; + $ttJmlBeli['sepatu']['jml'] += $jmlBeli; + $ttJmlBeli['sepatu']['rp'] += $rpBeli; + $ttJmlBeli['sepatu']['hp'] += $hrgPokok; + $str[$sepatu]['sepatu'] = $strip; + $jmlB[$sepatu]['sepatu'] = $jmlBeli; + $rpB[$sepatu]['sepatu'] = $rpBeli; + $HP[$sepatu]['sepatu'] = $hrgPokok; + $kdSupplier[$sepatu]['sepatu'] = $kdSuppl; + $nmSupplier[$sepatu]['sepatu'] = $nmSuppl; + $sepatu++; + } + + } + print(""); + print(""); + print("
"); + + +/* SEPATU -------------------------------------------------------------------------*/ + $jmlkatsepatu = $ttJmlBeli['sepatu']['jml']; + $rpkatsepatu = $ttJmlBeli['sepatu']['rp']; + $hpkatsepatu = $ttJmlBeli['sepatu']['hp']; + + if($ttJmlBeli['sepatu']['jml']!=0){ + print("
"); + for($i=0;$i<$sepatu;$i++){ + if ($str[$i-1]['sepatu']==$str[$i]['sepatu']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlah4 = 0; + $temphp4 = 0; + $temprp4 = 0; + } + $tempjumlah4 += $jmlB[$i]['sepatu']; + $temphp4 += $HP[$i]['sepatu']; + $temprp4 += $rpB[$i]['sepatu']; + } + print(""); + print(""); + } + + $ttjml = $jmlkatpria + $jmlkatwanita + $jmlkatanak + $jmlkatsepatu; + $ttrp = $rpkatpria + $rpkatwanita + $rpkatanak + $rpkatsepatu; + $tthp = $hpkatpria + $hpkatwanita + $hpkatanak + $hpkatsepatu; + + print(" + + + "); + print("
Lini ProdukKode Supp.Nama SupplierJumlah JualTotal JualTotal HP Jual
".$str[$i]['sepatu'].".".$kdSupplier[$i]['sepatu']."".$nmSupplier[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($rpB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlah4, 0, ",", ".")."".number_format($temprp4, 0, ",", ".")."".number_format($temphp4, 0, ",", ".")."
".$str[$i]['sepatu'].".".$kdSupplier[$i]['sepatu']."".$nmSupplier[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($rpB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlah4, 0, ",", ".")."".number_format($temprp4, 0, ",", ".")."".number_format($temphp4, 0, ",", ".")."
".number_format($ttJmlBeli['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['rp'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp'], 0, ",", ".")."
T O T A L : ".number_format($ttjml, 0, ",", ".")."".number_format($ttrp, 0, ",", ".")."".number_format($tthp, 0, ",", ".")."

"); + }else{ + echo "Tidak ada data penjualan untuk tanggal tersebut!"; + } + } +/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +if ($kdsupp!=""){ +$query2 = "select s.kel_jns,s.nama_strip,kode_supplier,nama_supplier,sum(juml) vol,sum(tot) totHJ,sum(hp) totHP + from ( + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, + sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_tunai d,m_nota_tunai m, barang b,supplier u + where d.no_nota = m.no_nota + AND d.kd_barang = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and u.kd_supplier = '$kdsupp' + and d.harga_pokok IS NOT NULL + and m.status_nota = 'S' + and d.diskon <> 100 + and ((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) < (d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + UNION ALL + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,(-1*sum(jumlah)) juml, + (-1*sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100))) tot, + (-1*sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp + from d_nota_retur d,m_nota_retur m, barang b,supplier u + where d.no_nota = m.no_nota + AND d.kd_barang = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and u.kd_supplier = '$kdsupp' + and d.harga_pokok IS NOT NULL + and d.diskon <> 100 + and ((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) < (d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + UNION ALL + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, + sum((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_bon d,m_bon m, barang b,supplier u + where d.no_bon = m.no_bon + AND d.kd_brg = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and u.kd_supplier = '$kdsupp' + and d.harga_pokok IS NOT NULL + and d.diskon <> 100 + and ((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) < (d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) + and date(tgl_bon) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + ) vlini,strip s + where s.kd_strip = lini + group by s.kd_strip,kode_supplier + order by s.kd_strip,vol desc"; +}else{ +$query2 = "select s.kel_jns,s.nama_strip,kode_supplier,nama_supplier,sum(juml) vol,sum(tot) totHJ,sum(hp) totHP + from ( + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, + sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_tunai d,m_nota_tunai m, barang b,supplier u + where d.no_nota = m.no_nota + AND d.kd_barang = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and d.harga_pokok IS NOT NULL + and m.status_nota = 'S' + and d.diskon <> 100 + and ((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) < (d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + UNION ALL + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,(-1*sum(jumlah)) juml, + (-1*sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100))) tot, + (-1*sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp + from d_nota_retur d,m_nota_retur m, barang b,supplier u + where d.no_nota = m.no_nota + AND d.kd_barang = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and d.harga_pokok IS NOT NULL + and d.diskon <> 100 + and ((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) < (d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + UNION ALL + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, + sum((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_bon d,m_bon m, barang b,supplier u + where d.no_bon = m.no_bon + AND d.kd_brg = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and d.harga_pokok IS NOT NULL + and d.diskon <> 100 + and ((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) < (d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) + and date(tgl_bon) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + ) vlini,strip s + where s.kd_strip = lini + group by s.kd_strip,kode_supplier + order by s.kd_strip,vol desc"; +} + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$kelJns,$strip,$kdSuppl,$nmSuppl,$jmlBeli,$rpBeli,$hrgPokok); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml2'] = 0; + $ttJmlBeli['pria']['rp2'] = 0; + $ttJmlBeli['pria']['hp2'] = 0; + $ttJmlBeli['wanita']['jml2'] = 0; + $ttJmlBeli['wanita']['rp2'] = 0; + $ttJmlBeli['wanita']['hp2'] = 0; + $ttJmlBeli['anak']['jml2'] = 0; + $ttJmlBeli['anak']['rp2'] = 0; + $ttJmlBeli['anak']['hp2'] = 0; + $ttJmlBeli['sepatu']['jml2'] = 0; + $ttJmlBeli['sepatu']['rp2'] = 0; + $ttJmlBeli['sepatu']['hp2'] = 0; + + print("
"); + print("

Laporan Penjualan Rugi Per Supplier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PADA TANGGAL : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $str = array(); + $jmlB = array(); + $rpB = array(); + $HP = array(); + $kdSupplier = array(); + $nmSupplier = array(); + + while(mysqli_stmt_fetch($stmt2)){ + if($jmlRetur == ''){ + $jmlRetur = 0; + } + if($rpRetur == ''){ + $rpRetur = 0; + } + if($kelJns == "P"){ + $kelJns = "Pria"; + $ttJmlBeli['pria']['jml2'] += $jmlBeli; + $ttJmlBeli['pria']['rp2'] += $rpBeli; + $ttJmlBeli['pria']['hp2'] += $hrgPokok; + $str[$pria]['pria'] = $strip; + $jmlB[$pria]['pria'] = $jmlBeli; + $rpB[$pria]['pria'] = $rpBeli; + $HP[$pria]['pria'] = $hrgPokok; + $kdSupplier[$pria]['pria'] = $kdSuppl; + $nmSupplier[$pria]['pria'] = $nmSuppl; + $pria++; + }elseif($kelJns == "W"){ + $kelJns = "Wanita"; + $ttJmlBeli['wanita']['jml2'] += $jmlBeli; + $ttJmlBeli['wanita']['rp2'] += $rpBeli; + $ttJmlBeli['wanita']['hp2'] += $hrgPokok; + $str[$wanita]['wanita'] = $strip; + $jmlB[$wanita]['wanita'] = $jmlBeli; + $rpB[$wanita]['wanita'] = $rpBeli; + $HP[$wanita]['wanita'] = $hrgPokok; + $kdSupplier[$wanita]['wanita'] = $kdSuppl; + $nmSupplier[$wanita]['wanita'] = $nmSuppl; + $wanita++; + }elseif($kelJns == "A"){ + $kelJns = "Anak"; + $ttJmlBeli['anak']['jml2'] += $jmlBeli; + $ttJmlBeli['anak']['rp2'] += $rpBeli; + $ttJmlBeli['anak']['hp2'] += $hrgPokok; + $str[$anak]['anak'] = $strip; + $jmlB[$anak]['anak'] = $jmlBeli; + $rpB[$anak]['anak'] = $rpBeli; + $HP[$anak]['anak'] = $hrgPokok; + $kdSupplier[$anak]['anak'] = $kdSuppl; + $nmSupplier[$anak]['anak'] = $nmSuppl; + $anak++; + }else{ + $kelJns = "Sepatu"; + $ttJmlBeli['sepatu']['jml2'] += $jmlBeli; + $ttJmlBeli['sepatu']['rp2'] += $rpBeli; + $ttJmlBeli['sepatu']['hp2'] += $hrgPokok; + $str[$sepatu]['sepatu'] = $strip; + $jmlB[$sepatu]['sepatu'] = $jmlBeli; + $rpB[$sepatu]['sepatu'] = $rpBeli; + $HP[$sepatu]['sepatu'] = $hrgPokok; + $kdSupplier[$sepatu]['sepatu'] = $kdSuppl; + $nmSupplier[$sepatu]['sepatu'] = $nmSuppl; + $sepatu++; + } + + } + print(""); + print(""); + print("
"); + +/* SEPATU -------------------------------------------------------------------------*/ + $jmlkatsepatu = $ttJmlBeli['sepatu']['jml2']; + $rpkatsepatu = $ttJmlBeli['sepatu']['rp2']; + $hpkatsepatu = $ttJmlBeli['sepatu']['hp2']; + + if($ttJmlBeli['sepatu']['jml2']!=0){ + print("
"); + for($i=0;$i<$sepatu;$i++){ + if ($str[$i-1]['sepatu']==$str[$i]['sepatu']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlahrugi4 = 0; + $temphprugi4 = 0; + $temprprugi4 = 0; + } + $tempjumlahrugi4 += $jmlB[$i]['sepatu']; + $temphprugi4 += $HP[$i]['sepatu']; + $temprprugi4 += $rpB[$i]['sepatu']; + } + print(""); + print(""); + } + + $ttjml = $jmlkatpria + $jmlkatwanita + $jmlkatanak + $jmlkatsepatu; + $ttrp = $rpkatpria + $rpkatwanita + $rpkatanak + $rpkatsepatu; + $tthp = $hpkatpria + $hpkatwanita + $hpkatanak + $hpkatsepatu; + + print(" + + + "); + print("
Lini ProdukKode Supp.Nama SupplierJml Jual RugiTotal Jual RugiTotal HP Rugi
".$str[$i]['sepatu'].".".$kdSupplier[$i]['sepatu']."".$nmSupplier[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($rpB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlahrugi4, 0, ",", ".")."".number_format($temprprugi4, 0, ",", ".")."".number_format($temphprugi4, 0, ",", ".")."
".$str[$i]['sepatu'].".".$kdSupplier[$i]['sepatu']."".$nmSupplier[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($rpB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlahrugi4, 0, ",", ".")."".number_format($temprprugi4, 0, ",", ".")."".number_format($temphprugi4, 0, ",", ".")."
".number_format($ttJmlBeli['sepatu']['jml2'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['rp2'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp2'], 0, ",", ".")."
T O T A L : ".number_format($ttjml, 0, ",", ".")."".number_format($ttrp, 0, ",", ".")."".number_format($tthp, 0, ",", ".")."

"); + }else{ + echo "Tidak ada data penjualan rugi untuk tanggal tersebut!"; + } + } + +/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ +if ($kdsupp!=""){ +$query3 = "select s.kel_jns,s.nama_strip,kode_supplier,nama_supplier,sum(juml) vol,sum(tot) totHJ,sum(hp) totHP + from ( + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, + sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_tunai d,m_nota_tunai m, barang b,supplier u + where d.no_nota = m.no_nota + AND d.kd_barang = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and u.kd_supplier = '$kdsupp' + and d.harga_pokok IS NOT NULL + and m.status_nota = 'S' + and d.diskon = 100 + and ((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) < (d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + UNION ALL + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,(-1*sum(jumlah)) juml, + (-1*sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100))) tot, + (-1*sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp + from d_nota_retur d,m_nota_retur m, barang b,supplier u + where d.no_nota = m.no_nota + AND d.kd_barang = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and u.kd_supplier = '$kdsupp' + and d.harga_pokok IS NOT NULL + and d.diskon = 100 + and ((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) < (d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + UNION ALL + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, + sum((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_bon d,m_bon m, barang b,supplier u + where d.no_bon = m.no_bon + AND d.kd_brg = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and u.kd_supplier = '$kdsupp' + and d.harga_pokok IS NOT NULL + and d.diskon = 100 + and ((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) < (d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) + and date(tgl_bon) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + ) vlini,strip s + where s.kd_strip = lini + group by s.kd_strip,kode_supplier + order by s.kd_strip,vol desc"; +}else{ +$query3 = "select s.kel_jns,s.nama_strip,kode_supplier,nama_supplier,sum(juml) vol,sum(tot) totHJ,sum(hp) totHP + from ( + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, + sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_tunai d,m_nota_tunai m, barang b,supplier u + where d.no_nota = m.no_nota + AND d.kd_barang = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and d.harga_pokok IS NOT NULL + and m.status_nota = 'S' + and d.diskon = 100 + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + UNION ALL + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,(-1*sum(jumlah)) juml, + (-1*sum((d.harga_jual * d.jumlah) - (d.harga_jual * d.jumlah * d.diskon / 100))) tot, + (-1*sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp + from d_nota_retur d,m_nota_retur m, barang b,supplier u + where d.no_nota = m.no_nota + AND d.kd_barang = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and d.harga_pokok IS NOT NULL + and d.diskon = 100 + and date(tgl_nota) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + UNION ALL + select b.kode_strip lini,b.kode_supplier, u.nama_supplier,sum(jumlah) juml, + sum((d.hrg_satuan * d.jumlah) - (d.hrg_satuan * d.jumlah * d.diskon / 100)) tot, + sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_bon d,m_bon m, barang b,supplier u + where d.no_bon = m.no_bon + AND d.kd_brg = b.kode_barang + AND b.kode_supplier = u.kd_supplier + and d.harga_pokok IS NOT NULL + and d.diskon = 100 + and date(tgl_bon) between '$startDate' and '$endDate' + group by b.kode_strip,b.kode_supplier + ) vlini,strip s + where s.kd_strip = lini + group by s.kd_strip,kode_supplier + order by s.kd_strip,vol desc"; +} + if($stmt3 = mysqli_prepare($conn,$query3)){ + mysqli_stmt_execute($stmt3); + mysqli_stmt_store_result($stmt3); + $cek3 = mysqli_stmt_num_rows($stmt3); + if($cek3 > 0){ + mysqli_stmt_bind_result($stmt3,$kelJns,$strip,$kdSuppl,$nmSuppl,$jmlBeli,$rpBeli,$hrgPokok); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml3'] = 0; + $ttJmlBeli['pria']['rp3'] = 0; + $ttJmlBeli['pria']['hp3'] = 0; + $ttJmlBeli['wanita']['jml3'] = 0; + $ttJmlBeli['wanita']['rp3'] = 0; + $ttJmlBeli['wanita']['hp3'] = 0; + $ttJmlBeli['anak']['jml3'] = 0; + $ttJmlBeli['anak']['rp3'] = 0; + $ttJmlBeli['anak']['hp3'] = 0; + $ttJmlBeli['sepatu']['jml3'] = 0; + $ttJmlBeli['sepatu']['rp3'] = 0; + $ttJmlBeli['sepatu']['hp3'] = 0; + + print("
"); + print("

Laporan Penjualan Diskon 100% Per Supplier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PADA TANGGAL : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $str = array(); + $jmlB = array(); + $rpB = array(); + $HP = array(); + $kdSupplier = array(); + $nmSupplier = array(); + + while(mysqli_stmt_fetch($stmt3)){ + if($jmlRetur == ''){ + $jmlRetur = 0; + } + if($rpRetur == ''){ + $rpRetur = 0; + } + if($kelJns == "P"){ + $kelJns = "Pria"; + $ttJmlBeli['pria']['jml3'] += $jmlBeli; + $ttJmlBeli['pria']['rp3'] += $rpBeli; + $ttJmlBeli['pria']['hp3'] += $hrgPokok; + $str[$pria]['pria'] = $strip; + $jmlB[$pria]['pria'] = $jmlBeli; + $rpB[$pria]['pria'] = $rpBeli; + $HP[$pria]['pria'] = $hrgPokok; + $kdSupplier[$pria]['pria'] = $kdSuppl; + $nmSupplier[$pria]['pria'] = $nmSuppl; + $pria++; + }elseif($kelJns == "W"){ + $kelJns = "Wanita"; + $ttJmlBeli['wanita']['jml3'] += $jmlBeli; + $ttJmlBeli['wanita']['rp3'] += $rpBeli; + $ttJmlBeli['wanita']['hp3'] += $hrgPokok; + $str[$wanita]['wanita'] = $strip; + $jmlB[$wanita]['wanita'] = $jmlBeli; + $rpB[$wanita]['wanita'] = $rpBeli; + $HP[$wanita]['wanita'] = $hrgPokok; + $kdSupplier[$wanita]['wanita'] = $kdSuppl; + $nmSupplier[$wanita]['wanita'] = $nmSuppl; + $wanita++; + }elseif($kelJns == "A"){ + $kelJns = "Anak"; + $ttJmlBeli['anak']['jml3'] += $jmlBeli; + $ttJmlBeli['anak']['rp3'] += $rpBeli; + $ttJmlBeli['anak']['hp3'] += $hrgPokok; + $str[$anak]['anak'] = $strip; + $jmlB[$anak]['anak'] = $jmlBeli; + $rpB[$anak]['anak'] = $rpBeli; + $HP[$anak]['anak'] = $hrgPokok; + $kdSupplier[$anak]['anak'] = $kdSuppl; + $nmSupplier[$anak]['anak'] = $nmSuppl; + $anak++; + }else{ + $kelJns = "Sepatu"; + $ttJmlBeli['sepatu']['jml3'] += $jmlBeli; + $ttJmlBeli['sepatu']['rp3'] += $rpBeli; + $ttJmlBeli['sepatu']['hp3'] += $hrgPokok; + $str[$sepatu]['sepatu'] = $strip; + $jmlB[$sepatu]['sepatu'] = $jmlBeli; + $rpB[$sepatu]['sepatu'] = $rpBeli; + $HP[$sepatu]['sepatu'] = $hrgPokok; + $kdSupplier[$sepatu]['sepatu'] = $kdSuppl; + $nmSupplier[$sepatu]['sepatu'] = $nmSuppl; + $sepatu++; + } + + } + print(""); + print(""); + print("
"); + +/* SEPATU -------------------------------------------------------------------------*/ + $jmlkatsepatu = $ttJmlBeli['sepatu']['jml3']; + $rpkatsepatu = $ttJmlBeli['sepatu']['rp3']; + $hpkatsepatu = $ttJmlBeli['sepatu']['hp3']; + + if($ttJmlBeli['sepatu']['jml3']!=0){ + print("
"); + for($i=0;$i<$sepatu;$i++){ + if ($str[$i-1]['sepatu']==$str[$i]['sepatu']){ + print(""); + }else{ + print(""); + print(""); + $tempjumlahrugi4 = 0; + $temphprugi4 = 0; + $temprprugi4 = 0; + } + $tempjumlahrugi4 += $jmlB[$i]['sepatu']; + $temphprugi4 += $HP[$i]['sepatu']; + $temprprugi4 += $rpB[$i]['sepatu']; + } + print(""); + print(""); + } + + $ttjml = $jmlkatpria + $jmlkatwanita + $jmlkatanak + $jmlkatsepatu; + $ttrp = $rpkatpria + $rpkatwanita + $rpkatanak + $rpkatsepatu; + $tthp = $hpkatpria + $hpkatwanita + $hpkatanak + $hpkatsepatu; + + print(" + + + "); + print("
Lini ProdukKode Supp.Nama SupplierJumlah JualTotal JualTotal HP Jual
".$str[$i]['sepatu'].".".$kdSupplier[$i]['sepatu']."".$nmSupplier[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($rpB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlahrugi4, 0, ",", ".")."".number_format($temprprugi4, 0, ",", ".")."".number_format($temphprugi4, 0, ",", ".")."
".$str[$i]['sepatu'].".".$kdSupplier[$i]['sepatu']."".$nmSupplier[$i]['sepatu']."".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($rpB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($tempjumlahrugi4, 0, ",", ".")."".number_format($temprprugi4, 0, ",", ".")."".number_format($temphprugi4, 0, ",", ".")."
".number_format($ttJmlBeli['sepatu']['jml3'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['rp3'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp3'], 0, ",", ".")."
T O T A L : ".number_format($ttjml, 0, ",", ".")."".number_format($ttrp, 0, ",", ".")."".number_format($tthp, 0, ",", ".")."

"); + }else{ + echo "Tidak ada data penjualan diskon 100% untuk tanggal tersebut!"; + } + } +} +?> diff --git a/old-source/LaporanJual/lapkomposisi.php b/old-source/LaporanJual/lapkomposisi.php new file mode 100644 index 0000000..5eef318 --- /dev/null +++ b/old-source/LaporanJual/lapkomposisi.php @@ -0,0 +1,386 @@ +"; + echo "table.tbl {width:80%;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}"; + echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}"; + echo "body {font-size:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + if(bukaKoneksi()){ + global $conn; + $query = "select vX.tgl,A,totA,B,totB,C,totC,D,totD,E,totE,F,totF,G,totG,H,totH + from + (SELECT date(tgl_nota) tgl,count(*) x,sum(jumlah_total) totx + FROM m_nota_tunai m + WHERE + date(tgl_nota) between '$startDate' AND '$endDate' + group by tgl)vX + LEFT OUTER JOIN + (SELECT date(tgl_nota) tgl,count(*) A,sum(jumlah_total) totA + FROM m_nota_tunai m + WHERE + m.status_nota = 'S' + and m.jumlah_total <= 100000 + and date(tgl_nota) between '$startDate' AND '$endDate' + group by tgl)vA + ON vX.tgl = vA.tgl + LEFT OUTER JOIN + (SELECT date(tgl_nota) tgl,count(*) B,sum(jumlah_total) totB + FROM m_nota_tunai m + WHERE + m.status_nota = 'S' + and m.jumlah_total >= 100001 and m.jumlah_total <= 200000 + and date(tgl_nota) between '$startDate' AND '$endDate' + group by tgl)vB + ON vX.tgl = vB.tgl + LEFT OUTER JOIN + (SELECT date(tgl_nota) tgl,count(*) C,sum(jumlah_total) totC + FROM m_nota_tunai m + WHERE + m.status_nota = 'S' + and m.jumlah_total >= 200001 and m.jumlah_total <= 300000 + and date(tgl_nota) between '$startDate' AND '$endDate' + group by tgl)vC + ON vX.tgl = vC.tgl + LEFT OUTER JOIN + (SELECT date(tgl_nota) tgl,count(*) D,sum(jumlah_total) totD + FROM m_nota_tunai m + WHERE + m.status_nota = 'S' + and m.jumlah_total >= 300001 and m.jumlah_total <= 400000 + and date(tgl_nota) between '$startDate' AND '$endDate' + group by tgl)vD + ON vX.tgl = vD.tgl + LEFT OUTER JOIN + (SELECT date(tgl_nota) tgl,count(*) E,sum(jumlah_total) totE + FROM m_nota_tunai m + WHERE + m.status_nota = 'S' + and m.jumlah_total >= 400001 and m.jumlah_total <= 500000 + and date(tgl_nota) between '$startDate' AND '$endDate' + group by tgl)vE + ON vX.tgl = vE.tgl + LEFT OUTER JOIN + (SELECT date(tgl_nota) tgl,count(*) F,sum(jumlah_total) totF + FROM m_nota_tunai m + WHERE + m.status_nota = 'S' + and m.jumlah_total >= 500001 and m.jumlah_total <= 600000 + and date(tgl_nota) between '$startDate' AND '$endDate' + group by tgl)vF + ON vX.tgl = vF.tgl + LEFT OUTER JOIN + (SELECT date(tgl_nota) tgl,count(*) G,sum(jumlah_total) totG + FROM m_nota_tunai m + WHERE + m.status_nota = 'S' + and m.jumlah_total >= 600001 and m.jumlah_total <= 1250000 + and date(tgl_nota) between '$startDate' AND '$endDate' + group by tgl)vG + ON vX.tgl = vG.tgl + LEFT OUTER JOIN + (SELECT date(tgl_nota) tgl,count(*) H,sum(jumlah_total) totH + FROM m_nota_tunai m + WHERE + m.status_nota = 'S' + and m.jumlah_total >= 1250001 + and date(tgl_nota) between '$startDate' AND '$endDate' + group by tgl)vH + ON vX.tgl = vH.tgl"; + $query2 = "select vX.tgl,A,totA,B,totB,C,totC,D,totD,E,totE,F,totF,G,totG,H,totH + from + (SELECT date(tgl_bon) tgl,count(*) x,sum(jumlah_total) totx + FROM m_bon m + WHERE + date(tgl_bon) between '$startDate' AND '$endDate' + group by tgl)vX + LEFT OUTER JOIN + (SELECT date(tgl_bon) tgl,count(*) A,sum(jumlah_total) totA + FROM m_bon m + WHERE + m.jumlah_total <= 100000 + and date(tgl_bon) between '$startDate' AND '$endDate' + group by tgl)vA + ON vX.tgl = vA.tgl + LEFT OUTER JOIN + (SELECT date(tgl_bon) tgl,count(*) B,sum(jumlah_total) totB + FROM m_bon m + WHERE + m.jumlah_total >= 100001 and m.jumlah_total <= 200000 + and date(tgl_bon) between '$startDate' AND '$endDate' + group by tgl)vB + ON vX.tgl = vB.tgl + LEFT OUTER JOIN + (SELECT date(tgl_bon) tgl,count(*) C,sum(jumlah_total) totC + FROM m_bon m + WHERE + m.jumlah_total >= 200001 and m.jumlah_total <= 300000 + and date(tgl_bon) between '$startDate' AND '$endDate' + group by tgl)vC + ON vX.tgl = vC.tgl + LEFT OUTER JOIN + (SELECT date(tgl_bon) tgl,count(*) D,sum(jumlah_total) totD + FROM m_bon m + WHERE + m.jumlah_total >= 300001 and m.jumlah_total <= 400000 + and date(tgl_bon) between '$startDate' AND '$endDate' + group by tgl)vD + ON vX.tgl = vD.tgl + LEFT OUTER JOIN + (SELECT date(tgl_bon) tgl,count(*) E,sum(jumlah_total) totE + FROM m_bon m + WHERE + m.jumlah_total >= 400001 and m.jumlah_total <= 500000 + and date(tgl_bon) between '$startDate' AND '$endDate' + group by tgl)vE + ON vX.tgl = vE.tgl + LEFT OUTER JOIN + (SELECT date(tgl_bon) tgl,count(*) F,sum(jumlah_total) totF + FROM m_bon m + WHERE + m.jumlah_total >= 500001 and m.jumlah_total <= 600000 + and date(tgl_bon) between '$startDate' AND '$endDate' + group by tgl)vF + ON vX.tgl = vF.tgl + LEFT OUTER JOIN + (SELECT date(tgl_bon) tgl,count(*) G,sum(jumlah_total) totG + FROM m_bon m + WHERE + m.jumlah_total >= 600001 and m.jumlah_total <= 1250000 + and date(tgl_bon) between '$startDate' AND '$endDate' + group by tgl)vG + ON vX.tgl = vG.tgl + LEFT OUTER JOIN + (SELECT date(tgl_bon) tgl,count(*) H,sum(jumlah_total) totH + FROM m_bon m + WHERE + m.jumlah_total >= 1250001 + and date(tgl_bon) between '$startDate' AND '$endDate' + group by tgl)vH + ON vX.tgl = vH.tgl"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tgl,$A,$totA,$B,$totB,$C,$totC,$D,$totD,$E,$totE,$F,$totF,$G,$totG,$H,$totH); + $ttJumlah = array(); + $ttJumlah['jmltunai'] = 0; + $ttJumlah['rptunai'] = 0; + + print("
"); + print("

Rekap Transaksi Per Komposisi Penjualan Tunai



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(" + + "); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['jmltunai'] += $A+$B+$C+$D+$E+$F+$G+$H; + $ttJumlah['rptunai'] += $totA+$totB+$totC+$totD+$totE+$totF+$totG+$totH; + print(""); + } + + print("
Tanggal<=100.000Rupiah100.001-200.000Rupiah200.001-300.000Rupiah300.001-400.000Rupiah400.001-500.000Rupiah500.001-600.000Rupiah600.001-1.250.000Rupiah>=1.250.001Rupiah
".encTgl($tgl)."$A".number_format($totA,0,',','.')."$B".number_format($totB,0,',','.')."$C".number_format($totC,0,',','.')."$D".number_format($totD,0,',','.')."$E".number_format($totE,0,',','.')."$F".number_format($totF,0,',','.')."$G".number_format($totG,0,',','.')."$H".number_format($totH,0,',','.')."

"); + print("
"); + + print(""); + print(""); + print("
Total Jumlah Transaksi : ".number_format($ttJumlah['jmltunai'],0,',','.')."
Total Rupiah Transaksi : ".number_format($ttJumlah['rptunai'],0,',','.')."
"); + }else{ + echo "Belum ada data transaksi tunai untuk tanggal tersebut!"; + } + } + $jmltunai = $ttJumlah['jmltunai']; + $rptunai = $ttJumlah['rptunai']; + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$tgl,$A,$totA,$B,$totB,$C,$totC,$D,$totD,$E,$totE,$F,$totF,$G,$totG,$H,$totH); + $ttJumlah = array(); + $ttJumlah['jmlbon'] = 0; + $ttJumlah['rpbon'] = 0; + + print("
"); + print("

Rekap Transaksi Per Komposisi Penjualan Bon



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(" + + "); + while(mysqli_stmt_fetch($stmt2)){ + $ttJumlah['jmlbon'] += $A+$B+$C+$D+$E+$F+$G+$H; + $ttJumlah['rpbon'] += $totA+$totB+$totC+$totD+$totE+$totF+$totG+$totH; + print(""); + } + + print("
Tanggal<=100.000Rupiah100.001-200.000Rupiah200.001-300.000Rupiah300.001-400.000Rupiah400.001-500.000Rupiah500.001-600.000Rupiah600.001-1.250.000Rupiah>=1.250.001Rupiah
".encTgl($tgl)."$A".number_format($totA,0,',','.')."$B".number_format($totB,0,',','.')."$C".number_format($totC,0,',','.')."$D".number_format($totD,0,',','.')."$E".number_format($totE,0,',','.')."$F".number_format($totF,0,',','.')."$G".number_format($totG,0,',','.')."$H".number_format($totH,0,',','.')."

"); + print("
"); + + print(""); + print(""); + print("
Total Jumlah Transaksi Bon: ".number_format($ttJumlah['jmlbon'],0,',','.')."
Total Rupiah Transaksi Bon: ".number_format($ttJumlah['rpbon'],0,',','.')."
"); + }else{ + echo "Belum ada data transaksi bon untuk tanggal tersebut!"; + } + } + $jmlbon = $ttJumlah['jmlbon']; + $rpbon = $ttJumlah['rpbon']; + + $totaljml = $jmltunai + $jmlbon; + $totalrp = $rptunai + $rpbon; + + print("
"); + print("_______________________________________________"); + print(""); + print(""); + print("
Total jumlah transaksi : ".number_format($totaljml,0,',','.')."
Total rupiah transaksi : ".number_format($totalrp,0,',','.')."
"); + +print("
"); + $query3 = "SELECT vX.kd_customer,vX.nama,A,totA,B,totB,C,totC,D,totD,E,totE,F,totF + FROM + (SELECT p.kd_customer,p.nama + FROM pelanggan p, m_nota_tunai m + WHERE + m.status_nota = 'S' + and p.kd_customer = m.kd_customer + and date(tgl_nota) between '$startDate' AND '$endDate' + group by p.kd_customer)vX + LEFT OUTER JOIN + (SELECT m.kd_customer,count(*) A,sum(jumlah_total) totA + FROM m_nota_tunai m + WHERE + m.status_nota = 'S' + and m.jumlah_total >= 200000 and m.jumlah_total <= 350000 + and date(tgl_nota) between '$startDate' AND '$endDate' + group by kd_customer)vA + ON vX.kd_customer = vA.kd_customer + LEFT OUTER JOIN + (SELECT m.kd_customer,count(*) B,sum(jumlah_total) totB + FROM m_nota_tunai m + WHERE + m.status_nota = 'S' + and m.jumlah_total > 350000 and m.jumlah_total <= 500000 + and date(tgl_nota) between '$startDate' AND '$endDate' + group by kd_customer)vB + ON vX.kd_customer = vB.kd_customer + LEFT OUTER JOIN + (SELECT m.kd_customer,count(*) C,sum(jumlah_total) totC + FROM m_nota_tunai m + WHERE + m.status_nota = 'S' + and m.jumlah_total > 500000 and m.jumlah_total <= 650000 + and date(tgl_nota) between '$startDate' AND '$endDate' + group by kd_customer)vC + ON vX.kd_customer = vC.kd_customer + LEFT OUTER JOIN + (SELECT m.kd_customer,count(*) D,sum(jumlah_total) totD + FROM m_nota_tunai m + WHERE + m.status_nota = 'S' + and m.jumlah_total > 650000 and m.jumlah_total <= 800000 + and date(tgl_nota) between '$startDate' AND '$endDate' + group by kd_customer)vD + ON vX.kd_customer = vD.kd_customer + LEFT OUTER JOIN + (SELECT m.kd_customer,count(*) E,sum(jumlah_total) totE + FROM m_nota_tunai m + WHERE + m.status_nota = 'S' + and m.jumlah_total > 800000 and m.jumlah_total <= 950000 + and date(tgl_nota) between '$startDate' AND '$endDate' + group by kd_customer)vE + ON vX.kd_customer = vE.kd_customer + LEFT OUTER JOIN + (SELECT m.kd_customer,count(*) F,sum(jumlah_total) totF + FROM m_nota_tunai m + WHERE + m.status_nota = 'S' + and m.jumlah_total > 950000 + and date(tgl_nota) between '$startDate' AND '$endDate' + group by kd_customer)vF + ON vX.kd_customer = vF.kd_customer + WHERE A is not NULL OR B is not NULL OR C is not NULL OR D is not NULL OR E is not NULL OR F is not NULL"; + + if($stmt3 = mysqli_prepare($conn,$query3)){ + mysqli_stmt_execute($stmt3); + mysqli_stmt_store_result($stmt3); + $cek3 = mysqli_stmt_num_rows($stmt3); + if($cek3 > 0){ + mysqli_stmt_bind_result($stmt3,$kd_customer,$nama,$A,$totA,$B,$totB,$C,$totC,$D,$totD,$E,$totE,$F,$totF); + $ttJumlah = array(); + $ttJumlah['jmlbon'] = 0; + $ttJumlah['rpbon'] = 0; + + print("
"); + print("

Rekap POINT PELANGGAN



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(" + + + + + + + + "); + while(mysqli_stmt_fetch($stmt3)){ + $ttJumlah['jumlah'] += $A+$B+$C+$D+$E+$F; + $ttJumlah['rupiah'] += $totA+$totB+$totC+$totD+$totE+$totF; + $pointA = $A*2; + $pointB = $B*4; + $pointC = $C*7; + $pointD = $D*10; + $pointE = $E*15; + $pointF = $F*25; + $ttJumlahPoint = $pointA+$pointB+$pointC+$pointD+$pointE+$pointF; + + print(" + + + + + + + "); + } + + print("
Kd PlgNama200.000-350.000RupiahPoint A350.001-500.000RupiahPoint B500.001-650.000RupiahPoint C650.001-800.000RupiahPoint D800.001-950.000RupiahPoint E>950.000RupiahPoint FTOTAL POINT
$kd_customer$nama$A".number_format($totA,0,',','.')."$pointA$B".number_format($totB,0,',','.')."$pointB$C".number_format($totC,0,',','.')."$pointC$D".number_format($totD,0,',','.')."$pointD$E".number_format($totE,0,',','.')."$pointE$F".number_format($totF,0,',','.')."$pointF$ttJumlahPoint

"); + print("
"); + + print(""); + print(""); + print("
Total Jumlah Transaksi: ".number_format($ttJumlah['jumlah'],0,',','.')."
Total Rupiah Transaksi: ".number_format($ttJumlah['rupiah'],0,',','.')."
"); + }else{ + echo "Belum ada data transaksi untuk tanggal tersebut!"; + } + } + + } +?> diff --git a/old-source/LaporanJual/lappk8.php b/old-source/LaporanJual/lappk8.php new file mode 100644 index 0000000..3abe00a --- /dev/null +++ b/old-source/LaporanJual/lappk8.php @@ -0,0 +1,138 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $th1 = substr($startDate,0,4) - 1; + $bulan1 = substr($startDate,5,2); + $tgl1 = substr($startDate,8,2); + $th2 = substr($endDate,0,4) - 1; + $bulan2 = substr($endDate,5,2); + $tgl2 = substr($endDate,8,2); + + $startlalu = $th1."-".$bulan1."-".$tgl1; + $endlalu = $th2."-".$bulan2."-".$tgl2; + + + if(bukaKoneksi()){ + global $conn; + $query = "select tempskrg.tanggal,tempskrg.Skrg bulanIni,templalu.Lalu bulanLalu + from + + (select tanggal,sum(vskrg.total) Skrg + from (select date(m.tgl_nota) tanggal,sum(m.jumlah_total) TOTAL + FROM m_nota_tunai m + where m.status_bayar = 'T' + and m.status_nota = 'S' + and m.no_nota_retur = '' + and date(m.tgl_nota) BETWEEN '$startDate' and '$endDate' + group by date(m.tgl_nota) + UNION ALL + select date(m.tgl_nota) tanggal,sum(jumlah_total-jumlah_total_retur) TOTAL + from m_nota_tunai m + where m.status_bayar = 'T' + and m.no_nota_retur != '' + and m.status_nota = 'S' + and date(m.tgl_nota) BETWEEN '$startDate' and '$endDate' + group by date(m.tgl_nota) + UNION ALL + select date(m.tgl_nota) tanggal,sum(-1*m.jumlah_total) TOTAL + from m_nota_retur m + where m.status_nota = 'D' + and date(m.tgl_nota) BETWEEN '$startDate' and '$endDate' + group by date(m.tgl_nota) + UNION ALL + select date(t.tgl_byr) tanggal,sum(t.bayar_bon) total + from bayar_bon t + where date(t.tgl_byr) between '$startDate' and '$endDate' + group by date(t.tgl_byr) + )vskrg group by tanggal)tempskrg + LEFT JOIN + (select tanggal,sum(vskrg.total) Lalu + from (select date(m.tgl_nota) tanggal,sum(m.jumlah_total) TOTAL + FROM m_nota_tunai m + where m.status_bayar = 'T' + and m.status_nota = 'S' + and m.no_nota_retur = '' + and date(m.tgl_nota) BETWEEN '$startlalu' and '$endlalu' + group by date(m.tgl_nota) + UNION ALL + select date(m.tgl_nota) tanggal,sum(jumlah_total-jumlah_total_retur) TOTAL + from m_nota_tunai m + where m.status_bayar = 'T' + and m.no_nota_retur != '' + and m.status_nota = 'S' + and date(m.tgl_nota) BETWEEN '$startlalu' and '$endlalu' + group by date(m.tgl_nota) + UNION ALL + select date(m.tgl_nota) tanggal,sum(-1*m.jumlah_total) TOTAL + from m_nota_retur m + where m.status_nota = 'D' + and date(m.tgl_nota) BETWEEN '$startlalu' and '$endlalu' + group by date(m.tgl_nota) + UNION ALL + select date(t.tgl_byr) tanggal,sum(t.bayar_bon) total + from bayar_bon t + where date(t.tgl_byr) between '$startlalu' and '$endlalu' + group by date(t.tgl_byr) + )vskrg group by tanggal)templalu + on day(tempskrg.tanggal)=day(templalu.tanggal)"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tgl,$sekarang,$lalu); + $ttJumlah = array(); + $ttJumlah['jml1'] = 0; + $ttJumlah['jml2'] = 0; + + print("
"); + print("

Rekap Transaksi Penjualan Perbandingan Tahun Lalu



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['jml1'] += $sekarang; + $ttJumlah['jml2'] += $lalu; + if ($lalu == 0) { + $peningkatan = 100; + }else{ + $peningkatan = ($sekarang - $lalu)/$lalu*100; + } + print(""); + } + + print("
TanggalLaluSekarangPeningkatan (%)
".encTgl($tgl)."".number_format($lalu,0,',','.')."".number_format($sekarang,0,',','.')."".number_format($peningkatan,2)."

"); + print("
"); + print(""); + print(""); + print("
Total Penjualan Periode Tahun Lalu : ".number_format($ttJumlah['jml2'],0,',','.')."
Total Penjualan Periode Tahun Sekarang : ".number_format($ttJumlah['jml1'],0,',','.')."
"); + }else{ + echo "Belum ada data transaksi untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanJual/lapstok.php b/old-source/LaporanJual/lapstok.php new file mode 100644 index 0000000..13e9e23 --- /dev/null +++ b/old-source/LaporanJual/lapstok.php @@ -0,0 +1,298 @@ +"; + echo "div#divprint{width:780px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:450px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ".master{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + + if(bukaKoneksi()){ + global $conn; + + $query = "SELECT s.kd_strip,s.nama_strip,k.ked_produk,sum(n.stok) jumlah, + SUM(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok) + totalHP + FROM barang b,no_barang n,strip s,kedalaman_produk k + WHERE n.stok>0 + and b.id_gabungan = n.id_gabungan + and s.kd_strip = b.kode_strip + and (b.kode_strip = k.kode_strip and b.ked_produk = k.kode_ked_produk) + GROUP BY b.kode_strip,b.ked_produk"; + + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kelJns,$strip,$subprod,$jmlBeli,$hrgPokok); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['rp'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['rp'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['rp'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['rp'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + + print("
"); + print("

Laporan Persediaan Barang Per Kelompok Kategori



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $kdstr = array(); + $str = array(); + $subprod = array(); + $jmlB = array(); + $rpB = array(); + $HP = array(); + + while(mysqli_stmt_fetch($stmt)){ + + $kdstr[$sepatu]['sepatu'] = $kelJns; + $ttJmlBeli['sepatu']['jml'] += $jmlBeli; + $ttJmlBeli['sepatu']['hp'] += $hrgPokok; + $str[$sepatu]['sepatu'] = $strip; + $sub[$sepatu]['sepatu'] = $subprod; + $jmlB[$sepatu]['sepatu'] = $jmlBeli; + $HP[$sepatu]['sepatu'] = $hrgPokok; + $sepatu++; + + + } + print(""); + print(""); + print("
"); + +/* SEPATU -------------------------------------------------------------------------*/ + if($ttJmlBeli['sepatu']['jml']!=0){ + print("
"); + $adaR = false; + for($i=0;$i<$sepatu;$i++){ + if(!$adaR){ + print(""); + } + } + print(""); + } + + print("
Kd. Lini ProdukLini ProdukKedalaman ProdukJumlah BarangTotal HP
".$kdstr[$i]['sepatu']."".$str[$i]['sepatu']."".$sub[$i]['sepatu']." ".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($ttJmlBeli['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp'], 0, ",", ".")."

"); + print("
"); + $ttJml = $ttJmlBeli['pria']['jml'] + $ttJmlBeli['wanita']['jml'] + $ttJmlBeli['anak']['jml'] + $ttJmlBeli['sepatu']['jml']; + $ttRp = $ttJmlBeli['pria']['hp'] + $ttJmlBeli['wanita']['hp'] + $ttJmlBeli['anak']['hp'] + $ttJmlBeli['sepatu']['hp']; + print(""); + print(""); + print("
Total Jumlah Barang : ".number_format($ttJml,0,',','.')."
Total Persediaan : ".number_format($ttRp,0,',','.')."
"); + }else{ + echo "Belum ada data untuk tanggal tersebut!"; + } + } + + $query3 = "SELECT s.kd_strip,s.nama_strip,k.ked_produk,sum(n.stok) jumlah, + SUM(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok) + totalHP + from barang b,no_barang n,strip s,kedalaman_produk k + WHERE n.stok<0 + and b.id_gabungan = n.id_gabungan + and s.kd_strip = b.kode_strip + and (b.kode_strip = k.kode_strip and b.ked_produk = k.kode_ked_produk) + GROUP BY b.kode_strip,b.ked_produk"; + + + if($stmt3 = mysqli_prepare($conn,$query3)){ + mysqli_stmt_execute($stmt3); + mysqli_stmt_store_result($stmt3); + $cek3 = mysqli_stmt_num_rows($stmt3); + if($cek3 > 0){ + mysqli_stmt_bind_result($stmt3,$kelJns,$strip,$subprod,$jmlBeli,$hrgPokok); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['rp'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['rp'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['rp'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['rp'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + + print("
"); + print("

Laporan Kontrol Persediaan Barang Minus Per Kelompok Kategori



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $kdstr = array(); + $str = array(); + $sub = array(); + $jmlB = array(); + $rpB = array(); + $HP = array(); + + while(mysqli_stmt_fetch($stmt3)){ + + $kdstr[$sepatu]['sepatu'] = $kelJns; + $ttJmlBeli['sepatu']['jml'] += $jmlBeli; + $ttJmlBeli['sepatu']['hp'] += $hrgPokok; + $str[$sepatu]['sepatu'] = $strip; + $sub[$sepatu]['sepatu'] = $subprod; + $jmlB[$sepatu]['sepatu'] = $jmlBeli; + $HP[$sepatu]['sepatu'] = $hrgPokok; + $sepatu++; + + } + print(""); + print(""); + print("
"); + + +/* SEPATU -------------------------------------------------------------------------*/ + if($ttJmlBeli['sepatu']['jml']!=0){ + print("
"); + $adaR = false; + for($i=0;$i<$sepatu;$i++){ + if(!$adaR){ + print(""); + } + } + print(""); + } + + print("
Kd. Lini ProdukLini ProdukKedalaman ProdukJumlah BarangTotal HP
".$kdstr[$i]['sepatu']."".$str[$i]['sepatu']."".$sub[$i]['sepatu']." ".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($ttJmlBeli['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp'], 0, ",", ".")."

"); + print("
"); + $ttJml = $ttJmlBeli['pria']['jml'] + $ttJmlBeli['wanita']['jml'] + $ttJmlBeli['anak']['jml'] + $ttJmlBeli['sepatu']['jml']; + $ttRp = $ttJmlBeli['pria']['hp'] + $ttJmlBeli['wanita']['hp'] + $ttJmlBeli['anak']['hp'] + $ttJmlBeli['sepatu']['hp']; + print(""); + print(""); + print("
Total Jumlah Barang : ".number_format($ttJml,0,',','.')."
Total Persediaan : ".number_format($ttRp,0,',','.')."
"); + }else{ + echo "Tidak ada data stok minus untuk tanggal tersebut!"; + } + } + + $query2 = "select tKonsy.kd_strip,tKonsy.nama_strip,tKonsy.ked_produk,sum(tKonsy.stok),sum(tKonsy.totalHP) + FROM + (select s.kd_strip,s.nama_strip,k.ked_produk,n.stok, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP + from barang b,no_barang n,strip s,m_pembelian m,d_pembelian d, kedalaman_produk k + where n.stok>0 + AND b.id_gabungan = n.id_gabungan + AND s.kd_strip = b.kode_strip + and (b.kode_strip = k.kode_strip and b.ked_produk = k.kode_ked_produk) + AND m.no_faktur = d.no_faktur + AND (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + AND m.validasi = '1' + AND m.status = 'K' + group by b.id_gabungan) tKonsy + GROUP BY tKonsy.kd_strip,tKonsy.ked_produk"; + + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$kelJns,$strip,$subprod,$jmlBeli,$hrgPokok); + $ttJmlBeli = array(); + $ttJmlBeli['pria']['jml'] = 0; + $ttJmlBeli['pria']['rp'] = 0; + $ttJmlBeli['pria']['hp'] = 0; + $ttJmlBeli['wanita']['jml'] = 0; + $ttJmlBeli['wanita']['rp'] = 0; + $ttJmlBeli['wanita']['hp'] = 0; + $ttJmlBeli['anak']['jml'] = 0; + $ttJmlBeli['anak']['rp'] = 0; + $ttJmlBeli['anak']['hp'] = 0; + $ttJmlBeli['sepatu']['jml'] = 0; + $ttJmlBeli['sepatu']['rp'] = 0; + $ttJmlBeli['sepatu']['hp'] = 0; + + print("
"); + print("

Laporan Persediaan Barang Konsinyasi Per Kelompok Kategori



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + $pria = 0; + $wanita = 0; + $anak = 0; + $sepatu = 0; + $kdstr = array(); + $str = array(); + $sub = array(); + $jmlB = array(); + $rpB = array(); + $HP = array(); + + while(mysqli_stmt_fetch($stmt2)){ + + $kdstr[$sepatu]['sepatu'] = $kelJns; + $ttJmlBeli['sepatu']['jml'] += $jmlBeli; + $ttJmlBeli['sepatu']['hp'] += $hrgPokok; + $str[$sepatu]['sepatu'] = $strip; + $sub[$sepatu]['sepatu'] = $subprod; + $jmlB[$sepatu]['sepatu'] = $jmlBeli; + $HP[$sepatu]['sepatu'] = $hrgPokok; + $sepatu++; + + } + print(""); + print(""); + print("
"); + + +/* SEPATU -------------------------------------------------------------------------*/ + if($ttJmlBeli['sepatu']['jml']!=0){ + print("
"); + $adaR = false; + for($i=0;$i<$sepatu;$i++){ + if(!$adaR){ + print(""); + } + } + print(""); + } + + print("
Kd. Lini ProdukLini ProdukKedalaman ProdukJumlah BarangTotal HP
".$kdstr[$i]['sepatu']."".$str[$i]['sepatu']."".$sub[$i]['sepatu']." ".number_format($jmlB[$i]['sepatu'], 0, ",", ".")."".number_format($HP[$i]['sepatu'], 0, ",", ".")."
".number_format($ttJmlBeli['sepatu']['jml'], 0, ",", ".")."".number_format($ttJmlBeli['sepatu']['hp'], 0, ",", ".")."

"); + print("
"); + $ttJml = $ttJmlBeli['pria']['jml'] + $ttJmlBeli['wanita']['jml'] + $ttJmlBeli['anak']['jml'] + $ttJmlBeli['sepatu']['jml']; + $ttRp = $ttJmlBeli['pria']['hp'] + $ttJmlBeli['wanita']['hp'] + $ttJmlBeli['anak']['hp'] + $ttJmlBeli['sepatu']['hp']; + print(""); + print(""); + print("
Total Jumlah Barang : ".number_format($ttJml,0,',','.')."
Total Persediaan : ".number_format($ttRp,0,',','.')."
"); + }else{ + echo "Belum ada data konsinyasi untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanJual/lapstokps1c.php b/old-source/LaporanJual/lapstokps1c.php new file mode 100644 index 0000000..74c2d3c --- /dev/null +++ b/old-source/LaporanJual/lapstokps1c.php @@ -0,0 +1,222 @@ +"; + echo "div#divprint{width:1280px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:1180px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:50px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = $_POST['kdsupp']; + $endDate = $_POST['endDate']; + + + if(bukaKoneksi()){ + global $conn; + IF ($startDate != '' && $endDate != ''){ + + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,k.ked_produk,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ + FROM barang b,no_barang n, d_pembelian d, kedalaman_produk k + WHERE n.stok < 0 + and b.id_gabungan = n.id_gabungan + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and (b.ked_produk = k.kode_ked_produk and b.kode_strip = k.kode_strip) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_supplier = '$startDate' + and b.kode_strip = '$endDate' + GROUP BY b.id_gabungan + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + }elseif ($startDate == '' && $endDate != ''){ + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,k.ked_produk,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ + FROM barang b,no_barang n, d_pembelian d, kedalaman_produk k + WHERE n.stok < 0 + and b.id_gabungan = n.id_gabungan + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and (b.ked_produk = k.kode_ked_produk and b.kode_strip = k.kode_strip) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_strip = '$endDate' + GROUP BY b.id_gabungan + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + }else { + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,k.ked_produk,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ + FROM barang b,no_barang n, d_pembelian d, kedalaman_produk k + WHERE n.stok < 0 + and b.id_gabungan = n.id_gabungan + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and (b.ked_produk = k.kode_ked_produk and b.kode_strip = k.kode_strip) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_supplier = '$startDate' + GROUP BY b.id_gabungan + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + + } + $querysupp = "select nama_supplier from supplier where kd_supplier = '$startDate' "; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tahun,$bln,$strip,$kdasli,$kedproduk,$nofaktur,$kdbrg,$nmbrg,$nomor,$akhir,$pokok,$hp,$jual,$hj); + $ttJumlah = array(); + $ttJumlah['jml'] = 0; + $ttJumlah['hp'] = 0; + + print("
"); + print("

Laporan Barang Minus Per Supplier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."

"); + if($stmtsupp = mysqli_prepare($conn,$querysupp)){ + mysqli_stmt_execute($stmtsupp); + mysqli_stmt_store_result($stmtsupp); + $ceksupp = mysqli_stmt_num_rows($stmtsupp); + if($ceksupp > 0){ + mysqli_stmt_bind_result($stmtsupp,$nama); + while(mysqli_stmt_fetch($stmtsupp)){ + print("Supplier : $nama


"); + } + } + } + print(""); + print("<"); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['jml'] += $akhir; + $ttJumlah['hp'] += $hp; + print(""); + } + + print("
TahunBulanLini Prod.Ked Prod.Kode AsliKode BarangNama BarangNomor Brg.Stok AkhirHPHJTot.HPTot.HJ
$tahun$bln$strip$kedproduk$kdasli$kdbrg$nmbrg$nomor$akhir".number_format($pokok,0,',','.')."".number_format($jual,0,',','.')."".number_format($hp,0,',','.')."".number_format($hj,0,',','.')."

"); + print("
"); + + print(""); + print(""); + + print("
Total Jumlah Barang : ".number_format($ttJumlah['jml'],0,',','.')."
Total Persediaan : ".number_format($ttJumlah['hp'],0,',','.')."
"); + }else{ + echo ""; + } + } + + + IF ($startDate != '' && $endDate != ''){ + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,k.ked_produk,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ, m.status + FROM barang b,no_barang n, d_pembelian d, m_pembelian m, kedalaman_produk k + WHERE n.stok > 0 + and b.id_gabungan = n.id_gabungan + and m.no_faktur = d.no_faktur + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and (b.ked_produk = k.kode_ked_produk and b.kode_strip = k.kode_strip) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_supplier = '$startDate' + and b.kode_strip = '$endDate' + GROUP BY b.id_gabungan + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + }elseif ($startDate == '' && $endDate != ''){ + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,k.ked_produk,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ, m.status + FROM barang b,no_barang n, d_pembelian d, m_pembelian m, kedalaman_produk k + WHERE n.stok > 0 + and b.id_gabungan = n.id_gabungan + and m.no_faktur = d.no_faktur + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and (b.ked_produk = k.kode_ked_produk and b.kode_strip = k.kode_strip) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_strip = '$endDate' + GROUP BY b.id_gabungan + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + }else { + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,k.ked_produk,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ, m.status + FROM barang b,no_barang n, d_pembelian d, m_pembelian m, kedalaman_produk k + WHERE n.stok > 0 + and b.id_gabungan = n.id_gabungan + and m.no_faktur = d.no_faktur + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and (b.ked_produk = k.kode_ked_produk and b.kode_strip = k.kode_strip) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_supplier = '$startDate' + GROUP BY b.id_gabungan + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + + } + $querysupp = "select nama_supplier from supplier where kd_supplier = '$startDate' "; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tahun,$bln,$strip,$kdasli,$kedproduk,$nofaktur,$kdbrg,$nmbrg,$nomor,$akhir,$pokok,$hp,$jual,$hj,$status); + $ttJumlah = array(); + $ttJumlah['jml'] = 0; + $ttJumlah['hp'] = 0; + + print("
"); + print("

Laporan Persediaan Barang Per Supplier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."

"); + if($stmtsupp = mysqli_prepare($conn,$querysupp)){ + mysqli_stmt_execute($stmtsupp); + mysqli_stmt_store_result($stmtsupp); + $ceksupp = mysqli_stmt_num_rows($stmtsupp); + if($ceksupp > 0){ + mysqli_stmt_bind_result($stmtsupp,$nama); + while(mysqli_stmt_fetch($stmtsupp)){ + print("Supplier : $nama


"); + } + } + } + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['jml'] += $akhir; + $ttJumlah['hp'] += $hp; + print(" + + + "); + } + + print("
TahunBulanLini Prod.Ked Prod.Kode AsliKode BarangNama BarangNomor Brg.Stok AkhirHPHJTot.HPTot.HJStatus Brg
$tahun$bln$strip$kedproduk$kdasli$kdbrg$nmbrg$nomor$akhir".number_format($pokok,0,',','.')."".number_format($jual,0,',','.')."".number_format($hp,0,',','.')."".number_format($hj,0,',','.')."$status

"); + print("
"); + + print(""); + print(""); + + print("
Total Jumlah Barang : ".number_format($ttJumlah['jml'],0,',','.')."
Total Persediaan : ".number_format($ttJumlah['hp'],0,',','.')."
"); + }else{ + echo "Data tidak ada!"; + } + } + } +?> diff --git a/old-source/LaporanJual/lapstokps1c.php~ b/old-source/LaporanJual/lapstokps1c.php~ new file mode 100644 index 0000000..4170f2a --- /dev/null +++ b/old-source/LaporanJual/lapstokps1c.php~ @@ -0,0 +1,116 @@ +"; + echo "div#divprint{width:1024px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:950px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:80px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = $_POST['kdsupp']; + $endDate = $_POST['endDate']; + + + if(bukaKoneksi()){ + global $conn; + IF ($startDate != '' && $endDate != ''){ + + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ + FROM barang b,no_barang n, d_pembelian d + WHERE n.stok <> 0 + and b.id_gabungan = n.id_gabungan + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_supplier = '$startDate' + and b.kode_strip = '$endDate' + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + }elseif ($startDate == '' && $endDate != ''){ + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ + FROM barang b,no_barang n, d_pembelian d + WHERE n.stok <> 0 + and b.id_gabungan = n.id_gabungan + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_strip = '$endDate' + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + }else { + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ + FROM barang b,no_barang n, d_pembelian d + WHERE n.stok <> 0 + and b.id_gabungan = n.id_gabungan + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_supplier = '$startDate' + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + + } + $querysupp = "select nama_supplier from supplier where kd_supplier = '$startDate' "; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tahun,$bln,$strip,$kdasli,$nofaktur,$kdbrg,$nmbrg,$nomor,$akhir,$pokok,$hp,$jual,$hj); + $ttJumlah = array(); + $ttJumlah['jml'] = 0; + $ttJumlah['hp'] = 0; + + print("
"); + print("

Laporan Persediaan Barang Per Supplier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."

"); + if($stmtsupp = mysqli_prepare($conn,$querysupp)){ + mysqli_stmt_execute($stmtsupp); + mysqli_stmt_store_result($stmtsupp); + $ceksupp = mysqli_stmt_num_rows($stmtsupp); + if($ceksupp > 0){ + mysqli_stmt_bind_result($stmtsupp,$nama); + while(mysqli_stmt_fetch($stmtsupp)){ + print("Supplier : $nama


"); + } + } + } + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['jml'] += $akhir; + $ttJumlah['hp'] += $hp; + print(""); + } + + print("
TahunBulanLini Prod.Kode AsliNo.FakturKode BarangNama BarangNomor Brg.Stok AkhirHPHJTot.HPTot.HJ
$tahun$bln$strip$kdasli$nofaktur$kdbrg$nmbrg$nomor$akhir".number_format($pokok,0,',','.')."".number_format($jual,0,',','.')."".number_format($hp,0,',','.')."".number_format($hj,0,',','.')."

"); + print("
"); + + print(""); + print(""); + + print("
Total Jumlah Barang : ".number_format($ttJumlah['jml'],0,',','.')."
Total Persediaan : ".number_format($ttJumlah['hp'],0,',','.')."
"); + }else{ + echo "Ada kolom yang kosong!"; + } + } + } +?> diff --git a/old-source/LaporanJual/laptransbrg.php b/old-source/LaporanJual/laptransbrg.php new file mode 100644 index 0000000..f8bf010 --- /dev/null +++ b/old-source/LaporanJual/laptransbrg.php @@ -0,0 +1,110 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + + if(bukaKoneksi()){ + global $conn; + $query = "SELECT m.faktur_oper,m.`tgl_transfer`, m.`toko_tujuan`,d.jml,m.total_transfer + FROM m_transfer m,(select id_transfer,sum(jumlah) jml from d_transfer group by id_transfer) as d + where m.id_transfer = d.id_transfer + and date(m.tgl_transfer) between '$startDate' and '$endDate' + and m.validasi = '1'"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$id,$tgl,$toko,$jum,$tot); + $ttJumlah = array(); + $ttJumlah['jml'] = 0; + $ttJumlah['rp'] = 0; + + print("
"); + print("

Laporan Transfer Barang Antar Toko



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['jml'] += $jum; + $ttJumlah['rp'] += $tot; + print(""); + } + + print("
No.FakturTgl TransferToko TujuanJumlah Brg.Total
$id".encTgl($tgl)."$toko$jum".number_format($tot,0,',','.')."

"); + print("
"); + + print(""); + print(""); + + print("
Total Jumlah Transfer : ".number_format($ttJumlah['jml'],0,',','.')."
Total Rp Transfer : ".number_format($ttJumlah['rp'],0,',','.')."
"); + }else{ + echo "Belum ada data transfer untuk tanggal tersebut!"; + } + } + + //laporan transfer barang kembali + $query = "SELECT m.faktur_oper,m.`tgl_kembali`, m.`toko_tujuan`,m.jml_item,m.total_transfer + FROM m_transfer_kembali m + where date(m.tgl_kembali) between '$startDate' and '$endDate' + and m.validasi = '1'"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$id,$tgl,$toko,$jum,$tot); + $ttJumlah = array(); + $ttJumlah['jml'] = 0; + $ttJumlah['rp'] = 0; + + print("
"); + print("

Laporan Transfer Barang Kembali



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['jml'] += $jum; + $ttJumlah['rp'] += $tot; + print(""); + } + + print("
No.FakturTgl KembaliToko PengirimJumlah Brg.Total
$id".encTgl($tgl)."$toko$jum".number_format($tot,0,',','.')."

"); + print("
"); + + print(""); + print(""); + + print("
Total Jumlah Transfer Kembali : ".number_format($ttJumlah['jml'],0,',','.')."
Total Rp Transfer Kembali : ".number_format($ttJumlah['rp'],0,',','.')."
"); + }else{ + echo "Belum ada data transfer kembali untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/LaporanJual/menu.php b/old-source/LaporanJual/menu.php new file mode 100644 index 0000000..3854d62 --- /dev/null +++ b/old-source/LaporanJual/menu.php @@ -0,0 +1,129 @@ + + + + + +
+ +
diff --git a/old-source/LaporanJual/pk8.php b/old-source/LaporanJual/pk8.php new file mode 100644 index 0000000..3a71c78 --- /dev/null +++ b/old-source/LaporanJual/pk8.php @@ -0,0 +1,81 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Rekap Penjualan Perbandingan Tahun Lalu +
+
+
+ + + +
Range Tanggal: s/d
+
+
+
+
+ +
+ + diff --git a/old-source/LaporanJual/prosesbawa.php b/old-source/LaporanJual/prosesbawa.php new file mode 100644 index 0000000..5e0818b --- /dev/null +++ b/old-source/LaporanJual/prosesbawa.php @@ -0,0 +1,130 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Rekap Bawa Belum Diproses +
+ + + +
+
+
+ + + +
Rentang Tanggal: -
Kode Pelanggan :
+
+
+
+
+
+ + + +
Rentang Tanggal: -
Kode Pelanggan :
+
+
+
+
+
+ + + +
Rentang Tanggal: -
Kode Pelanggan :
+
+
+
+ +
+
+ +
+
Cari Pelanggan
+
+
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+
+ +
+ +
+ + diff --git a/old-source/LaporanJual/rekapbawa.php b/old-source/LaporanJual/rekapbawa.php new file mode 100644 index 0000000..99f18de --- /dev/null +++ b/old-source/LaporanJual/rekapbawa.php @@ -0,0 +1,88 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $kodeplg = $_POST['kdplg']; + + if(bukaKoneksi()){ + global $conn; + IF (strlen($startDate) > 2 && strlen($endDate) > 2 && $kodeplg !=''){ + $query = "select m.no_nota, m.tgl_nota, m.kd_customer,p.nama, p.upline,m.jumlah_total, k.nama kasir + from m_nota_bawa m, karyawan k ,pelanggan p + where m.status_nota = 'S' + and m.kd_customer = p.kd_customer + and k.nik = m.kasir + and date(m.tgl_nota) BETWEEN '$startDate' and '$endDate' + and m.kd_customer = '$kodeplg' + order by m.tgl_nota,m.no_nota"; + }elseif ($startDate != '' && $endDate != '' && $kodeplg =='' ){ + $query = "select m.no_nota, m.tgl_nota, m.kd_customer,p.nama, p.upline,m.jumlah_total, k.nama kasir + from m_nota_bawa m, karyawan k ,pelanggan p + where m.status_nota = 'S' + and m.kd_customer = p.kd_customer + and k.nik = m.kasir + and date(m.tgl_nota) BETWEEN '$startDate' and '$endDate' + order by m.tgl_nota,m.no_nota"; + }elseif (strlen($startDate) <= 2 && strlen($endDate) <= 2 && $kodeplg !='') { + $query = "select m.no_nota, m.tgl_nota, m.kd_customer,p.nama, p.upline,m.jumlah_total, k.nama kasir + from m_nota_bawa m, karyawan k ,pelanggan p + where m.status_nota = 'S' + and m.kd_customer = p.kd_customer + and k.nik = m.kasir + and m.kd_customer = '$kodeplg' + order by m.tgl_nota,m.no_nota"; + } + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$nota,$tgl,$kdcust,$nama,$upline,$total,$kasir); + $ttJumlah = array(); + + $ttJumlah['hp'] = 0; + + print("
"); + print("

Laporan Rekap Bawa Barang



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['hp'] += $total; + print(""); + } + + print("
No.NotaTgl.NotaKd.PlgNamaUplineTotal BawaKasir
$nota$tgl$kdcust$nama$upline".number_format($total, 0, ",", ".")."$kasir

"); + print("
"); + print(""); + print("
Total Transaksi Bawa : ".number_format($ttJumlah['hp'],0,',','.')."
"); + }else{ + echo "Data tidak ditemukan!"; + } + } + } +?> + diff --git a/old-source/LaporanJual/rekapkartu.php b/old-source/LaporanJual/rekapkartu.php new file mode 100644 index 0000000..9604ea7 --- /dev/null +++ b/old-source/LaporanJual/rekapkartu.php @@ -0,0 +1,233 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $jml1 = 0; + $jml2 = 0; + $jml3 = 0; + $laci = 0; + + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Rekap kartu*/ + $query = "select m.no_nota, m.tgl_nota, m.kd_customer, m.jumlah_total, m.bank, m.no_kartu, m.no_validasi_bank, k.nama + from m_nota_tunai m, karyawan k + where m.status_bayar = 'K' + and m.no_nota_retur = '' + and m.status_nota = 'S' + and k.nik = m.kasir + and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate' + order by m.tgl_nota,m.no_nota"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$nota,$tgl,$kdcust,$ttBeli,$bank,$card,$validasi,$nama); + $ttJumlah = array(); + $ttJumlah['jml1'] = 0; + $ttJumlah['rp'] = 0; + + print("
"); + print("

Rekap Transaksi Kartu



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['rp1'] += $ttBeli; + $ttJumlah['jml1']++; + print(""); + } + + print("
No.NotaTanggal NotaKode Plg.Total BelanjaBankNo.KartuNo.ValidasiKasir
$nota$tgl$kdcust".number_format($ttBeli,0,',','.')."$bank$card$validasi$nama

"); + print("
"); + print(""); + print(""); + print("
Total Lembar Nota : ".$ttJumlah['jml1']."
Total Rupiah Transaksi : ".number_format($ttJumlah['rp1'],0,',','.')."
"); + }else{ + echo "Belum ada data penjualan untuk tanggal tersebut!"; + echo "
"; + } + } + $jml1 = $ttJumlah['rp1']; + + /*----------------------------------------Rekap Retur tukar barang*/ + $query2 = "select m.no_nota,m.tgl_nota, m.kd_customer, m.jumlah_total, m.bank, m.no_kartu, + m.no_nota_retur, m.jumlah_total_retur,(jumlah_total-jumlah_total_retur) TOTAL,k.nama + from m_nota_tunai m, karyawan k + where m.status_bayar = 'K' + and m.no_nota_retur != '' + and m.status_nota = 'S' + and m.kasir = k.nik + and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate' + order by m.tgl_nota,m.no_nota"; + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek = mysqli_stmt_num_rows($stmt2); + if($cek > 0){ + mysqli_stmt_bind_result($stmt2,$nota,$tgl,$kdcust,$ttBeli,$bank,$card,$notaretur,$totretur,$totalnya,$nama); + $ttJumlah = array(); + $ttJumlah['jml2'] = 0; + $ttJumlah['rp'] = 0; + + print("
"); + print("

Rekap Retur kartu



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt2)){ + $ttJumlah['rp2'] += $totalnya; + $ttJumlah['jml2']++; + print(" + "); + } + + print("
No.NotaTanggal NotaKode Plg.Total BelanjaBankNo.KartuNo.Nota ReturTot.ReturTOTAL BayarKasir
$nota$tgl$kdcust".number_format($ttBeli,0,',','.')."$bank$card$notaretur".number_format($totretur,0,',','.')."".number_format($totalnya,0,',','.')."$nama

"); + print("
"); + print(""); + print(""); + print("
Total Lembar Nota : ".$ttJumlah['jml2']."
Total Rupiah Transaksi : ".number_format($ttJumlah['rp2'],0,',','.')."
"); + }else{ + echo "Belum ada data retur transaksi kartu untuk tanggal tersebut!"; + echo "
"; + } + } + $jml2 = $ttJumlah['rp2']; + + /*----------------------------------------Rekap Retur */ + $query3 = "select distinct m.no_nota, m.tgl_nota, m.kd_customer, m.jumlah_total, k.nama + from m_nota_retur m, karyawan k,d_nota_retur d,m_nota_tunai mt + where m.kasir = k.nik + and d.no_nota = m.no_nota + and d.no_nota_tunai = mt.no_nota + and mt.status_bayar = 'K' + and (m.status_nota = 'K' or m.status_nota = 'D') + and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate' + order by m.tgl_nota,m.no_nota"; + if($stmt3 = mysqli_prepare($conn,$query3)){ + mysqli_stmt_execute($stmt3); + mysqli_stmt_store_result($stmt3); + $cek = mysqli_stmt_num_rows($stmt3); + if($cek > 0){ + mysqli_stmt_bind_result($stmt3,$nota,$tgl,$kdcust,$ttBeli,$nama); + $ttJumlah = array(); + $ttJumlah['jml3'] = 0; + $ttJumlah['rp'] = 0; + + print("
"); + print("

Rekap Retur



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt3)){ + $ttJumlah['rp3'] += $ttBeli; + $ttJumlah['jml3']++; + print(""); + } + + print("
No.NotaTanggal NotaKode Plg.Total BelanjaKasir
$nota$tgl$kdcust".number_format($ttBeli,0,',','.')."$nama

"); + print("
"); + print(""); + print(""); + print("
Total Lembar Nota : ".$ttJumlah['jml3']."
Total Rupiah Transaksi : ".number_format($ttJumlah['rp3'],0,',','.')."
"); + }else{ + echo "Belum ada data retur barang untuk tanggal tersebut!"; + echo "
"; + } + } + $jml3 = $ttJumlah['rp3']; + + /*----------------------------------------Rekap bank ----------------------------------------- */ + $query4 = "select temp.bank,sum(temp.TOTAL) from + (select m.bank,sum(jumlah_total) TOTAL + from m_nota_tunai m + where m.status_bayar = 'K' + and m.no_nota_retur = '' + and m.status_nota = 'S' + and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate' + group by m.bank + UNION ALL + select m.bank,sum((jumlah_total-jumlah_total_retur)) TOTAL + from m_nota_tunai m, karyawan k + where m.status_bayar = 'K' + and m.no_nota_retur != '' + and m.status_nota = 'S' + and m.kasir = k.nik + and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate' + group by m.bank) temp + group by temp.bank"; + + if($stmt4 = mysqli_prepare($conn,$query4)){ + mysqli_stmt_execute($stmt4); + mysqli_stmt_store_result($stmt4); + $cek = mysqli_stmt_num_rows($stmt4); + if($cek > 0){ + mysqli_stmt_bind_result($stmt4,$bank,$tot); + $ttJumlah = array(); + $ttJumlah['rp'] = 0; + + print("
"); + print("

Rekap Transaksi Kartu



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt4)){ + $ttJumlah['rp4'] += $tot; + print(""); + } + + print("
BankTOTAL
$bank".number_format($tot,0,',','.')."

"); + print("
"); + print(""); + print("
Total Rupiah Transaksi : ".number_format($ttJumlah['rp4'],0,',','.')."
"); + }else{ + echo "Belum ada data penjualan untuk tanggal tersebut!"; + echo "
"; + } + } + + $laci = $jml1 + $jml2 - $jml3; + print("

"); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print("
Total Transaksi Kartu:".number_format($jml1,0,',','.')."
Total Retur Transaksi Kartu:".number_format($jml2,0,',','.')."
_______________________________(+)
Total Retur:".number_format($jml3,0,',','.')."
_______________________________(-)
Total Transaksi:".number_format($laci,0,',','.')."
"); + print("


"); + } +?> diff --git a/old-source/LaporanJual/rekapprosesbawa.php b/old-source/LaporanJual/rekapprosesbawa.php new file mode 100644 index 0000000..6156542 --- /dev/null +++ b/old-source/LaporanJual/rekapprosesbawa.php @@ -0,0 +1,98 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $kodeplg = $_POST['kdplg']; + + if(bukaKoneksi()){ + global $conn; + IF (strlen($startDate) > 2 && strlen($endDate) > 2 && $kodeplg !=''){ + $query = "SELECT ((year(curdate()) - b.tahun) * 12) + month(curdate()) - b.bulan usia,DATEDIFF( CURDATE( ) , DATE( m.tgl_nota ) ) lama_bawa, p.nama, d.no_nota, m.tgl_nota, d.kd_barang, b.nama_barang, d.no_barang, SUM( d.jumlah ) , SUM( d.jumlah * d.harga_satuan ) rp, SUM( d.jumlah * REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( n.harga_pokok, 'B', '1' ) , 'R', '2' ) , 'A', '3' ) , 'W', '4' ) , 'N', '5' ) , 'F', '6' ) , 'O', '7' ) , 'X', '8' ) , 'E', '9' ) , 'S', '0' ) ) hp + FROM d_nota_bawa d, m_nota_bawa m, pelanggan p, barang b, no_barang n + WHERE d.`status_barang` IS NULL + AND m.no_nota = d.no_nota + AND b.id_gabungan = n.id_gabungan + AND m.kd_customer = p.kd_customer + AND (d.kd_barang = b.kode_barang AND d.no_barang = n.nomor) + AND DATE( m.tgl_nota ) + BETWEEN '$startDate' and '$endDate' + AND m.kd_customer = '$kodeplg' + GROUP BY CONCAT( d.kd_barang, d.no_barang ) , d.no_nota + ORDER BY DATE( tgl_nota ) , d.no_nota, p.nama"; + }elseif ($startDate != '' && $endDate != '' && $kodeplg =='' ){ + $query = "SELECT ((year(curdate()) - b.tahun) * 12) + month(curdate()) - b.bulan usia,DATEDIFF( CURDATE( ) , DATE( m.tgl_nota ) ) lama_bawa, p.nama, d.no_nota, m.tgl_nota, d.kd_barang, b.nama_barang, d.no_barang, SUM( d.jumlah ) , SUM( d.jumlah * d.harga_satuan ) rp, SUM( d.jumlah * REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( n.harga_pokok, 'B', '1' ) , 'R', '2' ) , 'A', '3' ) , 'W', '4' ) , 'N', '5' ) , 'F', '6' ) , 'O', '7' ) , 'X', '8' ) , 'E', '9' ) , 'S', '0' ) ) hp + FROM d_nota_bawa d, m_nota_bawa m, pelanggan p, barang b, no_barang n + WHERE d.`status_barang` IS NULL + AND m.no_nota = d.no_nota + AND b.id_gabungan = n.id_gabungan + AND m.kd_customer = p.kd_customer + AND (d.kd_barang = b.kode_barang AND d.no_barang = n.nomor) + AND DATE( m.tgl_nota ) + BETWEEN '$startDate' and '$endDate' + GROUP BY CONCAT( d.kd_barang, d.no_barang ) , d.no_nota + ORDER BY DATE( tgl_nota ) , d.no_nota, p.nama"; + }elseif (strlen($startDate) <= 2 && strlen($endDate) <= 2 && $kodeplg !='') { + $query = "SELECT ((year(curdate()) - b.tahun) * 12) + month(curdate()) - b.bulan usia,DATEDIFF( CURDATE( ) , DATE( m.tgl_nota ) ) lama_bawa, p.nama, d.no_nota, m.tgl_nota, d.kd_barang, b.nama_barang, d.no_barang, SUM( d.jumlah ) , SUM( d.jumlah * d.harga_satuan ) rp, SUM( d.jumlah * REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( n.harga_pokok, 'B', '1' ) , 'R', '2' ) , 'A', '3' ) , 'W', '4' ) , 'N', '5' ) , 'F', '6' ) , 'O', '7' ) , 'X', '8' ) , 'E', '9' ) , 'S', '0' ) ) hp + FROM d_nota_bawa d, m_nota_bawa m, pelanggan p, barang b, no_barang n + WHERE d.`status_barang` IS NULL + AND m.no_nota = d.no_nota + AND b.id_gabungan = n.id_gabungan + AND m.kd_customer = p.kd_customer + AND (d.kd_barang = b.kode_barang AND d.no_barang = n.nomor) + AND m.kd_customer = '$kodeplg' + GROUP BY CONCAT( d.kd_barang, d.no_barang ) , d.no_nota + ORDER BY DATE( tgl_nota ) , d.no_nota, p.nama"; + } + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$usia,$lama,$nama,$nota,$tgl,$brg,$nmbrg,$nobrg,$jml,$rp,$hp); + + print("
"); + print("

Rekap Bawa Barang yang Belum Diproses



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $tthargapokok += $hp; + print(""); + } + + print("
Lama Bawa (hari)NamaNo.NotaTgl.NotaKode BarangNama BarangNo.BarangJumlahHPHJUsia Brg (bln)
$lama$nama$nota$tgl$brg$nmbrg$nobrg$jml".number_format($hp, 0, ",", ".")."".number_format($rp, 0, ",", ".")."$usia

"); + print(""); + print(""); + print("
Total Harga Pokok : ".number_format($tthargapokok, 0, ",", ".")."
"); + print("
"); + + }else{ + echo "Data tidak ditemukan!"; + } + } + } +?> + diff --git a/old-source/LaporanJual/rekaptunai.php b/old-source/LaporanJual/rekaptunai.php new file mode 100644 index 0000000..53a8a83 --- /dev/null +++ b/old-source/LaporanJual/rekaptunai.php @@ -0,0 +1,230 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + $jml1 = 0; + $jml2 = 0; + $jml3 = 0; + $laci = 0; + + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Rekap Tunai*/ + $query = "select m.no_nota,m.tgl_nota, m.kd_customer, m.jumlah_total, k.nama + FROM m_nota_tunai m, karyawan k + where m.status_bayar = 'T' + and m.status_nota = 'S' + and m.no_nota_retur = '' + and k.nik = m.kasir + and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate' + order by m.no_nota"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$nota,$tgl,$kdcust,$ttBeli,$nama); + $ttJumlah = array(); + $ttJumlah['jml1'] = 0; + $ttJumlah['rp1'] = 0; + + print("
"); + print("

Rekap Transaksi Tunai



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['rp1'] += $ttBeli; + $ttJumlah['jml1']++; + print(""); + } + + print("
No.NotaTanggal NotaKode Plg.Total BelanjaKasir
$nota$tgl$kdcust".number_format($ttBeli,0,',','.')."$nama

"); + print("
"); + print(""); + print(""); + print("
Total Lembar Nota : ".$ttJumlah['jml1']."
Total Rupiah Transaksi : ".number_format($ttJumlah['rp1'],0,',','.')."
"); + }else{ + echo "Belum ada data penjualan untuk tanggal tersebut!"; + echo "
"; + } + } + $jml1 = $ttJumlah['rp1']; + + /*----------------------------------------Rekap Retur tukar barang---------------*/ + $query2 = "select m.no_nota,m.tgl_nota, m.kd_customer, m.jumlah_total, + m.no_nota_retur, m.jumlah_total_retur,(jumlah_total-jumlah_total_retur) TOTAL,k.nama + from m_nota_tunai m, karyawan k + where m.status_bayar = 'T' + and m.no_nota_retur != '' + and m.status_nota = 'S' + and m.kasir = k.nik + and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate' + order by m.no_nota"; + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek = mysqli_stmt_num_rows($stmt2); + if($cek > 0){ + mysqli_stmt_bind_result($stmt2,$nota,$tgl,$kdcust,$ttBeli,$notaretur,$totretur,$totalnya,$nama); + $ttJumlah = array(); + $ttJumlah['jml2'] = 0; + $ttJumlah['rp2'] = 0; + + print("
"); + print("

Rekap Retur Tunai



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt2)){ + $ttJumlah['rp2'] += $totalnya; + $ttJumlah['jml2']++; + print(" + "); + } + + print("
No.NotaTanggal NotaKode Plg.Total BelanjaNo.Nota ReturTot.ReturTOTAL BayarKasir
$nota$tgl$kdcust".number_format($ttBeli,0,',','.')."$notaretur".number_format($totretur,0,',','.')."".number_format($totalnya,0,',','.')."$nama

"); + print("
"); + print(""); + print(""); + print("
Total Lembar Nota : ".$ttJumlah['jml2']."
Total Rupiah Transaksi : ".number_format($ttJumlah['rp2'],0,',','.')."
"); + }else{ + echo "Belum ada data retur tunai untuk tanggal tersebut!"; + echo "
"; + } + } + $jml2 = $ttJumlah['rp2']; + + /*----------------------------------------Rekap Retur */ + $query3 = "select distinct m.no_nota, m.tgl_nota, m.kd_customer, m.jumlah_total, k.nama + from m_nota_retur m, karyawan k,d_nota_retur d,m_nota_tunai mt + where m.kasir = k.nik + and d.no_nota = m.no_nota + and d.no_nota_tunai = mt.no_nota + and mt.status_bayar = 'T' + and (m.status_nota = 'K' or m.status_nota = 'D') + and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate' + order by m.no_nota"; + if($stmt3 = mysqli_prepare($conn,$query3)){ + mysqli_stmt_execute($stmt3); + mysqli_stmt_store_result($stmt3); + $cek = mysqli_stmt_num_rows($stmt3); + if($cek > 0){ + mysqli_stmt_bind_result($stmt3,$nota,$tgl,$kdcust,$ttBeli,$nama); + $ttJumlah = array(); + $ttJumlah['jml3'] = 0; + $ttJumlah['rp3'] = 0; + + print("
"); + print("

Rekap Retur



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt3)){ + $ttJumlah['rp3'] += $ttBeli; + $ttJumlah['jml3']++; + print(""); + } + + print("
No.NotaTanggal NotaKode Plg.Total BelanjaKasir
$nota$tgl$kdcust".number_format($ttBeli,0,',','.')."$nama

"); + print("
"); + print(""); + print(""); + print("
Total Lembar Nota : ".$ttJumlah['jml3']."
Total Rupiah Transaksi : ".number_format($ttJumlah['rp3'],0,',','.')."
"); + }else{ + echo "Belum ada data retur barang untuk tanggal tersebut!"; + echo "
"; + } + } + $jml3 = $ttJumlah['rp3']; + + /*----------------------------------------Rekap TITIPAN */ + $query4 = "select sum(t.bayar_bon) + from bayar_bon t + where date(t.tgl_byr) between '$startDate' AND '$endDate'"; + if($stmt4 = mysqli_prepare($conn,$query4)){ + mysqli_stmt_execute($stmt4); + mysqli_stmt_store_result($stmt4); + $cek = mysqli_stmt_num_rows($stmt4); + if($cek > 0){ + mysqli_stmt_bind_result($stmt4,$total); + $ttJumlah = array(); + $ttJumlah['rp4'] = 0; + + while(mysqli_stmt_fetch($stmt4)){ + $ttJumlah['rp4'] += $total; + } + }else{ + echo "Belum ada data titipan untuk tanggal tersebut!"; + echo "
"; + } + } + $jml4 = $ttJumlah['rp4']; + + /*----------------------------------------Rekap Komisi */ + $query5 = "select sum(k.jumlah) + from komisi k + where date(k.tgl_ambil) between '$startDate' AND '$endDate'"; + if($stmt5 = mysqli_prepare($conn,$query5)){ + mysqli_stmt_execute($stmt5); + mysqli_stmt_store_result($stmt5); + $cek = mysqli_stmt_num_rows($stmt5); + if($cek > 0){ + mysqli_stmt_bind_result($stmt5,$total1); + $ttJumlah = array(); + $ttJumlah['rp5'] = 0; + + while(mysqli_stmt_fetch($stmt5)){ + $ttJumlah['rp5'] += $total1; + } + }else{ + echo "Belum ada data komisi untuk tanggal tersebut!"; + echo "
"; + } + } + $jml5 = $ttJumlah['rp5']; + + $laci = $jml1 + $jml2 + $jml4 - $jml3 - $jml5; + print("

"); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print("
Total Transaksi Tunai:".number_format($jml1,0,',','.')."
Total Retur Tunai:".number_format($jml2,0,',','.')."
Total Titipan:".number_format($jml4,0,',','.')."
_____________________________(+)
Total Retur:".number_format($jml3,0,',','.')."
Total Komisi:".number_format($jml5,0,',','.')."
_____________________________(-)
Total Uang Laci:".number_format($laci,0,',','.')."
"); + print("


"); + } +?> diff --git a/old-source/LaporanJual/returkonsinyasi.php b/old-source/LaporanJual/returkonsinyasi.php new file mode 100644 index 0000000..4a9d4bf --- /dev/null +++ b/old-source/LaporanJual/returkonsinyasi.php @@ -0,0 +1,83 @@ +"; + echo "div#divprint{width:950px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:900px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate3']); + $endDate = decTgl($_POST['endDate3']); + + if(bukaKoneksi()){ + global $conn; + + $query = "select d.no_nota, m.tgl_nota, m.kd_customer, m.status_nota, + d.kd_barang,d.no_barang,dp.nm_brg,sum(d.jumlah), + sum(d.jumlah*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp, + sum(d.jumlah*d.harga_jual) hj,m.keterangan,d.kode_pram + from m_nota_retur m,d_nota_retur d,no_barang n, barang b, d_pembelian dp, m_pembelian mp + where b.id_gabungan = n.id_gabungan + and m.no_nota = d.no_nota + and dp.no_faktur = mp.no_faktur + AND left(mp.no_faktur,4) <> 'RVB-' + AND mp.status = 'K' + AND mp.validasi = '1' + AND (dp.kode_barang = d.kd_barang AND dp.nomor = d.no_barang) + and (d.kd_barang = b.kode_barang and d.no_barang = n.nomor) + and date(m.tgl_nota) BETWEEN '$startDate' and '$endDate' + group by m.no_nota,concat(d.kd_barang,d.no_barang) + order by m.tgl_nota,m.no_nota"; + + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$nota,$tgl,$kdcust,$status,$kdbrg,$nomor,$namabrg,$jumlah,$hp,$hj,$ket,$kasir); + $ttJumlah = array(); + + $ttJumlah['hp'] = 0; + $ttJumlah['hj'] = 0; + print("
"); + print("

Laporan Rekap Retur Barang Konsinyasi



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['hp'] += $hp; + $ttJumlah['hj'] += $hj; + print(" + + "); + } + + print("
No.NotaTgl.NotaKd.PlgStatus NotaKd.BarangNomorNama BrgJumlahHPHJKeteranganKasir
$nota$tgl$kdcust$status$kdbrg$nomor$namabrg$jumlah".number_format($hp, 0, ",", ".")."".number_format($hj, 0, ",", ".")."$ket$kasir

"); + print("
"); + print(""); + print(""); + print("
Total Harga Pokok : ".number_format($ttJumlah['hp'],0,',','.')."
Total Harga Jual : ".number_format($ttJumlah['hj'],0,',','.')."
"); + }else{ + echo "Data tidak ditemukan!"; + } + } + } +?> + diff --git a/old-source/LaporanJual/rincian_jual.php b/old-source/LaporanJual/rincian_jual.php new file mode 100644 index 0000000..f099706 --- /dev/null +++ b/old-source/LaporanJual/rincian_jual.php @@ -0,0 +1,289 @@ +"; + echo "table.tbl {width:750px;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}"; + echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}"; + echo "body {font-size:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $nonota = $_GET['nota']; + if(substr($_GET['nota'],0,2) == 'B-'): + $nonotabon = $nonota; + bon($nonotabon); + elseif(substr($_GET['nota'],0,2) == 'W-'): + $nonotabawa = $nonota; + bawa($nonotabawa); + elseif(substr($_GET['nota'],0,2) == 'R-'): + $nonotaretur = $nonota; + retur($nonotaretur); + else: + $nonotatunai = $nonota; + tunai($nonotatunai); + endif; + +function bon($nonotabon) +{ + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Rekap Bon*/ + $query = "SELECT d.`kd_brg`, d.`nomor`, b.nama_barang,d.`jumlah`, d.`diskon`, + d.`hrg_satuan`,(d.`hrg_satuan`*d.`jumlah`) subtotal,d.`kd_pram` + FROM d_bon d,barang b + where d.`kd_brg`=b.kode_barang + and d.no_bon = '$nonotabon'"; + $query2 = "select m.no_bon,m.tgl_bon,m.kode_plg, + m.jumlah_total,m.diskon, + m.bank,m.no_kartu,m.kasir + from m_bon m + where m.no_bon = '$nonotabon'"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdbrg,$nomor,$nmbrg,$jum,$diskon,$hj,$subtotal,$kdpram); + + print("
"); + print("

Rincian Penjualan


"); + print("

"); + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$nota,$tglnota,$kdcust,$tot,$disc,$bank,$kartu,$kasir); + while(mysqli_stmt_fetch($stmt2)){ + print("Nomor Nota : ".$nota."
"); + print("Tanggal Nota : ".$tglnota."
"); + print("Plg : ".$kdcust."
"); + print("Total : ".number_format($tot,0,',','.')."
"); + print("Jumlah uang : ".number_format($totuang,0,',','.')."
"); + print("Discount : ".$disc."
"); + print("Bank : ".$bank."
"); + print("No.kartu : ".$kartu."
"); + print("Kasir : ".$kasir."

"); + } + } + } + + + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + print(""); + } + + print("
Kode Brg.NomorNamaJumlDiscHJSub TotalKd Pram
$kdbrg$nomor$nmbrg$jum".$diskon."".number_format($hj,0,',','.')."".number_format($subtotal,0,',','.')."$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + print("

"); + } +} + +function bawa($nonotabawa) +{ + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Rekap Bawa*/ + $query = "SELECT d.`kd_barang`, d.`no_barang`, b.nama_barang,d.`jumlah`, + d.`harga_satuan`,(d.`harga_satuan`*d.`jumlah`) subtotal,d.`kode_pram` + FROM d_nota_bawa d,barang b + where d.`kd_barang`=b.kode_barang + and d.no_nota = '$nonotabawa'"; + $query2 = "select m.no_nota,m.tgl_nota,m.kd_customer, + m.jumlah_total,m.kasir + from m_nota_bawa m + where m.no_nota = '$nonotabawa'"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdbrg,$nomor,$nmbrg,$jum,$hj,$subtotal,$kdpram); + + print("
"); + print("

Rincian Penjualan


"); + print("

"); + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$nota,$tglnota,$kdcust,$tot,$kasir); + while(mysqli_stmt_fetch($stmt2)){ + print("Nomor Nota : ".$nota."
"); + print("Tanggal Nota : ".$tglnota."
"); + print("Plg : ".$kdcust."
"); + print("Total : ".number_format($tot,0,',','.')."
"); + print("Kasir : ".$kasir."

"); + } + } + } + + + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + print(""); + } + + print("
Kode Brg.NomorNamaJumlHJSub TotalKd Pram
$kdbrg$nomor$nmbrg$jum".number_format($hj,0,',','.')."".number_format($subtotal,0,',','.')."$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + print("

"); + } +} + +function retur($nonotaretur) +{ + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Rekap Tunai*/ + $query = "SELECT d.`kd_barang`, d.`no_barang`, b.nama_barang,d.`jumlah`, d.`diskon`, + d.`harga_jual`,(d.`harga_jual`*d.`jumlah`) subtotal,d.no_nota_tunai,d.`kode_pram` + FROM d_nota_retur d,barang b + where d.`kd_barang`=b.kode_barang + and d.no_nota = '$nonotaretur'"; + $query2 = "select m.no_nota,m.tgl_nota,m.kd_customer, + m.jumlah_total,m.total_diskon,m.keterangan,m.kasir + from m_nota_retur m + where m.no_nota = '$nonotaretur'"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdbrg,$nomor,$nmbrg,$jum,$diskon,$hj,$subtotal,$notatunai,$kdpram); + + print("
"); + print("

Rincian Penjualan


"); + print("

"); + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$nota,$tglnota,$kdcust,$tot,$disc,$keterangan,$kasir); + while(mysqli_stmt_fetch($stmt2)){ + print("Nomor Nota : ".$nota."
"); + print("Tanggal Nota : ".$tglnota."
"); + print("Plg : ".$kdcust."
"); + print("Total : ".number_format($tot,0,',','.')."
"); + print("Keterangan : ".$keterangan."
"); + print("Kasir : ".$kasir."

"); + } + } + } + + + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + print(""); + } + + print("
Kode Brg.NomorNamaJumlDiscHJSub TotalNota tunaiKd Pram
$kdbrg$nomor$nmbrg$jum".$diskon."".number_format($hj,0,',','.')."".number_format($subtotal,0,',','.')."$notatunai$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + print("

"); + } +} + +function tunai($nonotatunai) +{ + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Rekap Tunai*/ + $query = "SELECT d.`kd_barang`, d.`no_barang`, b.nama_barang,d.`jumlah`, d.`diskon`, + d.`harga_jual`,(d.`harga_jual`*d.`jumlah`) subtotal,d.`kode_pram` + FROM d_nota_tunai d,barang b + where d.`kd_barang`=b.kode_barang + and d.no_nota = '$nonotatunai'"; + $query2 = "select m.no_nota,m.tgl_nota,m.kd_customer, + m.jumlah_total,m.total_uang,m.total_diskon, + m.bank,m.no_kartu,m.kasir + from m_nota_tunai m + where m.no_nota = '$nonotatunai'"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdbrg,$nomor,$nmbrg,$jum,$diskon,$hj,$subtotal,$kdpram); + + print("
"); + print("

Rincian Penjualan


"); + print("

"); + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$nota,$tglnota,$kdcust,$tot,$totuang,$disc,$bank,$kartu,$kasir); + while(mysqli_stmt_fetch($stmt2)){ + print("Nomor Nota : ".$nota."
"); + print("Tanggal Nota : ".$tglnota."
"); + print("Plg : ".$kdcust."
"); + print("Total : ".number_format($tot,0,',','.')."
"); + print("Jumlah uang : ".number_format($totuang,0,',','.')."
"); + print("Discount : ".$disc."
"); + print("Bank : ".$bank."
"); + print("No.kartu : ".$kartu."
"); + print("Kasir : ".$kasir."

"); + } + } + } + + + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + print(""); + } + + print("
Kode Brg.NomorNamaJumlDiscHJSub TotalKd Pram
$kdbrg$nomor$nmbrg$jum".$diskon."".number_format($hj,0,',','.')."".number_format($subtotal,0,',','.')."$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + print("

"); + } +} + +?> diff --git a/old-source/LaporanJual/rincibeli.php b/old-source/LaporanJual/rincibeli.php new file mode 100644 index 0000000..a2cb6d2 --- /dev/null +++ b/old-source/LaporanJual/rincibeli.php @@ -0,0 +1,73 @@ +"; + echo "table.tbl {width:950px;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}"; + echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}"; + echo "body {font-size:9pt;}"; + echo "div.luar{text-align:left;margin-left:100px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $tgl = left($_GET['tgllini'],10); + $lini = right($_GET['tgllini'],2); + + + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Pembelian Rinci*/ + $query = "SELECT m.tgl_masuk,m.tgl_nota,m.no_faktur,s.nama_supplier,d.kode_barang,d.nm_brg,d.nomor,d.jum_fisik, + (d.jum_fisik*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp, + (d.jum_fisik*d.harga_satuan) hj,m.keterangan + FROM m_pembelian m, d_pembelian d, supplier s, barang b + WHERE s.kd_supplier = m.kd_supplier + AND d.kode_barang = b.kode_barang + AND m.no_faktur = d.no_faktur + AND m.validasi = '1' + AND m.status_revisi = '1' + AND b.kode_strip = '$lini' + AND m.tgl_masuk = '$tgl' + ORDER BY d.id"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tglmsk,$tglnota,$nota,$supp,$kdbrg,$nmbrg,$no,$jml,$hp,$hj,$ktr); + + print("
"); + print("

Rekap Transaksi Pembelian



"); + print("

"); + print(""); + print(" + "); + + $ttHP = 0; + $ttHJ = 0; + while(mysqli_stmt_fetch($stmt)){ + $ttHP += $hp; + $ttHJ += $hj; + print(" + + "); + } + print(""); + print("
Tgl MasukTgl NotaNo.FakturSupplierKode Brg.Nama Brg.NomorJumlHPHJKeterangan
$tglmsk$tglnota$nota$supp$kdbrg$nmbrg$no$jml".number_format($hp,0,',','.')."".number_format($hj,0,',','.')."$ktr
Total HP Beli".number_format($ttHP,0,',','.')."".number_format($ttHJ,0,',','.')."

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + print("

"); + } + +?> diff --git a/old-source/LaporanJual/rincijual.php b/old-source/LaporanJual/rincijual.php new file mode 100644 index 0000000..9e74b71 --- /dev/null +++ b/old-source/LaporanJual/rincijual.php @@ -0,0 +1,139 @@ +"; + echo "table.tbl {width:950px;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}"; + echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}"; + echo "body {font-size:9pt;}"; + echo "div.luar{text-align:left;margin-left:100px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $tanggal = left($_GET['tgllini'],10); + $lini = right($_GET['tgllini'],2); + + + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Rekap Tunai*/ + $query = "SELECT m.tgl_nota,d.no_nota,d.kd_barang,b.nama_barang,d.no_barang,d.jumlah,d.diskon, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + d.harga_jual, + d.kode_pram + from m_nota_tunai m, d_nota_tunai d, barang b + where m.no_nota = d.no_nota + and d.kd_barang = b.kode_barang + and b.kode_strip = '$lini' + and date(m.tgl_nota) = '$tanggal' + order by d.no_nota"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tgl,$nota,$kdbrg,$nmbrg,$no,$jml,$disc,$hp,$hj,$kdpram); + + print("
"); + print("

Rekap Transaksi Tunai



"); + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + print(" + + "); + } + + print("
Tanggal NotaNo.NotaKode Brg.Nama Brg.NomorJumlDiscHPHJKd Pram
$tgl$nota$kdbrg$nmbrg$no$jml$disc".number_format($hp,0,',','.')."".number_format($hj,0,',','.')."$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + /*----------------------------------------Rekap BON*/ + $query2 = "SELECT m.tgl_bon,d.no_bon,d.kd_brg,b.nama_barang,d.nomor,d.jumlah,d.diskon, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + d.hrg_satuan, + d.kd_pram + from m_bon m, d_bon d, barang b + where m.no_bon = d.no_bon + and d.kd_brg = b.kode_barang + and b.kode_strip = '$lini' + and date(m.tgl_bon) = '$tanggal' + order by d.no_bon"; + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$tgl,$nota,$kdbrg,$nmbrg,$no,$jml,$disc,$hp,$hj,$kdpram); + + print("
"); + print("

Rekap Transaksi BON



"); + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt2)){ + print(" + + "); + } + + print("
Tanggal NotaNo.NotaKode Brg.Nama Brg.NomorJumlDiscHPHJKd Pram
$tgl$nota$kdbrg$nmbrg$no$jml$disc".number_format($hp,0,',','.')."".number_format($hj,0,',','.')."$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + /*----------------------------------------Rekap retur */ + $query4 = "SELECT m.tgl_nota,d.no_nota,d.kd_barang,b.nama_barang,s.nama_supplier,d.no_barang,d.jumlah,d.diskon,d.harga_jual,d.harga_pokok,d.kode_pram + FROM d_nota_retur d,barang b,m_nota_retur m, supplier s + WHERE d.kd_barang = b.kode_barang + and d.no_nota = m.no_nota + and b.kode_supplier = s.kd_supplier + and (m.status_nota = 'T' or m.status_nota = 'K' or m.status_nota = 'D') + and b.kode_strip = '$lini' + and date(m.tgl_nota) = '$tanggal' + order by m.tgl_nota"; + if($stmt4 = mysqli_prepare($conn,$query4)){ + mysqli_stmt_execute($stmt4); + mysqli_stmt_store_result($stmt4); + $cek = mysqli_stmt_num_rows($stmt4); + if($cek > 0){ + mysqli_stmt_bind_result($stmt4,$tgl,$nota,$kdbrg,$nmbrg,$kdlama,$no,$jml,$disc,$hj,$hp,$kdpram); + + print("
"); + print("

Rekap Transaksi Retur



"); + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt4)){ + print(""); + } + + print("
Tanggal NotaNo.NotaKode Brg.Nama Brg.Kode LamaNomorJumlDiscHJHPKd Pram
$tgl$nota$kdbrg$nmbrg$kdlama$no$jml$disc".number_format($hj,0,',','.')."$hp$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + print("

"); + } + +?> diff --git a/old-source/LaporanJual/rincirekapbawa.php b/old-source/LaporanJual/rincirekapbawa.php new file mode 100644 index 0000000..5e4dd88 --- /dev/null +++ b/old-source/LaporanJual/rincirekapbawa.php @@ -0,0 +1,69 @@ +"; + echo "table.tbl {width:950px;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}"; + echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}"; + echo "body {font-size:9pt;}"; + echo "div.luar{text-align:left;margin-left:100px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $tgl = left($_GET['tgllini'],10); + $lini = right($_GET['tgllini'],2); + + + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Rekap Bawa*/ + $query = "select m.tgl_nota,d.no_nota,d.kd_barang,b.nama_barang,d.no_barang,sum(d.jumlah), + sum(d.jumlah*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp, + sum(d.jumlah*d.harga_satuan) hj, + d.kode_pram + from m_nota_bawa m,d_nota_bawa d,no_barang n, barang b + where m.status_nota = 'S' + and m.no_nota = d.no_nota + and b.id_gabungan = n.id_gabungan + and (d.kd_barang = b.kode_barang and d.no_barang = n.nomor) + and b.kode_strip = '$lini' + and date(m.tgl_nota) = '$tgl' + group by m.no_nota,concat(d.kd_barang,d.no_barang) + order by m.tgl_nota,m.no_nota"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tgl,$nota,$kdbrg,$nmbrg,$no,$jml,$hp,$hj,$kdpram); + + print("
"); + print("

Rekap Transaksi Bawa



"); + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + print(" + + "); + } + + print("
Tanggal NotaNo.NotaKode Brg.Nama Brg.NomorJumlHPHJKd Pram
$tgl$nota$kdbrg$nmbrg$no$jml".number_format($hp,0,',','.')."".number_format($hj,0,',','.')."$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + print("

"); + } + +?> diff --git a/old-source/LaporanJual/rinciretur.php b/old-source/LaporanJual/rinciretur.php new file mode 100644 index 0000000..1cb6332 --- /dev/null +++ b/old-source/LaporanJual/rinciretur.php @@ -0,0 +1,69 @@ +"; + echo "table.tbl {width:950px;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}"; + echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}"; + echo "body {font-size:9pt;}"; + echo "div.luar{text-align:left;margin-left:100px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $tgl = left($_GET['tgllini'],10); + $lini = right($_GET['tgllini'],2); + + + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Retur Pembelian rinci*/ + $query = "select r.`tgl_retur`,r.`no_nota`,s.nama_supplier,d.kd_barang,b.nama_barang,d.nomor_barang,d.jumlah,SUM(d.jumlah*d.harga_satuan) hp,r.`keterangan` + from m_retur_beli r,d_retur_beli d,supplier s, barang b + where + d.kd_barang = b.kode_barang + and r.kd_supplier = s.kd_supplier + and r.id_retur = d.id_retur + and r.validasi = '1' + and r.tgl_retur = '$tgl' + and b.kode_strip = '$lini' + GROUP BY r.`no_nota`,concat(d.kd_barang,d.nomor_barang)"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tglnota,$nota,$supp,$kdbrg,$nmbrg,$no,$jml,$hp,$ktr); + + print("
"); + print("

Rekap Retur Pembelian



"); + print("

"); + print(""); + print(" + "); + + $ttHP = 0; + while(mysqli_stmt_fetch($stmt)){ + $ttHP += $hp; + print(" + + "); + } + print(""); + print("
Tgl NotaNo.FakturSupplierKode Brg.Nama Brg.NomorJumlHPKeterangan
$tglnota$nota$supp$kdbrg$nmbrg$no$jml".number_format($hp,0,',','.')."$ktr
Total HP".number_format($ttHP,0,',','.')."

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + print("

"); + } + +?> diff --git a/old-source/LaporanJual/rincirevisi.php b/old-source/LaporanJual/rincirevisi.php new file mode 100644 index 0000000..68ebc38 --- /dev/null +++ b/old-source/LaporanJual/rincirevisi.php @@ -0,0 +1,75 @@ +"; + echo "table.tbl {width:1024px;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}"; + echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}"; + echo "body {font-size:9pt;}"; + echo "div.luar{text-align:left;margin-left:100px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $tgl = left($_GET['tgllini'],10); + $lini = right($_GET['tgllini'],2); + + + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Revisi Rinci*/ + $query = "SELECT m.tgl_masuk,m.tgl_nota,m.no_faktur,s.nama_supplier,d.kode_barang,d.nm_brg,d.nomor,SUM(d.jum_fisik) jml, + SUM(d.jum_fisik*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hp, + SUM(d.jum_fisik*d.harga_satuan) hj,m.keterangan + FROM m_pembelian m, d_pembelian d, supplier s, barang b + WHERE s.kd_supplier = m.kd_supplier + AND d.kode_barang = b.kode_barang + AND m.no_faktur = d.no_faktur + AND m.validasi = '1' + AND left(m.no_faktur,4) = 'RVB-' + AND m.status_revisi = 0 + AND m.tgl_masuk = '$tgl' + AND b.kode_strip = '$lini' + GROUP BY m.no_faktur,concat(d.kode_barang,d.nomor) + ORDER BY d.id"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tglmsk,$tglnota,$nota,$supp,$kdbrg,$nmbrg,$no,$jml,$hp,$hj,$ktr); + + print("
"); + print("

Rekap Revisi



"); + print("

"); + print(""); + print(" + "); + + $ttHP = 0; + $ttHJ = 0; + while(mysqli_stmt_fetch($stmt)){ + $ttHP += $hp; + $ttHJ += $hj; + print(" + + "); + } + print(""); + print("
Tgl MasukTgl NotaNo.FakturSupplierKode Brg.Nama Brg.NomorJumlHPHJKeterangan
$tglmsk$tglnota$nota$supp$kdbrg$nmbrg$no$jml".number_format($hp,0,',','.')."".number_format($hj,0,',','.')."$ktr
Total HP".number_format($ttHP,0,',','.')."".number_format($ttHJ,0,',','.')."

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + print("

"); + } + +?> diff --git a/old-source/LaporanJual/rincistockopname.php b/old-source/LaporanJual/rincistockopname.php new file mode 100644 index 0000000..66e9b3b --- /dev/null +++ b/old-source/LaporanJual/rincistockopname.php @@ -0,0 +1,70 @@ +"; + echo "table.tbl {width:950px;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}"; + echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}"; + echo "body {font-size:9pt;}"; + echo "div.luar{text-align:left;margin-left:100px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $tgl = left($_GET['tgllini'],10); + $lini = right($_GET['tgllini'],2); + + + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Stock opname*/ + $query = "select m.tanggal,d.no_nota,d.kode_barang,b.nama_barang,d.nomor,d.jumlah_asli,d.jumlah_stok_sebelum, + (d.jumlah_asli*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hpscan, + (d.jumlah_stok_sebelum*(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0'))) hpstok + from barang b, no_barang n, d_stock_opname d, m_stock_opname m + where b.id_gabungan = n.id_gabungan + and (d.kode_barang = b.kode_barang and d.nomor=n.nomor) + and d.no_nota = m.no_nota + and m.konfirmasi = 1 + and d.jumlah_asli <> d.jumlah_stok_sebelum + and m.tanggal = '$tgl' + and m.strip = '$lini' + order by d.no_nota,d.kode_barang + "; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tanggal,$nota,$kdbrg,$nmbrg,$no,$jmlasli,$jmlstok,$hpscan,$hpstok); + + print("
"); + print("

Rinci Stock Opname



"); + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $HPselisih = $hpscan - $hpstok; + $ttHPselisih += $HPselisih; + print(" + "); + } + print(""); + print("
TanggalNotaKode Brg.Nama Brg.NomorJuml AsliJuml StokHP ScanHP StokSelisih
$tanggal$nota$kdbrg$nmbrg$no$jmlasli$jmlstok".number_format($hpscan,0,',','.')."".number_format($hpstok,0,',','.')."".number_format($HPselisih,0,',','.')."
Total HP".number_format($ttHPselisih,0,',','.')."

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + print("

"); + } + +?> diff --git a/old-source/LaporanJual/rincistokmin.php b/old-source/LaporanJual/rincistokmin.php new file mode 100644 index 0000000..36b8ffb --- /dev/null +++ b/old-source/LaporanJual/rincistokmin.php @@ -0,0 +1,66 @@ +"; + echo "table.tbl {width:950px;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}"; + echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}"; + echo "body {font-size:9pt;}"; + echo "div.luar{text-align:left;margin-left:100px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $tgl = left($_GET['tgllini'],10); + $lini = right($_GET['tgllini'],2); + + + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Stock Minus*/ + $query = "SELECT b.kode_supplier,s.nama_supplier,b.kode_barang,b.nama_barang,n.nomor,SUM(n.stok) stok, + SUM(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok) + totalHP + from barang b,no_barang n,supplier s + WHERE n.stok<0 + and b.kode_supplier = s.kd_supplier + and b.id_gabungan = n.id_gabungan + and b.kode_strip = '$lini' + GROUP BY concat(n.id_gabungan,n.nomor)"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdsupp,$supp,$kdbrg,$nmbrg,$no,$jml,$hp); + + print("
"); + print("

Persediaan yang Minus



"); + print("

"); + print(""); + print(""); + + $ttHP = 0; + while(mysqli_stmt_fetch($stmt)){ + $ttHP += $hp; + print(" + "); + } + print(""); + print("
Kode SupplierSupplierKode Brg.Nama Brg.NomorJumlHP
$kdsupp$supp$kdbrg$nmbrg$no$jml".number_format($hp,0,',','.')."
Total HP".number_format($ttHP,0,',','.')."

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + print("

"); + } + +?> diff --git a/old-source/LaporanJual/rincitrans.php b/old-source/LaporanJual/rincitrans.php new file mode 100644 index 0000000..843d984 --- /dev/null +++ b/old-source/LaporanJual/rincitrans.php @@ -0,0 +1,161 @@ +"; + echo "table.tbl {width:950px;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}"; + echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}"; + echo "body {font-size:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate2']); + $endDate = decTgl($_POST['endDate2']); + + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Rekap Tunai*/ + $query = "SELECT m.tgl_nota,d.no_nota,d.kd_barang,b.nama_barang,s.nama_supplier,d.no_barang,d.jumlah,d.diskon,d.harga_jual, + d.harga_pokok,d.kode_pram + FROM d_nota_tunai d,barang b,m_nota_tunai m, supplier s + WHERE d.kd_barang = b.kode_barang + and b.kode_supplier = s.kd_supplier + and d.no_nota = m.no_nota + and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate' + order by m.tgl_nota"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tgl,$nota,$kdbrg,$nmbrg,$kdlama,$no,$jml,$disc,$hj,$hp,$kdpram); + + print("
"); + print("

Rekap Transaksi Tunai



"); + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + print(""); + } + + print("
Tanggal NotaNo.NotaKode Brg.Nama Brg.SupplierNomorJumlDiscHJHPKd Pram
$tgl$nota$kdbrg$nmbrg$kdlama$no$jml$disc".number_format($hj,0,',','.')."$hp$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + /*----------------------------------------Rekap bon barang*/ + $query2 = "SELECT m.tgl_bon,d.no_bon,m.kode_plg,d.kd_brg,b.nama_barang,s.nama_supplier,d.nomor,d.jumlah,d.diskon,d.hrg_satuan,d.harga_pokok,d.kd_pram + FROM d_bon d, barang b, m_bon m, supplier s + WHERE d.kd_brg = b.kode_barang + and b.kode_supplier = s.kd_supplier + and d.no_bon = m.no_bon + and date(m.tgl_bon) BETWEEN '$startDate' AND '$endDate' + order by m.tgl_bon"; + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek = mysqli_stmt_num_rows($stmt2); + if($cek > 0){ + mysqli_stmt_bind_result($stmt2,$tgl,$nota,$kdplg,$kdbrg,$nmbrg,$kdlama,$no,$jml,$disc,$hj,$hp,$kdpram); + + print("
"); + print("

Rekap Transaksi Bon



"); + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt2)){ + print(""); + } + + print("
Tanggal NotaNo.NotaKd.PlgKode Brg.Nama Brg.SupplierNomorJumlDiscHJHPKd Pram
$tgl$nota$kdplg$kdbrg$nmbrg$kdlama$no$jml$disc".number_format($hj,0,',','.')."$hp$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + /*----------------------------------------Rekap Bawa */ + $query3 = "SELECT m.tgl_nota,d.no_nota,m.kd_customer,d.kd_barang,b.nama_barang,d.status_barang,s.nama_supplier,d.no_barang,d.jumlah,d.harga_satuan,n.harga_pokok,d.kode_pram + FROM d_nota_bawa d,barang b, no_barang n, m_nota_bawa m, supplier s + WHERE (d.kd_barang = b.kode_barang and d.no_barang = n.nomor) + and b.id_gabungan = n.id_gabungan + and d.no_nota = m.no_nota + and b.kode_supplier = s.kd_supplier + and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate' + order by m.tgl_nota"; + //and status_barang is null + if($stmt3 = mysqli_prepare($conn,$query3)){ + mysqli_stmt_execute($stmt3); + mysqli_stmt_store_result($stmt3); + $cek = mysqli_stmt_num_rows($stmt3); + if($cek > 0){ + mysqli_stmt_bind_result($stmt3,$tgl,$nota,$kd_customer,$kdbrg,$nmbrg,$status,$kdlama,$no,$jml,$hj,$hp,$kdpram); + + print("
"); + print("

Rekap Transaksi Bawa



"); + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt3)){ + print(""); + } + + print("
Tanggal NotaNo.NotaKd. PlgKode Brg.Nama Brg.StatusSupplierNomorJumlHJHPKd Pram
$tgl$nota$kd_customer$kdbrg$nmbrg$status$kdlama$no$jml".number_format($hj,0,',','.')."$hp$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + /*----------------------------------------Rekap retur */ + $query4 = "SELECT m.tgl_nota,d.no_nota,d.kd_barang,b.nama_barang,s.nama_supplier,d.no_barang,d.jumlah,d.diskon,d.harga_jual,d.harga_pokok,d.kode_pram + FROM d_nota_retur d,barang b,m_nota_retur m, supplier s + WHERE d.kd_barang = b.kode_barang + and d.no_nota = m.no_nota + and b.kode_supplier = s.kd_supplier + and (m.status_nota = 'T' or m.status_nota = 'K' or m.status_nota = 'D') + and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate' + order by m.tgl_nota"; + if($stmt4 = mysqli_prepare($conn,$query4)){ + mysqli_stmt_execute($stmt4); + mysqli_stmt_store_result($stmt4); + $cek = mysqli_stmt_num_rows($stmt4); + if($cek > 0){ + mysqli_stmt_bind_result($stmt4,$tgl,$nota,$kdbrg,$nmbrg,$kdlama,$no,$jml,$disc,$hj,$hp,$kdpram); + + print("
"); + print("

Rekap Transaksi Retur



"); + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt4)){ + print(""); + } + + print("
Tanggal NotaNo.NotaKode Brg.Nama Brg.Kode LamaNomorJumlDiscHJHPKd Pram
$tgl$nota$kdbrg$nmbrg$kdlama$no$jml$disc".number_format($hj,0,',','.')."$hp$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + print("
"); + } +?> diff --git a/old-source/LaporanJual/rincitransfer.php b/old-source/LaporanJual/rincitransfer.php new file mode 100644 index 0000000..3c99e0a --- /dev/null +++ b/old-source/LaporanJual/rincitransfer.php @@ -0,0 +1,67 @@ +"; + echo "table.tbl {width:950px;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}"; + echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}"; + echo "body {font-size:9pt;}"; + echo "div.luar{text-align:left;margin-left:100px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $tgl = left($_GET['tgllini'],10); + $lini = right($_GET['tgllini'],2); + + + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Transfer Barang rinci*/ + $query = "SELECT m.`tgl_transfer`,m.faktur_oper,m.`toko_tujuan`,d.kode_barang_nota,b.nama_barang,d.nomor,sum(d.jumlah) juml,sum(d.jumlah*d.harga_satuan) hp,d.no_nota + FROM m_transfer m, d_transfer d, barang b + where m.id_transfer = d.id_transfer + and d.kode_barang_nota = b.kode_barang + and m.validasi = '1' + and date(m.tgl_transfer) = '$tgl' + and b.kode_strip = '$lini' + GROUP BY m.faktur_oper,concat(d.kode_barang_nota,d.nomor)"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tglnota,$nota,$supp,$kdbrg,$nmbrg,$no,$jml,$hp,$ktr); + + print("
"); + print("

Rekap Transfer Barang



"); + print("

"); + print(""); + print(" + "); + + $ttHP = 0; + while(mysqli_stmt_fetch($stmt)){ + $ttHP += $hp; + print(" + + "); + } + print(""); + print("
Tgl NotaNo.FakturToko TujuanKode Brg.Nama Brg.NomorJumlHPNota Asli
$tglnota$nota$supp$kdbrg$nmbrg$no$jml".number_format($hp,0,',','.')."$ktr
Total HP".number_format($ttHP,0,',','.')."

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + print("
"); + } + +?> diff --git a/old-source/LaporanJual/rincitransferkembali.php b/old-source/LaporanJual/rincitransferkembali.php new file mode 100644 index 0000000..08b37d1 --- /dev/null +++ b/old-source/LaporanJual/rincitransferkembali.php @@ -0,0 +1,67 @@ +"; + echo "table.tbl {width:950px;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}"; + echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}"; + echo "body {font-size:9pt;}"; + echo "div.luar{text-align:left;margin-left:100px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $tgl = left($_GET['tgllini'],10); + $lini = right($_GET['tgllini'],2); + + + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Transfer Barang rinci*/ + $query = "SELECT m.`tgl_transfer`,m.faktur_oper,m.`toko_tujuan`,d.kode_barang_nota,b.nama_barang,d.nomor,sum(d.jumlah) juml,sum(d.jumlah*d.harga_satuan) hp,d.no_nota + FROM m_transfer_kembali m, d_transfer_kembali d, barang b + where m.id_transfer = d.id_transfer + and d.kode_barang_nota = b.kode_barang + and m.validasi = '1' + and date(m.tgl_kembali) = '$tgl' + and b.kode_strip = '$lini' + GROUP BY m.faktur_oper,concat(d.kode_barang_nota,d.nomor)"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tglnota,$nota,$supp,$kdbrg,$nmbrg,$no,$jml,$hp,$ktr); + + print("
"); + print("

Rekap Transfer Barang Kembali



"); + print("

"); + print(""); + print(" + "); + + $ttHP = 0; + while(mysqli_stmt_fetch($stmt)){ + $ttHP += $hp; + print(" + + "); + } + print(""); + print("
Tgl NotaNo.FakturToko TujuanKode Brg.Nama Brg.NomorJumlHPNota Asli
$tglnota$nota$supp$kdbrg$nmbrg$no$jml".number_format($hp,0,',','.')."$ktr
Total HP".number_format($ttHP,0,',','.')."

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + print("
"); + } + +?> diff --git a/old-source/LaporanJual/send_lapdetailjual.php b/old-source/LaporanJual/send_lapdetailjual.php new file mode 100644 index 0000000..650135d --- /dev/null +++ b/old-source/LaporanJual/send_lapdetailjual.php @@ -0,0 +1,89 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $idToko = $_POST['idToko']; + $bulan = $_POST['bulan']; + $tahun = $_POST['tahun']; + + if(bukaKoneksi() AND bukaKoneksiPA()){ + global $conn; + global $connPA; + + $query = "SELECT * FROM tmp_lapdetailjual"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tunai,$omset,$andil); + + echo "

[Home]

"; + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + + print(" + "); + + $query_server = "SELECT tahun,bulan,toko FROM andil_tunai + WHERE tahun = '$tahun' + AND bulan = '$bulan' + AND toko = '$idToko'"; + if($stmt2 = mysqli_prepare($connPA,$query_server)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + //cek di pusat,jika ada data yg sama,maka di update + while(mysqli_stmt_fetch($stmt2)){ + $queryUpdate = "UPDATE andil_tunai SET total_tunai = $tunai, total_omset = $omset, andil = $andil + WHERE tahun = '$tahun' + AND bulan = '$bulan' + AND toko = '$idToko'"; + runQueryPA($queryUpdate); + } + }else{ + // jika tdk ada data yg sama,masukkan data yang baru. + $queryins = "INSERT INTO andil_tunai(tahun,bulan,toko,total_tunai,total_omset,andil) + VALUES ('$tahun', '$bulan', '$idToko', $tunai, $omset, $andil)"; + runQueryPA($queryins); + } + } + } + print("
Total TunaiTotal OmsetAndil Tunai
".number_format($tunai,0,',','.')."".number_format($omset,0,',','.')."".number_format($andil,2,'.',',')."

"); + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
"; + echo "Data berhasil dikirim."; + echo "
"; + }else{ + echo "Data tidak ada!"; + } + $queryclear1= "DROP TABLE IF EXISTS tmp_lapdetailjual"; + runQuery($queryclear1); + + } + } +?> diff --git a/old-source/LaporanJual/send_lapjualperkat.php b/old-source/LaporanJual/send_lapjualperkat.php new file mode 100644 index 0000000..9ec274a --- /dev/null +++ b/old-source/LaporanJual/send_lapjualperkat.php @@ -0,0 +1,95 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $idToko = $_POST['idToko']; + $bulan = $_POST['bulan']; + $tahun = $_POST['tahun']; + + if(bukaKoneksi() AND bukaKoneksiPA()){ + global $conn; + global $connPA; + + $query = "SELECT tl.kel_jns,tl.lini,tl.vol,tl.totHJ,tl.nettprofit + FROM tmp_lapjualperkat tl + ORDER BY tl.kel_jns,tl.lini"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kat,$lini,$jml,$om,$profit); + + $jum = 0; + echo "

[Home]

"; + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + + print(" + "); + + $query_server = "SELECT tahun,bulan,toko,kategori,lini FROM om_kat_lini + WHERE tahun = '$tahun' + AND bulan = '$bulan' + AND toko = '$idToko' + AND lini = '$lini'"; + if($stmt2 = mysqli_prepare($connPA,$query_server)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + //cek di pusat,jika ada data yg sama,maka di update + while(mysqli_stmt_fetch($stmt2)){ + $queryUpdate = "UPDATE om_kat_lini SET unit = $jml, omset = $om, nett_profit = $profit + WHERE tahun = '$tahun' + AND bulan = '$bulan' + AND toko = '$idToko' + AND lini = '$lini'"; + runQueryPA($queryUpdate); + } + }else{ + // jika tdk ada data yg sama,masukkan data yang baru. + $queryins = "INSERT INTO om_kat_lini(tahun,bulan,toko,kategori,lini,unit,omset,nett_profit) + VALUES ('$tahun', '$bulan', '$idToko', '$kat', '$lini', $jml, $om, $profit)"; + runQueryPA($queryins); + } + } + $jum += 1; + } + print("
KategoriLiniVolOmsetNett Profit
$kat$lini$jml".number_format($om,0,',','.')."".number_format($profit,2,'.',',')."

"); + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
"; + echo "Ada ". $jum ." data yang berhasil dikirim."; + echo "
"; + }else{ + echo "Data tidak ada!"; + } + } + $queryclear1= "DROP TABLE IF EXISTS tmp_lapjualperkat"; + runQuery($queryclear1); + + } +?> diff --git a/old-source/LaporanJual/stokps1c.php b/old-source/LaporanJual/stokps1c.php new file mode 100644 index 0000000..5343eb8 --- /dev/null +++ b/old-source/LaporanJual/stokps1c.php @@ -0,0 +1,100 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan Persediaan Per Supplier +
+
+
+ + +
Kode Supplier: + +
Lini Produk : + +
+
+
+
+
+
+ +
+
Cari Supplier
+
+ +
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + + +
+ + diff --git a/old-source/LaporanJual/transbrg.php b/old-source/LaporanJual/transbrg.php new file mode 100644 index 0000000..b64911b --- /dev/null +++ b/old-source/LaporanJual/transbrg.php @@ -0,0 +1,81 @@ + + + + + :: Pengadaan Barang + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan Transfer Antar Toko & Transfer Barang Kembali +
+
+
+ + + +
Range Tanggal: s/d
+
+
+
+
+ +
+ + diff --git a/old-source/LaporanJual/transbrg.php~ b/old-source/LaporanJual/transbrg.php~ new file mode 100644 index 0000000..4c0adfa --- /dev/null +++ b/old-source/LaporanJual/transbrg.php~ @@ -0,0 +1,72 @@ + + + + + Amigo Group :: Pengadaan Barang + + + + + + + + + + + +
+
+ +
+
+
Laporan Transfer Antar Toko
+
+
+
+ + + +
Range Tanggal: s/d
+
+
+
+
+ +
+ + diff --git a/old-source/LaporanJual/tunai.php b/old-source/LaporanJual/tunai.php new file mode 100644 index 0000000..ad9f35f --- /dev/null +++ b/old-source/LaporanJual/tunai.php @@ -0,0 +1,117 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Rekap Transaksi Tunai +
+
+
+ + + +
Range Tanggal: s/d
+
+
+
+
+ + + +
Range Tanggal: s/d
+
+
+
+
+
Laporan Retur Penjualan Barang Konsinyasi + + + +
Range Tanggal: s/d
+
+
+
+
+ +
+ + diff --git a/old-source/README.md b/old-source/README.md new file mode 100644 index 0000000..e69de29 diff --git a/old-source/ajaxbarang.php b/old-source/ajaxbarang.php new file mode 100644 index 0000000..8efbeef --- /dev/null +++ b/old-source/ajaxbarang.php @@ -0,0 +1,410 @@ + +prepare($query); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function hapus_beli($id_barang){ + if ($id_barang != "") { + $array_data = array(); + require_once 'db_login.inc.php'; + $pemakai = $_SESSION["useracc"]; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $query = "DELETE FROM `tPembelian$pemakai` WHERE id = '".$id_barang."' LIMIT 1"; + $stmt = $mysqli->prepare($query); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function edit_beli($id_barang){ + if ($id_barang != "") { + $array_data = array(); + require_once 'db_login.inc.php'; + $pemakai = $_SESSION["useracc"]; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT *,DATE_FORMAT(exp,'%m-%d-%Y') expdate, + (REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + FROM `tPembelian$pemakai` WHERE id = '".$id_barang."' LIMIT 1"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'id' => $a['id'], + 'kode_barang' => $a['kode_barang'], + 'barcode' => $a['barcode'], + 'jumlah' => $a['jumlah'], + 'subtotal' => $a['subtotal'], + 'disc' => $a['disc'], + 'discrp' => $a['discrp'], + 'profit' => $a['profit'], + 'ppn' => $a['ppn'], + 'harga_pokok' => $a['hp'], + 'harga_jual' => $a['harga_jual'], + 'exp' => $a['expdate'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + + +function simpan($kdbrg,$barcode,$namabrg,$kdsupp,$group,$ceklini,$hp,$hj,$isi2,$hj2,$isi3,$hj3,$satuan,$tglentry,$stock,$operasi) +{ + require_once 'db_login.inc.php'; + require_once "func_lib.php"; + $harray = array(); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $tahun = substr($tglentry,0,4); + $bulan = substr($tglentry,5,2); + $idgabungan = "A8".$kdbrg; + $hrgp = convHrgP($hp); + if ($operasi === "simpan") + { + if($kdbrg != "" && $barcode != ""){ + $stmt = $mysqli->prepare("INSERT INTO barang( + `kode_barang`, + `kode_lama`, + `nama_barang`, + `kode_toko`, + `tahun`, + `bulan`, + `id_gabungan`, + `kode_strip`, + `kode_supplier`, + `ked_produk`) + VALUES ('$kdbrg','$barcode','$namabrg','A8','$tahun','$bulan','$idgabungan','$group','$kdsupp','$ceklini')"); + $stmt->execute(); + $stmt2 = $mysqli->prepare("INSERT INTO no_barang( + `id_gabungan`, + `nomor`, + `harga_pokok`, + `harga_jual`, + `harga_jual2`, + `isi_max2`, + `harga_jual3`, + `isi_max3`, + `satuan`, + `stok_min`, + `stok`) + VALUES ('$idgabungan','1','$hrgp','$hj','$hj2','$isi2','$hj3','$isi3','$satuan','1','$stock')"); + $stmt2->execute(); + if($stmt->affected_rows > 0) { + $harray[0] = 1; + $stmt->close(); + } else { + $harray[0] = 0; + } + }else{ + $harray[0] = 2; + } + } elseif ($operasi === "update") { + + $stmt = $mysqli->prepare("UPDATE barang SET + `kode_lama`='$barcode', + `nama_barang`='$namabrg', + `kode_strip` = '$group', + `ked_produk` = '$ceklini' + WHERE kode_barang = '$kdbrg'"); + $stmt->execute(); + $stmt2 = $mysqli->prepare("UPDATE no_barang SET + `harga_pokok`='$hrgp', + `harga_jual`='$hj', + `harga_jual2`='$hj2', + `isi_max2`='$isi2', + `harga_jual3`='$hj3', + `isi_max3`='$isi3', + `satuan`='$satuan' + WHERE id_gabungan = '$idgabungan'"); + $stmt2->execute(); + if($stmt->affected_rows > 0) { + $harray[0] = 1; + $stmt->close(); + } else + { + $harray[0] = 0; + } + } + $mysqli->close(); + echo json_encode($harray); +} + +function cek_barang($kd_barang) +{ + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT COUNT(*) FROM barang WHERE kode_barang = '$kd_barang'")->fetch_array(); + if ($data[0] > 0) + { + return true; + } else + { + return false; + } +} + +function cari_barang($nama) { + if($nama != "") { + $harray = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT kode_barang, kode_lama, nama_barang, nama_supplier FROM barang b, supplier s + WHERE b.kode_supplier = s.kd_supplier + AND (kode_lama LIKE '%".$nama."%' OR nama_barang LIKE '%".$nama."%')"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'], + 'barcode' => $a['kode_lama'], + 'nama_barang' => $a['nama_barang'], + 'nama_supplier' => $a['nama_supplier'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + +function cari_barang_purchase($nama) { + if($nama != "") { + $harray = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT kode_barang, kode_lama, nama_barang, nama_supplier FROM barang b, supplier s + WHERE b.kode_supplier = s.kd_supplier + AND (kode_lama LIKE '%".$nama."%' OR nama_barang LIKE '%".$nama."%')"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'], + 'barcode' => $a['kode_lama'], + 'nama_barang' => $a['nama_barang'], + 'nama_supplier' => $a['nama_supplier'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + +function ambil_barang($id_barang) { + if ($id_barang != "") { + $array_data = array(); + require_once 'db_login.inc.php'; + require_once 'func_lib.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT b.kode_barang,b.kode_lama,b.nama_barang,b.kode_strip,s.nama_strip, + b.kode_supplier,b.ked_produk,k.ked_produk namakedproduk, + n.harga_pokok,n.harga_jual,n.harga_jual2,n.isi_max2,n.harga_jual3,n.isi_max3, + n.satuan,sb.namaSatuanBarang,n.stok + FROM barang b,no_barang n,kedalaman_produk k,strip s,satuan_barang sb + WHERE b.id_gabungan = n.id_gabungan + AND b.kode_strip = s.kd_strip + AND b.kode_strip = k.kode_strip + AND b.ked_produk = k.kode_ked_produk + AND n.satuan = sb.idSatuanBarang + AND b.kode_barang = '".$id_barang."'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $hplama = DeconvHrgP($a['harga_pokok']); + $array_data[$idx] = array( + 'kode_barang' => $a['kode_barang'], + 'barcode' => $a['kode_lama'], + 'nama_barang' => $a['nama_barang'], + 'kode_strip' => $a['kode_strip'], + 'nama_strip' => $a['nama_strip'], + 'kode_supplier' => $a['kode_supplier'], + 'ked_produk' => $a['ked_produk'], + 'namakedproduk' => $a['namakedproduk'], + 'harga_pokok' => $hplama, + 'harga_jual' => $a['harga_jual'], + 'harga_jual2' => $a['harga_jual2'], + 'isi_max2' => $a['isi_max2'], + 'harga_jual3' => $a['harga_jual3'], + 'isi_max3' => $a['isi_max3'], + 'satuan' => $a['satuan'], + 'namaSatuanBarang' => $a['namaSatuanBarang'], + 'stokbrg' => $a['stok'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($array_data); + } +} + +function ambil_kode() { + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT kode_barang FROM barang ORDER BY kode_barang DESC limit 1"); + if($data->num_rows > 0) { + $a = $data->fetch_array(MYSQLI_NUM); + //$kode_awal = $a[0]; + //$kode = (int)$a[0] + 1; + //$kode = '0'.$kode; + //$array_data[0] = $kode; + + $kode_awal = intval(substr($a[0],1,6)); + $kode_awal++; + $strUrut = strlen($kode_awal); + for($i=1;$i<=(6-$strUrut);$i++){ + $kode = "0" . $kode_awal; + } + $array_data[0] = $kode; + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); +} + +function cekBarang($barcode){ + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT kode_barang, kode_lama FROM barang WHERE kode_barang = '$barcode' OR kode_lama = '$barcode' limit 1"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $array_data[$idx] = array( + 'kode_barang' => $a['kode_barang'], + 'barcode' => $a['kode_lama'] + ); + $idx++; + } + $data->close(); + }else{ + $array_data[0] = 0; + } + $mysqli->close(); + echo json_encode($array_data); +} + +function cekFaktur($faktur){ + $harray = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT no_faktur FROM m_pembelian WHERE no_faktur = '$faktur' limit 1"); + if($data->num_rows > 0) { + $harray[0] = 1; + $data->close(); + } else { + $harray[0] = 0; + } + $mysqli->close(); + echo json_encode($harray); +} + +?> diff --git a/old-source/ajaxbayar.php b/old-source/ajaxbayar.php new file mode 100644 index 0000000..e5a4651 --- /dev/null +++ b/old-source/ajaxbayar.php @@ -0,0 +1,109 @@ + +prepare("INSERT INTO bayar( + `periode_awal`, + `periode_akhir`, + `tgl_bayar`, + `jenis_bayar`, + `tgl_cair`, + `no_giro`, + `kd_supplier`, + `diskon`, + `penyesuaian`, + `materai`, + `total_bayar`, + `ket_bayar` + ) + VALUES ('$per_awal','$per_akhir','$tglbyr','$jnsbayar','$tglcair','$nogiro', + '$kdsupplier','$disc','$penyesuaian','$materai','$grandtotal','$ketbayar')"); + $dtInsert->execute(); + + $qry_select = $mysqli->query("SELECT MAX(`IDbayar`) id FROM `bayar` WHERE 1"); + if($qry_select->num_rows > 0){ + while($n = $qry_select->fetch_array(MYSQLI_ASSOC)){ + $id = $n['id']; + } + } + validBeli($id); + validRetur($id); + if($dtInsert->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $dtInsert->close(); + + $mysqli->close(); + } + + echo json_encode($array_data); +} + +function validBeli($id){ + $notabelis = $_POST['notabeli']; + + $mysqli_beli = new mysqli(HOST, USER, PASSWORD, DATABASE); + + foreach ($notabelis as $fakt => $valnotabelis){ + $update_beli = $mysqli_beli->prepare("UPDATE `m_pembelian` SET status_bayar = '1', + IDbayar = '$id' + WHERE no_faktur = '$fakt'"); + $update_beli->execute(); + + } + + $mysqli_beli->close(); +} + +function validRetur($id){ + $notareturs = $_POST['notaretur']; + + $mysqli_retur = new mysqli(HOST, USER, PASSWORD, DATABASE); + + foreach ($notareturs as $nota => $valnotareturs){ + $update_retur = $mysqli_retur->prepare("UPDATE `m_retur_beli` SET status_bayar = '1', + IDbayar = '$id' + WHERE no_nota = '$nota'"); + $update_retur->execute(); + + } + $mysqli_retur->close(); +} + +?> diff --git a/old-source/ajaxdlmpdk.php b/old-source/ajaxdlmpdk.php new file mode 100644 index 0000000..e59eb6d --- /dev/null +++ b/old-source/ajaxdlmpdk.php @@ -0,0 +1,181 @@ + +prepare($query); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function cari_dlmpdk($nama) { + if($nama != "") { + $harray = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $nama = addslashes($nama); + $data = $mysqli->query("SELECT * FROM kedalaman_produk WHERE kode_strip LIKE '%".$nama."%' ORDER BY kode_strip,kode_ked_produk"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kode_strip' => stripcslashes($a['kode_strip']), + 'kode_ked_produk' => $a['kode_ked_produk'], + 'ked_produk' => $a['ked_produk'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + +function ambil_dlmpdk($id_dlmpdk) { + if ($id_dlmpdk != "") { + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT * FROM kedalaman_produk WHERE concat(kode_strip,kode_ked_produk) = '".$id_dlmpdk."' ORDER BY kode_ked_produk"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $array_data[$idx] = array( + 'kode_ked_produk' => $a['kode_ked_produk'], + 'kode_strip' => stripcslashes($a['kode_strip']), + 'ked_produk' => $a['ked_produk'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($array_data); + } +} + + + +function transaksi_dlmpdk($lini,$id_dlmpdk) { + if($id_dlmpdk != ""){ + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT * FROM kedalaman_produk WHERE concat(kode_strip,kode_ked_produk) = '".$lini.$id_dlmpdk."'"); + if($data->num_rows > 0) { + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + /* update data dlmpdk */ + update_dlmpdk(); + } else { + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + /* simpan data dlmpdk baru */ + simpan_dlmpdk(); + } + } +} + +function update_dlmpdk(){ + if(isset($_POST)) { + $kode_dlmpdk = $_POST['kodedlmpdk']; + $lini = $_POST['lini']; + $nama = $_POST['nama']; + + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $query = "UPDATE kedalaman_produk SET "; + $query .= "kode_ked_produk = ?, "; + $query .= "kode_strip = ?, "; + $query .= "ked_produk = ? "; + $query .= "WHERE kode_ked_produk = ? AND kode_strip = ?"; + + $stmt = $mysqli->prepare($query); + $stmt->bind_param("sssss", $kode_dlmpdk, $lini, $nama, $kode_dlmpdk, $lini); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function simpan_dlmpdk() { + if(isset($_POST)) { + $kode_dlmpdk = $_POST['kodedlmpdk']; + $lini = $_POST['lini']; + $nama = $_POST['nama']; + + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $query = "INSERT INTO kedalaman_produk(kode_ked_produk, kode_strip, ked_produk) VALUES (?, ?, ?)"; + $stmt = $mysqli->prepare($query); + $stmt->bind_param("sss", $kode_dlmpdk, $lini, $nama); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} +?> \ No newline at end of file diff --git a/old-source/ajaxedittmpbeli.php b/old-source/ajaxedittmpbeli.php new file mode 100644 index 0000000..f2c5e59 --- /dev/null +++ b/old-source/ajaxedittmpbeli.php @@ -0,0 +1,62 @@ + +prepare("UPDATE `tPembelian$pemakai` SET + `kode_barang` = '$kodebarang', + `barcode` = '$barcode', + `nm_brg` = '$nama', + `jumlah` = '$jmlbeli', + `subtotal` = '$subtotal', + `disc` = '$disc', + `discrp` = '$discrp', + `profit` = '$profit', + `ppn` = '$ppn', + `harga_pokok` = '$hpbaru', + `harga_jual` = '$hjbaru', + `exp` = '$expdate' + WHERE id = '$id'"); + $dtUpdate->execute(); + if($dtUpdate->affected_rows > 0) { + $harray[0] = 1; + $dtUpdate->close(); + } else { + $harray[0] = 0; + } + $mysqli->close(); + }else{ + $harray[0] = 2; + } + echo json_encode($harray); + +?> + \ No newline at end of file diff --git a/old-source/ajaxkaryawan.php b/old-source/ajaxkaryawan.php new file mode 100644 index 0000000..1ff7cfb --- /dev/null +++ b/old-source/ajaxkaryawan.php @@ -0,0 +1,248 @@ + +query("SELECT nik,nama,id_pekerjaan FROM karyawan WHERE nama LIKE '%".$nama."%' ORDER BY nik"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'nik' => $a['nik'], + 'nama' => stripcslashes($a['nama']), + 'id_pekerjaan' => $a['id_pekerjaan'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + }else{ + $harray = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $nama = addslashes($nama); + $data = $mysqli->query("SELECT nik,nama,id_pekerjaan FROM karyawan ORDER BY nik"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'nik' => $a['nik'], + 'nama' => stripcslashes($a['nama']), + 'id_pekerjaan' => $a['id_pekerjaan'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + +function ambil_kary($id_kary) { + if ($id_kary != "") { + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT * FROM karyawan WHERE nik = '".$id_kary."' ORDER BY nik"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $array_data[$idx] = array( + 'nik' => $a['nik'], + 'nama' => $a['nama'], + 'username' => $a['username'], + 'password' => $a['password'], + 'id_pekerjaan' => $a['id_pekerjaan'], + 'id_department' => $a['id_department'], + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($array_data); + } +} + +function hapus_kary($id_kary){ + if ($id_kary != "") { + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $query = "DELETE FROM karyawan WHERE nik = '".$id_kary."' LIMIT 1"; + $stmt = $mysqli->prepare($query); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + + +function transaksi_kary($id_kary) { + if($id_kary != ""){ + // cek data + $nik = $_POST['nik']; + $username = $_POST['uname']; + $passwdlama = MD5($_POST['passwdlama']); + + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT nik,username,password FROM karyawan WHERE nik = '".$id_kary."' ORDER BY nik"); + $dt = $data->fetch_array(MYSQLI_ASSOC); + if ($dt['password']=='') + { $pass = MD5($dt['password']); } + else + { $pass = $dt['password']; } + if ($dt['username']=='') + { $uname = $username ; } + else + { $uname = $dt['username']; } + $nomor_induk = $dt['nik']; + + if($data->num_rows > 0) { + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + + /* update data kary */ + if ($nik==$nomor_induk && $passwdlama==$pass) + { + update_kary(); + } + else + { + alert_error(); + } + + } else { + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + /* simpan data kary baru */ + simpan_kary(); + + } + } +} + +function alert_error(){ + $array_data = array(); + $array_data[0] = 0; + echo json_encode($array_data); +} + +function update_kary(){ + if(isset($_POST)) { + $kode_kary = $_POST['nik']; + $nama_kary = $_POST['namakary']; + $uname = $_POST['uname']; + $passwdlama = $_POST['passwdlama']; + $passwd = MD5($_POST['passwd']); + $job = $_POST['job']; + $department = $_POST['department']; + + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $query = "UPDATE karyawan SET "; + $query .= "nama = ?, "; + $query .= "username = ?, "; + $query .= "password = ?, "; + $query .= "id_pekerjaan = ?, "; + $query .= "id_department = ? "; + $query .= "WHERE nik = ?"; + + $stmt = $mysqli->prepare($query); + $stmt->bind_param("ssssss", $nama_kary, $uname, $passwd, $job, $department, $kode_kary); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function simpan_kary() { + if(isset($_POST)) { + $kode_kary = $_POST['nik']; + $nama_kary = $_POST['namakary']; + $uname = $_POST['uname']; + $passwd = MD5($_POST['passwd']); + $job = $_POST['job']; + $department = $_POST['department']; + $last_login = '0000-00-00 00:00:00'; + + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $query = "INSERT INTO karyawan VALUES (?, ?, ?, ?, ?, ?, ?)"; + $stmt = $mysqli->prepare($query); + $stmt->bind_param("sssssss", $kode_kary, $nama_kary, $uname, $passwd, $job, $department, $last_login); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} +?> \ No newline at end of file diff --git a/old-source/ajaxpelanggan.php b/old-source/ajaxpelanggan.php new file mode 100644 index 0000000..9db2460 --- /dev/null +++ b/old-source/ajaxpelanggan.php @@ -0,0 +1,266 @@ + +prepare($query); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function simpan($id_pel, $alias, $stsmember, $ktp, $nama, $alamat, $wilayah, $tp_lahir, $tg_lahir, $jen_kel, $agama, $kerja, $statusnikah, $telp, $hp, $email, $upline, $batasbon, + $nilaibon, $bonistimewa, $komisi, $komisiambil, $statuspel, $tglentry, $operasi) +{ + require_once 'db_login.inc.php'; + $harray = array(); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if ($operasi === "simpan") + { + if($nama != "" && $alamat != ""){ + $stmt = $mysqli->prepare("INSERT INTO pelanggan(kd_customer, ktp, nama, alamat, wilayah, tempat_lahir, tgl_lahir, jns_kelamin, agama, pekerjaan, + status_nikah, telp, ponsel, email, upline, bts_bon, nilai_bon, bts_bon_istimewa, nilai_komisi, komisi_diambil, tgl_entry, jenis_customer) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); + $stmt->bind_param("sssssssssssssssiiiiiss", $id_pel, $ktp, $nama, $alamat, $wilayah, $tp_lahir, $tg_lahir, $jen_kel, $agama, $kerja, $statusnikah, $telp, + $hp, $email, $upline, $batasbon, $nilaibon, $bonistimewa, $komisi, $komisiambil, $tglentry, $statuspel); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $harray[0] = 1; + $stmt->close(); + } else { + $harray[0] = 0; + } + }else{ + $harray[0] = 2; + } + } elseif ($operasi === "update") { + $stmt = $mysqli->prepare("UPDATE pelanggan SET ktp=?, nama=?, alamat=?, wilayah=?, tempat_lahir=?, tgl_lahir=?, jns_kelamin=?, agama=?, pekerjaan=?, + status_nikah=?, telp=?, ponsel=?, email=?, upline=?, bts_bon=?, nilai_bon=?, bts_bon_istimewa=?, nilai_komisi=?, komisi_diambil=?, + jenis_customer=? WHERE kd_customer=?"); + $stmt->bind_param("ssssssssssssssiiiiiss", $ktp, $nama, $alamat, $wilayah, $tp_lahir, $tg_lahir, $jen_kel, $agama, $kerja, $statusnikah, $telp, $hp, + $email, $upline, $batasbon, $nilaibon, $bonistimewa, $komisi, $komisiambil, $statuspel, $id_pel); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $harray[0] = 1; + $stmt->close(); + } else + { + $harray[0] = 0; + } + } + $mysqli->close(); + echo json_encode($harray); +} + +function cek_pelanggan($id_pelanggan) +{ + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT COUNT(*) FROM pelanggan WHERE kd_customer = '{$id_pelanggan}'")->fetch_array(); + if ($data[0] > 0) + { + return true; + } else + { + return false; + } +} + +function cari_pelanggan($nama) { + if($nama != "") { + $harray = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT kd_customer, nama, alamat, nilai_bon, bts_bon FROM pelanggan WHERE nama LIKE '%".$nama."%'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_customer' => $a['kd_customer'], + 'nama' => $a['nama'], + 'alamat' => $a['alamat'], + 'nilai_bon' => number_format($a['nilai_bon'],0,',','.'), + 'bts_bon' => number_format($a['bts_bon'],0,',','.') + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + +function cari_upline($nama) { + if($nama != "") { + $harray = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT kd_customer, nama, alamat, nilai_bon, bts_bon FROM pelanggan WHERE nama LIKE '%".$nama."%' AND upline = '#'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_customer' => $a['kd_customer'], + 'nama' => $a['nama'], + 'alamat' => $a['alamat'], + 'nilai_bon' => number_format($a['nilai_bon'],0,',','.'), + 'bts_bon' => number_format($a['bts_bon'],0,',','.') + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + +function ambil_pelanggan($id_pelanggan) { + if ($id_pelanggan != "") { + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT * FROM pelanggan WHERE kd_customer = '".$id_pelanggan."'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $tgl_lahir = ''; + + if($a['tgl_lahir'] != "") { + $tgl_lahir = substr($a['tgl_lahir'],8,2)."-".substr($a['tgl_lahir'],5,2)."-".substr($a['tgl_lahir'],0,4); + } else { + $tgl_lahir = $a['tgl_lahir']; + } + + $array_data[$idx] = array( + 'kd_customer' => $a['kd_customer'], + 'alias' => $a['alias'], + 'member' => $a['member'], + 'ktp' => $a['ktp'], + 'nama' => $a['nama'], + 'alamat' => $a['alamat'], + 'kd_lokasi' => $a['kd_lokasi'], + 'wilayah' => $a['wilayah'], + 'tempat_lahir' => $a['tempat_lahir'], + 'tgl_lahir' => $tgl_lahir, + 'jns_kelamin' => $a['jns_kelamin'], + 'agama' => $a['agama'], + 'kd_lokasi' => $a['kd_lokasi'], + 'pekerjaan' => $a['pekerjaan'], + 'status_nikah' => $a['status_nikah'], + 'telp' => $a['telp'], + 'ponsel' => $a['ponsel'], + 'email' => $a['email'], + 'status' => $a['status'], + 'upline' => $a['upline'], + 'bts_bon' => $a['bts_bon'], + 'nilai_bon' => $a['nilai_bon'], + 'bts_bon_istimewa' => $a['bts_bon_istimewa'], + 'nilai_komisi' => $a['nilai_komisi'], + 'komisi_diambil' => $a['komisi_diambil'], + 'jenis_customer' => $a['jenis_customer'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($array_data); + } +} + +function ambil_kode() { + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT kd_customer FROM pelanggan ORDER BY kd_customer DESC limit 1"); + if($data->num_rows > 0) { + $a = $data->fetch_array(MYSQLI_NUM); + //$kode_awal = substr($a[0],2,6); + $kode_awal = intval(substr($a[0],2,6)); + $kode_awal++; + $strUrut = strlen($kode_awal); + for($i=1;$i<=(6-$strUrut);$i++){ + $kode_awal = "0" . $kode_awal; + } + + //$kode = $kode_awal + 1; + $kode = 'A8'.$kode_awal; + $array_data[0] = $kode; + + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); +} +?> \ No newline at end of file diff --git a/old-source/ajaxplafon.php b/old-source/ajaxplafon.php new file mode 100644 index 0000000..184521e --- /dev/null +++ b/old-source/ajaxplafon.php @@ -0,0 +1,127 @@ + +query("SELECT kd_customer, nama, alamat, nilai_bon, bts_bon FROM pelanggan WHERE nama LIKE '%".$nama."%'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_customer' => $a['kd_customer'], + 'nama' => $a['nama'], + 'alamat' => $a['alamat'], + 'nilai_bon' => number_format($a['nilai_bon'],0,',','.'), + 'bts_bon' => number_format($a['bts_bon'],0,',','.') + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + +function ambil_pelanggan($id_pelanggan) { + if ($id_pelanggan != "") { + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT * FROM pelanggan WHERE kd_customer = '".$id_pelanggan."'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $tgl_lahir = ''; + + if($a['tgl_lahir'] != "") { + $tgl_lahir = substr($a['tgl_lahir'],8,2)."-".substr($a['tgl_lahir'],5,2)."-".substr($a['tgl_lahir'],0,4); + } else { + $tgl_lahir = $a['tgl_lahir']; + } + + $array_data[$idx] = array( + 'kd_customer' => $a['kd_customer'], + 'ktp' => $a['no_ktp_sim'], + 'nama' => $a['nama'], + 'alamat' => $a['alamat'], + 'tempat_lahir' => $a['tempat_lahir'], + 'tgl_lahir' => $tgl_lahir, + 'jns_kelamin' => $a['jns_kelamin'], + 'agama' => $a['agama'], + 'kd_lokasi' => $a['kd_lokasi'], + 'pekerjaan' => $a['pekerjaan'], + 'status_nikah' => $a['status_nikah'], + 'telp' => $a['telp'], + 'ponsel' => $a['ponsel'], + 'email' => $a['email'], + 'status' => $a['status'], + 'upline' => $a['upline'], + 'bts_bon' => number_format($a['bts_bon'],0,',','.'), + 'nilai_bon' => number_format($a['nilai_bon'],0,',','.'), + 'bts_bon_istimewa' => number_format($a['bts_bon_istimewa'],0,',','.'), + 'nilai_komisi' => number_format($a['nilai_komisi'],0,',','.'), + 'komisi_diambil' => number_format($a['komisi_diambil'],0,',','.'), + 'jenis_customer' => number_format($a['jenis_customer'],0,',','.') + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($array_data); + } +} + +function update_plafon($kode, $plafon) { + if ($kode != "" && $plafon != "") { + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $query = "UPDATE pelanggan SET bts_bon = ? WHERE kd_customer = ?"; + $stmt = $mysqli->prepare($query); + $stmt->bind_param("is", $plafon, $kode); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +?> \ No newline at end of file diff --git a/old-source/ajaxpurchase.php b/old-source/ajaxpurchase.php new file mode 100644 index 0000000..1a28978 --- /dev/null +++ b/old-source/ajaxpurchase.php @@ -0,0 +1,141 @@ + +prepare("INSERT INTO `m_pembelian`( + `no_faktur`, + `tgl_nota`, + `tgl_masuk`, + `tgl_jatuh_tempo`, + `kd_supplier`, + `status`, + `diskon`, + `diskon_pembelian`, + `ppn`, + `nik`, + `rp_beli`, + `total_beli`, + `validasi`, + `keterangan`, + `tgl_entry`, + `status_revisi` + ) + VALUES ('$nofaktur','$tglNota','$tgl_masuk','$tglJthTmp','$kdsupp','$status', + '$discProNota','$diskNota','$ppnNota','$nik','$trBeliNett','$tjBeli','$validasi', + '$ket','$tgl_entry','$status_revisi')"); + $dtInsert->execute(); + if($dtInsert->affected_rows > 0) { + simpan_d_pembelian(); + drop_temp(); + $harray[0] = 1; + $dtInsert->close(); + } else { + $harray[0] = 0; + } + $mysqli->close(); + }else{ + $harray[0] = 2; + } + echo json_encode($harray); +} + +function simpan_d_pembelian(){ + $nofaktur = $_REQUEST['nofaktur']; + $pemakai = $_SESSION["useracc"]; + + $mysqli_dbeli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $qry_select = $mysqli_dbeli->query("SELECT * FROM `tPembelian$pemakai` ORDER BY id"); + if($qry_select->num_rows > 0){ + while($pembelian = $qry_select->fetch_array(MYSQLI_ASSOC)){ + $kode_brg = $pembelian['kode_barang']; + $barcode = $pembelian['barcode']; + $nomor = 1; + $nama_brg = addslashes($pembelian['nm_brg']); + $jumlah = $pembelian['jumlah']; + $subtotal = $pembelian['subtotal']; + $disc = $pembelian['disc']; + $discrp = $pembelian['discrp']; + $profit = $pembelian['profit']; + $ppn = $pembelian['ppn']; + $harga_pokok = $pembelian['harga_pokok']; + $harga_jual = $pembelian['harga_jual']; + $expdate = $pembelian['exp']; + $Insert_to_dbeli = $mysqli_dbeli->prepare("INSERT INTO `d_pembelian`( + `id`, + `no_faktur`, + `kode_barang`, + `nomor`, + `harga_satuan`, + `harga_pokok`, + `diskon`, + `diskonrp`, + `profit`, + `ppn`, + `kode_asli`, + `jum_fisik`, + `hj_final`, + `nm_brg`, + `exp_date` + ) + VALUES (NULL, '$nofaktur','$kode_brg',$nomor,'$subtotal','$harga_pokok', + '$disc','$discrp','$profit','$ppn','$barcode','$jumlah','$harga_jual', + '$nama_brg','$expdate')"); + $Insert_to_dbeli->execute(); + $id_gab = "A8".$kode_brg; + $Insert_to_dbeli = $mysqli_dbeli->prepare("UPDATE `no_barang` SET stok = stok + $jumlah, + harga_pokok = '$harga_pokok', harga_jual = '$harga_jual' + WHERE id_gabungan = '$id_gab'"); + $Insert_to_dbeli->execute(); + } + } +} + +function drop_temp(){ + $pemakai = $_SESSION["useracc"]; + $queryclear ="DROP TABLE IF EXISTS `tPembelian$pemakai`"; + runQuery($queryclear); +} + +?> + \ No newline at end of file diff --git a/old-source/ajaxrak.php b/old-source/ajaxrak.php new file mode 100644 index 0000000..82f926b --- /dev/null +++ b/old-source/ajaxrak.php @@ -0,0 +1,167 @@ + +prepare($query); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function cari_rak($nama) { + $harray = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $nama = addslashes($nama); + $data = $mysqli->query("SELECT * FROM rak WHERE namaRak LIKE '%".$nama."%' ORDER BY idRak"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'idRak' => stripcslashes($a['idRak']), + 'namaRak' => $a['namaRak'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); +} + +function ambil_rak($id_rak) { + if ($id_rak != "") { + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT * FROM rak WHERE idRak = '".$id_rak."' ORDER BY idRak"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $array_data[$idx] = array( + 'idRak' => stripcslashes($a['idRak']), + 'namaRak' => $a['namaRak'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($array_data); + } +} + + + +function transaksi_rak($id_rak) { + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT * FROM rak WHERE idRak = '".$id_rak."'"); + if($data->num_rows > 0) { + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + /* update data rak */ + update_rak(); + } else { + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + /* simpan data rak baru */ + simpan_rak(); + } +} + +function update_rak(){ + if(isset($_POST)) { + $kode_rak = $_POST['koderak']; + $nama = $_POST['nama']; + + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $query = "UPDATE rak SET "; + $query .= "namaRak = ? "; + $query .= "WHERE idRak = ? "; + + $stmt = $mysqli->prepare($query); + $stmt->bind_param("si", $nama, $kode_rak); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function simpan_rak() { + $nama = $_POST['nama']; + + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $query = "INSERT INTO rak(namaRak) VALUES ('$nama')"; + $stmt = $mysqli->prepare($query); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); +} +?> \ No newline at end of file diff --git a/old-source/ajaxsatuanbrg.php b/old-source/ajaxsatuanbrg.php new file mode 100644 index 0000000..dcf4d61 --- /dev/null +++ b/old-source/ajaxsatuanbrg.php @@ -0,0 +1,168 @@ + +prepare($query); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function cari_satuanbrg($nama) { + $harray = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $nama = addslashes($nama); + $data = $mysqli->query("SELECT * FROM satuan_barang WHERE namaSatuanBarang LIKE '%".$nama."%' ORDER BY idSatuanBarang"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'idSatuanBarang' => stripcslashes($a['idSatuanBarang']), + 'namaSatuanBarang' => $a['namaSatuanBarang'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); +} + +function ambil_satuanbrg($id_satuanbrg) { + if ($id_satuanbrg != "") { + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT * FROM satuan_barang WHERE idSatuanBarang = '".$id_satuanbrg."' ORDER BY idSatuanBarang"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $array_data[$idx] = array( + 'idSatuanBarang' => stripcslashes($a['idSatuanBarang']), + 'namaSatuanBarang' => $a['namaSatuanBarang'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($array_data); + } +} + + + +function transaksi_satuanbrg($id_satuanbrg) { + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT * FROM satuan_barang WHERE idSatuanBarang = '".$id_satuanbrg."'"); + if($data->num_rows > 0) { + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + /* update data satuanbrg */ + update_satuanbrg(); + } else { + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + /* simpan data satuanbrg baru */ + simpan_satuanbrg(); + } +} + +function update_satuanbrg(){ + if(isset($_POST)) { + $idSatuanBarang = $_POST['kodesatuanbrg']; + $nama = $_POST['nama']; + + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $query = "UPDATE satuan_barang SET "; + $query .= "namaSatuanBarang = ? "; + $query .= "WHERE idSatuanBarang = ? "; + + $stmt = $mysqli->prepare($query); + $stmt->bind_param("si", $nama, $idSatuanBarang); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function simpan_satuanbrg() { + $idSatuanBarang = $_POST['kodesatuanbrg']; + $nama = $_POST['nama']; + + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $query = "INSERT INTO satuan_barang(namaSatuanBarang) VALUES ('$nama')"; + $stmt = $mysqli->prepare($query); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); +} +?> \ No newline at end of file diff --git a/old-source/ajaxstrip.php b/old-source/ajaxstrip.php new file mode 100644 index 0000000..b454c43 --- /dev/null +++ b/old-source/ajaxstrip.php @@ -0,0 +1,250 @@ + +prepare($query); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function cari_strip($nama) { + if($nama != "") { + $harray = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $nama = addslashes($nama); + $data = $mysqli->query("SELECT kd_strip, nama_strip, kel_jns FROM strip WHERE kd_strip LIKE '%".$nama."%' ORDER BY kd_strip"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_strip' => $a['kd_strip'], + 'nama_strip' => stripcslashes($a['nama_strip']), + 'kel_jns' => $a['kel_jns'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + }else{ + $harray = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $nama = addslashes($nama); + $data = $mysqli->query("SELECT kd_strip, nama_strip, kel_jns FROM strip ORDER BY kd_strip"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_strip' => $a['kd_strip'], + 'nama_strip' => stripcslashes($a['nama_strip']), + 'kel_jns' => $a['kel_jns'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + +function ambil_strip($id_strip) { + if ($id_strip != "") { + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT * FROM strip WHERE kd_strip = '".$id_strip."' ORDER BY kd_strip"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $array_data[$idx] = array( + 'kd_strip' => $a['kd_strip'], + 'nama_strip' => $a['nama_strip'], + 'murah1' => $a['murah1'], + 'murah2' => $a['murah2'], + 'sedang1' => $a['sedang1'], + 'sedang2' => $a['sedang2'], + 'mahal1' => $a['mahal1'], + 'mahal2' => $a['mahal2'], + 'benik_murah' => $a['benik_murah'], + 'benik_sedang' => $a['benik_sedang'], + 'benik_mahal' => $a['benik_mahal'], + 'kel_brg' => $a['kel_brg'], + 'kel_jns' => $a['kel_jns'], + 'persen_thiwul' => $a['persen_tiwul'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($array_data); + } +} + + + +function transaksi_strip($id_strip) { + if($id_strip != ""){ + // cek data + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT kd_strip FROM strip WHERE kd_strip = '".$id_strip."' ORDER BY kd_strip"); + if($data->num_rows > 0) { + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + /* update data strip */ + update_strip(); + } else { + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + /* simpan data strip baru */ + simpan_strip(); + } + } +} + +function update_strip(){ + if(isset($_POST)) { + $kode_strip = $_POST['kodestrip']; + $nama_strip = $_POST['namastrip']; + $murah1 = $_POST['murah1']; + $murah2 = $_POST['murah2']; + $sedang1 = $_POST['sedang1']; + $sedang2 = $_POST['sedang2']; + $mahal1 = $_POST['mahal1']; + $mahal2 = $_POST['mahal2']; + $benikmurah = $_POST['benikmurah']; + $beniksedang = $_POST['beniksedang']; + $benikmahal = $_POST['benikmahal']; + $kelbrg = $_POST['kelbrg']; + $keljns = $_POST['keljns']; + $thiwul = $_POST['thiwul']; + + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $query = "UPDATE strip SET "; + $query .= "nama_strip = ?, "; + $query .= "murah1 = ?, "; + $query .= "murah2 = ?, "; + $query .= "sedang1 = ?, "; + $query .= "sedang2 = ?, "; + $query .= "mahal1 = ?, "; + $query .= "mahal2 = ?, "; + $query .= "benik_murah = ?, "; + $query .= "benik_sedang = ?, "; + $query .= "benik_mahal = ?, "; + $query .= "kel_brg = ?, "; + $query .= "kel_jns = ?, "; + $query .= "persen_tiwul = ? "; + $query .= "WHERE kd_strip = ?"; + + $stmt = $mysqli->prepare($query); + $stmt->bind_param("siiiiiiiiissds", $nama_strip, $murah1, $murah2, $sedang1, $sedang2, $mahal1, + $mahal2, $benikmurah, $beniksedang, $benikmahal, $kelbrg, $keljns, $thiwul, $kode_strip); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function simpan_strip() { + if(isset($_POST)) { + $kode_strip = $_POST['kodestrip']; + $nama_strip = $_POST['namastrip']; + $murah1 = $_POST['murah1']; + $murah2 = $_POST['murah2']; + $sedang1 = $_POST['sedang1']; + $sedang2 = $_POST['sedang2']; + $mahal1 = $_POST['mahal1']; + $mahal2 = $_POST['mahal2']; + $benikmurah = $_POST['benikmurah']; + $beniksedang = $_POST['beniksedang']; + $benikmahal = $_POST['benikmahal']; + $kelbrg = $_POST['kelbrg']; + $keljns = $_POST['keljns']; + $thiwul = $_POST['thiwul']; + + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $query = "INSERT INTO strip VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; + $stmt = $mysqli->prepare($query); + $stmt->bind_param("ssiiiiiiiiissd", $kode_strip, $nama_strip, $murah1, $murah2, $sedang1, $sedang2, $mahal1, + $mahal2, $benikmurah, $beniksedang, $benikmahal, $kelbrg, $keljns, $thiwul); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} +?> diff --git a/old-source/ajaxsuppbarang.php b/old-source/ajaxsuppbarang.php new file mode 100644 index 0000000..cda61aa --- /dev/null +++ b/old-source/ajaxsuppbarang.php @@ -0,0 +1,43 @@ + +prepare($query); + $stmt->bind_param("ssi", $kd_supplier, $lini, $ranking); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 2; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + } else{ + $array_data[0] = 3; + } + /* cetak hasil */ + echo json_encode($array_data); + +} +?> \ No newline at end of file diff --git a/old-source/ajaxsupplier.php b/old-source/ajaxsupplier.php new file mode 100644 index 0000000..fb8a255 --- /dev/null +++ b/old-source/ajaxsupplier.php @@ -0,0 +1,288 @@ + +prepare($query); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function ambil_kode() { + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT MAX( kd_supplier ) + FROM supplier + WHERE kd_supplier NOT IN ('088888', '099998', '099999', '999999')"); + if($data->num_rows > 0) { + $a = $data->fetch_array(MYSQLI_NUM); + $kode_awal = $a[0]; + $kode = (int)$a[0] + 1; + $selisih = strlen($kode_awal) - strlen($kode); + for($i=0; $i<$selisih; $i++){ + $kode = '0'.$kode; + } + $array_data[0] = $kode; + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); +} + +function cari_supplier($nama) { + if($nama != "") { + $harray = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $nama = addslashes($nama); + $data = $mysqli->query("SELECT kd_supplier, nama_supplier, alamat1, lama_tempo FROM supplier WHERE nama_supplier LIKE '%".$nama."%'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_supplier' => $a['kd_supplier'], + 'nama_supplier' => stripcslashes($a['nama_supplier']), + 'alamat1' => $a['alamat1'], + 'lama_tempo' => $a['lama_tempo'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + }else{ + $harray = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $nama = addslashes($nama); + $data = $mysqli->query("SELECT kd_supplier, nama_supplier, alamat1, lama_tempo FROM supplier"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_supplier' => $a['kd_supplier'], + 'nama_supplier' => stripcslashes($a['nama_supplier']), + 'alamat1' => $a['alamat1'], + 'lama_tempo' => $a['lama_tempo'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + +function ambil_supplier($id_supplier) { + if ($id_supplier != "") { + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT * FROM supplier WHERE kd_supplier = '".$id_supplier."'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $array_data[$idx] = array( + 'kd_supplier' => $a['kd_supplier'], + 'nama_supplier' => $a['nama_supplier'], + 'alamat1' => $a['alamat1'], + 'alamat2' => $a['alamat2'], + 'nama_rekening' => $a['nama_rekening'], + 'rekening1' => $a['rekening1'], + 'rekening2' => $a['rekening2'], + 'bank1' => $a['bank1'], + 'bank2' => $a['bank2'], + 'telp' => $a['telp'], + 'ponsel' => $a['ponsel'], + 'email' => $a['email'], + 'fax' => $a['fax'], + 'jns_pembayaran' => $a['jns_pembayaran'], + 'lama_tempo' => $a['lama_tempo'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($array_data); + } +} + + + +function transaksi_supplier($id_supplier) { + if($id_supplier != ""){ + // cek data + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT kd_supplier FROM supplier WHERE kd_supplier = '".$id_supplier."'"); + if($data->num_rows > 0) { + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + /* update data supplier */ + update_supplier(); + } else { + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + /* simpan data supplier baru */ + simpan_supplier(); + } + } +} + +function update_supplier(){ + if(isset($_POST)) { + $kode_supplier = $_POST['kodesupplier']; + $supplier = $_POST['supplier']; + $alamat = $_POST['alamat']; + $namarek = $_POST['namarek']; + $rek = $_POST['rek']; + $bank = $_POST['bank']; + $alamat2 = $_POST['alamat2']; + $rek2 = $_POST['rek2']; + $bank2 = $_POST['bank2']; + $telp = $_POST['telp']; + $ponsel = $_POST['ponsel']; + $email = $_POST['email']; + $fax = $_POST['fax']; + $jenisbayar = $_POST['jenisbayar']; + $tempo = $_POST['tempo']; + + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $query = "UPDATE supplier SET "; + $query .= "nama_supplier = ?, "; + $query .= "alamat1 = ?, "; + $query .= "alamat2 = ?, "; + $query .= "nama_rekening = ?, "; + $query .= "rekening1 = ?, "; + $query .= "rekening2 = ?, "; + $query .= "bank1 = ?, "; + $query .= "bank2 = ?, "; + $query .= "telp = ?, "; + $query .= "ponsel = ?, "; + $query .= "email = ?, "; + $query .= "fax = ?, "; + $query .= "jns_pembayaran = ?, "; + $query .= "lama_tempo = ? "; + $query .= "WHERE kd_supplier = ?"; + + $stmt = $mysqli->prepare($query); + $stmt->bind_param("sssssssssssssis", $supplier, $alamat, $alamat2, $namarek, $rek, + $rek2, $bank, $bank2, $telp, $ponsel, $email, $fax, $jenisbayar, $tempo, $kode_supplier); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function simpan_supplier() { + if(isset($_POST)) { + $kode_supplier = $_POST['kodesupplier']; + $supplier = strtoupper($_POST['supplier']); + $alamat = strtoupper($_POST['alamat']); + $namarek = $_POST['namarek']; + $rek = $_POST['rek']; + $bank = $_POST['bank']; + $alamat2 = $_POST['alamat2']; + $rek2 = $_POST['rek2']; + $bank2 = $_POST['bank2']; + $telp = $_POST['telp']; + $ponsel = $_POST['ponsel']; + $email = $_POST['email']; + $fax = $_POST['fax']; + $jenisbayar = strtoupper($_POST['jenisbayar']); + $tempo = $_POST['tempo']; + + $array_data = array(); + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if($supplier != "" && $alamat != ""){ + $query = "INSERT INTO supplier VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; + $stmt = $mysqli->prepare($query); + $stmt->bind_param("ssssssssssssssi", $kode_supplier, $supplier, $alamat, $alamat2, $namarek, $rek, $rek2, + $bank, $bank2, $telp, $ponsel, $email, $fax, $jenisbayar, $tempo); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + }else{ + $array_data[0] = 2; + } + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} +?> \ No newline at end of file diff --git a/old-source/ajaxtmpbeli.php b/old-source/ajaxtmpbeli.php new file mode 100644 index 0000000..8eb51a7 --- /dev/null +++ b/old-source/ajaxtmpbeli.php @@ -0,0 +1,82 @@ + +prepare("INSERT INTO `tPembelian$pemakai`( + `id`, + `kode_barang` , + `barcode` , + `nm_brg` , + `jumlah` , + `subtotal` , + `disc`, + `discrp`, + `profit`, + `ppn`, + `harga_pokok` , + `harga_jual`, + `exp` + ) + VALUES (NULL,'$kodebarang','$barcode','$nama','$jmlbeli','$subtotal','$disc','$discrp', + '$profit','$ppn','$hpbaru','$hjbaru','$expdate')"); + $dtInsert->execute(); + if($dtInsert->affected_rows > 0) { + $harray[0] = 1; + $dtInsert->close(); + } else { + $harray[0] = 0; + } + $mysqli->close(); + }else{ + $harray[0] = 2; + } + echo json_encode($harray); + +?> + \ No newline at end of file diff --git a/old-source/barang.php b/old-source/barang.php new file mode 100644 index 0000000..c8c9c26 --- /dev/null +++ b/old-source/barang.php @@ -0,0 +1,226 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Data Pengadaan Barang +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID Barang: + + + +
Barcode: *
Nama barang: * +
Kode Supplier:
Group Product: + +
Sub Group Product: +
+ +

+
+ + +
+
+
Harga Pokok:
% Profit:
Harga Jual:
Pcs Max II:
Harga Jual II:
Pcs Max III:
Harga Jual III:
Satuan: + +
Stok Barang:

+ + +
+
+
+ +
+ +
+
Cari barang
+
+
+
+ + + + +
Barcode/Nama Brg:
+
+
+ Hasil pencarian +
+
+
+
+ +
+ + + diff --git a/old-source/barang_ambilgroup.php b/old-source/barang_ambilgroup.php new file mode 100644 index 0000000..6f64f9c --- /dev/null +++ b/old-source/barang_ambilgroup.php @@ -0,0 +1,29 @@ + +query("SELECT kd_strip,nama_strip FROM strip ORDER BY nama_strip"); +if($data->num_rows > 0) +{ + $idx = 0; + while($ket = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('kd_strip' => $ket['kd_strip'],'nama_strip' => $ket['nama_strip']); + $idx += 1; + } + /* tutup hasil query */ + $data->close(); +} +/* tutup koneksi */ +$mysqli->close(); +/* cetak hasil */ +echo json_encode($harray); diff --git a/old-source/barang_ambilsatuan.php b/old-source/barang_ambilsatuan.php new file mode 100644 index 0000000..c087e12 --- /dev/null +++ b/old-source/barang_ambilsatuan.php @@ -0,0 +1,29 @@ + +query("SELECT * FROM satuan_barang ORDER BY namaSatuanBarang"); +if($data->num_rows > 0) +{ + $idx = 0; + while($ket = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('idSatuanBarang' => $ket['idSatuanBarang'],'namaSatuanBarang' => $ket['namaSatuanBarang']); + $idx += 1; + } + /* tutup hasil query */ + $data->close(); +} +/* tutup koneksi */ +$mysqli->close(); +/* cetak hasil */ +echo json_encode($harray); diff --git a/old-source/barcoding/barcode.php b/old-source/barcoding/barcode.php new file mode 100644 index 0000000..0297824 --- /dev/null +++ b/old-source/barcoding/barcode.php @@ -0,0 +1,49 @@ +init(); // You must call this method to initialize the image +$drawing->add_barcode($code_generated); +$drawing->draw_all(); +$im = $drawing->get_im(); + +// Next line create the little picture, the barcode is being copied inside +$im2 = imagecreate($code_generated->lastX,$code_generated->lastY); +imagecopyresized($im2, $im, 0, 0, 0, 0, $code_generated->lastX, $code_generated->lastY, $code_generated->lastX, $code_generated->lastY); +$drawing->set_im($im2); + +// Header that says it is an image (remove it if you save the barcode to a file) +header('Content-Type: image/png'); + +// Draw (or save) the image into PNG format. +//$hasil = $drawing->finish(IMG_FORMAT_PNG); +$drawing->finish(IMG_FORMAT_PNG); +?> \ No newline at end of file diff --git a/old-source/barcoding/barcode_cari_barang.php b/old-source/barcoding/barcode_cari_barang.php new file mode 100644 index 0000000..64ba31f --- /dev/null +++ b/old-source/barcoding/barcode_cari_barang.php @@ -0,0 +1,111 @@ +query("SELECT b.kode_barang, b.nama_barang, nb.nomor,nb.harga_pokok,nb.harga_jual,nb.stok,dp.no_faktur,b.kode_supplier + FROM barang b, no_barang nb, d_pembelian dp, m_pembelian m + WHERE b.id_gabungan = nb.id_gabungan + AND (b.kode_barang = dp.kode_barang AND dp.nomor = nb.nomor) + AND dp.no_faktur = m.no_faktur + AND left(m.no_faktur,4) <> 'RVB-' + AND b.kode_barang = '$kodebarang' + AND b.nama_barang LIKE '%$namabarang%' + AND nb.nomor = '$nobarang' + ORDER BY b.kode_barang, nb.nomor"); + else if($kodebarang != "" && $namabarang != "" && $nobarang == "") + $data = $mysqli->query("SELECT b.kode_barang, b.nama_barang, nb.nomor,nb.harga_pokok,nb.harga_jual,nb.stok,dp.no_faktur,b.kode_supplier + FROM barang b, no_barang nb, d_pembelian dp, m_pembelian m + WHERE b.id_gabungan = nb.id_gabungan + AND (b.kode_barang = dp.kode_barang AND dp.nomor = nb.nomor) + AND dp.no_faktur = m.no_faktur + AND left(m.no_faktur,4) <> 'RVB-' + AND b.kode_barang = '$kodebarang' + AND b.nama_barang LIKE '%$namabarang%' + ORDER BY b.kode_barang, nb.nomor"); + else if($kodebarang != "" && $namabarang == "" && $nobarang != "") + $data = $mysqli->query("SELECT b.kode_barang, b.nama_barang, nb.nomor,nb.harga_pokok,nb.harga_jual,nb.stok,dp.no_faktur,b.kode_supplier + FROM barang b, no_barang nb, d_pembelian dp, m_pembelian m + WHERE b.id_gabungan = nb.id_gabungan + AND (b.kode_barang = dp.kode_barang AND dp.nomor = nb.nomor) + AND dp.no_faktur = m.no_faktur + AND left(m.no_faktur,4) <> 'RVB-' + AND b.kode_barang = '$kodebarang' + AND nb.nomor = '$nobarang' + ORDER BY b.kode_barang, nb.nomor"); + else if($kodebarang != "" && $namabarang == "" && $nobarang == "") + $data = $mysqli->query("SELECT b.kode_barang, b.nama_barang, nb.nomor,nb.harga_pokok,nb.harga_jual,nb.stok,dp.no_faktur,b.kode_supplier + FROM barang b, no_barang nb, d_pembelian dp, m_pembelian m + WHERE b.id_gabungan = nb.id_gabungan + AND (b.kode_barang = dp.kode_barang AND dp.nomor = nb.nomor) + AND dp.no_faktur = m.no_faktur + AND left(m.no_faktur,4) <> 'RVB-' + AND b.kode_barang = '$kodebarang' + ORDER BY b.kode_barang, nb.nomor"); + else if($kodebarang == "" && $namabarang != "" && $nobarang != "") + $data = $mysqli->query("SELECT b.kode_barang, b.nama_barang, nb.nomor,nb.harga_pokok,nb.harga_jual,nb.stok,dp.no_faktur,b.kode_supplier + FROM barang b, no_barang nb, d_pembelian dp, m_pembelian m + WHERE b.id_gabungan = nb.id_gabungan + AND (b.kode_barang = dp.kode_barang AND dp.nomor = nb.nomor) + AND dp.no_faktur = m.no_faktur + AND left(m.no_faktur,4) <> 'RVB-' + AND b.nama_barang LIKE '%$namabarang%' + AND nb.nomor = '$nobarang' + ORDER BY b.kode_barang, nb.nomor"); + else if($kodebarang == "" && $namabarang != "" && $nobarang == "") + $data = $mysqli->query("SELECT b.kode_barang, b.nama_barang, nb.nomor,nb.harga_pokok,nb.harga_jual,nb.stok,dp.no_faktur,b.kode_supplier + FROM barang b, no_barang nb, d_pembelian dp, m_pembelian m + WHERE b.id_gabungan = nb.id_gabungan + AND (b.kode_barang = dp.kode_barang AND dp.nomor = nb.nomor) + AND dp.no_faktur = m.no_faktur + AND left(m.no_faktur,4) <> 'RVB-' + AND b.nama_barang LIKE '%$namabarang%' + ORDER BY b.kode_barang, nb.nomor"); + else if($kodebarang == "" && $namabarang == "" && $nobarang != "") + $data = $mysqli->query("SELECT b.kode_barang, b.nama_barang, nb.nomor,nb.harga_pokok,nb.harga_jual,nb.stok,dp.no_faktur,b.kode_supplier + FROM barang b, no_barang nb, d_pembelian dp, m_pembelian m + WHERE b.id_gabungan = nb.id_gabungan + AND (b.kode_barang = dp.kode_barang AND dp.nomor = nb.nomor) + AND dp.no_faktur = m.no_faktur + AND left(m.no_faktur,4) <> 'RVB-' + AND nb.nomor = '$nobarang' + ORDER BY b.kode_barang, nb.nomor"); + + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + // dibenerin ya... + // tidak di loop lagi. + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('kode_barang' => $a['kode_barang'], 'nama_barang' => $a['nama_barang'], 'kode_toko' => $a['no_faktur'], 'no_barang' => $a['nomor'], + 'HP'=> $a['harga_pokok'], 'HJ'=>$a['harga_jual'], 'stok'=>$a['stok'], 'kdsupp' => $a['kode_supplier']); + $idx++; + + $faktur = ""; + } + /* tutup hasil query */ + $data->close(); + + } + /* tutup koneksi */ + $mysqli->close(); + + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/barcoding/barcode_cari_barang.php~ b/old-source/barcoding/barcode_cari_barang.php~ new file mode 100644 index 0000000..0167a5b --- /dev/null +++ b/old-source/barcoding/barcode_cari_barang.php~ @@ -0,0 +1,97 @@ +query("SELECT DISTINCT b.kode_barang, b.nama_barang, nb.nomor,nb.harga_pokok,nb.harga_jual,nb.stok,dp.no_faktur,b.kode_supplier + FROM barang b, no_barang nb, d_pembelian dp, m_pembelian m + WHERE b.id_gabungan = nb.id_gabungan AND b.kode_barang = dp.kode_barang + AND dp.no_faktur = m.no_faktur + AND m.referensi = '' + AND b.kode_barang LIKE '%$kodebarang%' + AND b.nama_barang LIKE '%$namabarang%' + AND nb.nomor LIKE '%$nobarang%'"); + else if($kodebarang != "" && $namabarang != "" && $nobarang == "") + $data = $mysqli->query("SELECT DISTINCT b.kode_barang, b.nama_barang, nb.nomor,nb.harga_pokok,nb.harga_jual,nb.stok,dp.no_faktur,b.kode_supplier + FROM barang b, no_barang nb, d_pembelian dp + WHERE b.id_gabungan = nb.id_gabungan AND b.kode_barang = dp.kode_barang + AND dp.no_faktur = m.no_faktur + AND m.referensi = '' + AND b.kode_barang LIKE '%$kodebarang%' + AND b.nama_barang LIKE '%$namabarang%'"); + else if($kodebarang != "" && $namabarang == "" && $nobarang != "") + $data = $mysqli->query("SELECT DISTINCT b.kode_barang, b.nama_barang, nb.nomor,nb.harga_pokok,nb.harga_jual,nb.stok,dp.no_faktur,b.kode_supplier + FROM barang b, no_barang nb, d_pembelian dp + WHERE b.id_gabungan = nb.id_gabungan AND b.kode_barang = dp.kode_barang + AND dp.no_faktur = m.no_faktur + AND m.referensi = '' + AND b.kode_barang LIKE '%$kodebarang%' + AND nb.nomor LIKE '%$nobarang%'"); + else if($kodebarang != "" && $namabarang == "" && $nobarang == "") + $data = $mysqli->query("SELECT DISTINCT b.kode_barang, b.nama_barang, nb.nomor,nb.harga_pokok,nb.harga_jual,nb.stok,dp.no_faktur,b.kode_supplier + FROM barang b, no_barang nb, d_pembelian dp + WHERE b.id_gabungan = nb.id_gabungan AND b.kode_barang = dp.kode_barang + AND dp.no_faktur = m.no_faktur + AND m.referensi = '' + AND b.kode_barang LIKE '%$kodebarang%'"); + else if($kodebarang == "" && $namabarang != "" && $nobarang != "") + $data = $mysqli->query("SELECT DISTINCT b.kode_barang, b.nama_barang, nb.nomor,nb.harga_pokok,nb.harga_jual,nb.stok,dp.no_faktur,b.kode_supplier + FROM barang b, no_barang nb, d_pembelian dp + WHERE b.id_gabungan = nb.id_gabungan AND b.kode_barang = dp.kode_barang + AND dp.no_faktur = m.no_faktur + AND m.referensi = '' + AND b.nama_barang LIKE '%$namabarang%' + AND nb.nomor LIKE '%$nobarang%'"); + else if($kodebarang == "" && $namabarang != "" && $nobarang == "") + $data = $mysqli->query("SELECT DISTINCT b.kode_barang, b.nama_barang, nb.nomor, nb.harga_pokok,nb.harga_jual,nb.stok,dp.no_faktur,b.kode_supplier + FROM barang b, no_barang nb, d_pembelian dp + WHERE b.id_gabungan = nb.id_gabungan AND b.kode_barang = dp.kode_barang + AND dp.no_faktur = m.no_faktur + AND m.referensi = '' + AND b.nama_barang LIKE '%$namabarang%'"); + else if($kodebarang == "" && $namabarang == "" && $nobarang != "") + $data = $mysqli->query("SELECT DISTINCT b.kode_barang, b.nama_barang, nb.nomor,nb.harga_pokok,nb.harga_jual,nb.stok,dp.no_faktur,b.kode_supplier + FROM barang b, no_barang nb, d_pembelian dp + WHERE b.id_gabungan = nb.id_gabungan AND b.kode_barang = dp.kode_barang + AND dp.no_faktur = m.no_faktur + AND m.referensi = '' + AND nb.nomor LIKE '%$nobarang%'"); + + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + // dibenerin ya... + // tidak di loop lagi. + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('kode_barang' => $a['kode_barang'], 'nama_barang' => $a['nama_barang'], 'kode_toko' => $a['no_faktur'], 'no_barang' => $a['nomor'], + 'HP'=> $a['harga_pokok'], 'HJ'=>$a['harga_jual'], 'stok'=>$a['stok'], 'kdsupp' => $a['kode_supplier']); + $idx++; + + $faktur = ""; + } + /* tutup hasil query */ + $data->close(); + + } + /* tutup koneksi */ + $mysqli->close(); + + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/barcoding/barcode_form.php b/old-source/barcoding/barcode_form.php new file mode 100644 index 0000000..b4add15 --- /dev/null +++ b/old-source/barcoding/barcode_form.php @@ -0,0 +1,249 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ Pilih Sumber Data + + + + + + + + +
Nomor Faktur
Nomor Faktur : +
Kode Barang
Kode Barang : +
Nomor Barang :
Jumlah Cetak :
+ +
+ + + +
+
+
+ +
+ + +
+

+
+ +
+ + + + + + + + + + + +
Nomor Faktur:
Rentang Tanggal: + s/d + +
Kode Supplier:
+
+ Hasil pencarian +
+
+
+ +
+ + + + + + + + + + +
Kode Barang:
Nama Barang:
Nomor Barang:
+
+ Hasil pencarian +
+
+
+ + + + +"); + print("
"); + print("
"); + print(""); + print("
"); + print("
"); +} + +?> \ No newline at end of file diff --git a/old-source/barcoding/barcode_hasil (copy).php b/old-source/barcoding/barcode_hasil (copy).php new file mode 100644 index 0000000..94ea81d --- /dev/null +++ b/old-source/barcoding/barcode_hasil (copy).php @@ -0,0 +1,80 @@ + + + + +"); + print("
"); + print("
".strtoupper($namabr)."
"); + print("
Rp. ".number_format($hjual,0,',','.')."
"); + print("
"); + $string = $string.$barcode.",".strtoupper($namabr).",".number_format($hjual,0,',','.')."\n"; + } +} +else if(isset($_POST["fkodebarang"]) && isset($_POST["fjml"]) && isset($_POST["count"])) +{ + $kode = $_POST["fkodebarang"]; + $namabr = $_POST["fnamabarang"]; + $nomor = $_POST["fnomor"]; + $jumlah = $_POST["fjml"]; + $hjual = $_POST["fhjual"]; + $count = $_POST["count"]; + + for($i = 0; $i<$count; $i++) + { + $barcode = $kode[$i]; + for($j = 0; $j<$jumlah[$i]; $j++) + { + print("
"); + print("
"); + print("
".strtoupper($namabr[$i])."
"); + print("
Rp. ".number_format($hjual[$i],0,',','.')."
"); + print("

"); + $string = $string.$barcode.",".strtoupper($namabr[$i]).",".number_format($hjual[$i],0,',','.')."\n"; + } + } +} + +createFile(substr($string,0,-1)); + +function createFile($contentAdd) + { + $filename = '../data/barcode_cetak.csv'; + + $handle = fopen($filename,"wt"); + $somecontent = $contentAdd."\n"; + fwrite($handle,$somecontent); + fclose($handle); + + } + +?> diff --git a/old-source/barcoding/barcode_hasil.php b/old-source/barcoding/barcode_hasil.php new file mode 100644 index 0000000..c39b253 --- /dev/null +++ b/old-source/barcoding/barcode_hasil.php @@ -0,0 +1,138 @@ + + + + + $label_per_baris) { + $kolom = 1; + $baris++; + $clear = " clear:left; "; + }; + if ($baris > $baris_per_halaman) { + $baris = 1; + echo '

'; + }; + + $namaBarang = $namabr; + + // cetak label + echo "\n + +

+ +
+
+
".strtoupper($namaBarang)."
+
Rp. ".number_format($hjual,0,',','.')."
+
+ +
+ "; + + $kolom++; + } // end for + +} +else if(isset($_POST["fkodebarang"]) && isset($_POST["fjml"]) && isset($_POST["count"])) +{ + $kode = $_POST["fkodebarang"]; + $namabr = $_POST["fnamabarang"]; + $nomor = $_POST["fnomor"]; + $jumlah = $_POST["fjml"]; + $hjual = $_POST["fhjual"]; + $count = $_POST["count"]; + $lebar_label = 175; + $tinggi_label = 90; + $label_per_baris = 3; + $baris_per_halaman = 7; + $baris=1; $kolom=1; + + for($i = 0; $i<$count; $i++) + { + $barcode = $kode[$i]; + $namaBarang = $namabr[$i]; + $hrgjual = $hjual[$i]; + for($j = 0; $j<$jumlah[$i]; $j++) + { + $clear = ""; + // cek posisi saat ini + if ($kolom > $label_per_baris) { + $kolom = 1; + $baris++; + $clear = " clear:left; "; + }; + if ($baris > $baris_per_halaman) { + $baris = 1; + echo '

'; + }; + + // cetak label + echo "\n + +

+ +
+
+
".strtoupper($namaBarang)."
+
Rp. ".number_format($hrgjual,0,',','.')."
+
+ +
+ "; + + $kolom++; + } // end for + + } +} + + +?> diff --git a/old-source/barcoding/barcode_hasil2.php b/old-source/barcoding/barcode_hasil2.php new file mode 100644 index 0000000..6a66cc6 --- /dev/null +++ b/old-source/barcoding/barcode_hasil2.php @@ -0,0 +1,130 @@ + + + + + $label_per_baris) { + $kolom = 1; + $baris++; + $clear = " clear:left; "; + }; + if ($baris > $baris_per_halaman) { + $baris = 1; + echo '

'; + }; + + $namaBarang = $namabr; + + // cetak label + echo "\n + +

+ +
+
+
".strtoupper($namaBarang)."
+
Rp. ".number_format($hjual,0,',','.')."
+
+ +
+ "; + + $kolom++; + } // end for + +} +else if(isset($_POST["fkodebarang"]) && isset($_POST["fjml"]) && isset($_POST["count"])) +{ + $kode = $_POST["fkodebarang"]; + $namabr = $_POST["fnamabarang"]; + $nomor = $_POST["fnomor"]; + $jumlah = $_POST["fjml"]; + $hjual = $_POST["fhjual"]; + $count = $_POST["count"]; + + for($i = 0; $i<$count; $i++) + { + $barcode = $kode[$i]; + $namaBarang = $namabr[$i]; + $hrgjual = $hjual[$i]; + for($j = 1; $j<=1; $j++) + { + $clear = ""; + // cek posisi saat ini + if ($kolom > $label_per_baris) { + $kolom = 1; + $baris++; + $clear = " clear:left; "; + }; + if ($baris > $baris_per_halaman) { + $baris = 1; + echo '

'; + }; + + // cetak label + echo "\n + +

+ +
+
+
".strtoupper($namaBarang)."
+
Rp. ".number_format($hrgjual,0,',','.')."
+
+ +
+ "; + + $kolom++; + } // end for + } +} + + +?> diff --git a/old-source/barcoding/barcode_kbarang.php b/old-source/barcoding/barcode_kbarang.php new file mode 100644 index 0000000..e93d042 --- /dev/null +++ b/old-source/barcoding/barcode_kbarang.php @@ -0,0 +1,50 @@ +query("SELECT br.kode_lama, br.nama_barang, nb.id_gabungan, nb.harga_jual + FROM barang br, no_barang nb + WHERE br.id_gabungan = nb.id_gabungan + AND br.kode_barang = '$_REQUEST[kode]' + AND nb.nomor = '$_REQUEST[nomor]' + GROUP BY nb.id_gabungan + "); + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'barcode_asli' => $a['kode_lama'], + 'nama_barang' => $a['nama_barang'], + 'harga_jual' => $a['harga_jual'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/barcoding/barcode_nota.php b/old-source/barcoding/barcode_nota.php new file mode 100644 index 0000000..3c88e0e --- /dev/null +++ b/old-source/barcoding/barcode_nota.php @@ -0,0 +1,51 @@ +query("SELECT dp.kode_barang, dp.nomor, dp.jumlah, dp.hj_final, br.nama_barang + FROM d_pembelian dp, barang br + WHERE dp.kode_barang = br.kode_barang AND dp.no_faktur = '$_REQUEST[nota]'"); + */ + $data = $mysqli->query("SELECT dp.kode_barang, dp.kode_asli, dp.nomor, dp.jum_fisik, dp.hj_final, dp.nm_brg + FROM d_pembelian dp + WHERE dp.no_faktur = '$_REQUEST[nota]' + ORDER BY dp.kode_barang,dp.nm_brg,dp.nomor + "); + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'], + 'kode_asli' => $a['kode_asli'], + 'nama_barang' => $a['nm_brg'], + 'nomor' => $a['nomor'], + 'jumlah' => $a['jum_fisik'], + 'harga_jual' => $a['hj_final'] + ); + $idx++; + } + } + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/barcoding/class_barcode/BarCode.php b/old-source/barcoding/class_barcode/BarCode.php new file mode 100644 index 0000000..034f3a0 --- /dev/null +++ b/old-source/barcoding/class_barcode/BarCode.php @@ -0,0 +1,128 @@ +maxHeight = $maxHeight; + $this->color1 = $color1; + $this->color2 = $color2; + $this->res = $res; + $this->error = 0; + $this->positionY = 0; + } + + /** + * Returns the index in $keys (useful for checksum) + * + * @param mixed $var + * @return mixed + */ + protected function findIndex($var){ + return array_search($var,$this->keys); + } + + /** + * Returns the code of the char (useful for drawing bars) + * + * @param mixed $var + * @return string + */ + protected function findCode($var){ + return $this->code[$this->findIndex($var)]; + } + + /** + * Draws a Bar of $color depending of the resolution + * + * @param ressource $img + * @param FColor $color + */ + protected function DrawSingleBar($im,FColor $color){ + $bar_color = (is_null($color))?NULL:$color->allocate($im); + if(!is_null($bar_color)) + for($i=0;$i<$this->res;$i++) + imageline($im,$this->positionX+$i,$this->positionY,$this->positionX+$i,$this->positionY+$this->maxHeight,$bar_color); + } + + /** + * Writes the Error on the picture + * + * @param ressource $img + * @param string $text + */ + protected function DrawError($im,$text){ + $text_color = (is_null($this->color1))?NULL:$this->color1->allocate($im); + imagestring($im,5,0,$this->error*15,$text,$text_color); + $this->error++; + $this->lastX = (imagefontwidth(5)*strlen($text)>$this->lastX)?imagefontwidth(5)*strlen($text):$this->lastX; + $this->lastY = $this->error*15; + } + + /** + * Moving the pointer right to write a bar + */ + protected function nextX(){ + $this->positionX+=$this->res; + } + + /** + * Draws all chars thanks to $code. if $start==1, the line begins by a bar. + * if $start==2, the line begins by a space. + * + * @param ressource $im + * @param string $code + * @param int $start + */ + protected function DrawChar($im,$code,$start=1){ + $currentColor = ($start==1)?$this->color1:$this->color2; + $colornumber = $start; + for($i=0;$iDrawSingleBar($im,$currentColor); + $this->nextX(); + } + if($colornumber==1){ + $currentColor=$this->color2; + $colornumber=2; + } + else{ + $currentColor=$this->color1; + $colornumber=1; + } + } + } + + /** + * Draws the label under the barcode + * + * @param ressource $im + */ + protected function DrawText($im) { + if($this->textfont != 0) { + $xPosition = ($this->positionX / 2) - (strlen($this->text)/2)*imagefontwidth($this->textfont); + $text_color = (is_null($this->color1))?NULL:$this->color1->allocate($im); + imagestring($im,$this->textfont,$xPosition,$this->maxHeight,$this->text,$text_color); + $this->lastY = $this->maxHeight + imagefontheight($this->textfont); + } + } +}; +?> \ No newline at end of file diff --git a/old-source/barcoding/class_barcode/FColor.php b/old-source/barcoding/class_barcode/FColor.php new file mode 100644 index 0000000..fa92e4f --- /dev/null +++ b/old-source/barcoding/class_barcode/FColor.php @@ -0,0 +1,59 @@ +r = $r; + $this->g = $g; + $this->b = $b; + } + + /** + * Returns Red Color + * + * @return int + */ + public function r(){ + return $this->r; + } + + /** + * Returns Green Color + * + * @return int + */ + public function g(){ + return $this->g; + } + + /** + * Returns Blue Color + * + * @return int + */ + public function b(){ + return $this->b; + } + + /** + * Returns the int value for PHP color + * + * @return int + */ + public function allocate($im) { + return imagecolorallocate($im,$this->r,$this->g,$this->b); + } +}; +?> \ No newline at end of file diff --git a/old-source/barcoding/class_barcode/FDrawing.php b/old-source/barcoding/class_barcode/FDrawing.php new file mode 100644 index 0000000..7c174e0 --- /dev/null +++ b/old-source/barcoding/class_barcode/FDrawing.php @@ -0,0 +1,98 @@ +w = $w; + $this->h = $h; + $this->filename = $filename; + $this->color = $color; + } + + /** + * Destructor + */ + public function __destruct() { + $this->destroy(); + } + + /** + * Init Image and color background + */ + public function init(){ + $this->im = imagecreate($this->w, $this->h) + or die('Can\'t Initialize the GD Libraty'); + imagecolorallocate($this->im,$this->color->r(),$this->color->g(),$this->color->b()); + } + + /** + * @return ressource + */ + public function get_im() { + return $this->im; + } + public function set_im($im) { + $this->im = $im; + } + + /** + * Add barcode into the drawing array (for future drawing) + * + * @param BarCode $barcode + */ + public function add_barcode(BarCode $barcode) { + $this->barcode[] = $barcode; + } + + /** + * Draw first all forms and after all texts on $im + */ + public function draw_all() { + for($i=0;$ibarcode);$i++) + $this->barcode[$i]->draw($this->im); + } + + /** + * Save $im into the file (many format available) + * + * @param int $image_style + * @param int $quality + */ + public function finish($image_style=IMG_FORMAT_PNG,$quality=100) { + if($image_style==constant('IMG_FORMAT_PNG')){ + if(empty($this->filename)) + imagepng($this->im); + else + imagepng($this->im,$this->filename); + } + elseif($image_style==constant('IMG_FORMAT_JPEG')) + imagejpeg($this->im,$this->filename,$quality); + } + + /** + * Free the memory of PHP (called also by destructor) + */ + public function destroy() { + imagedestroy($this->im); + } +}; +?> \ No newline at end of file diff --git a/old-source/barcoding/class_barcode/bar128.php b/old-source/barcoding/class_barcode/bar128.php new file mode 100644 index 0000000..5a40a45 --- /dev/null +++ b/old-source/barcoding/class_barcode/bar128.php @@ -0,0 +1,52 @@ + + + +?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~'; +$char128wid = array( + '212222','222122','222221','121223','121322','131222','122213','122312','132212','221213', // 0-9 + '221312','231212','112232','122132','122231','113222','123122','123221','223211','221132', // 10-19 + '221231','213212','223112','312131','311222','321122','321221','312212','322112','322211', // 20-29 + '212123','212321','232121','111323','131123','131321','112313','132113','132311','211313', // 30-39 + '231113','231311','112133','112331','132131','113123','113321','133121','313121','211331', // 40-49 + '231131','213113','213311','213131','311123','311321','331121','312113','312311','332111', // 50-59 + '314111','221411','431111','111224','111422','121124','121421','141122','141221','112214', // 60-69 + '112412','122114','122411','142112','142211','241211','221114','413111','241112','134111', // 70-79 + '111242','121142','121241','114212','124112','124211','411212','421112','421211','212141', // 80-89 + '214121','412121','111143','111341','131141','114113','114311','411113','411311','113141', // 90-99 + '114131','311141','411131','211412','211214','211232','23311120' ); // 100-106 + +////Define Function +function bar128($text) { // Part 1, make list of widths + global $char128asc,$char128wid; + $w = $char128wid[$sum = 104]; // START symbol + $onChar=1; + for($x=0;$x"; + //return "$html$text"; + return "$html"; +} \ No newline at end of file diff --git a/old-source/barcoding/class_barcode/code128.barcode.php b/old-source/barcoding/class_barcode/code128.barcode.php new file mode 100644 index 0000000..76004b9 --- /dev/null +++ b/old-source/barcoding/class_barcode/code128.barcode.php @@ -0,0 +1,306 @@ +starting = 103; + elseif($start=='B') + $this->starting = 104; + elseif($start=='C') + $this->starting = 105; + $this->ending = 106; + $this->currentCode = $start; + /* CODE 128 A */ + $this->keysA = array(' ','!','"','#','$','%','&','\'','(',')','*','+',',','-','.','/','0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?','@','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','[','\\',']','^','_','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','',chr(128),chr(129)); + + /* CODE 128 B */ + $this->keysB = array(' ','!','"','#','$','%','&','\'','(',')','*','+',',','-','.','/','0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?','@','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','[','\\',']','^','_','`','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','{','|','}','~','','','','',chr(128),'',chr(130)); + + /* CODE 128 C */ + $this->keysC = array(); + for($i=0;$i<=99;$i++) + $this->keysC[] = sprintf('%02d',$i); + $this->keysC[] = chr(129); + $this->keysC[] = chr(130); + + $this->code = array( + '101111', /* 00 */ + '111011', /* 01 */ + '111110', /* 02 */ + '010112', /* 03 */ + '010211', /* 04 */ + '020111', /* 05 */ + '011102', /* 06 */ + '011201', /* 07 */ + '021101', /* 08 */ + '110102', /* 09 */ + '110201', /* 10 */ + '120101', /* 11 */ + '001121', /* 12 */ + '011021', /* 13 */ + '011120', /* 14 */ + '002111', /* 15 */ + '012011', /* 16 */ + '012110', /* 17 */ + '112100', /* 18 */ + '110021', /* 19 */ + '110120', /* 20 */ + '102101', /* 21 */ + '112001', /* 22 */ + '201020', /* 23 */ + '200111', /* 24 */ + '210011', /* 25 */ + '210110', /* 26 */ + '201101', /* 27 */ + '211001', /* 28 */ + '211100', /* 29 */ + '101012', /* 30 */ + '101210', /* 31 */ + '121010', /* 32 */ + '000212', /* 33 */ + '020012', /* 34 */ + '020210', /* 35 */ + '001202', /* 36 */ + '021002', /* 37 */ + '021200', /* 38 */ + '100202', /* 39 */ + '120002', /* 40 */ + '120200', /* 41 */ + '001022', /* 42 */ + '001220', /* 43 */ + '021020', /* 44 */ + '002012', /* 45 */ + '002210', /* 46 */ + '022010', /* 47 */ + '202010', /* 48 */ + '100220', /* 49 */ + '120020', /* 50 */ + '102002', /* 51 */ + '102200', /* 52 */ + '102020', /* 53 */ + '200012', /* 54 */ + '200210', /* 55 */ + '220010', /* 56 */ + '201002', /* 57 */ + '201200', /* 58 */ + '221000', /* 59 */ + '203000', /* 60 */ + '110300', /* 61 */ + '320000', /* 62 */ + '000113', /* 63 */ + '000311', /* 64 */ + '010013', /* 65 */ + '010310', /* 66 */ + '030011', /* 67 */ + '030110', /* 68 */ + '001103', /* 69 */ + '001301', /* 70 */ + '011003', /* 71 */ + '011300', /* 72 */ + '031001', /* 73 */ + '031100', /* 74 */ + '130100', /* 75 */ + '110003', /* 76 */ + '302000', /* 77 */ + '130001', /* 78 */ + '023000', /* 79 */ + '000131', /* 80 */ + '010031', /* 81 */ + '010130', /* 82 */ + '003101', /* 83 */ + '013001', /* 84 */ + '013100', /* 85 */ + '300101', /* 86 */ + '310001', /* 87 */ + '310100', /* 88 */ + '101030', /* 89 */ + '103010', /* 90 */ + '301010', /* 91 */ + '000032', /* 92 */ + '000230', /* 93 */ + '020030', /* 94 */ + '003002', /* 95 */ + '003200', /* 96 */ + '300002', /* 97 */ + '300200', /* 98 */ + '002030', /* 99 */ + '003020', /* 100*/ + '200030', /* 101*/ + '300020', /* 102*/ + '100301', /* 103*/ + '100103', /* 104*/ + '100121', /* 105*/ + '122000' /*STOP*/ + ); + $this->setText($text); + $this->textfont = $textfont; + $this->usingCode($start); + $this->starting_text = $start; + } + + /** + * Saves Text + * + * @param string $text + */ + public function setText($text) { + $this->text = $text; + } + + private function usingCode($code) { + if($code=='A') + $this->keys = $this->keysA; + elseif($code=='B') + $this->keys = $this->keysB; + elseif($code=='C') + $this->keys = $this->keysC; + $this->currentCode = $code; + } + + /** + * Draws the barcode + * + * @param ressource $im + */ + public function draw($im) { + $error_stop = false; + + $this->usingCode($this->starting_text); + // Checking if all chars are allowed + for($i=0;$itext);$i++) { + if($this->currentCode=='C') { + if(isset($this->text[$i+1]) && $this->check_int($this->text[$i+1])) { + $value_test = array_search($this->text[$i].$this->text[$i+1],$this->keys); + $i++; + } + else { + $this->DrawError($im,'With Code C, you must provide always pair of two integers.'); + $error_stop = true; + } + } + else + $value_test = array_search($this->text[$i],$this->keys); + if(!is_int($value_test)) { + $this->DrawError($im,'Char \''.$this->text[$i].'\' not allowed.'); + $error_stop = true; + } + if($this->findIndex($this->text[$i]) == 99 && $this->currentCode != 'C') + $this->usingCode('C'); + elseif($this->findIndex($this->text[$i]) == 100 && $this->currentCode != 'B') + $this->usingCode('B'); + elseif($this->findIndex($this->text[$i]) == 101 && $this->currentCode != 'A') + $this->usingCode('A'); + } + if($error_stop == false) { + // The START-A, START-B, START-C, STOP are not allowed + if(is_int(strpos($this->text,chr(135))) || is_int(strpos($this->text,chr(136))) || is_int(strpos($this->text,chr(137))) || is_int(strpos($this->text,chr(138)))) { + $this->DrawError($im,'Chars START-A, START-B, START-C, STOP not allowed.'); + $error_stop = true; + } + if($error_stop == false) { + $this->usingCode($this->starting_text); + // Starting Code + $this->DrawChar($im,$this->code[$this->starting],1); + // Chars + for($i=0;$itext);$i++) { + if($this->currentCode=='C') { + $this->DrawChar($im,$this->findCode($this->text[$i].$this->text[$i+1]),1); + $i++; + } + else + $this->DrawChar($im,$this->findCode($this->text[$i]),1); + if($this->findIndex($this->text[$i]) == 99 && $this->currentCode != 'C') + $this->usingCode('C'); + elseif($this->findIndex($this->text[$i]) == 100 && $this->currentCode != 'B') + $this->usingCode('B'); + elseif($this->findIndex($this->text[$i]) == 101 && $this->currentCode != 'A') + $this->usingCode('A'); + } + // Checksum + // First Char (START) + // + Starting with the first data character following the start character, + // take the value of the character (between 0 and 102, inclusive) multiply + // it by its character position (1) and add that to the running checksum. + // Modulated 103 + if($this->starting == 103) + $this->usingCode('A'); + elseif($this->starting == 104) + $this->usingCode('B'); + elseif($this->starting == 105) + $this->usingCode('C'); + $checksum = 0; + $checksum += $this->starting; + for($position=1,$i=0;$itext);$position++,$i++) { + if($this->currentCode=='C') { + $checksum += intval($this->text[$i].$this->text[$i+1]) * $position; + $i++; + } + else + $checksum += $this->findIndex($this->text[$i]) * $position; + + if($this->findIndex($this->text[$i]) == 99 && $this->currentCode != 'C') + $this->usingCode('C'); + elseif($this->findIndex($this->text[$i]) == 100 && $this->currentCode != 'B') + $this->usingCode('B'); + elseif($this->findIndex($this->text[$i]) == 101 && $this->currentCode != 'A') + $this->usingCode('A'); + } + $this->DrawChar($im,$this->code[$checksum % 103],1); + // Ending Code + $this->DrawChar($im,$this->code[$this->ending],1); + // Draw a Final Bar + $this->DrawChar($im,'1',1); + $this->lastX = $this->positionX; + $this->lastY = $this->maxHeight; + // Removing Special Code + $this->text = ereg_replace(chr(128),'',$this->text); + $this->text = ereg_replace(chr(129),'',$this->text); + $this->text = ereg_replace(chr(130),'',$this->text); + $this->DrawText($im); + } + } + } + + private function check_int($var) { + if(intval($var)>=0 || intval($var)<=9) + return true; + else + return false; + } +}; +?> \ No newline at end of file diff --git a/old-source/barcoding/class_barcode/index.php b/old-source/barcoding/class_barcode/index.php new file mode 100644 index 0000000..0a68ec2 --- /dev/null +++ b/old-source/barcoding/class_barcode/index.php @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/old-source/barcoding/down.php b/old-source/barcoding/down.php new file mode 100644 index 0000000..13daee6 --- /dev/null +++ b/old-source/barcoding/down.php @@ -0,0 +1,19 @@ + diff --git a/old-source/barcoding/hmenu.php~ b/old-source/barcoding/hmenu.php~ new file mode 100644 index 0000000..82270dc --- /dev/null +++ b/old-source/barcoding/hmenu.php~ @@ -0,0 +1,128 @@ + diff --git a/old-source/barcoding/lapdisp.php b/old-source/barcoding/lapdisp.php new file mode 100644 index 0000000..a092365 --- /dev/null +++ b/old-source/barcoding/lapdisp.php @@ -0,0 +1,218 @@ + + +"; + echo "div#divprint{width:1024px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:950px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:50px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = $_POST['kdsupp']; + $endDate = $_POST['endDate']; + + + if(bukaKoneksi()){ + global $conn; + IF ($startDate != '' && $endDate != ''){ + + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ + FROM barang b,no_barang n, d_pembelian d + WHERE n.stok < 0 + and b.id_gabungan = n.id_gabungan + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_supplier = '$startDate' + and b.kode_strip = '$endDate' + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + }elseif ($startDate == '' && $endDate != ''){ + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ + FROM barang b,no_barang n, d_pembelian d + WHERE n.stok < 0 + and b.id_gabungan = n.id_gabungan + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_strip = '$endDate' + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + }else { + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ + FROM barang b,no_barang n, d_pembelian d + WHERE n.stok < 0 + and b.id_gabungan = n.id_gabungan + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_supplier = '$startDate' + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + + } + $querysupp = "select nama_supplier from supplier where kd_supplier = '$startDate' "; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tahun,$bln,$strip,$kdasli,$nofaktur,$kdbrg,$nmbrg,$nomor,$akhir,$pokok,$hp,$jual,$hj); + $ttJumlah = array(); + $ttJumlah['jml'] = 0; + $ttJumlah['hp'] = 0; + + print("
"); + print("

Laporan Barang Minus Per Supplier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."

"); + if($stmtsupp = mysqli_prepare($conn,$querysupp)){ + mysqli_stmt_execute($stmtsupp); + mysqli_stmt_store_result($stmtsupp); + $ceksupp = mysqli_stmt_num_rows($stmtsupp); + if($ceksupp > 0){ + mysqli_stmt_bind_result($stmtsupp,$nama); + while(mysqli_stmt_fetch($stmtsupp)){ + print("Supplier : $nama


"); + } + } + } + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['jml'] += $akhir; + $ttJumlah['hp'] += $hp; + print(""); + } + + print("
TahunBulanLini Prod.Kode AsliNo.FakturKode BarangNama BarangNomor Brg.Stok AkhirHPHJTot.HPTot.HJ
$tahun$bln$strip$kdasli.$nofaktur$kdbrg$nmbrg$nomor$akhir".number_format($pokok,0,',','.')."".number_format($jual,0,',','.')."".number_format($hp,0,',','.')."".number_format($hj,0,',','.')."

"); + print("
"); + + print(""); + print(""); + + print("
Total Jumlah Barang : ".number_format($ttJumlah['jml'],0,',','.')."
Total Persediaan : ".number_format($ttJumlah['hp'],0,',','.')."
"); + }else{ + echo ""; + } + } + + + IF ($startDate != '' && $endDate != ''){ + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ, m.status + FROM barang b,no_barang n, d_pembelian d, m_pembelian m + WHERE n.stok > 0 + and b.id_gabungan = n.id_gabungan + and m.no_faktur = d.no_faktur + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_supplier = '$startDate' + and b.kode_strip = '$endDate' + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + }elseif ($startDate == '' && $endDate != ''){ + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ, m.status + FROM barang b,no_barang n, d_pembelian d, m_pembelian m + WHERE n.stok > 0 + and b.id_gabungan = n.id_gabungan + and m.no_faktur = d.no_faktur + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_strip = '$endDate' + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + }else { + $query = "SELECT b.tahun,b.bulan,b.kode_strip,d.kode_asli,d.no_faktur,b.kode_barang,b.nama_barang,n.nomor,n.stok stokAKH, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') hp, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(n.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0') * n.stok + totalHP,n.harga_jual hj,n.stok*n.harga_jual totalHJ, m.status + FROM barang b,no_barang n, d_pembelian d, m_pembelian m + WHERE n.stok > 0 + and b.id_gabungan = n.id_gabungan + and m.no_faktur = d.no_faktur + and (b.kode_barang = d.kode_barang and d.nomor = n.nomor) + and left(d.no_faktur,4) <> 'RVB-' + and b.kode_supplier = '$startDate' + ORDER BY b.tahun,b.bulan,b.kode_strip,b.kode_barang,n.nomor"; + + } + $querysupp = "select nama_supplier from supplier where kd_supplier = '$startDate' "; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tahun,$bln,$strip,$kdasli,$nofaktur,$kdbrg,$nmbrg,$nomor,$akhir,$pokok,$hp,$jual,$hj,$status); + $ttJumlah = array(); + $ttJumlah['jml'] = 0; + $ttJumlah['hp'] = 0; + + print("
"); + print("

Laporan Persediaan Barang Per Supplier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."

"); + if($stmtsupp = mysqli_prepare($conn,$querysupp)){ + mysqli_stmt_execute($stmtsupp); + mysqli_stmt_store_result($stmtsupp); + $ceksupp = mysqli_stmt_num_rows($stmtsupp); + if($ceksupp > 0){ + mysqli_stmt_bind_result($stmtsupp,$nama); + while(mysqli_stmt_fetch($stmtsupp)){ + print("Supplier : $nama


"); + } + } + } + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['jml'] += $akhir; + $ttJumlah['hp'] += $hp; + print(" + + + "); + } + + print("
TahunBulanLini Prod.Kode AsliNo.FakturKode BarangNama BarangNomor Brg.Stok AkhirHPHJTot.HPTot.HJStatus Brg
$tahun$bln$strip$kdasli.$nofaktur$kdbrg$nmbrg$nomor$akhir".number_format($pokok,0,',','.')."".number_format($jual,0,',','.')."".number_format($hp,0,',','.')."".number_format($hj,0,',','.')."$status

"); + print("
"); + + print(""); + print(""); + + print("
Total Jumlah Barang : ".number_format($ttJumlah['jml'],0,',','.')."
Total Persediaan : ".number_format($ttJumlah['hp'],0,',','.')."
"); + }else{ + echo "Data tidak ada!"; + } + } + } +?> diff --git a/old-source/barcoding/menu.php b/old-source/barcoding/menu.php new file mode 100644 index 0000000..e19fc00 --- /dev/null +++ b/old-source/barcoding/menu.php @@ -0,0 +1,130 @@ + + + + + +
+ +
diff --git a/old-source/bayar.php b/old-source/bayar.php new file mode 100644 index 0000000..2b5ed18 --- /dev/null +++ b/old-source/bayar.php @@ -0,0 +1,120 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Pembayaran Per Supplier +
+ + + + +
+
+
+ + + +
Range Tanggal: s/d
Kode Supplier: + +
+
+
+
+
+
+
+ +
+
Cari Supplier
+
+ +
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + +
+ + \ No newline at end of file diff --git a/old-source/bon/ajaxpelanggan.php b/old-source/bon/ajaxpelanggan.php new file mode 100644 index 0000000..8596e1c --- /dev/null +++ b/old-source/bon/ajaxpelanggan.php @@ -0,0 +1,266 @@ + +prepare($query); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function simpan($id_pel, $alias, $stsmember, $ktp, $nama, $alamat, $wilayah, $tp_lahir, $tg_lahir, $jen_kel, $agama, $kerja, $statusnikah, $telp, $hp, $email, $upline, $batasbon, + $nilaibon, $bonistimewa, $komisi, $komisiambil, $statuspel, $tglentry, $operasi) +{ + require_once '../db_login.inc.php'; + $harray = array(); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if ($operasi === "simpan") + { + if($nama != "" && $alamat != ""){ + $stmt = $mysqli->prepare("INSERT INTO pelanggan(kd_customer, ktp, nama, alamat, wilayah, tempat_lahir, tgl_lahir, jns_kelamin, agama, pekerjaan, + status_nikah, telp, ponsel, email, upline, bts_bon, nilai_bon, bts_bon_istimewa, nilai_komisi, komisi_diambil, tgl_entry, jenis_customer) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); + $stmt->bind_param("sssssssssssssssiiiiiss", $id_pel, $ktp, $nama, $alamat, $wilayah, $tp_lahir, $tg_lahir, $jen_kel, $agama, $kerja, $statusnikah, $telp, + $hp, $email, $upline, $batasbon, $nilaibon, $bonistimewa, $komisi, $komisiambil, $tglentry, $statuspel); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $harray[0] = 1; + $stmt->close(); + } else { + $harray[0] = 0; + } + }else{ + $harray[0] = 2; + } + } elseif ($operasi === "update") { + $stmt = $mysqli->prepare("UPDATE pelanggan SET ktp=?, nama=?, alamat=?, wilayah=?, tempat_lahir=?, tgl_lahir=?, jns_kelamin=?, agama=?, pekerjaan=?, + status_nikah=?, telp=?, ponsel=?, email=?, upline=?, bts_bon=?, nilai_bon=?, bts_bon_istimewa=?, nilai_komisi=?, komisi_diambil=?, + jenis_customer=? WHERE kd_customer=?"); + $stmt->bind_param("ssssssssssssssiiiiiss", $ktp, $nama, $alamat, $wilayah, $tp_lahir, $tg_lahir, $jen_kel, $agama, $kerja, $statusnikah, $telp, $hp, + $email, $upline, $batasbon, $nilaibon, $bonistimewa, $komisi, $komisiambil, $statuspel, $id_pel); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $harray[0] = 1; + $stmt->close(); + } else + { + $harray[0] = 0; + } + } + $mysqli->close(); + echo json_encode($harray); +} + +function cek_pelanggan($id_pelanggan) +{ + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT COUNT(*) FROM pelanggan WHERE kd_customer = '{$id_pelanggan}'")->fetch_array(); + if ($data[0] > 0) + { + return true; + } else + { + return false; + } +} + +function cari_pelanggan($nama) { + if($nama != "") { + $harray = array(); + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT kd_customer, nama, alamat, nilai_bon, bts_bon FROM pelanggan WHERE nama LIKE '%".$nama."%'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_customer' => $a['kd_customer'], + 'nama' => $a['nama'], + 'alamat' => $a['alamat'], + 'nilai_bon' => number_format($a['nilai_bon'],0,',','.'), + 'bts_bon' => number_format($a['bts_bon'],0,',','.') + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + +function cari_upline($nama) { + if($nama != "") { + $harray = array(); + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT kd_customer, nama, alamat, nilai_bon, bts_bon FROM pelanggan WHERE nama LIKE '%".$nama."%' AND upline = '#'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_customer' => $a['kd_customer'], + 'nama' => $a['nama'], + 'alamat' => $a['alamat'], + 'nilai_bon' => number_format($a['nilai_bon'],0,',','.'), + 'bts_bon' => number_format($a['bts_bon'],0,',','.') + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + +function ambil_pelanggan($id_pelanggan) { + if ($id_pelanggan != "") { + $array_data = array(); + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT * FROM pelanggan WHERE kd_customer = '".$id_pelanggan."'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $tgl_lahir = ''; + + if($a['tgl_lahir'] != "") { + $tgl_lahir = substr($a['tgl_lahir'],8,2)."-".substr($a['tgl_lahir'],5,2)."-".substr($a['tgl_lahir'],0,4); + } else { + $tgl_lahir = $a['tgl_lahir']; + } + + $array_data[$idx] = array( + 'kd_customer' => $a['kd_customer'], + 'alias' => $a['alias'], + 'member' => $a['member'], + 'ktp' => $a['ktp'], + 'nama' => $a['nama'], + 'alamat' => $a['alamat'], + 'kd_lokasi' => $a['kd_lokasi'], + 'wilayah' => $a['wilayah'], + 'tempat_lahir' => $a['tempat_lahir'], + 'tgl_lahir' => $tgl_lahir, + 'jns_kelamin' => $a['jns_kelamin'], + 'agama' => $a['agama'], + 'kd_lokasi' => $a['kd_lokasi'], + 'pekerjaan' => $a['pekerjaan'], + 'status_nikah' => $a['status_nikah'], + 'telp' => $a['telp'], + 'ponsel' => $a['ponsel'], + 'email' => $a['email'], + 'status' => $a['status'], + 'upline' => $a['upline'], + 'bts_bon' => $a['bts_bon'], + 'nilai_bon' => $a['nilai_bon'], + 'bts_bon_istimewa' => $a['bts_bon_istimewa'], + 'nilai_komisi' => $a['nilai_komisi'], + 'komisi_diambil' => $a['komisi_diambil'], + 'jenis_customer' => $a['jenis_customer'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($array_data); + } +} + +function ambil_kode() { + $array_data = array(); + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT kd_customer FROM pelanggan ORDER BY kd_customer DESC limit 1"); + if($data->num_rows > 0) { + $a = $data->fetch_array(MYSQLI_NUM); + //$kode_awal = substr($a[0],2,6); + $kode_awal = intval(substr($a[0],2,6)); + $kode_awal++; + $strUrut = strlen($kode_awal); + for($i=1;$i<=(6-$strUrut);$i++){ + $kode_awal = "0" . $kode_awal; + } + + //$kode = $kode_awal + 1; + $kode = 'A8'.$kode_awal; + $array_data[0] = $kode; + + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); +} +?> \ No newline at end of file diff --git a/old-source/bon/ak4.php b/old-source/bon/ak4.php new file mode 100644 index 0000000..8dfd39a --- /dev/null +++ b/old-source/bon/ak4.php @@ -0,0 +1,74 @@ + + + + + Amigo Group :: Pengadaan Barang + + + + + + + + + + + + + +
+
+ +
+
+
Rekap Bon dan Titipan (AK.4)
+
+
+
+ + + +
Range Tanggal: s/d
+
+
+
+
+ +
+ + diff --git a/old-source/bon/komisi.php b/old-source/bon/komisi.php new file mode 100644 index 0000000..fdb2135 --- /dev/null +++ b/old-source/bon/komisi.php @@ -0,0 +1,94 @@ + + + + + Amigo Group :: Pengadaan Barang + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
Rekap Komisi Bon
+
+
+
+ + + +
Rentang Tanggal: -
Kode Pelanggan :
+
+
+
+
+
+
+
Cari Pelanggan
+
+
+
+ + + + +
Nama: +
+
+
+ Hasil pencarian +
+
+
+
+ + +
+ + diff --git a/old-source/bon/kontrolbon.php b/old-source/bon/kontrolbon.php new file mode 100644 index 0000000..97dde0a --- /dev/null +++ b/old-source/bon/kontrolbon.php @@ -0,0 +1,64 @@ + + + + + Amigo Group :: Pengadaan Barang + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
Kontrol Bon
+
+
+
+ + +
Batas tampilan data :
+
+
+
+
+
+ + +
+ + diff --git a/old-source/bon/lapak4.php b/old-source/bon/lapak4.php new file mode 100644 index 0000000..47e7432 --- /dev/null +++ b/old-source/bon/lapak4.php @@ -0,0 +1,125 @@ +"; + echo "table.tbl {width:80%;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}"; + echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}"; + echo "body {font-size:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + if(bukaKoneksi()){ + global $conn; + $query = "SELECT tmpX.tgl,tmpBon.totbon,tmpRetur.totretur,tmpTitip.tottitip + FROM(select date(tgl_bon) tgl + FROM m_bon m + WHERE + date(tgl_bon) between '$startDate' and '$endDate' + group by tgl)tmpX + LEFT OUTER JOIN + (select date(m.tgl_bon) as tgl,sum(d.jumlah*d.hrg_satuan) as totbon + from d_bon d,m_bon m + where + m.no_bon = d.no_bon + and date(tgl_bon) between '$startDate' and '$endDate' + group by date(tgl_bon))tmpBon + ON tmpX.tgl = tmpBon.tgl + LEFT OUTER JOIN + (select date(m.tgl_nota) as tgl, sum(m.jumlah_total) as totretur + from m_nota_retur m + where m.status_nota = 'B' + and date(m.tgl_nota) BETWEEN '$startDate' and '$endDate' + group by date(m.tgl_nota))tmpRetur + ON tmpX.tgl = tmpRetur.tgl + LEFT OUTER JOIN + (select date(t.tgl_byr) tgl,sum(t.bayar_bon) as tottitip + from bayar_bon t + where date(t.tgl_byr) between '$startDate' and '$endDate' + group by date(t.tgl_byr)) tmpTitip + ON tmpX.tgl = tmpTitip.tgl"; + + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tgl,$totA,$totB,$totC); + $ttJumlah = array(); + $ttJumlah['rpbon'] = 0; + $ttJumlah['rpretur'] = 0; + $ttJumlah['rpnettbon'] = 0; + $ttJumlah['rptitip'] = 0; + $ttJumlah['rpkomisi'] = 0; + $ttJumlah['saldo_akh'] = 0; + $ttJumlah['saldo_awalbln'] = 559659149; + $ttJumlah['saldo_awalthn'] = 601788749; + $ttJumlah['saldo_rata2'] = 0; + $ttJumlah['akum_titiplalu'] = 1122281800; + $bulan = substr($_POST['endDate'],3,2); + $ttJumlah['akum_titip'] = 0; + $ttJumlah['rata2_titip'] = 0; + $ttJumlah['usia_piutang'] = 0; + + print("
"); + print("

Rekap AK.4



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."


"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['rpbon'] += $totA; + $ttJumlah['rpretur'] += $totB; + $ttJumlah['rpnettbon'] += $totA-$totB; + $ttJumlah['rptitip'] += $totC; + print(" + + "); + } + print(" + + + "); + print("
TanggalBONRETUR BONNETTO BONTITIPKOMISI
".encTgl($tgl)."".number_format($totA,0,',','.')."".number_format($totB,0,',','.')."".number_format($totA-$totB,0,',','.')."".number_format($totC,0,',','.')."
T O T A L".number_format($ttJumlah['rpbon'],0,',','.')."".number_format($ttJumlah['rpretur'],0,',','.')."".number_format($ttJumlah['rpnettbon'],0,',','.')."".number_format($ttJumlah['rptitip'],0,',','.')."".number_format(0,0,',','.')."

"); + + $ttJumlah['saldo_akh'] = $ttJumlah['saldo_awalbln'] + $ttJumlah['rpnettbon'] - $ttJumlah['rptitip']; + $ttJumlah['saldo_rata2'] = ($ttJumlah['saldo_akh'] + $ttJumlah['saldo_awalthn']) / 2; + $ttJumlah['akum_titip'] = $ttJumlah['akum_titiplalu'] + $ttJumlah['rptitip']; + $ttJumlah['rata2_titip'] = $ttJumlah['akum_titip']/$bulan; + $ttJumlah['usia_piutang'] = $ttJumlah['saldo_rata2'] / $ttJumlah['rata2_titip']; + + print("
"); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print(""); + print("
SALDO AWAL BULAN : ".number_format($ttJumlah['saldo_awalbln'],0,',','.')."
Nett BON : ".number_format($ttJumlah['rpnettbon'],0,',','.')."
TITIP : ".number_format($ttJumlah['rptitip'],0,',','.')."
SALDO AKHIR : ".number_format($ttJumlah['saldo_akh'],0,',','.')."

SALDO AWAL TH : ".number_format($ttJumlah['saldo_awalthn'],0,',','.')."
SALDO RATA-RATA : ".number_format($ttJumlah['saldo_rata2'],0,',','.')."
AKUMULASI TITIP : ".number_format($ttJumlah['akum_titip'],0,',','.')."
RATA2 TITIP : ".number_format($ttJumlah['rata2_titip'],0,',','.')."
USIA PIUTANG : ".number_format($ttJumlah['usia_piutang'],2,',','.')."

KOMISI BLN INI : ".number_format(0,0,',','.')."
AKUMULASI KOMISI : ".number_format(0,0,',','.')."
"); + }else{ + echo "Belum ada data transaksi untuk tanggal tersebut!"; + } + } + } +?> diff --git a/old-source/bon/lapbonperiode.php b/old-source/bon/lapbonperiode.php new file mode 100644 index 0000000..192f582 --- /dev/null +++ b/old-source/bon/lapbonperiode.php @@ -0,0 +1,98 @@ +"; + echo "div#divprint{width:900px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:50px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + +$startDate = decTgl($_POST['startDate']); +$endDate = decTgl($_POST['endDate']); + + if(bukaKoneksi()){ + global $conn; + $query = "select p.kd_customer,p.nama,p.alamat,p.upline from pelanggan p where p.upline = '#'"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdcust,$nama,$alamat,$upline); + $ttJumlah = array(); + + print("
"); + print("

Laporan Rekap Saldo Bon Per Periode



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("Periode Bon Tanggal : ".encTgl($startDate)." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."

"); + print(""); + print(""); + while(mysqli_stmt_fetch($stmt)){ + $query2 = "select sum(m.jumlah_total) + from pelanggan p2 force index (primary,upline), m_bon m force index (kd_plg) + where p2.kd_customer = m.kode_plg and + (p2.upline = '$kdcust' or p2.kd_customer = '$kdcust') + and date(m.tgl_bon) BETWEEN '$startDate' and '$endDate' + group by p2.kd_customer"; + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$total); + $ttJumlah['totalbon'] = 0; + while(mysqli_stmt_fetch($stmt2)){ + $ttJumlah['totalbon'] += $total; + } + }else{ + $ttJumlah['totalbon'] = 0; + } + } + + $query3 = "select m.jumlah_total,t.bayar_bon + from pelanggan p force index (primary,upline),bayar_bon t left join m_bon m on (t.no_bon = m.no_bon) + where t.kd_plg = p.kd_customer + and (t.kd_plg = '$kdcust' or p.upline = '$kdcust') + and date(t.tgl_byr) between '$startDate' and '$endDate'"; + + if($stmt3 = mysqli_prepare($conn,$query3)){ + mysqli_stmt_execute($stmt3); + mysqli_stmt_store_result($stmt3); + $cek3 = mysqli_stmt_num_rows($stmt3); + if($cek3 > 0){ + mysqli_stmt_bind_result($stmt3,$totNota,$titip); + $ttJumlah['titip'] = 0; + while(mysqli_stmt_fetch($stmt3)){ + $ttJumlah['titip'] += $titip; + } + }else{ + $ttJumlah['titip'] = 0; + } + } + + if ($ttJumlah['totalbon'] != 0){ + print(""); + } + } + print("
Kode PlgNamaAlamatUplineTotal BonTotal Titip
$kdcust$nama$alamat$upline".number_format($ttJumlah['totalbon'], 0, ",", ".")."".number_format($ttJumlah['titip'], 0, ",", ".")."

"); + print("
"); + }else{ + echo "Data tidak ditemukan!"; + } + } + } +?> + diff --git a/old-source/bon/lapkomisi.php b/old-source/bon/lapkomisi.php new file mode 100644 index 0000000..4672a1a --- /dev/null +++ b/old-source/bon/lapkomisi.php @@ -0,0 +1,96 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $kodeplg = $_POST['kdplg']; + + if(bukaKoneksi()){ + global $conn; + IF (strlen($startDate) > 2 && strlen($endDate) > 2 && $kodeplg !=''){ + $query = "select k.tgl_ambil,k.kd_plg,p.nama,k.jumlah,k.kd_kasir + from pelanggan p,komisi k + where k.kd_plg = p.kd_customer + and date(k.tgl_ambil) between '$startDate' and '$endDate' + and k.kd_plg = '$kodeplg' + order by k.tgl_ambil,k.kd_plg"; + }elseif ($startDate != '' && $endDate != '' && $kodeplg =='' ){ + $query = "select k.tgl_ambil,k.kd_plg,p.nama,k.jumlah,k.kd_kasir + from pelanggan p,komisi k + where k.kd_plg = p.kd_customer + and date(k.tgl_ambil) between '$startDate' and '$endDate' + order by k.tgl_ambil,k.kd_plg"; + }elseif (strlen($startDate) <= 2 && strlen($endDate) <= 2 && $kodeplg !=''){ + $query = "select k.tgl_ambil,k.kd_plg,p.nama,k.jumlah,k.kd_kasir + from pelanggan p,komisi k + where k.kd_plg = p.kd_customer + and k.kd_plg = '$kodeplg' + order by k.tgl_ambil,k.kd_plg"; + } + $querynama = "select nama from pelanggan where kd_customer = '$kodeplg'"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek >= 0){ + mysqli_stmt_bind_result($stmt,$tgl,$kdplg,$nama,$juml,$kasir); + $ttJumlah = array(); + + $ttJumlah['hp'] = 0; + print("
"); + print("

Laporan Rekap Komisi Bon



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."
"); + if($stmtnama = mysqli_prepare($conn,$querynama)){ + mysqli_stmt_execute($stmtnama); + mysqli_stmt_store_result($stmtnama); + $ceknama = mysqli_stmt_num_rows($stmtnama); + if($ceknama > 0){ + mysqli_stmt_bind_result($stmtnama,$nama); + + while(mysqli_stmt_fetch($stmtnama)){ + print("Nama Pelanggan : ".$nama."
"); + } + } + } + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['rp'] += $juml; + print(""); + } + + print("
Tanggal AmbilKode PlgNamaKomisi yg diambilKasir
$tgl$kdplg$nama".number_format($juml, 0, ",", ".")."$kasir

"); + print("
"); + + print(""); + print("
Total Komisi Bon : ".number_format($ttJumlah['rp'],0,',','.')."
"); + }else{ + echo "Data tidak ditemukan!"; + } + } + } +?> + diff --git a/old-source/bon/lapkontrolbon.php b/old-source/bon/lapkontrolbon.php new file mode 100644 index 0000000..dcb4b70 --- /dev/null +++ b/old-source/bon/lapkontrolbon.php @@ -0,0 +1,65 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $limit = $_POST['limit']; + + if(bukaKoneksi()){ + global $conn; + $query = "select p.upline,p2.nama nama_upline,m.kode_plg,p.nama,m.tgl_bon,m.no_bon,m.jumlah_total,m.kasir + from m_bon m inner join pelanggan p on m.kode_plg = p.kd_customer + left join pelanggan p2 on p.upline = p2.kd_customer + where m.status = 'B' + order by m.tgl_bon,p.upline,m.kode_plg + limit ".$limit.""; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek >= 0){ + mysqli_stmt_bind_result($stmt,$upline,$nmupline,$kdplg,$nama,$tgl,$nobon,$juml,$kasir); + + $ttJumlah = array(); + $ttJumlah['hp'] = 0; + + print("
"); + print("

Laporan Rekap Kontrol Bon



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."
"); + + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['rp'] += $juml; + print(""); + } + + print("
Kd.PngJwbNama PngJwbKode PlgNamaTgl NotaNo.NotaJumlahKasir
$upline$nmupline$kdplg$nama$tgl$nobon".number_format($juml, 0, ",", ".")."$kasir

"); + print("
"); + }else{ + echo "Data tidak ditemukan!"; + } + } + } +?> + diff --git a/old-source/bon/laprekapbon.php b/old-source/bon/laprekapbon.php new file mode 100644 index 0000000..4aa15cb --- /dev/null +++ b/old-source/bon/laprekapbon.php @@ -0,0 +1,108 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $kodeplg = $_POST['kodepelanggan']; + + if(bukaKoneksi()){ + global $conn; + IF (strlen($startDate) > 2 && strlen($endDate) > 2 && $kodeplg !=''){ + $query = "select m.tgl_bon,m.kode_plg,p.nama,p.upline,m.no_bon,sum(d.jumlah*d.hrg_satuan),m.kasir + from d_bon d,m_bon m,pelanggan p + where + m.kode_plg = p.kd_customer + and m.no_bon = d.no_bon + and date(tgl_bon) between '$startDate' and '$endDate' + and (p.kd_customer = '$kodeplg' or p.upline = '$kodeplg') + group by m.no_bon + order by m.tgl_bon,p.kd_customer"; + }elseif ($startDate != "" && $endDate != "" && $kodeplg =='' ){ + $query = "select m.tgl_bon,m.kode_plg,p.nama,p.upline,m.no_bon,sum(d.jumlah*d.hrg_satuan),m.kasir + from d_bon d,m_bon m,pelanggan p + where + m.kode_plg = p.kd_customer + and m.no_bon = d.no_bon + and date(tgl_bon) between '$startDate' and '$endDate' + group by m.no_bon + order by m.tgl_bon,p.kd_customer"; + }elseif (strlen($startDate) <= 2 && strlen($endDate) <= 2 && $kodeplg !=''){ + $query = "select m.tgl_bon,m.kode_plg,p.nama,p.upline,m.no_bon,sum(d.jumlah*d.hrg_satuan),m.kasir + from d_bon d,m_bon m,pelanggan p + where + m.kode_plg = p.kd_customer + and m.no_bon = d.no_bon + and (p.kd_customer = '$kodeplg' or p.upline = '$kodeplg') + group by m.no_bon + order by m.tgl_bon,p.kd_customer"; + } + + + $querynama = "select nama from pelanggan where kd_customer = '$kodeplg'"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tgl,$kdplg,$nama,$upline,$nomor,$tot,$kasir); + $ttJumlah = array(); + + $ttJumlah['hp'] = 0; + + print("
"); + print("

Laporan Rekap Bon



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."
"); + if($stmtnama = mysqli_prepare($conn,$querynama)){ + mysqli_stmt_execute($stmtnama); + mysqli_stmt_store_result($stmtnama); + $ceknama = mysqli_stmt_num_rows($stmtnama); + if($ceknama > 0){ + mysqli_stmt_bind_result($stmtnama,$nama); + + while(mysqli_stmt_fetch($stmtnama)){ + print("Nama Pelanggan : ".$nama."
"); + } + } + } + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['hp'] += $tot; + print(""); + } + + print("
Tanggal BonKode PlgNamaPenanggung JawabNomor Nota BonTotal BelanjaKasir
".encTgl($tgl)."$kdplg$nama$upline$nomor".number_format($tot, 0, ",", ".")."$kasir

"); + print("
"); + + print(""); + + print("
Total Bon : ".number_format($ttJumlah['hp'],0,',','.')."
"); + }else{ + echo "Data tidak ditemukan!"; + } + } + } +?> + diff --git a/old-source/bon/laprekappj.php b/old-source/bon/laprekappj.php new file mode 100644 index 0000000..07a2316 --- /dev/null +++ b/old-source/bon/laprekappj.php @@ -0,0 +1,297 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:50px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $kodeplg = $_POST['kodepelanggan']; + + if(bukaKoneksi()){ + global $conn; + IF ($kodeplg !=''){ +// $query = "select m.kode_plg,p2.nama,m.tgl_bon, m.no_bon, m.jumlah_total,m.kasir +// from pelanggan p1, pelanggan p2, m_bon m force index(kd_plg) +// where p2.kd_customer = m.kode_plg and m.status = 'B' +// and ((p1.upline = '$kodeplg'and p1.kd_customer = p2.upline) +// or p2.upline = '$kodeplg' +// or p2.kd_customer = '$kodeplg') +// group by m.tgl_bon, p2.kd_customer,no_bon"; +/*------------query untuk downline lapis 2--------------------*/ +// $queryLunas = "select m.kode_plg,p2.nama,m.tgl_bon, m.no_bon, m.jumlah_total,m.kasir +// from pelanggan p1, pelanggan p2, m_bon m force index(kd_plg) +// where p2.kd_customer = m.kode_plg and m.status = 'L' +// and ((p1.upline = '$kodeplg'and p1.kd_customer = p2.upline) +// or p2.upline = '$kodeplg' +// or p2.kd_customer = '$kodeplg') +// group by m.tgl_bon, p2.kd_customer,no_bon"; + + + // Query NOTA BELUM LUNAS + IF (strlen($startDate) > 2 && strlen($endDate) > 2){ + $query = "select m.kode_plg,p2.nama,m.tgl_bon, m.no_bon, m.jumlah_total,m.kasir,datediff(date(now()),date(m.tgl_bon)) usianota + from pelanggan p2, m_bon m + where p2.kd_customer = m.kode_plg and m.status = 'B' and + (p2.upline = '$kodeplg' + or p2.kd_customer = '$kodeplg') + and date(m.tgl_bon) between '$startDate' and '$endDate' + order by m.tgl_bon, p2.kd_customer,no_bon"; + + $qrypenagihan = "select m.kode_plg,p2.nama,m.tgl_bon, m.no_bon, m.jumlah_total,m.kasir,datediff(date(now()),date(m.tgl_bon)) usianota + from pelanggan p2, m_bon m + where p2.kd_customer = m.kode_plg and m.status = 'B' and + (p2.upline = '$kodeplg' + or p2.kd_customer = '$kodeplg') + and date(m.tgl_bon) between '$startDate' and '$endDate' + order by p2.kd_customer,m.tgl_bon,no_bon"; + + + $query2 = "select nama, alamat from pelanggan where kd_customer = '$kodeplg'"; + + $query3 = "select m.jumlah_total,t.bayar_bon + from pelanggan p,bayar_bon t left join m_bon m on (t.no_bon = m.no_bon) + where t.kd_plg = p.kd_customer + and (t.kd_plg = '$kodeplg' or p.upline = '$kodeplg') + order by t.tgl_byr,t.no_bon"; + + $query4 = "select distinct p2.nilai_bon, p2.kd_customer + from pelanggan p2, m_bon m + where p2.kd_customer = m.kode_plg and + (p2.upline = '$kodeplg' or p2.kd_customer = '$kodeplg')"; + + $query5 = "select p2.kd_customer,p2.nilai_bon,p2.upline,m.kode_plg,m.tgl_bon, m.no_bon, m.jumlah_total + from pelanggan p2, m_bon m where p2.kd_customer = m.kode_plg and m.status != 'L' and + (p2.upline = '$kodeplg' or p2.kd_customer = '$kodeplg') + order by m.tgl_bon, p2.kd_customer,no_bon + ')"; + + + }elseif (strlen($startDate) <= 2 && strlen($endDate) <= 2){ + echo "tanggal belum diisi"; + } + }else{ + echo "kode pelanggan belum diisi
"; + } + +//untuk penagihan + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$nama,$alamat); + print("
"); + print("

Rekap Untuk Penanggungjawab Bon



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE TANGGAL : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."
"); + print("Kode : ".$kodeplg."
"); + while(mysqli_stmt_fetch($stmt2)){ + print("Nama : ".$nama."
"); + print("Alamat : ".$alamat."

"); + + } + } + } + + + + if($stmtPenagihan = mysqli_prepare($conn,$qrypenagihan)){ + mysqli_stmt_execute($stmtPenagihan); + mysqli_stmt_store_result($stmtPenagihan); + $cekPenagihan = mysqli_stmt_num_rows($stmtPenagihan); + if($cekPenagihan > 0){ + mysqli_stmt_bind_result($stmtPenagihan,$kdplg,$nama,$tgl,$nomor,$hp,$kasir,$usianota); + $kode = 0; + $tt_tempjumlah = 0; + print("

Rincian Transaksi Belum Lunas


"); + print(""); + print(""); + while(mysqli_stmt_fetch($stmtPenagihan)){ + $tt_tempjumlah += $hp; + $kd[$kode]['kd'] = $kdplg; + $nm[$kode]['kd'] = $nama; + $tanggal[$kode]['kd'] = $tgl; + $no[$kode]['kd'] = $nomor; + $hape[$kode]['kd'] = $hp; + $ksr[$kode]['kd'] = $kasir; + $usia[$kode]['kd'] = $usianota; + $kode++; + } + for($i=0;$i<$kode;$i++){ + if($kd[$i-1]['kd']==$kd[$i]['kd']){ + print(""); + }else{ + if($tempjumlah == 0){ + print(""); + }else{ + print(""); + print(""); + } + $tempjumlah = 0; + } + $tempjumlah += $hape[$i]['kd']; + } + print(""); + + print("
Kode PlgNamaTgl BonNomor Nota BonTotal BelanjaKasirUsiaNota(hari)
".$kd[$i]['kd']."".$nm[$i]['kd']."".$tanggal[$i]['kd']."".$no[$i]['kd']."".number_format($hape[$i]['kd'], 0, ",", ".")."".$ksr[$i]['kd']."".$usia[$i]['kd']."
".$kd[$i]['kd']."".$nm[$i]['kd']."".$tanggal[$i]['kd']."".$no[$i]['kd']."".number_format($hape[$i]['kd'], 0, ",", ".")."".$ksr[$i]['kd']."".$usia[$i]['kd']."
Sub Total".number_format($tempjumlah, 0, ",", ".")."
".$kd[$i]['kd']."".$nm[$i]['kd']."".$tanggal[$i]['kd']."".$no[$i]['kd']."".number_format($hape[$i]['kd'], 0, ",", ".")."".$ksr[$i]['kd']."".$usia[$i]['kd']."
Sub Total".number_format($tempjumlah, 0, ",", ".")."

"); + print("
"); + print(""); + + + print("
Total Bon Belum Lunas : ".number_format($tt_tempjumlah,0,',','.')."
"); + }else{ + echo "Data tidak ditemukan"; + } + } + +//end of untuk penagihan + + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$nama,$alamat); + print("
"); + print("

Laporan Rekap Penanggungjawab Bon



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE TANGGAL : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."
"); + print("Kode : ".$kodeplg."
"); + while(mysqli_stmt_fetch($stmt2)){ + print("Nama : ".$nama."
"); + print("Alamat : ".$alamat."


"); + + } + } + } + + // Query NOTA LUNAS + IF (strlen($startDate) > 2 && strlen($endDate) > 2){ + $queryLunas = "select m.kode_plg,p2.nama,m.tgl_bon, m.no_bon, m.jumlah_total,m.kasir,datediff(date(byr.tgl_byr ),date(m.tgl_bon)) usianota + from pelanggan p2, m_bon m, bayar_bon byr + where p2.kd_customer = m.kode_plg and m.status = 'L' and + (p2.upline = '$kodeplg' + or p2.kd_customer = '$kodeplg') + and m.tgl_bon between '$startDate' and '$endDate' + and m.no_bon = byr.no_bon + order by m.tgl_bon, p2.kd_customer,no_bon"; + }elseif (strlen($startDate) <= 2 && strlen($endDate) <= 2){ + $queryLunas = "select m.kode_plg,p2.nama,m.tgl_bon, m.no_bon, m.jumlah_total,m.kasir,datediff(date(byr.tgl_byr ),date(m.tgl_bon)) usianota + from pelanggan p2, m_bon m, bayar_bon byr + where p2.kd_customer = m.kode_plg and m.status = 'L' and + (p2.upline = '$kodeplg' + or p2.kd_customer = '$kodeplg') + and m.no_bon = byr.no_bon + order by m.tgl_bon, p2.kd_customer,no_bon"; + } + if($stmtLunas = mysqli_prepare($conn,$queryLunas)){ + mysqli_stmt_execute($stmtLunas); + mysqli_stmt_store_result($stmtLunas); + $cekLunas = mysqli_stmt_num_rows($stmtLunas); + if($cekLunas > 0){ + mysqli_stmt_bind_result($stmtLunas,$kdplgL,$namaL,$tglL,$nomorL,$hpL,$kasirL,$usiaL); + + print("

Rincian Transaksi Lunas


"); + print(""); + print(""); + while(mysqli_stmt_fetch($stmtLunas)){ + $ttJumlah['hpL'] += $hpL; + print(""); + } + print("
Kode PlgNamaTgl BonNomor Nota BonTotal BelanjaKasirUsiaPelunasan(hari)
$kdplgL$namaL$tglL$nomorL".number_format($hpL, 0, ",", ".")."$kasirL$usiaL

"); + print("
"); + print(""); + print("
Total Bon Sudah Lunas : ".number_format($ttJumlah['hpL'],0,',','.')."
"); + }else{ + echo "Tidak ada nota lunas
"; + } + + } + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdplg,$nama,$tgl,$nomor,$hp,$kasir,$usianota); + $ttJumlah = array(); + + $ttJumlah['hp'] = 0; + + print("

Rincian Transaksi Belum Lunas


"); + print(""); + print(""); + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['hp'] += $hp; + print(""); + } + print("
Kode PlgNamaTgl BonNomor Nota BonTotal BelanjaKasirUsiaNota(hari)
$kdplg$nama$tgl$nomor".number_format($hp, 0, ",", ".")."$kasir$usianota

"); + print("
"); + print(""); + + if($stmt3 = mysqli_prepare($conn,$query3)){ + mysqli_stmt_execute($stmt3); + mysqli_stmt_store_result($stmt3); + $cek3 = mysqli_stmt_num_rows($stmt3); + if($cek3 > 0){ + mysqli_stmt_bind_result($stmt3,$totNota,$titip); + while(mysqli_stmt_fetch($stmt3)){ + $ttJumlah['titip'] += $titip; + $ttJumlah['nota'] += $totNota; + $saldotitip = $ttJumlah['titip'] - $ttJumlah['nota']; + } + print(""); + } + } + if($stmt5 = mysqli_prepare($conn,$query5)){ + mysqli_stmt_execute($stmt5); + mysqli_stmt_store_result($stmt5); + $cek5 = mysqli_stmt_num_rows($stmt5); + if($cek5 > 0){ + mysqli_stmt_bind_result($stmt5,$kd_customer,$nilai_bon,$upline,$kode_plg,$tgl_bon,$no_bon,$jumlah_total); + while(mysqli_stmt_fetch($stmt5)){ + $ttJumlah['jumlah_total'] += $jumlah_total; + } + } + } + if($stmt4 = mysqli_prepare($conn,$query4)){ + mysqli_stmt_execute($stmt4); + mysqli_stmt_store_result($stmt4); + $cek4 = mysqli_stmt_num_rows($stmt4); + if($cek4 > 0){ + mysqli_stmt_bind_result($stmt4,$nilai_bon,$kd_cust); + while(mysqli_stmt_fetch($stmt4)){ + $ttJumlah['nilai_bon'] += $nilai_bon; + } + print(""); + } + } + print(""); + print("
Total Bon Belum Lunas : ".number_format($ttJumlah['hp'],0,',','.')."
Saldo Titip : ".number_format($saldotitip,0,',','.')."
Saldo Titip (versi prg kasir) : ".number_format($ttJumlah['hp']-$ttJumlah['nilai_bon'],0,',','.')."
Total Net Bon : ".number_format($ttJumlah['hp']-$saldotitip,0,',','.')."
"); + }else{ + echo "Tidak ada nota belum lunas"; + } + } + + } +?> + diff --git a/old-source/bon/lapreturbon.php b/old-source/bon/lapreturbon.php new file mode 100644 index 0000000..1323063 --- /dev/null +++ b/old-source/bon/lapreturbon.php @@ -0,0 +1,103 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $kodeplg = $_POST['kodepelanggan']; + + if(bukaKoneksi()){ + global $conn; + IF (strlen($startDate) > 2 && strlen($endDate) > 2 && $kodeplg !=''){ + $query = "select distinct m.tgl_nota, m.no_nota,d.no_nota_tunai, m.kd_customer,p.nama namaPlg, m.jumlah_total, k.nama kasir + from m_nota_retur m, d_nota_retur d, pelanggan p,karyawan k + where m.status_nota = 'B' + and m.no_nota = d.no_nota + and m.kasir = k.nik + and m.kd_customer = p.kd_customer + and date(m.tgl_nota) BETWEEN '$startDate' and '$endDate' + and (p.kd_customer = '$kodeplg' or p.upline = '$kodeplg')"; + }elseif ($startDate != '' && $endDate != '' && $kodeplg =='' ){ + $query = "select distinct m.tgl_nota, m.no_nota,d.no_nota_tunai, m.kd_customer,p.nama namaPlg, m.jumlah_total, k.nama kasir + from m_nota_retur m, d_nota_retur d, pelanggan p,karyawan k + where m.status_nota = 'B' + and m.no_nota = d.no_nota + and m.kasir = k.nik + and m.kd_customer = p.kd_customer + and date(m.tgl_nota) BETWEEN '$startDate' and '$endDate'"; + }elseif (strlen($startDate) <= 2 && strlen($endDate) <= 2 && $kodeplg !=''){ + $query = "select distinct m.tgl_nota, m.no_nota,d.no_nota_tunai, m.kd_customer,p.nama namaPlg, m.jumlah_total, k.nama kasir + from m_nota_retur m, d_nota_retur d, pelanggan p,karyawan k + where m.status_nota = 'B' + and m.no_nota = d.no_nota + and m.kasir = k.nik + and m.kd_customer = p.kd_customer + and (p.kd_customer = '$kodeplg' or p.upline = '$kodeplg')"; + } + $querynama = "select nama from pelanggan where kd_customer = '$kodeplg'"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tgl,$no,$nobon,$kdplg,$nmplg,$total,$kasir); + $ttJumlah = array(); + + $ttJumlah['hp'] = 0; + + print("
"); + print("

Laporan Rekap Retur Bon



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."
"); + if($stmtnama = mysqli_prepare($conn,$querynama)){ + mysqli_stmt_execute($stmtnama); + mysqli_stmt_store_result($stmtnama); + $ceknama = mysqli_stmt_num_rows($stmtnama); + if($ceknama > 0){ + mysqli_stmt_bind_result($stmtnama,$nama); + + while(mysqli_stmt_fetch($stmtnama)){ + print("Nama Pelanggan : ".$nama."
"); + } + } + } + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['hp'] += $total; + print(""); + } + + print("
TanggalNo Nota ReturNo Nota BonKode Plg.Nama Plg.TotalKasir
$tgl$no$nobon$kdplg$nmplg".number_format($total, 0, ",", ".")."$kasir

"); + print("
"); + + print(""); + + print("
Total Retur Bon : ".number_format($ttJumlah['hp'],0,',','.')."
"); + }else{ + echo "Data tidak ditemukan!"; + } + } + } +?> + diff --git a/old-source/bon/laprincikomisi.php b/old-source/bon/laprincikomisi.php new file mode 100644 index 0000000..cf71291 --- /dev/null +++ b/old-source/bon/laprincikomisi.php @@ -0,0 +1,90 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $kodeplg = $_POST['kdplg']; + + if(bukaKoneksi()){ + global $conn; + IF (strlen($startDate) > 2 && strlen($endDate) > 2 && $kodeplg !=''){ + $query = "select t.kd_plg,p.nama, + case when datediff(t.tgl_byr,date(m.tgl_bon)) <= 46 then '10%' + when datediff(t.tgl_byr,date(m.tgl_bon)) >= 47 and datediff(t.tgl_byr,date(m.tgl_bon)) <= 76 then '7.5%' + when datediff(t.tgl_byr,date(m.tgl_bon)) >= 77 and datediff(t.tgl_byr,date(m.tgl_bon)) <= 107 then '5%' + when datediff(t.tgl_byr,date(m.tgl_bon)) >= 108 then '0%' + end as komisi,sum(t.jumlah_bon) jumlah_bon + from bayar_bon t inner join m_bon m on t.no_bon = m.no_bon inner join pelanggan p on t.kd_plg = p.kd_customer + where t.jumlah_bon <> 0 and date(t.tgl_byr) between '$startDate' and '$endDate' + and t.kd_plg = '$kodeplg' + group by t.kd_plg, komisi"; + }elseif ($startDate != "" && $endDate != "" && $kodeplg =='' ){ + $query = "select t.kd_plg,p.nama, + case when datediff(t.tgl_byr,date(m.tgl_bon)) <= 46 then '10%' + when datediff(t.tgl_byr,date(m.tgl_bon)) >= 47 and datediff(t.tgl_byr,date(m.tgl_bon)) <= 76 then '7.5%' + when datediff(t.tgl_byr,date(m.tgl_bon)) >= 77 and datediff(t.tgl_byr,date(m.tgl_bon)) <= 107 then '5%' + when datediff(t.tgl_byr,date(m.tgl_bon)) >= 108 then '0%' + end as komisi,sum(t.jumlah_bon) jumlah_bon + from bayar_bon t inner join m_bon m on t.no_bon = m.no_bon inner join pelanggan p on t.kd_plg = p.kd_customer + where t.jumlah_bon <> 0 and date(t.tgl_byr) between '$startDate' and '$endDate' + group by t.kd_plg, komisi"; + }elseif (strlen($startDate) <= 2 && strlen($endDate) <= 2 && $kodeplg !=''){ + $query = "select t.kd_plg,p.nama, + case when datediff(t.tgl_byr,date(m.tgl_bon)) <= 46 then '10%' + when datediff(t.tgl_byr,date(m.tgl_bon)) >= 47 and datediff(t.tgl_byr,date(m.tgl_bon)) <= 76 then '7.5%' + when datediff(t.tgl_byr,date(m.tgl_bon)) >= 77 and datediff(t.tgl_byr,date(m.tgl_bon)) <= 107 then '5%' + when datediff(t.tgl_byr,date(m.tgl_bon)) >= 108 then '0%' + end as komisi,sum(t.jumlah_bon) jumlah_bon + from bayar_bon t inner join m_bon m on t.no_bon = m.no_bon inner join pelanggan p on t.kd_plg = p.kd_customer + where t.jumlah_bon <> 0 and t.kd_plg = '$kodeplg' + group by t.kd_plg, komisi"; + } + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek >= 0){ + mysqli_stmt_bind_result($stmt,$kdplg,$nama,$komisi,$juml); + print("
"); + print("

Laporan Rekap Rinci Komisi Bon



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."
"); + + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $tmp = $komisi * $juml / 100; + print(""); + } + + print("
Kode PlgNamaKategori KomisiJumlah BonTotal Komisi
$kdplg$nama$komisi".number_format($juml, 0, ",", ".")."".number_format($tmp, 0, ",", ".")."

"); + print("
"); + }else{ + echo "Data tidak ditemukan!"; + } + } + } +?> + diff --git a/old-source/bon/lapsaldobon.php b/old-source/bon/lapsaldobon.php new file mode 100644 index 0000000..83865b8 --- /dev/null +++ b/old-source/bon/lapsaldobon.php @@ -0,0 +1,142 @@ +"; + echo "div#divprint{width:950px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:800px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:30px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['jtTempo']); + + if(bukaKoneksi()){ + global $conn; + $query = "select p.kd_customer,p.nama,p.alamat,p.upline from pelanggan p where p.upline = '#'"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdcust,$nama,$alamat,$upline); + $ttJumlah = array(); + $ttJumlahTotalBon = 0; + $ttJumlahSaldoTitip = 0; + $ttJumlahNetSaldo = 0; + $ttJumlahBonLimit = 0; + + print("
"); + print("

Laporan Rekap Saldo Bon



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("Jatuh Tempo Tanggal : ".encTgl($startDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."
"); + print(""); + print(""); + while(mysqli_stmt_fetch($stmt)){ + $query2 = "select sum(m.jumlah_total) + from pelanggan p2 force index (primary,upline), m_bon m force index (kd_plg) + where p2.kd_customer = m.kode_plg and m.status = 'B' and + (p2.upline = '$kdcust' + or p2.kd_customer = '$kdcust') + group by p2.kd_customer"; + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$total); + $ttJumlah['totalbon'] = 0; + while(mysqli_stmt_fetch($stmt2)){ + $ttJumlah['totalbon'] += $total; + } + }else{ + $ttJumlah['totalbon'] = 0; + } + } + + $query3 = "select m.jumlah_total,t.bayar_bon + from pelanggan p force index (primary,upline),bayar_bon t left join m_bon m on (t.no_bon = m.no_bon) + where t.kd_plg = p.kd_customer + and (t.kd_plg = '$kdcust' or p.upline = '$kdcust')"; + + if($stmt3 = mysqli_prepare($conn,$query3)){ + mysqli_stmt_execute($stmt3); + mysqli_stmt_store_result($stmt3); + $cek3 = mysqli_stmt_num_rows($stmt3); + if($cek3 > 0){ + mysqli_stmt_bind_result($stmt3,$totNota,$titip); + $ttJumlah['titip'] = 0; + $ttJumlah['nota'] = 0; + while(mysqli_stmt_fetch($stmt3)){ + $ttJumlah['titip'] += $titip; + $ttJumlah['nota'] += $totNota; + $saldotitip = $ttJumlah['titip'] - $ttJumlah['nota']; + } + }else{ + $saldotitip = 0; + } + } + + $query4 = "select sum(m.jumlah_total) + from pelanggan p2 force index (primary,upline), m_bon m force index (kd_plg) + where p2.kd_customer = m.kode_plg and m.status = 'B' and + (p2.upline = '$kdcust' + or p2.kd_customer = '$kdcust') + and date(m.tgl_bon) <= '$startDate' + group by p2.kd_customer"; + if($stmt4 = mysqli_prepare($conn,$query4)){ + mysqli_stmt_execute($stmt4); + mysqli_stmt_store_result($stmt4); + $cek4 = mysqli_stmt_num_rows($stmt4); + if($cek4 > 0){ + mysqli_stmt_bind_result($stmt4,$total4); + $ttJumlah['bonlimit'] = 0; + while(mysqli_stmt_fetch($stmt4)){ + $ttJumlah['bonlimit'] += $total4; + } + }else{ + $ttJumlah['bonlimit'] = 0; + } + } + + $netsaldo = $ttJumlah['totalbon']-$saldotitip; + + if ($netsaldo != 0){ + $urut ++; + print(" + + + + "); + $ttJumlahTotalBon += $ttJumlah['totalbon']; + $ttJumlahSaldoTitip += $saldotitip; + $ttJumlahNetSaldo += $netsaldo; + $ttJumlahBonLimit += $ttJumlah['bonlimit']; + } + + } + print(" + + + + "); + print("
No.Kode PlgNamaAlamatUplineTotal BonTotal TitipSaldo Net BonSaldo Jth Tempo
$urut$kdcust$nama$alamat$upline".number_format($ttJumlah['totalbon'], 0, ",", ".")."".number_format($saldotitip, 0, ",", ".")."".number_format($netsaldo, 0, ",", ".")."".number_format($ttJumlah['bonlimit'], 0, ",", ".")."
".number_format($ttJumlahTotalBon, 0, ",", ".")."".number_format($ttJumlahSaldoTitip, 0, ",", ".")."".number_format($ttJumlahNetSaldo, 0, ",", ".")."".number_format($ttJumlahBonLimit, 0, ",", ".")."

"); + print("
"); + }else{ + echo "Data tidak ditemukan!"; + } + } + } +?> + diff --git a/old-source/bon/laptitipan.php b/old-source/bon/laptitipan.php new file mode 100644 index 0000000..0009e8a --- /dev/null +++ b/old-source/bon/laptitipan.php @@ -0,0 +1,100 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:750px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $kodeplg = $_POST['kodepelanggan']; + + if(bukaKoneksi()){ + global $conn; + IF (strlen($startDate) > 2 && strlen($endDate) > 2 && $kodeplg !=''){ + $query = "select t.tgl_byr,t.kd_plg,p.nama,p.upline,t.no_bon,t.jumlah_bon,t.bayar_bon,t.kd_kasir + from pelanggan p,bayar_bon t + where t.kd_plg = p.kd_customer + and date(t.tgl_byr) between '$startDate' and '$endDate' + and (t.kd_plg = '$kodeplg' or p.upline = '$kodeplg') + order by t.tgl_byr,t.no_bon "; + }elseif ($startDate != '' && $endDate != '' && $kodeplg =='' ){ + $query = "select t.tgl_byr,t.kd_plg,p.nama,p.upline,t.no_bon,t.jumlah_bon,t.bayar_bon,t.kd_kasir + from pelanggan p,bayar_bon t + where t.kd_plg = p.kd_customer + and date(t.tgl_byr) between '$startDate' and '$endDate' + order by t.tgl_byr,t.kd_plg"; + }elseif (strlen($startDate) <= 2 && strlen($endDate) <= 2 && $kodeplg !=''){ + $query = "select t.tgl_byr,t.kd_plg,p.nama,p.upline,t.no_bon,t.jumlah_bon,t.bayar_bon,t.kd_kasir + from pelanggan p,bayar_bon t + where t.kd_plg = p.kd_customer + and (t.kd_plg = '$kodeplg' or p.upline = '$kodeplg') + order by t.tgl_byr,t.no_bon"; + } + $querynama = "select nama from pelanggan where kd_customer = '$kodeplg'"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek >= 0){ + mysqli_stmt_bind_result($stmt,$tahun,$strip,$kdbrg,$nmbrg,$nomor,$totNota,$hp,$kasir); + $ttJumlah = array(); + + $ttJumlah['hp'] = 0; + print("
"); + print("

Laporan Rekap Titipan Bon



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("PERIODE : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y [H:i]')."
"); + if($stmtnama = mysqli_prepare($conn,$querynama)){ + mysqli_stmt_execute($stmtnama); + mysqli_stmt_store_result($stmtnama); + $ceknama = mysqli_stmt_num_rows($stmtnama); + if($ceknama > 0){ + mysqli_stmt_bind_result($stmtnama,$nama); + + while(mysqli_stmt_fetch($stmtnama)){ + print("Nama Pelanggan : ".$nama."
"); + } + } + } + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + $ttJumlah['hp'] += $hp; + $ttJumlah['rp'] += $totNota; + if ($hp != 0) { + print(""); + } + } + + print("
Tanggal TitipKode PlgNamaPenanggung JawabTotal TitipanKasir
".encTgl($tahun)."$strip$kdbrg$nmbrg".number_format($hp, 0, ",", ".")."$kasir

"); + print("
"); + + print(""); + print(""); + print("
Total Titipan Bon : ".number_format($ttJumlah['hp'],0,',','.')."
Saldo Titipan Bon : ".number_format($ttJumlah['hp']-$ttJumlah['rp'],0,',','.')."
"); + }else{ + echo "Data tidak ditemukan!"; + } + } + } +?> + diff --git a/old-source/bon/menu.php b/old-source/bon/menu.php new file mode 100644 index 0000000..ad41080 --- /dev/null +++ b/old-source/bon/menu.php @@ -0,0 +1,130 @@ + + + + + +
+ +
diff --git a/old-source/bon/rekapbon.php b/old-source/bon/rekapbon.php new file mode 100644 index 0000000..5e104f2 --- /dev/null +++ b/old-source/bon/rekapbon.php @@ -0,0 +1,112 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Rekap Bon +
+
+
+ + + + +
Rentang Tanggal: s/d
Kode Pelanggan :
+
+
+
+
+
+ +
+
Cari Pelanggan
+
+ +
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + +
+ + diff --git a/old-source/bon/rekappj.php b/old-source/bon/rekappj.php new file mode 100644 index 0000000..09af12b --- /dev/null +++ b/old-source/bon/rekappj.php @@ -0,0 +1,112 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Rekap Penanggungjawab Bon +
+
+
+ + + + +
Rentang Tanggal: s/d
Kode Pelanggan :
+
+
+
+
+ +
+
Cari Pelanggan
+
+ +
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + +
+ + + diff --git a/old-source/bon/returbon.php b/old-source/bon/returbon.php new file mode 100644 index 0000000..ae7ec1c --- /dev/null +++ b/old-source/bon/returbon.php @@ -0,0 +1,112 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Rekap Retur Bon +
+
+
+ + + + +
Rentang Tanggal: s/d
Kode Pelanggan :
+
+
+
+
+
+ +
+
Cari Pelanggan
+
+ +
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + +
+ + diff --git a/old-source/bon/rincian_jual.php b/old-source/bon/rincian_jual.php new file mode 100644 index 0000000..9d139fd --- /dev/null +++ b/old-source/bon/rincian_jual.php @@ -0,0 +1,85 @@ +"; + echo "table.tbl {width:750px;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}"; + echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}"; + echo "body {font-size:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + + $nonota = $_GET['nota']; + $nonotabon = $nonota; + bon($nonotabon); + +function bon($nonotabon) +{ + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Rekap Bon*/ + $query = "SELECT d.`kd_brg`, d.`nomor`, b.nama_barang,d.`jumlah`, d.`diskon`, + d.`hrg_satuan`,(d.`hrg_satuan`*d.`jumlah`) subtotal,d.`kd_pram` + FROM d_bon d,barang b + where d.`kd_brg`=b.kode_barang + and d.no_bon = '$nonotabon'"; + $query2 = "select m.no_bon,m.tgl_bon,m.kode_plg, + m.jumlah_total,m.diskon, + m.bank,m.no_kartu,m.kasir + from m_bon m + where m.no_bon = '$nonotabon'"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdbrg,$nomor,$nmbrg,$jum,$diskon,$hj,$subtotal,$kdpram); + + print("
"); + print("

Rincian Penjualan


"); + print("

"); + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$nota,$tglnota,$kdcust,$tot,$disc,$bank,$kartu,$kasir); + while(mysqli_stmt_fetch($stmt2)){ + print("Nomor Nota : ".$nota."
"); + print("Tanggal Nota : ".$tglnota."
"); + print("Plg : ".$kdcust."
"); + print("Total : ".number_format($tot,0,',','.')."
"); + print("Jumlah uang : ".number_format($totuang,0,',','.')."
"); + print("Discount : ".$disc."
"); + print("Bank : ".$bank."
"); + print("No.kartu : ".$kartu."
"); + print("Kasir : ".$kasir."

"); + } + } + } + + + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + print(""); + } + + print("
Kode Brg.NomorNamaJumlDiscHJSub TotalKd Pram
$kdbrg$nomor$nmbrg$jum".$diskon."".number_format($hj,0,',','.')."".number_format($subtotal,0,',','.')."$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + print("

"); + } +} + + + +?> diff --git a/old-source/bon/rincikomisi.php b/old-source/bon/rincikomisi.php new file mode 100644 index 0000000..4edde0f --- /dev/null +++ b/old-source/bon/rincikomisi.php @@ -0,0 +1,94 @@ + + + + + Amigo Group :: Pengadaan Barang + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
Rekap Rinci Komisi Bon
+
+
+
+ + + +
Rentang Tanggal: -
Kode Pelanggan :
+
+
+
+
+
+
+
Cari Pelanggan
+
+
+
+ + + + +
Nama: +
+
+
+ Hasil pencarian +
+
+
+
+ + +
+ + diff --git a/old-source/bon/saldobon.php b/old-source/bon/saldobon.php new file mode 100644 index 0000000..bba012c --- /dev/null +++ b/old-source/bon/saldobon.php @@ -0,0 +1,81 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Saldo Bon +
+
+
+ + + +
Jatuh Tempo AK2 :
+
+
+
+
+
+ + +
+ + diff --git a/old-source/bon/saldobonperiode.php b/old-source/bon/saldobonperiode.php new file mode 100644 index 0000000..a5e748e --- /dev/null +++ b/old-source/bon/saldobonperiode.php @@ -0,0 +1,88 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Rekap Saldo Bon Per Periode +
+
+
+ + +
Rentang Tanggal: s/d +
+
+
+
+
+
+ + +
+ + diff --git a/old-source/bon/titipan.php b/old-source/bon/titipan.php new file mode 100644 index 0000000..ed73a5f --- /dev/null +++ b/old-source/bon/titipan.php @@ -0,0 +1,113 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Rekap Titipan Bon +
+
+
+ + + + +
Rentang Tanggal: s/d
Kode Pelanggan :
+
+
+
+
+
+ +
+
Cari Pelanggan
+
+ +
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + +
+ + + diff --git a/old-source/convert_hp.php b/old-source/convert_hp.php new file mode 100644 index 0000000..7d7055d --- /dev/null +++ b/old-source/convert_hp.php @@ -0,0 +1,16 @@ +query("SELECT id,harga_pokok FROM `no_barang` ORDER BY id"); + if($qry_select->num_rows > 0){ + while($pembelian = $qry_select->fetch_array(MYSQLI_ASSOC)){ + $id = $pembelian['id']; + $harga_pokok = $pembelian['harga_pokok']; + $harga_pokok_new = convHrgP($harga_pokok); + $Insert_to_dbeli = $mysqli_dbeli->prepare("UPDATE no_barang SET harga_pokok = '$harga_pokok_new' where id = '$id'"); + $Insert_to_dbeli->execute(); + echo $harga_pokok." ".$harga_pokok_new."
"; + } + } +?> \ No newline at end of file diff --git a/old-source/css/css.css b/old-source/css/css.css new file mode 100644 index 0000000..6d1354b --- /dev/null +++ b/old-source/css/css.css @@ -0,0 +1,86 @@ +body { + margin: 0; + padding: 0; + font: 10pt Arial, Tahoma, Helvetica, sans-serif; + color: #7e7e7e; + line-height: 16px; + background-color: #EBE999; +} + +a { + color: #33ADDB; + background-color: inherit; +} + +a:hover { + color: #575757; + background-color: inherit; +} + +p { + padding: 2px 0 5px; + margin: 0; +} + +legend { + font-size: 1.2em; +} + +#content { + clear:both; + margin: 0px auto; + width: 1180px; +} + +.headermenu { + padding-top:7px; + background-color:#FABB55; + clear: both; + height: 35px; + width:inherit; + border-top: 3px solid #000000; +} +.c_content { + float: right; + width: 1160px; + margin: 5px 0 3px 0; + padding: 0px 10px 10px 10px; + color: #000; + background-color: #FFFFFF; +} + +.footer { + clear: both; + color: #999999; + background-color: #FFFFFF; + padding: 10px 0 10px 0; + text-align: center; + font-size:.8em; + line-height: 13px; +} + +.footer a { + text-decoration: underline; +} + +p#top{ + padding-top:5px; + display:block; + color:#FFF; + text-align:center; + font-size:2em; + font-weight:bold; +} + +p#alertmsg{ + color:#FF0000; +} + +div#ovlay{ + text-align:center; +} + +ol.catatan{ + color:#FF0000; + font-weight:bold; +} \ No newline at end of file diff --git a/old-source/css/dialogcustom.css b/old-source/css/dialogcustom.css new file mode 100644 index 0000000..5fe49c2 --- /dev/null +++ b/old-source/css/dialogcustom.css @@ -0,0 +1,71 @@ +div.whiteOverlay { background-color: #000; } +div.jqDrag {cursor: move;} + +/* jqmModal dialog CSS courtesy of; + Brice Burgess */ + +div.jqmDialog { + display: none; + position: fixed; + top: 10%; + left: 37%; + margin-left: -200px; + width: 800px; + overflow: hidden; + font-family:verdana,tahoma,helvetica; + border:1px solid #FFF; + font-size: 12px; + z-index:999; +} + +div.jqmDialog a { + color:#cc0000; +} +div.jqmDialog a:hover { + text-decoration: none; +} +/* Fixed posistioning emulation for IE6 + Star selector used to hide definition from browsers other than IE6 + For valid CSS, use a conditional include instead */ +* html div.jqmDialog { + position: absolute; + top: expression((document.documentElement.scrollTop || document.body.scrollTop) + Math.round(17 * (document.documentElement.offsetHeight || document.body.clientHeight) / 100) + 'px'); +} + + +/* [[[ Title / Top Classes ]]] */ +div.jqmdTC { + background-color: #cc0000; + color: #FFF; + padding: 7px 22px 5px 5px; + font-family:"sans serif",verdana,tahoma,helvetica; + font-weight: bold; + * zoom: 1; +} + +/* [[[ Body / Message Classes ]]] */ +div.jqmdBC { + padding: 7px 7px 7px; + height: 350px; + overflow: auto; + background-color: #fff; +} + +div.jqmdMSG { color: #000; } + +/* [[[ Button classes ]]] */ +input.jqmdX { + position: absolute; + right: 7px; + top: 4px; + padding: 0 0 0 19px; + height: 19px; + width: 0px; + background: url(../images/close.gif) no-repeat top left; + overflow: hidden; +} +input.jqmdXFocus {background-position: bottom left; outline: none;} + +div.jqmdBC button, div.jqmdBC input[type="submit"] { + cursor: pointer; +} \ No newline at end of file diff --git a/old-source/css/flora.datepicker.css b/old-source/css/flora.datepicker.css new file mode 100644 index 0000000..68a31e5 --- /dev/null +++ b/old-source/css/flora.datepicker.css @@ -0,0 +1,216 @@ +/* Main Flora Style Sheet for jQuery UI ui-datepicker */ +#ui-datepicker-div, .ui-datepicker-inline { + font-family: Arial,Helvetica,sans-serif; + font-size: 14px; + padding: 0; + margin: 0; + background: #E0F4D7; + width: 185px; +} +#ui-datepicker-div { + display: none; + border: 1px solid #FF9900; + z-index: 10; +} +.ui-datepicker-inline { + float: left; + display: block; + border: 0; +} +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-dialog { + padding: 5px !important; + border: 4px ridge #83C948 !important; +} +button.ui-datepicker-trigger { + width: 25px; +} +img.ui-datepicker-trigger { + margin: 2px; + vertical-align: middle; +} +.ui-datepicker-prompt { + float: left; + padding: 2px; + background: #E0F4D7; + color: #000; +} +*html .ui-datepicker-prompt { + width: 185px; +} +.ui-datepicker-control, .ui-datepicker-links, .ui-datepicker-header, .ui-datepicker { + clear: both; + float: left; + width: 100%; + color: #FFF; +} +.ui-datepicker-control { + background: #FF9900; + padding: 2px 0px; +} +.ui-datepicker-links { + background: #E0F4D7; + padding: 2px 0px; +} +.ui-datepicker-control, .ui-datepicker-links { + font-weight: bold; + font-size: 80%; + letter-spacing: 1px; +} +.ui-datepicker-links label { + padding: 2px 5px; + color: #888; +} +.ui-datepicker-clear, .ui-datepicker-prev { + float: left; + width: 34%; +} +.ui-datepicker-rtl .ui-datepicker-clear, .ui-datepicker-rtl .ui-datepicker-prev { + float: right; + text-align: right; +} +.ui-datepicker-current { + float: left; + width: 30%; + text-align: center; +} +.ui-datepicker-close, .ui-datepicker-next { + float: right; + width: 34%; + text-align: right; +} +.ui-datepicker-rtl .ui-datepicker-close, .ui-datepicker-rtl .ui-datepicker-next { + float: left; + text-align: left; +} +.ui-datepicker-header { + padding: 1px 0 3px; + background: #83C948; + text-align: center; + font-weight: bold; + height: 1.3em; +} +.ui-datepicker-header select { + background: #83C948; + color: #000; + border: 0px; + font-weight: bold; +} +.ui-datepicker { + background: #CCC; + text-align: center; + font-size: 100%; +} +.ui-datepicker a { + display: block; + width: 100%; +} +.ui-datepicker-title-row { + background: #B1DB87; + color: #000; +} +.ui-datepicker-title-row .ui-datepicker-week-end-cell { + background: #B1DB87; +} +.ui-datepicker-days-row { + background: #FFF; + color: #666; +} +.ui-datepicker-week-col { + background: #B1DB87; + color: #000; +} +.ui-datepicker-days-cell { + color: #000; + border: 1px solid #DDD; +} +.ui-datepicker-days-cell a { + display: block; +} +.ui-datepicker-week-end-cell { + background: #E0F4D7; +} +.ui-datepicker-unselectable { + color: #888; +} +.ui-datepicker-week-over, .ui-datepicker-week-over .ui-datepicker-week-end-cell { + background: #B1DB87 !important; +} +.ui-datepicker-days-cell-over, .ui-datepicker-days-cell-over.ui-datepicker-week-end-cell { + background: #FFF !important; + border: 1px solid #777; +} +* html .ui-datepicker-title-row .ui-datepicker-week-end-cell { + background: #B1DB87 !important; +} +* html .ui-datepicker-week-end-cell { + background: #E0F4D7 !important; + border: 1px solid #DDD !important; +} +* html .ui-datepicker-days-cell-over { + background: #FFF !important; + border: 1px solid #777 !important; +} +* html .ui-datepicker-current-day { + background: #83C948 !important; +} +.ui-datepicker-today { + background: #B1DB87 !important; +} +.ui-datepicker-current-day { + background: #83C948 !important; +} +.ui-datepicker-status { + background: #E0F4D7; + width: 100%; + font-size: 80%; + text-align: center; +} +#ui-datepicker-div a, .ui-datepicker-inline a { + cursor: pointer; + margin: 0; + padding: 0; + background: none; + color: #000; +} +.ui-datepicker-inline .ui-datepicker-links a { + padding: 0 5px !important; +} +.ui-datepicker-control a, .ui-datepicker-links a { + padding: 2px 5px !important; + color: #000 !important; +} +.ui-datepicker-title-row a { + color: #000 !important; +} +.ui-datepicker-control a:hover { + background: #FDD !important; + color: #333 !important; +} +.ui-datepicker-links a:hover, .ui-datepicker-title-row a:hover { + background: #FFF !important; + color: #333 !important; +} +.ui-datepicker-multi .ui-datepicker { + border: 1px solid #83C948; +} +.ui-datepicker-one-month { + float: left; + width: 185px; +} +.ui-datepicker-new-row { + clear: left; +} +.ui-datepicker-cover { + display: none; + display/**/: block; + position: absolute; + z-index: -1; + filter: mask(); + top: -4px; + left: -4px; + width: 193px; + height: 200px; +} diff --git a/old-source/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/old-source/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png new file mode 100644 index 0000000000000000000000000000000000000000..954e22dbd99e8c6dd7091335599abf2d10bf8003 GIT binary patch literal 260 zcmeAS@N?(olHy`uVBq!ia0vp^8X(NU1|)m_?Z^dEr#)R9Ln2z=UU%d=WFXS=@V?HT z#xG*`>Yvsgk=}99w^d^D^d*@m74oMo<%#FcopJf?u00-~YVKV2wzrI*_R6;UORMea zBFVSEnN~eiVA6V&z`E)YLz5Aok^D)In}Yn=OzDpgR5Wv0XfT8pOkmV{sKAJ-PO9#T zZK}IXj&Q-V!U)!LcB_3K0&C*{ literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-bg_diagonals-thick_20_666666_40x40.png b/old-source/css/images/ui-bg_diagonals-thick_20_666666_40x40.png new file mode 100644 index 0000000000000000000000000000000000000000..64ece5707d91a6edf9fad4bfcce0c4dbcafcf58d GIT binary patch literal 251 zcmVbvPcjKS|RKP(6sDcCAB(_QB%0978a<$Ah$!b|E zwn;|HO0i8cQj@~)s!ajF0S002ovPDHLkV1oEp BYH0uf literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-bg_diagonals-thick_75_f3d8d8_40x40.png b/old-source/css/images/ui-bg_diagonals-thick_75_f3d8d8_40x40.png new file mode 100644 index 0000000000000000000000000000000000000000..13a229fbd619180ea24cfdb8f30dbe95cddd63a9 GIT binary patch literal 256 zcmeAS@N?(olHy`uVBq!ia0vp^8X(NU1|)m_?Z^dE$30yfLn2z=UU%ebHV|ofxPM{x z`+6t-2g_zV?cO+H*-7uDDLhZl2BrKEF*);g<2wCGHrsXgewqAxQ^}wAYo_hLqmp0p^NY}(hv&?JUSjZc^>bP0l+XkKhP7#@ literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-bg_dots-small_65_a6a6a6_2x2.png b/old-source/css/images/ui-bg_dots-small_65_a6a6a6_2x2.png new file mode 100644 index 0000000000000000000000000000000000000000..500070bd471176456ae853cb9e5c8afb51429612 GIT binary patch literal 83 zcmeAS@N?(olHy`uVBq!ia0vp^Od!m`#=yYHy3uwMkR#>k;uyj)ll34YBLf2mlY;c4 h+B_*1?y`v6HmTg4I_G}bCIMA3c)I$ztaD0e0su^)5m^8L literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-bg_flat_0_333333_40x100.png b/old-source/css/images/ui-bg_flat_0_333333_40x100.png new file mode 100644 index 0000000000000000000000000000000000000000..2f2c7a45bbd7c61634394ede600d6bacc1c494a1 GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F!3HG1q!d*FscKIb$B>N1x91EQ4=4yQ7#_Iv z`+As4$%zYm;;c7~Kd+Iuj%U9o62cnl7#bi-T}qs{k}2VRN1x91EQ4=4yQ7#`Sv zZF_)9$%zYm;;c7~Kd+Iuj%U9o62cnl7#bi-T}u4XA(n|-?{<9$I)lN})z4*}Q$iB} D#5ytf literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-bg_flat_10_000000_40x100.png b/old-source/css/images/ui-bg_flat_10_000000_40x100.png new file mode 100644 index 0000000000000000000000000000000000000000..abdc01082bf3534eafecc5819d28c9574d44ea89 GIT binary patch literal 178 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F!3HG1q!d*FsY*{5$B>N1x91EQ4=4yQY-ImG zFPf9b{J;c_6SHRK%WcbN_hZpM=(Ry;4Rxv2@@2Y=$K57eF$X$=!PC{xWt~$(69B)$ BI)4BF literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-bg_flat_15_cc0000_40x100.png b/old-source/css/images/ui-bg_flat_15_cc0000_40x100.png new file mode 100644 index 0000000000000000000000000000000000000000..360dbe332667710ff06ae3767082a23a895a048f GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F!3HG1q!d*FscKIb$B>N1x91EQ4=4yQY}Eg^ z^kJu0!j6TqLadeF&dijLj%Uwf(LU(4L1+zisnz0B|1(WqwYH}S=nMu=S3j3^P6N1x91EQ4=4yQYz+E8 zPo9&<{J;c_6SHRil>2s{Zw^OT)6@jj2u|u!(plXsM>LJD`vD!n;OXk;vd$@?2>^GI BH@yG= literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-bg_flat_75_ffffff_40x100.png b/old-source/css/images/ui-bg_flat_75_ffffff_40x100.png new file mode 100644 index 0000000000000000000000000000000000000000..ac8b229af950c29356abf64a6c4aa894575445f0 GIT binary patch literal 178 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F!3HG1q!d*FsY*{5$B>N1x91EQ4=4yQYz+E8 zPo9&<{J;c_6SHRil>2s{Zw^OT)6@jj2u|u!(plXsM>LJD`vD!n;OXk;vd$@?2>^GI BH@yG= literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-bg_glass_100_f6f6f6_1x400.png b/old-source/css/images/ui-bg_glass_100_f6f6f6_1x400.png new file mode 100644 index 0000000000000000000000000000000000000000..9b383f4d2eab09c0f2a739d6b232c32934bc620b GIT binary patch literal 104 zcmeAS@N?(olHy`uVBq!ia0vp^j6gJjgAK^akKnour1U*q978O6-yYw{%b*}|_(02F z@qbE9)0CJMo;*v*PWv`Vh2h6EmG8IS-Cm{3U~` zFlmZ}YMcJY=eo?o%*@I?2`NblNeMudl#t?{+tN>ySr~=F{k$>;_x^_y?afmf9pRKH0)6?eSP?3s5hEr>mdKI;Vst E0O;M1& literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/old-source/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png new file mode 100644 index 0000000000000000000000000000000000000000..1b1972b56f47b340eae0527677270e2956ccc85e GIT binary patch literal 4427 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 literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-bg_highlight-hard_100_f6f6f6_1x100.png b/old-source/css/images/ui-bg_highlight-hard_100_f6f6f6_1x100.png new file mode 100644 index 0000000000000000000000000000000000000000..2656c0821a8b009ba2e1d1fd5567f22ad95a3b40 GIT binary patch literal 89 zcmeAS@N?(olHy`uVBq!ia0vp^j6j^i!3HGVb)pi0l!B*=V~E7m3f3H_#V`FPe n^!W4tzr3}$G`Dnlg%E@O4&fD5bIWf7)iQXx`njxgN@xNAhL{*f literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/old-source/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png new file mode 100644 index 0000000000000000000000000000000000000000..f1273672d253263b7564e9e21d69d7d9d0b337d9 GIT binary patch literal 90 zcmeAS@N?(olHy`uVBq!ia0vp^j6j^i!3HGVb)pi0l%l7LV~E7mxPQ=F85a&M@g_{ d|GeK{$Y5lo%PMu^>wln`44$rjF6*2UngE4^EGqy2 literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-icons_004276_256x240.png b/old-source/css/images/ui-icons_004276_256x240.png new file mode 100644 index 0000000000000000000000000000000000000000..46ae6caa2c77365164c3efc75b4b2b86f8a5a3ea GIT binary patch literal 4369 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 oB7@Ah9GJSic5@~ literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-icons_222222_256x240.png b/old-source/css/images/ui-icons_222222_256x240.png new file mode 100644 index 0000000000000000000000000000000000000000..ee039dc096a38a3753f92519546eee94bcfbeffa GIT binary patch literal 4369 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 literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-icons_228ef1_256x240.png b/old-source/css/images/ui-icons_228ef1_256x240.png new file mode 100644 index 0000000000000000000000000000000000000000..10e3631dcab364a0a1ab81862d678fd032908dd7 GIT binary patch literal 4369 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 literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-icons_cc0000_256x240.png b/old-source/css/images/ui-icons_cc0000_256x240.png new file mode 100644 index 0000000000000000000000000000000000000000..80cbad50b76d557718d4556741cf18a842a58da8 GIT binary patch literal 4369 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 literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-icons_ffd27a_256x240.png b/old-source/css/images/ui-icons_ffd27a_256x240.png new file mode 100644 index 0000000000000000000000000000000000000000..4a48e64dc5787d629c7018412638d5a791b19695 GIT binary patch literal 5355 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 W{n<*kA)EjA%Y34)uU4z#5c5A# literal 0 HcmV?d00001 diff --git a/old-source/css/images/ui-icons_ffffff_256x240.png b/old-source/css/images/ui-icons_ffffff_256x240.png new file mode 100644 index 0000000000000000000000000000000000000000..bef5178a9054c16582876bac57017f783272e750 GIT binary patch literal 4369 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 l!Q;r%?Y*7ztoF~2ao>D^xRgPV&GAM literal 0 HcmV?d00001 diff --git a/old-source/css/jqModal.css b/old-source/css/jqModal.css new file mode 100644 index 0000000..48df2cb --- /dev/null +++ b/old-source/css/jqModal.css @@ -0,0 +1,37 @@ +/* jqModal base Styling courtesy of; + Brice Burgess */ + +/* The Window's CSS z-index value is respected (takes priority). If none is supplied, + the Window's z-index value will be set to 3000 by default (via jqModal.js). */ + +.jqmWindow { + display: none; + z-index: 200; + position: fixed; + top: 17%; + left: 50%; + + margin-left: -300px; + width: 600px; + + background-color: #EEE; + color: #333; + border: 1px solid black; + padding: 12px; +} + +.jqmOverlay { background-color: #000; } + +/* Background iframe styling for IE6. Prevents ActiveX bleed-through ( + + + + + + + Group Product + : + + + + + + Nama Sub Group Product + : + + + + +
+ + + +
+ +
+ +
+
Cari Sub Group Product
+
+ +
+
+ + + + +
Group Product:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + diff --git a/old-source/footer.php b/old-source/footer.php new file mode 100644 index 0000000..7786c11 --- /dev/null +++ b/old-source/footer.php @@ -0,0 +1,4 @@ +© Copyright 2014,
LPPTI | Design: Daniel Susanto - dan + | v.1901-15

"; +?> diff --git a/old-source/func_lib.php b/old-source/func_lib.php new file mode 100644 index 0000000..34b6ca6 --- /dev/null +++ b/old-source/func_lib.php @@ -0,0 +1,1136 @@ +query($query); + $mysqli->close; + } + + function runningQuery($query){ + $mysqli = new mysqli (HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query($query); + if($data->num_rows > 0) + { + return $data; + } + else + return false; + $mysqli->close; + } + + function runQueryPusat($query){ + $mysqli = new mysqli (HOST_PUSAT,USER_PUSAT,PASSWORD_PUSAT,DB_PUSAT); + $data = $mysqli->query($query); + $mysqli->close; + } + + function closepusat($connpusat){ + mysqli_close($connpusat); + } + + function tutupKoneksi($conn){ + mysqli_close($conn); + } + + function right($value, $count){ + return substr($value, ($count*-1)); + } + + function left($string, $count){ + return substr($string, 0, $count); + } + + function getConn(){ + return $conn; + } + + function cekUser($user,$pass){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT * FROM karyawan WHERE username = ? AND password = ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,"ss",$user,$pass); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + return true; + }else{ + return false; + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + mysqli_close($conn); + }else{ + return false; + mysqli_close($conn); + } + }else{ + return false; + } + } + + function cekAssko($user,$pass){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT id_pekerjaan FROM karyawan WHERE username = ? AND password= ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,"ss",$user,$pass); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + mysqli_stmt_bind_result($stmt,$type); + + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$type); + while(mysqli_stmt_fetch($stmt)){ + if($type=='Asisten Pemimpin Toko') + return true; + else + return false; + } + }else{ + return false; + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + mysqli_close($conn); + }else{ + return false; + mysqli_close($conn); + } + }else{ + return false; + } + } + + function cekAdmin($user,$pass){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT id_pekerjaan FROM karyawan WHERE username = ? AND password= ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,"ss",$user,$pass); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + mysqli_stmt_bind_result($stmt,$type); + + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$type); + while(mysqli_stmt_fetch($stmt)){ + if($type=='Petugas Administrasi') + return true; + else + return false; + } + }else{ + return false; + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + mysqli_close($conn); + }else{ + return false; + mysqli_close($conn); + } + }else{ + return false; + } + } + + function cekPemko($user,$pass){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT id_pekerjaan FROM karyawan WHERE username = ? AND password= ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,"ss",$user,$pass); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + mysqli_stmt_bind_result($stmt,$type); + + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$type); + while(mysqli_stmt_fetch($stmt)){ + if($type=='Pemimpin Toko') + return true; + else + return false; + } + }else{ + return false; + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + mysqli_close($conn); + }else{ + return false; + mysqli_close($conn); + } + }else{ + return false; + } + } + // -----------------FUNGSI GENERATE NO ORDER------------------------- + + function noOrder(){ + //$param = "kd_toko"; + $tahun = date('y'); + if(bukaKoneksi()){ + global $conn; + //$nilaine = $kdToko."%"; + //$query2 = "SELECT no_order FROM m_order WHERE no_order like ? ORDER BY no_order DESC limit 1"; + $query2 = "SELECT no_order FROM m_order ORDER BY no_order DESC limit 1"; + if($stmt2 = mysqli_prepare($conn,$query2)){ + //mysqli_stmt_bind_param($stmt2,"s",$nilaine); + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek = mysqli_stmt_num_rows($stmt2); + mysqli_stmt_bind_result($stmt2,$noOrder); + if($cek == 0){//jika belum ada data, no_order dimulai dari awal + $str = "$kdToko"."$tahun"."000001"; + echo $str; + }else{ + while(mysqli_stmt_fetch($stmt2)){ + $noOrdere = $noOrder; + } + $thn = substr($noOrdere,2,2); + $kdToko = substr($noOrdere,0,2); + if($thn!=date('y')){//jika ganti tahun + $thn = date('y'); + $no_urut = "000001"; + $str = "$kdToko"."$thn"."$no_urut"; + echo $str; + }else{//jika pada tahun yang sama + + $no_urut = intval(substr($noOrdere,4,6)); + $no_urut++; + $strUrut = strlen($no_urut); + for($i=1;$i<=(6-$strUrut);$i++){ + $no_urut = "0" . $no_urut; + } + $str = "$kdToko"."$thn"."$no_urut"; + + if(cekTempOrder($str)){ + $strAkhir = selectTempOrder(); + $urutTemp = intval(substr($strAkhir,4,6)); + $urutTemp++; + $strTemp = strlen($urutTemp); + for($i=1;$i<=(6-$strTemp);$i++){ + $urutTemp = "0" . $urutTemp; + } + $strBaru = "$kdToko"."$thn"."$urutTemp"; + $str = $strBaru; + } + insertTempOrder($str); + echo $str; + } + + } + mysqli_stmt_free_result($stmt2); + mysqli_stmt_close($stmt2); + } + tutupKoneksi($conn); + } + } + //--------------------------------------------------------------------------------- + function getKdToko($nama,$pass){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT d.id_department FROM department d, karyawan k WHERE + d.id_department = k.id_department AND username = ? AND password = ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,"ss",$nama,$pass); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kd); + while(mysqli_stmt_fetch($stmt)){ + return $kd; + } + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + } + tutupKoneksi($conn); + } + } + function getNmToko($nama,$pass){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT d.department FROM department d, karyawan k WHERE + d.id_department = k.id_department AND username = ? AND password = ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,"ss",$nama,$pass); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kd); + while(mysqli_stmt_fetch($stmt)){ + return $kd; + } + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + } + tutupKoneksi($conn); + } + } + function cariIdRncO($kd_str,$kd_supp){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT distinct(m.kode_strip),d.kode_supplier,m.id + FROM m_rencana_beli m,d_rencana_beli d + WHERE d.id = m.id AND m.kode_strip = ? AND d.kode_supplier = ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,"ss",$kd_str,$kd_supp); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + return true; + }else{ + return false; + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + } + tutupKoneksi($conn); + } + } + + function getNIK($nama,$pass){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT nik FROM karyawan WHERE username = ? AND password = ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,"ss",$nama,$pass); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$nik); + while(mysqli_stmt_fetch($stmt)){ + return $nik; + } + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + } + tutupKoneksi($conn); + } + } +// ---------------------------------source code original , jgn dihapuss!!--------------------------------------- +/* function labeling($strip,$merk,$kp,$subkat,$bulan,$tahun,$hp,$no){ + if(bukaKoneksi()){ + global $conn; + $kd_merk = $strip.$merk; + $incBrg = $strip.$merk.$kp."%"; + $query = "SELECT kode_barang FROM barang WHERE kode_strip = ? AND kode_merk = ? AND ked_produk = ? ORDER BY kode_barang DESC limit 1"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'sss',$strip,$kd_merk,$kp); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + mysqli_stmt_bind_result($stmt,$kdBrg); + if($cek == 0){//jika ga ada data dengan kriteria yang ada + $str = $strip.$merk.$kp.$subkat."000"; + return $str; + }else{ + $query1 = "SELECT bulan, tahun, id_gabungan FROM barang WHERE kode_barang = ?"; + while(mysqli_stmt_fetch($stmt)){ + if($stmt1 = mysqli_prepare($conn,$query1)){ + mysqli_stmt_bind_param($stmt1,'s',$kdBrg); + mysqli_stmt_execute($stmt1); + mysqli_stmt_store_result($stmt1); + $cek1 = mysqli_stmt_num_rows($stmt1); + + if($cek1 > 0){ + mysqli_stmt_bind_result($stmt1,$bln,$thn,$id_gabungan); + while(mysqli_stmt_fetch($stmt1)){ + if($bln==$bulan && $thn==$tahun){//jika kode barang ada di bulan dan tahun yang sama + if(cekHP($hp,$id_gabungan,$no)){//jika HP nya sama + return $kdBrg; + }else{ + $noUrut = substr($kdBrg,6,3);//untuk di increment + $index = getIdUrut($noUrut);//get index nya + $index++;//increment index + $Urut = getNoUrut($index);//get no urut untuk index yang disebut + $str = $strip.$merk.$kp.$subkat.$Urut; + return $str; + } + }else{//jika di bulan dan tahun yang berbeda maka increment + $noUrut = substr($kdBrg,6,3);//untuk di increment + /*if($noUrut == "999"){ //jika sudah 999, maka mulai gunakan kombinasi huruf angka + $noUrut = "000"; + }else{//jika belum 999 maka increment + $noUrut = intval($noUrut); + $noUrut++; + $strUrut = strlen($noUrut); + for($i=1;$i<=(3-$strUrut);$i++){ + $noUrut = "0".$noUrut; + } + }*/ +/* $index = getIdUrut($noUrut);//get index nya + $index++;//increment index + //if($index > 999){//jika index/id lebih besar dari 999 gunakan urut kombinasi huruf angka + $noUrut = getNoUrut($index);//get no urut untuk index yang disebut + + $str = $strip.$merk.$kp.$subkat.$noUrut; + return $str; + } + } + } + } + } + } + } + } + } */ + + function labeling($strip,$merk,$kp,$subkat,$bulan,$tahun,$hp,$no){ + if(bukaKoneksi()){ + global $conn; + $kd_merk = $strip.$merk; + $incBrg = $strip.$merk.$kp."%"; + //$query = "SELECT kode_barang FROM barang WHERE kode_strip = ? AND kode_merk = ? AND ked_produk = ? ORDER BY kode_barang DESC limit 1"; + $query = "SELECT b.kode_barang + FROM barang b FORCE INDEX (kode_strip,kode_merk,ked_produk),nomor_urut n FORCE INDEX (urut) + where n.urut = right(b.kode_barang,3) + and kode_strip = ? AND kode_merk = ? AND ked_produk = ? + ORDER BY n.id DESC limit 1"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'sss',$strip,$kd_merk,$kp); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + mysqli_stmt_bind_result($stmt,$kdBrg); + if($cek == 0){//jika ga ada data dengan kriteria yang ada + $str = $strip.$merk.$kp.$subkat."000"; + return $str; + }else{ + $query1 = "SELECT bulan, tahun, id_gabungan FROM barang WHERE kode_barang = ?"; + while(mysqli_stmt_fetch($stmt)){ + if($stmt1 = mysqli_prepare($conn,$query1)){ + mysqli_stmt_bind_param($stmt1,'s',$kdBrg); + mysqli_stmt_execute($stmt1); + mysqli_stmt_store_result($stmt1); + $cek1 = mysqli_stmt_num_rows($stmt1); + + if($cek1 > 0){ + mysqli_stmt_bind_result($stmt1,$bln,$thn,$id_gabungan); + while(mysqli_stmt_fetch($stmt1)){ + if($bln==$bulan && $thn==$tahun){//jika kode barang ada di bulan dan tahun yang sama + if(cekHP($hp,$id_gabungan,$no)){//jika HP nya sama + return $kdBrg; + }else{ + $noUrut = substr($kdBrg,6,3);//untuk di increment + $index = getIdUrut($noUrut);//get index nya + $index++;//increment index + $Urut = getNoUrut($index);//get no urut untuk index yang disebut + $str = $strip.$merk.$kp.$subkat.$Urut; + return $str; + } + }else{//jika di bulan dan tahun yang berbeda maka increment + $noUrut = substr($kdBrg,6,3);//untuk di increment + $index = getIdUrut($noUrut);//get index nya + $index++;//increment index + $noUrut = getNoUrut($index);//get no urut untuk index yang disebut + $str = $strip.$merk.$kp.$subkat.$noUrut; + return $str; + } + } + } + } + } + } + } + } + } + + //----------------------------------FUNGSI FORMAT TANGGAL ------------------------------------------------------ + function encTgl($tgl){ // ke format dd-mm-yyyy + $y = substr($tgl,0,4); + $m = substr($tgl,5,2); + $d = substr($tgl,8,2); + return $d."-".$m."-".$y; + } + function decTgl($tgl){// ke format yyyy-mm-dd + $d = substr($tgl,0,2); + $m = substr($tgl,3,2); + $y = substr($tgl,6,4); + return $y."-".$m."-".$d; + } + + function convHrgP($hrgP){ + $kode = ""; + for($i=0;$i 0){ + mysqli_stmt_bind_result($stmt,$kd_merk); + while(mysqli_stmt_fetch($stmt)){ + return $kd_merk; + } + } + } + } + } + //-----------------------------------------------FUNGSI UNTUK GET NAMA SUPPLIER---------------------------------- + function getNamaSup($kd){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT nama_supplier FROM supplier WHERE kd_supplier = ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'s',$kd); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$nmSup); + while(mysqli_stmt_fetch($stmt)){ + return $nmSup; + } + } + } + } + } + //--------------------------------------------SIMPAN BARANG----------------------------------------------------- + function cekNoBrg($id,$ukur){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT count(*) FROM no_barang WHERE id_gabungan = ? AND nomor = ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'ss',$id,$ukur); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + mysqli_stmt_bind_result($stmt,$jumlah); + while(mysqli_stmt_fetch($stmt)){ + if($jumlah > 0){//berarti sudah ada + return true; + }else{ + return false; + } + } + } + } + } + + function cekKodeBrg($kdBrg){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT kode_barang FROM barang WHERE kode_barang = ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,"s",$kdBrg); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){//berarti sudah ada + return true; + }else{ + return false; + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + } + } + } + + /*function updateStok($id,$ukur,$jml){ + if(bukaKoneksi()){ + global $conn; + $query = "UPDATE no_barang SET stok += ? WHERE id_gabungan = ? AND nomor = ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'iss',$jml,$id,$ukur); + mysqli_stmt_execute($stmt); + $cek = mysqli_stmt_affected_rows($stmt); + if($cek > 0){ + return true; + }else{ + return false; + } + mysqli_stmt_close($stmt); + } + } + }*/ + + function insertNoBrg($id,$nomor,$hrgP,$hjF,$stokMin,$jumlah){ + if(bukaKoneksi()){ + global $conn; + $query = "INSERT INTO no_barang(id_gabungan,nomor,harga_pokok,harga_jual,stok_min,stok) VALUES(?,?,?,?,?,?)"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,"sssiii",$id,$nomor,$hrgP,$hjF,$stokMin,$jumlah); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_affected_rows($stmt); + if($cek > 0){ + return true; + }else{ + return false; + } + mysqli_stmt_close($stmt); + } + } + } + + function insertKdBrg($kode,$nmBrg,$kdToko,$tahun,$bulan,$id,$strip,$supp,$kp,$kdmerk,$posBrg,$kdLama){ + if(bukaKoneksi()){ + global $conn; + $query = "INSERT INTO barang(kode_barang,nama_barang,kode_toko,tahun,bulan,id_gabungan,kode_strip,kode_supplier + ,ked_produk,kode_merk,kelompok,kode_lama) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,"sssiisssssss",$kode,$nmBrg,$kdToko,$tahun,$bulan,$id,$strip,$supp,$kp,$kdmerk,$posBrg,$kdLama); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_affected_rows($stmt); + if($cek > 0){ + return true; + }else{ + return false; + } + mysqli_stmt_close($stmt); + } + } + } + + //-------------------------------------------FUNGSI MENGAMBIL NO URUT HURUF_ANGKA------------------------------ + + function getNoUrut($index){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT urut FROM nomor_urut WHERE id = ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'i',$index); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$urut); + while(mysqli_stmt_fetch($stmt)){ + return $urut; + } + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + } + } + } + + function getIdUrut($urut){//fungsi get id untuk no urut di tabel nomor_urut + if(bukaKoneksi()){ + global $conn; + $query = "SELECT id FROM nomor_urut WHERE urut = ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'s',$urut); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$index); + while(mysqli_stmt_fetch($stmt)){ + return $index; + } + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + } + } + } + + function cekHP($hp,$id_gabungan,$no){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT harga_pokok FROM no_barang WHERE id_gabungan = ? AND nomor = ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'ss',$id_gabungan,$no); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$hrgP); + while(mysqli_stmt_fetch($stmt)){ + if($hrgP == $hp){ + return true; + }else{ + return false; + } + } + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + } + } + } + //------------------------------FUNGSI MASUKKAN KODE BARANG KE TABEL TEMP_BARANG + function insertTemp($kdBrg,$id,$session){ + if(bukaKoneksi()){ + global $conn; + $query = "INSERT INTO temp$session VALUES(?,?)"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'si',$kdBrg,$id); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_affected_rows($stmt); + if($cek > 1){ + return true; + }else{ + return false; + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + tutupKoneksi($conn); + } + } + } + //------------------------------------FUNGSI CEK KODE BARANG DI TABEL TEMP KODE BARANG--------------------------- + function cekTemp($strip,$IDmerk,$kp,$subkat,$bulan,$tahun,$hp,$no,$session){ + if(bukaKoneksi()){ + global $conn; + $kdBrg = $strip.$IDmerk.$kp."%"; + $str = ""; + //cek ke temporary table + $query = "SELECT kode_barang FROM temp$session WHERE kode_barang LIKE ? ORDER BY id_urut DESC LIMIT 1"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'s',$kdBrg); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){//jika ada maka increment no urut nya lalu insert ke tabel temp + mysqli_stmt_bind_result($stmt,$kd_barang); + while(mysqli_stmt_fetch($stmt)){ + $noUrut = substr($kd_barang,6,3); + $index = getIdUrut($noUrut); + $index++; + $noUrut = getNoUrut($index); + $str = substr($kd_barang,0,6).$noUrut; + insertTemp($str,$index,$session); + } + }else{//jika ga ada, cek ke db d_pembelian,jika ketemu diincrement pake fungsi 'getKdBeli', setelah itu masukkan ke tabel temp + if(cekKdBeli($kdBrg)){//jika sudah ada di tabel d_pembelian : + $str = getKdBeli($kdBrg); + $noUrut = substr($str,6,3); + $index = getIdUrut($noUrut);//get index nya + }else{ //jika tdk ada di d_pembelian maka ambil ke db barang melalui fungsi labeling + $str = labeling($strip,$IDmerk,$kp,$subkat,$bulan,$tahun,$hp,$no); + $noUrut = substr($str,6,3); + $index = getIdUrut($noUrut);//get index nya + } + insertTemp($str,$index,$session); + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + tutupKoneksi($conn); + } + return $str; + } + } + //--------------------------------------FUNGSI DROP TABEL TEMP BARANG--------------------------------------- + function hapusTemp($session){ + if(bukaKoneksi()){ + global $conn; + $query = "DROP TABLE temp$session"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_affected_rows($stmt); + if($cek > 0){ + return true; + }else{ + return false; + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + tutupKoneksi($conn); + } + } + } + + //---------------------------------------FUNGSI UNTUK BUAT TABEL TEMP_NAMA_USER-------------------------------------- + function buatTemp($session){ + if(bukaKoneksi()){ + global $conn; + $query = "CREATE TABLE temp$session(kode_barang char(9) primary key,id_urut int(11))"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_affected_rows($stmt); + if($cek > 0){ + return true; + }else{ + return false; + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + } + tutupKoneksi($conn); + } + } + //---------------------------------------FUNGSI HAPUS ISI TEMP_NAMA_USER--------------------------------------- + function truncTemp($session){ + if(bukaKoneksi()){ + global $conn; + $query = "TRUNCATE TABLE temp$session"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_affected_rows($stmt); + if($cek > 0){ + return true; + }else{ + return false; + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + tutupKoneksi($conn); + } + } + } + //---------------------------------------FUNGSI CEK KODE BARANG DI TABEL TEMP ------------------------------------- + function cekBrgTemp($kdBrg,$session){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT kode_barang FROM temp$session WHERE kode_barang = ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'s',$kdBrg); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + $query1 = "DELETE FROM temp$session WHERE kode_barang = ?"; + if($stmt1 = mysqli_prepare($conn,$query1)){ + mysqli_stmt_bind_param($stmt1,'s',$kdBrg); + mysqli_stmt_execute($stmt1); + mysqli_stmt_free_result($stmt1); + mysqli_stmt_close($stmt1); + } + } + } + } + } + //---------------------------------------FUNGSI UNTUK HAPUS ISI TABEL TEMP_ORDER------------------------------------- + function hapusTempOrder($noOrder){ + if(bukaKoneksi()){ + global $conn; + $query = "DELETE FROM temp_order WHERE no_order = ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'s',$noOrder); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_affected_rows($stmt); + if($cek > 0){ + return true; + }else{ + return false; + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + } + tutupKoneksi($conn); + } + } + //-------------------------------------FUNGSI CEK TEMP ORDER--------------------------------------------------- + function cekTempOrder($noOrder){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT no_order FROM temp_order WHERE no_order = ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'s',$noOrder); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + return true; + }else{ + return false; + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + } + tutupKoneksi($conn); + } + } + //------------------------------FUNGSI INSERT NO ORDER KE TEMP ORDER-------------------------------------- + function insertTempOrder($noOrder){ + if(bukaKoneksi()){ + global $conn; + $query = "INSERT INTO temp_order VALUES(?)"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'s',$noOrder); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_affected_rows($stmt); + if($cek > 1){ + return true; + }else{ + return false; + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + tutupKoneksi($conn); + } + } + } + function selectTempOrder(){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT no_order FROM temp_order ORDER BY no_order DESC LIMIT 1"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$noOrder); + while(mysqli_stmt_fetch($stmt)){ + //$no_order = $noOrder; + return $noOrder; + } + + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + tutupKoneksi($conn); + } + } + } + //----------------------------------FUNGSI CEK KODE BARANG DI D_PEMBELIAN--------------------------------------- + function cekKdBeli($kdBrg){ + if(bukaKoneksi()){ + global $conn; + //$query = "SELECT kode_barang FROM d_pembelian WHERE kode_barang LIKE ? ORDER BY kode_barang DESC LIMIT 1"; + $query = "SELECT d.kode_barang + FROM d_pembelian d, nomor_urut n + FORCE INDEX ( urut ) + WHERE n.urut = right( d.kode_barang, 3 ) + AND d.kode_barang LIKE ? + ORDER BY n.id DESC + LIMIT 1"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'s',$kdBrg); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){//berarti sudah ada kode barangnya di dbeli + return true; + }else{ + return false; + } + } + } + } + //---------------------------------FUNGSI GET KODE BARANG TERAKHIR INCREMENT DARI D_BELI-------------------------- + function getKdBeli($kdBrg){ + if(bukaKoneksi()){ + global $conn; + //$query = "SELECT kode_barang FROM d_pembelian WHERE kode_barang LIKE ? ORDER BY kode_barang DESC LIMIT 1"; + $query = "SELECT d.kode_barang + FROM d_pembelian d, nomor_urut n + FORCE INDEX ( urut ) + WHERE n.urut = right( d.kode_barang, 3 ) + AND d.kode_barang LIKE ? + ORDER BY n.id DESC + LIMIT 1"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'s',$kdBrg); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){//berarti sudah ada kode barangnya di dbeli + mysqli_stmt_bind_result($stmt,$kodeBrg); + while(mysqli_stmt_fetch($stmt)){ + $strip = substr($kodeBrg,0,2); + $merk = substr($kodeBrg,2,2); + $kp = substr($kodeBrg,4,1); + $subkat = substr($kodeBrg,5,1); + $noUrut = substr($kodeBrg,6,3);//untuk di increment + $index = getIdUrut($noUrut);//get index nya + $index++;//increment index + $Urut = getNoUrut($index);//get no urut untuk index yang disebut + $str = $strip.$merk.$kp.$subkat.$Urut; + return $str; + } + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + tutupKoneksi($conn); + } + } + } + //------------------------------------------FUNGSI CEK BARANG DI TABEL BARANG------------------------------------- + function cekKdBarang($kdBrg){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT * FROM barang WHERE kode_barang LIKE ? ORDER BY kode_barang DESC LIMIT 1"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'s',$kdBrg); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){//berarti kode barang sudah ada di tabel barang + return true; + }else{ + return false; + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + tutupKoneksi($conn); + } + } + } + + //---------------------------------------------FUNGSI CEK ID GABUNGAN DI NO BARANG------------------------------ + function cekIDNo($id,$nomor){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT * FROM no_barang WHERE id_gabungan = ? AND nomor = ?"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'ss',$id,$nomor); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){//jika sudah ada no dan id gabungan di nomor barang maka + return true; + }else{ + return false; + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + tutupKoneksi($conn); + } + } + } + //---------------------------------------------FUNGSI UNTUK GET BARANG DARI DBELI MASUK KE TEMPUSER-------------- + function loadDBeliTemp($kdBrg,$session){ + if(bukaKoneksi()){ + global $conn; + $query = "SELECT kode_barang FROM d_pembelian WHERE kode_barang LIKE ? ORDER BY kode_barang DESC LIMIT 1"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_bind_param($stmt,'s',$kdBrg); + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kodebarang); + while(mysqli_stmt_fetch($stmt)){ + $noUrut = substr($kodebarang,6,3);//untuk di increment + $index = getIdUrut($noUrut);//get index nya + insertTemp($kodebarang,$index,$session); + } + } + mysqli_stmt_free_result($stmt); + mysqli_stmt_close($stmt); + tutupKoneksi($conn); + } + } + } + + +?> diff --git a/old-source/getTempo.php b/old-source/getTempo.php new file mode 100644 index 0000000..404c49a --- /dev/null +++ b/old-source/getTempo.php @@ -0,0 +1,30 @@ + + 0){ + mysqli_stmt_bind_result($stmt,$lamaTempo); + while(mysqli_stmt_fetch($stmt)){ + echo $lamaTempo; + } + } + } + } +?> \ No newline at end of file diff --git a/old-source/images/calendar.gif b/old-source/images/calendar.gif new file mode 100644 index 0000000000000000000000000000000000000000..d0abaa7c0b892e781b6f553453a0027efea014b9 GIT binary patch literal 269 zcmZ?wbhEHb6kyoJ#dt% zaYstuiRe5}O|8;NEA%ba6j)5k7TbN(gNwC&D)Y{1Cu2PhDy(ymnp7_1Ai(k{X>FbJ zg$yQ1aX#U+v{)u7c4kS5=DdO;0Y*k<=8BdGnYaWYcOkak83LIJ0`39}`h<8zSFc^O QT3n!+Z|k=0I}{nL0T`orxBvhE literal 0 HcmV?d00001 diff --git a/old-source/images/close.gif b/old-source/images/close.gif new file mode 100644 index 0000000000000000000000000000000000000000..3a91256bd0688524a96548e827bc0d2e9b485d71 GIT binary patch literal 807 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 T)6_**#cgp_+?JL9(ew3BlNF>u literal 0 HcmV?d00001 diff --git a/old-source/images/logo.JPG b/old-source/images/logo.JPG new file mode 100644 index 0000000000000000000000000000000000000000..14d15629ce4dcdc4b42d8b30e738d7ee8a49838a GIT binary patch literal 24536 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 Q;pP1AVdj4-ntvz%3uQpYI{*Lx literal 0 HcmV?d00001 diff --git a/old-source/images/logocleo.jpg b/old-source/images/logocleo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..14d15629ce4dcdc4b42d8b30e738d7ee8a49838a GIT binary patch literal 24536 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 Q;pP1AVdj4-ntvz%3uQpYI{*Lx literal 0 HcmV?d00001 diff --git a/old-source/index.php b/old-source/index.php new file mode 100644 index 0000000..52de5aa --- /dev/null +++ b/old-source/index.php @@ -0,0 +1,46 @@ + + + + + Cleopatra + + + + + + + +
+
+
+
+
+
+ + + + +
+ + + + + +
Login Program Cleopatra Minimarket
Username
Password
+
+
+ + + diff --git a/old-source/js/barang.js b/old-source/js/barang.js new file mode 100644 index 0000000..327f45f --- /dev/null +++ b/old-source/js/barang.js @@ -0,0 +1,482 @@ +$(document).ready(function() { + $('#fshasil').invisibleEl(); + $('#fshasilupline').invisibleEl(); + + /* dialog */ + $('#dialogcaribarang').jqm({ + modal: true, + trigger: '#btncaribarang', + overlay: 30, + overlayClass: 'whiteOverlay', + onShow : function(hash){ + hash.w.fadeIn(50); + }, + onHide : function(hash){ + hash.w.fadeOut(50, function(){if(hash.o) hash.o.remove();}); + $('input[name="txtcari"]').val(''); + $('#hasil').empty(); + } + }); + $('#btncaribarang').live('click', function(){ + $('#dialogcaribarang').jqmShow(); + return false; + }); + + // Close Button Highlighting. IE doesn't support :hover. Surprise? + $('input.jqmdX') + .hover( + function(){ $(this).addClass('jqmdXFocus'); }, + function(){ $(this).removeClass('jqmdXFocus'); }) + .focus( + function(){ this.hideFocus=true; $(this).addClass('jqmdXFocus'); }) + .blur( + function(){ $(this).removeClass('jqmdXFocus'); + }); + + //$('input[name="tgllahir"]').datepicker({ + // dateFormat: 'dd-mm-yy', + // changeMonth: true, + // changeYear: true, + // yearRange: '1900:2009', + //}); + + //cek barang form purchase + $('input[name="barcode"]').bind('blur', function(){ + var postvars = { + barcode : $("input[name='barcode']").val(), + operation: "cekbarang", + status: "ok" + }; + if ($("input[name='barcode']").val() != "") { + $.post('ajaxbarang.php', postvars, function(data) { + var barang = eval('('+data+')'); + if (barang[0] == 0) { + alert('Barang belum terdaftar,silahkan entry barang terlebih dahulu!'); + }else{ + for(i in barang) { + setNilaiPurchase(barang[i].kode_barang); + } + } + }); + } + }); + + //cek faktur + $('input[name="nofaktur"]').bind('blur', function(){ + var postvars = { + nofaktur : $("input[name='nofaktur']").val(), + operation: "cekfaktur", + status: "ok" + }; + if ($("input[name='nofaktur']").val() != "") { + $.post('ajaxbarang.php', postvars, function(data) { + var hasil = eval('('+data+')'); + if (hasil[0] == 1) { + alert('PERHATIAN,NO.FAKTUR SUDAH ADA!'); + }else{ + alert('No.faktur belum terdaftar,silahkan dilanjut..'); + } + }); + } + }); + + // ambil data + $('form[name="fcaribarang"]').submit(function(){ + var postvars = { + txtcari: $("input[name='txtcari']").val(), + operation: "caribarang", + status: "ok" + }; + $.post('ajaxbarang.php', postvars, function(data) { + var barang = eval('('+data+')'); + var hasil;//[barang.length]; + var tabel = ""; + tabel += ""; + for(i in barang) { + tabel += ""; + tabel += ""; + tabel += ""; + tabel += ""; + } + tabel += "
KodeBarcodeNamaSupplierHapus
"+barang[i].kode_barang+"" + barang[i].barcode + "" + barang[i].nama_barang + "" + barang[i].nama_supplier + " HAPUS
"; + $("#hasil").html(tabel); + $('#fshasil').visibleEl(); + }); + return false; + }); + + // ambil data purchase + $('form[name="fcaribarangpurchase"]').submit(function(){ + var postvars = { + txtcaripurchase: $("input[name='txtcaripurchase']").val(), + operation: "caribarangpurchase", + status: "ok" + }; + $.post('ajaxbarang.php', postvars, function(data) { + var barang = eval('('+data+')'); + var hasil;//[barang.length]; + var tabel = ""; + tabel += ""; + for(i in barang) { + tabel += ""; + tabel += ""; + tabel += ""; + tabel += ""; + } + tabel += "
KodeBarcodeNamaSupplierHapus
"+barang[i].kode_barang+"" + barang[i].barcode + "" + barang[i].nama_barang + "" + barang[i].nama_supplier + " HAPUS
"; + $("#hasil").html(tabel); + $('#fshasil').visibleEl(); + }); + return false; + }); + + // simpan barang + $('input[name="btnsubmit"]').click(function(){ + var postvars = $('form[name="barang"]').formToArray(); + $.post('ajaxbarang.php', postvars, function(data) { + var hasil = eval('('+data+')'); + if (hasil[0] == 1) { + alert("Simpan Data berhasil!"); + $('form[name="barang"]').resetForm(); + ambilKodeBarang(); + } else if (hasil[0] == 2) { + alert("Ada data yang kosong!"); + } else { + alert("Update data berhasil"); + } + }); + return false; + }); + + // tambah barang ke temp pembelian + $('input[name="btntambah"]').click(function(){ + var postvars = $('form[name="barang"]').formToArray(); + $.post('ajaxtmpbeli.php', postvars, function(data) { + var hasil = eval('('+data+')'); + if (hasil[0] == 1) { + refreshDetilBeli(); + } else if (hasil[0] == 2) { + alert("Ada data yang kosong!"); + } + }); + return false; + }); + + // edit barang di temp pembelian + $('input[name="btnedit"]').click(function(){ + var postvars = $('form[name="barang"]').formToArray(); + $.post('ajaxedittmpbeli.php', postvars, function(data) { + var hasil = eval('('+data+')'); + if (hasil[0] == 1) { + refreshDetilBeli(); + } else if (hasil[0] == 2) { + alert("Ada data yang kosong!"); + } + }); + return false; + }); + + // tambah ke pembelian + $('input[name="btnsubmitpurchase"]').click(function(){ + var postvars = $('form[name="barang"]').formToArray(); + $.post('ajaxpurchase.php', postvars, function(data) { + var hasil = eval('('+data+')'); + if (hasil[0] == 1) { + alert("Faktur pembelian berhasil disimpan."); + window.location = 'purchase.php'; + } else if (hasil[0] == 2) { + alert("Ada data yang kosong!"); + } + }); + return false; + }); + + $('#tglNota').bind('change', function(){ + var postvars = {supp : $('#supp').val()}; + $.post('getTempo.php',postvars,function(data){ + var tglMsk = $('#tglNota').val(); + var tahun = tglMsk.substr(6,4); + var bulan = tglMsk.substr(3,2); + var tgl = tglMsk.substr(0,2); + //var date = tgl+"/"+bulan+"/"+tahun; + bulan = parseInt(bulan,10)-1; + tahun = parseInt(tahun,10); + tgl = parseInt(tgl,10); + var Detnya = new Date(tahun,bulan,tgl);//convert to date + //Detnya.add("day",data); + + function addDays(myDate,days) { + return new Date(myDate.getTime() + days*24*60*60*1000); + } + tglJthTmp = addDays(Detnya,data); + //alert (tglJthTmp); + + tglJthTmp = tglJthTmp.toString(); + var blnB = tglJthTmp.substr(4,3); + var tglB = tglJthTmp.substr(8,2); + var thnB = tglJthTmp.substr(11,4); + switch(blnB){ + case "Jan" : blnB = "01";break; + case "Feb" : blnB = "02";break; + case "Mar" : blnB = "03";break; + case "Apr" : blnB = "04";break; + case "May" : blnB = "05";break; + case "Jun" : blnB = "06";break; + case "Jul" : blnB = "07";break; + case "Aug" : blnB = "08";break; + case "Sep" : blnB = "09";break; + case "Oct" : blnB = "10";break; + case "Nov" : blnB = "11";break; + case "Dec" : blnB = "12";break; + } + var dateB = tglB+"-"+blnB+"-"+thnB; + $('#tglJthTmp').val(dateB); + document.getElementById("status").focus(); + }); + }); + +}); // end of document ready + +function setNilai(barang) { + var postvars = {id_barang: barang, + operation: 'ambilbarang', + status: 'ok' + }; + $.post('ajaxbarang.php', postvars, function(data){ + var barang = eval('('+data+')'); + $('input[name="kodebarang"]').val(barang[0].kode_barang); + $('input[name="barcode"]').val(barang[0].barcode); + $('input[name="nama"]').val(barang[0].nama_barang); + $('input[name="supp"]').val(barang[0].kode_supplier); + if(barang[0].kode_strip == ""){ + $('select[name="group"] option[value="-"]').attr("selected", "selected"); + } else{ + $('select[name="group"] option[value="'+barang[0].kode_strip+'"]').attr("selected", "selected"); + } + if(barang[0].ked_produk != ""){ + $("#lininya").show(); + $('input[name="kode_dlmpdk"]').val(barang[0].ked_produk); + $('input[name="radiolini"]').val(barang[0].namakedproduk); + } + $('input[name="hp"]').val(barang[0].harga_pokok); + $('input[name="hj"]').val(barang[0].harga_jual); + $('input[name="isi2"]').val(barang[0].isi_max2); + $('input[name="hj2"]').val(barang[0].harga_jual2); + $('input[name="isi3"]').val(barang[0].isi_max3); + $('input[name="hj3"]').val(barang[0].harga_jual3); + if(barang[0].satuan == ""){ + $('select[name="satuan"] option[value="-"]').attr("selected", "selected"); + } else{ + $('select[name="satuan"] option[value="'+barang[0].satuan+'"]').attr("selected", "selected"); + } + $('input[name="stokbrg"]').val(barang[0].stokbrg); + $('#dialogcaribarang').jqmHide(); + }); +} + +function setNilaiPurchase(barang) { + var postvars = {id_barang: barang, + operation: 'ambilbarang', + status: 'ok' + }; + $.post('ajaxbarang.php', postvars, function(data){ + var barang = eval('('+data+')'); + $('input[name="kodebarang"]').val(barang[0].kode_barang); + $('input[name="barcode"]').val(barang[0].barcode); + $('input[name="nama"]').val(barang[0].nama_barang); + $('input[name="supp"]').val(barang[0].kode_supplier); + $('select[name="group"]').val(barang[0].nama_strip); + $('input[name="group"]').val(barang[0].nama_strip); + if(barang[0].ked_produk != ""){ + $("#lininya").show(); + $('input[name="radiolini"]').val(barang[0].namakedproduk); + } + $('input[name="subgroup"]').val(barang[0].namakedproduk); + $('input[name="hp"]').val(barang[0].harga_pokok); + $('input[name="hj"]').val(barang[0].harga_jual); + $('input[name="isi2"]').val(barang[0].isi_max2); + $('input[name="hj2"]').val(barang[0].harga_jual2); + $('input[name="isi3"]').val(barang[0].isi_max3); + $('input[name="hj3"]').val(barang[0].harga_jual3); + $('input[name="satuan"]').val(barang[0].namaSatuanBarang); + $('select[name="satuan"]').val(barang[0].namaSatuanBarang); + $('input[name="stokbrg"]').val(barang[0].stokbrg); + $('#dialogcaribarang').jqmHide(); + document.forms["barang"].jmlbeli.focus(); + }); +} + +function setDelete(barang) { + var postvars = {id_barang: barang, + operation: 'hapusbarang', + status: 'ok' + }; + var answer = confirm ("Yakin hapus data?") + if (answer) + $.post('ajaxbarang.php', postvars, function(data){ + var kary = eval('('+data+')'); + if(kary[0] == 1){ + alert("Hapus Berhasil"); + $('#dialogcaribarang').jqmHide(); + $('form[name="barang"]').resetForm(); + } else { + alert("Hapus Gagal"); + } + }); +} + +function setDeleteBeli(idbeli) { + var postvars = {id_barang: idbeli, + operation: 'hapusbeli', + status: 'ok' + }; + var answer = confirm ("Yakin hapus data?") + if (answer) + $.post('ajaxbarang.php', postvars, function(data){ + var tbeli = eval('('+data+')'); + if(tbeli[0] == 1){ + alert("Hapus Berhasil"); + refreshDetilBeli(); + } else { + alert("Hapus Gagal"); + } + }); +} + +function setEditBeli(idbeli) { + var postvars = {id_barang: idbeli, + operation: 'editbeli', + status: 'ok' + }; + $.post('ajaxbarang.php', postvars, function(data){ + var tbeli = eval('('+data+')'); + setNilaiPurchase(tbeli[0].kode_barang); + $('#jmlbeli').val(tbeli[0].jumlah); + $('#subtotal').val(tbeli[0].subtotal); + $('#disc').val(tbeli[0].disc); + $('#discrp').val(tbeli[0].discrp); + $('#ppn').val(tbeli[0].ppn); + $('#profit').val(tbeli[0].profit); + $('#hpbaru').val(tbeli[0].harga_pokok); + $('#hjbaru').val(tbeli[0].harga_jual); + $('#expdate').val(tbeli[0].exp); + $('#idTemp').val(tbeli[0].id); + + }); + +} + +function ambilKodeBarang() { + var postvars = { operation: 'ambilKode', status: 'ok'}; + $.post('ajaxbarang.php', postvars, function(data){ + var kdBarang = eval('('+data+')'); + $('input[name="kodebarang"]').val(kdBarang); + }); +} + +function getHP(){ + var jml = $('#jmlbeli').val(); + var subtbeli = $('#subtotal').val(); + var disc = $('#disc').val(); + var discrp = $('#discrp').val(); + var ppn = $('#ppn').val(); + + jml = parseInt(jml,10); + subtbeli = parseInt(subtbeli,10); + disc = parseInt(disc,10); + discrp = parseInt(discrp,10); + ppn = parseInt(ppn,10); + + HrgP = Math.round(subtbeli/jml); + A = HrgP - (HrgP*disc/100); //hrg pokok stlh disc + B = A - discrp; //hrg pokok stlh disc dan disc rupiah + C = B + (B*ppn/100); //hrg pokok stlh disc dan disc rupiah dan PPn + newHrgP = Math.round(C); + return newHrgP; + +} +function getHJ(){ + var newHP = getHP(); + var profit = $('#profit').val(); + + profit = parseInt(profit,10); + newHrgJ = newHP + (newHP*profit/100); + newHrgJ = Math.round(newHrgJ); + return newHrgJ; +} + +function getHrgNew(){ + var newHP = getHP(); + var newHJ = getHJ(); + + $('input[name="hpbaru"]').val(newHP); + $('input[name="hjbaru"]').val(newHJ); + +} + +function hitProfit(){ + var hp = $('#hp').val(); + var profit = $('#profit').val(); + + hp = parseInt(hp,10); + profit = parseInt(profit,10); + hj = hp + (hp*profit/100); + newhj = Math.round(hj); + $('input[name="hj"]').val(newhj); +} + +function getRpNett(){ + var trpbeli = $('#trBeli').val(); + var disc = $('#discProNota').val(); + var discrp = $('#discNota').val(); + var ppn = $('#ppnNota').val(); + + trpbeli = parseInt(trpbeli,10); + disc = parseInt(disc,10); + discrp = parseInt(discrp,10); + ppn = parseInt(ppn,10); + + A = trpbeli - (trpbeli*disc/100); //hrg beli stlh disc + B = A - discrp; //hrg beli stlh disc dan disc rupiah + C = B + (B*ppn/100); //hrg beli stlh disc dan disc rupiah dan PPn + newHrgNett = Math.round(C); + + $('input[name="trBeliNett"]').val(newHrgNett); +} + +function clearChildren(element) { + for (var i = 0; i < element.childNodes.length; i++) { + var e = element.childNodes[i]; + if (e.tagName) switch (e.tagName.toLowerCase()) { + case 'input': + switch (e.type) { + case "radio": + case "checkbox": e.checked = false; break; + case "button": + case "submit": + case "image": break; + default: e.value = ''; break; + } + break; + case 'select': e.selectedIndex = 0; break; + case 'textarea': e.innerHTML = ''; break; + default: clearChildren(e); + } + } +} + +function refreshDetilBeli(){ + var nol = 0; + var main = "viewtmpbeli.php"; + $("#tmpbeli").load(main); + clearChildren(document.getElementById('detilbeli')); + + $('input[name="disc"]').val(nol); + $('input[name="discrp"]').val(nol); + $('input[name="ppn"]').val(nol); + $('input[name="profit"]').val(nol); + $('input[name="hpbaru"]').val(nol); + $('input[name="hjbaru"]').val(nol); + document.forms["barang"].barcode.focus(); + +} diff --git a/old-source/js/barcoding.js b/old-source/js/barcoding.js new file mode 100644 index 0000000..e75309c --- /dev/null +++ b/old-source/js/barcoding.js @@ -0,0 +1,224 @@ +$().ready(function() { + /** + * plug in button operation(disabled and enabled) + * by Daniel Susanto - susantodaniel@gmail.com + */ + jQuery.fn.disabledBtn = function() { + if(this != null){ + if(this.attr('disabled') == false) + this.attr('disabled', true); + } + } + + jQuery.fn.enabledBtn = function() { + if(this != null){ + if(this.attr('disabled') == true) + this.attr('disabled', false); + } + } + + $('#alert').dialog({ + modal:true, + autoOpen: false, + width: 250, + height: 70, + overlay: { + opacity: 0.5, + background: "black" + }, + buttons: { + "Ok": function() { + $(this).dialog("close"); + } + } + }); +}); + +/* + * alert function + * @param String msg message to be displayed + */ +function alert(msg) +{ + $('p#alertmsg').text(msg); + $('#alert').dialog('open'); +} + +/** + * Mode untuk nomor faktur + */ +function fakturMode() +{ + // enable textbox nomor faktur dan btn car, set focus ke textbox no faktur; + document.forms["frmlabeling"].nofaktur.disabled = false; + document.forms["frmlabeling"].btncarib.disabled = true; + document.forms["frmlabeling"].btncarin.disabled = false; + document.forms["frmlabeling"].nofaktur.focus(); + // disable textbox untuk kode barang dan jumlah barang + document.forms["frmlabeling"].kkodebarang.value = ""; + document.forms["frmlabeling"].knomorbarang.value = ""; + document.forms["frmlabeling"].kjml.value = ""; + document.forms["frmlabeling"].kkodebarang.disabled = true; + document.forms["frmlabeling"].knomorbarang.disabled = true; + document.forms["frmlabeling"].kjml.disabled = true; +} + +/** + * Mode untuk kode barang + */ +function kodeMode() +{ + // enable textbox kode barang dan jml barang, set focus ke textbox kode barang; + document.forms["frmlabeling"].kkodebarang.disabled = false; + document.forms["frmlabeling"].knomorbarang.disabled = false; + document.forms["frmlabeling"].kjml.disabled = false; + //document.forms["frmlabeling"].kkodebarang.focus(); + // disable textbox untuk no faktur dan btn cari + document.forms["frmlabeling"].nofaktur.value = ""; + document.forms["frmlabeling"].nofaktur.disabled = true; + document.forms["frmlabeling"].btncarin.disabled = true; + document.forms["frmlabeling"].btncarib.disabled = false; +} + +/** + * Proses inputan barcode + */ +function prosesBarcode() +{ + // jika sumber data dari kode barang tertentu + if(document.forms["frmlabeling"].kkodebarang.disabled == false && document.forms["frmlabeling"].nofaktur.disabled == true) + { + var jumlahCetak = parseInt(document.forms["frmlabeling"].kjml.value); + jumlahCetak = isNaN(jumlahCetak) ? 0 : jumlahCetak; + // jika kode barang atau jumlah cetak tidak diisi + if(document.forms["frmlabeling"].kkodebarang.value == "" || document.forms["frmlabeling"].kjml.value == "" || jumlahCetak == 0) + alert("Data Tidak Valid !."); + + else + { + $(function(){ + var dt = ""; + var gvar = $("#kkodebarang").val(); + var gvar2 = $("#knomorbarang").val(); + $.get("barcode_kbarang.php?kode=" + gvar + "&nomor=" + gvar2, function(data){ + var nota = eval('('+data+')'); + for(i in nota) { + dt += "" + + ""; + jum++; + } + $("#dbayangan").empty(); + $("#dbayangan").append(dt); + document.forms["frmlabeling"].submit(); + var postvar = {sesi : 6} + $.post('../log.php',postvar, function(data){ + alert(data); + }); + }); + }); + } + } + // jika sumber data dari nomor faktur + else if(document.forms["frmlabeling"].nofaktur.disabled == false && document.forms["frmlabeling"].kkodebarang.disabled == true) + { + // jika nomor faktur masih kosong + if(document.forms["frmlabeling"].nofaktur.value == "") + alert("Data Tidak Valid !."); + else + { + var nofak = document.forms["frmlabeling"].nofaktur.value; + var postvars = {nota:nofak}; + var dt = ""; + var jum = 0; + $(function(){ + $.post('barcode_nota.php', postvars, function(data){ + var nota = eval('('+data+')'); + for(i in nota) { + dt += "" + + "" + + "" + + "" + + ""; + jum++; + } + dt += ""; + $("#dbayangan").empty(); + $("#dbayangan").append(dt); + document.forms["frmlabeling"].submit(); + }); + }); + } + } +} + +function printlabel() +{ + // jika sumber data dari kode barang tertentu + if(document.forms["frmlabeling"].kkodebarang.disabled == false && document.forms["frmlabeling"].nofaktur.disabled == true) + { + var jumlahCetak = parseInt(document.forms["frmlabeling"].kjml.value); + jumlahCetak = isNaN(jumlahCetak) ? 0 : jumlahCetak; + // jika kode barang atau jumlah cetak tidak diisi + if(document.forms["frmlabeling"].kkodebarang.value == "" || document.forms["frmlabeling"].kjml.value == "" || jumlahCetak == 0) + alert("Data Tidak Valid !"); + + else + { + $(function(){ + var dta = ""; + var jvar = $("#kkodebarang").val(); + var jvar2 = $("#knomorbarang").val(); + var jvar3 = $("#kjml").val(); + $.get("barcode_kbarang.php?kode=" + jvar + "&nomor=" + jvar2, function(data){ + var nota2 = eval('('+data+')'); + for(i in nota2) { + dta += "" + + "" + + "" + + "" + + ""; + jum++; + } + $("#dbayangan2").empty(); + $("#dbayangan2").append(dta); + document.forms["frmlabeling2"].submit(); + var postvar = {sesi : 6} + $.post('../log.php',postvar, function(data){ + alert(data); + }); + }); + }); + } + } + // jika sumber data dari nomor faktur + else if(document.forms["frmlabeling"].nofaktur.disabled == false && document.forms["frmlabeling"].kkodebarang.disabled == true) + { + // jika nomor faktur masih kosong + if(document.forms["frmlabeling"].nofaktur.value == "") + alert("Data Tidak Valid !."); + else + { + var nofak = document.forms["frmlabeling"].nofaktur.value; + var postvars = {nota:nofak}; + var dta = ""; + var jum = 0; + $(function(){ + $.post('barcode_nota.php', postvars, function(data){ + var nota2 = eval('('+data+')'); + for(i in nota2) { + dta += "" + + "" + + "" + + "" + + ""; + jum++; + } + dta += ""; + $("#dbayangan2").empty(); + $("#dbayangan2").append(dta); + document.forms["frmlabeling2"].submit(); + }); + }); + } + } +} diff --git a/old-source/js/dlmpdk.js b/old-source/js/dlmpdk.js new file mode 100644 index 0000000..9c207f0 --- /dev/null +++ b/old-source/js/dlmpdk.js @@ -0,0 +1,106 @@ +// JavaScript Document +$(document).ready(function() { + $('#fshasil').invisibleEl(); + /* dialog */ + $('#dialogcaridlmpdk').jqm({ + modal: true, + trigger: '#btncarinama', + overlay: 30, + overlayClass: 'whiteOverlay', + onShow : function(hash){ + hash.w.fadeIn(50); + }, + onHide : function(hash){ + hash.w.fadeOut(50, function(){if(hash.o) hash.o.remove();}); + $('input[name="txtcari"]').val(''); + $('#hasil').empty(); + } + }); + + $('#btncarinama').live('click', function(){ + $('#dialogcaridlmpdk').jqmShow(); + return false; + }); + + // Close Button Highlighting. IE doesn't support :hover. Surprise? + $('input.jqmdX') + .hover( + function(){ $(this).addClass('jqmdXFocus'); }, + function(){ $(this).removeClass('jqmdXFocus'); }) + .focus( + function(){ this.hideFocus=true; $(this).addClass('jqmdXFocus'); }) + .blur( + function(){ $(this).removeClass('jqmdXFocus'); }); + + // ambil data + $('form[name="fcaridlmpdk"]').submit(function(){ + var postvars = { + txtcari: $("input[name='txtcari']").val(), + operation: "caridlmpdk", + status: "ok" + }; + $.post('ajaxdlmpdk.php', postvars, function(data) { + var dlmpdk = eval('('+data+')'); + var hasil; + var tabel = ""; + tabel += ""; + tabel += ""; + for(i in dlmpdk) { + tabel += ""; + tabel += " "; + } + tabel += "
Sub Group ProductGroup ProductNamaHapus
"+dlmpdk[i].kode_ked_produk+" " + dlmpdk[i].kode_strip + " " + dlmpdk[i].ked_produk + " HAPUS
"; + $("#hasil").html(tabel); + $('#fshasil').visibleEl(); + }); + return false; + }); + + // simpan dlmpdk + $('form[name="fdlmpdk"]').submit(function(){ + var postvars = $('form[name="fdlmpdk"]').formToArray(); + $.post('ajaxdlmpdk.php', postvars, function(data) { + var hasil = eval('('+data+')'); + if(hasil[0] == 1){ + alert("Berhasil"); + $('form[name="fdlmpdk"]').resetForm(); + } else { + alert("Gagal"); + } + }); + return false; + }); +}); + +function setNilai(dlmpdk) { + var postvars = {id_dlmpdk: dlmpdk, + operation: 'ambildlmpdk', + status: 'ok' + }; + $.post('ajaxdlmpdk.php', postvars, function(data){ + var dlmpdk = eval('('+data+')'); + $('input[name="kodedlmpdk"]').val(dlmpdk[0].kode_ked_produk); + $('input[name="lini"]').val(dlmpdk[0].kode_strip); + $('input[name="nama"]').val(dlmpdk[0].ked_produk); + $('#dialogcaridlmpdk').jqmHide(); + }); +} + +function setDelete(dlmpdk) { + var postvars = {id_dlmpdk: dlmpdk, + operation: 'hapusdlmpdk', + status: 'ok' + }; + var answer = confirm ("Yakin hapus data?") + if (answer) + $.post('ajaxdlmpdk.php', postvars, function(data){ + var kary = eval('('+data+')'); + if(kary[0] == 1){ + alert("Hapus Berhasil"); + $('#dialogcaridlmpdk').jqmHide(); + $('form[name="fdlmpdk"]').resetForm(); + } else { + alert("Hapus Gagal"); + } + }); +} diff --git a/old-source/js/jqModal.js b/old-source/js/jqModal.js new file mode 100644 index 0000000..3aac816 --- /dev/null +++ b/old-source/js/jqModal.js @@ -0,0 +1,69 @@ +/* + * jqModal - Minimalist Modaling with jQuery + * (http://dev.iceburg.net/jquery/jqModal/) + * + * Copyright (c) 2007,2008 Brice Burgess + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * $Version: 03/01/2009 +r14 + */ +(function($) { +$.fn.jqm=function(o){ +var p={ +overlay: 50, +overlayClass: 'jqmOverlay', +closeClass: 'jqmClose', +trigger: '.jqModal', +ajax: F, +ajaxText: '', +target: F, +modal: F, +toTop: F, +onShow: F, +onHide: F, +onLoad: F +}; +return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s; +H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s}; +if(p.trigger)$(this).jqmAddTrigger(p.trigger); +});}; + +$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');}; +$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');}; +$.fn.jqmShow=function(t){return this.each(function(){t=t||window.event;$.jqm.open(this._jqm,t);});}; +$.fn.jqmHide=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t)});}; + +$.jqm = { +hash:{}, +open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3000,o=$('
').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z); + if(c.modal) {if(!A[0])L('bind');A.push(s);} + else if(c.overlay > 0)h.w.jqmAddClose(o); + else o=F; + + h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F; + if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in {Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");}} + + if(c.ajax) {var r=c.target||h.w,u=c.ajax,r=(typeof r == 'string')?$(r,h.w):$(r),u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u; + r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});} + else if(cc)h.w.jqmAddClose($(cc,h.w)); + + if(c.toTop&&h.o)h.w.before('').insertAfter(h.o); + (c.onShow)?c.onShow(h):h.w.show();e(h);return F; +}, +close:function(s){var h=H[s];if(!h.a)return F;h.a=F; + if(A[0]){A.pop();if(!A[0])L('unbind');} + if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove(); + if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();} return F; +}, +params:{}}; +var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version == "6.0"),F=false, +i=$('').css({opacity:0}), +e=function(h){if(ie6)if(h.o)h.o.html('

').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i); f(h);}, +f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}}, +L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);}, +m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return !r;}, +hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function() { + if(!this[c]){this[c]=[];$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});}; +})(jQuery); \ No newline at end of file diff --git a/old-source/js/jqSajax.class.php b/old-source/js/jqSajax.class.php new file mode 100644 index 0000000..5062f82 --- /dev/null +++ b/old-source/js/jqSajax.class.php @@ -0,0 +1,313 @@ +as_method=0;$this->as_jquery_plugin=0;} + if($jq==1){$this->as_jquery_plugin=1;$this->as_method=0;} + if($jq==2){$this->as_method=1;$this->as_jquery_plugin=0;} + $this->asincronous=$asc; + $this->use_json=$json; + //if($this->as_jquery_plugin)$this->as_method=0; + } + + function getUri($uri='') { + if($uri=='')$uri=$_SERVER["REQUEST_URI"]; + return $uri; + } + + function checkJson(){ + if(function_exists('json_encode') && $this->use_json)return true; + else return false; + } + + function getJsRepr($value) { + $value=serialize($value); + // Escapes a string so it can be safely echo'ed out as Javascript + $value = str_replace(array('\\', "'"), array("\\\\", "\\'"), $value); + $value = preg_replace('#([\x00-\x1F])#e', '"\x" . sprintf("%02x", ord("\1"))', $value); + $value = "'$value'"; + return $value; + } + + function processClientReq() { + $mode = ""; + $obj=isset($_REQUEST['rsobj'])?$_REQUEST['rsobj']:''; + + if (! empty($_GET["rs"])) + $mode = "get"; + + if (!empty($_POST["rs"])) + $mode = "post"; + + if (empty($mode)) + return; + + $target = ""; + + if ($mode == "get") { + // Bust cache in the head + header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past + header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + // always modified + header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 + $func_name = $_GET["rs"]; + if (! empty($_GET["rsargs"])) + $args = $_GET["rsargs"]; + else + $args = array(); + } + else { + $func_name = $_POST["rs"]; + if (! empty($_POST["rsargs"])) + $args = $_POST["rsargs"]; + else + $args = array(); + } + if($obj!='')$fname=$obj.'->'.$func_name; + else $fname=$func_name; + if (! in_array($fname, $this->export_list)) + echo "-:$func_name not callable"; + else { + if(!$this->checkJson())echo "+:"; + //for PHP 5 + foreach($args as $key=>$value)$args[$key]=str_replace(array("\\\"", "\\'"), array('"', "'"), $value); + if($obj=='')$result = call_user_func_array($func_name, $args); + else{ + eval("global \$$obj;"); + foreach($args as $key=>$value)$arg[$key]='\''.$value.'\''; + if(isset($arg))$arg2=implode(',',$arg); + else $arg2=NULL; + eval("\$result=\$$fname($arg2);"); + } + //echo "var res = " . trim($this->getJsValue($result)) . "; res;"; + if(!$this->checkJson())echo "var res = " . trim($this->getJsRepr($result)) . "; res;"; + else { + if(is_string($result))echo json_encode('"'.addslashes($result).'"'); + else echo json_encode($result); + //see http://www.json.org/js.html for better solution + } + //because we use php serialize/unserialize http://www.coolcode.cn/?p=171 + //echo "var res = '" . trim(sajax_esc($result)) . "'; res;"; + } + exit; + } + + function getCommonJs() { + $t = strtoupper($this->request_type); + if ($t != "" && $t != "GET" && $t != "POST") + return "// Invalid type: $t.. \n\n"; + + ob_start(); + ?> + + var jqSajax = { + debug_mode : debug_mode ? "true" : "false"; ?>,request_type : "", + target_id : target_id.'\''; ?>,failure_redirect : "failure_redirect; ?>", + friendly_url : friendly_url ? "true" : "false"; ?>,requests: new Array(),data_return:"", + + debug:function(text) {if (this.debug_mode)alert(text);}, + cancel: function() {for (var i = 0; i < this.requests.length; i++)this.requests[i].abort();}, + + serialize:function(inp){ + var getType=function(inp){var type=typeof inp,match;if(type=='object'&&!inp){return'null'}if(type=="object"){if(!inp.constructor){return'object'}var cons=inp.constructor.toString();if(match=cons.match(/(\w+)\(/)){cons=match[1].toLowerCase()}var types=["boolean","number","string","array"];for(key in types){if(cons==types[key]){type=types[key];break}}}return type};var type=getType(inp);var val;switch(type){case"undefined":val="N";break;case"boolean":val="b:"+(inp?"1":"0");break;case"number":val=(Math.round(inp)==inp?"i":"d")+":"+inp;break;case"string":val="s:"+inp.length+":\""+inp+"\"";break;case"array":val="a";case"object":if(type=="object"){var objname=inp.constructor.toString().match(/(\w+)\(\)/);if(objname==undefined){return}objname[1]=this.serialize(objname[1]);val="O"+objname[1].substring(1,objname[1].length-1)}var count=0;var vals="";var okey;for(key in inp){okey=(key.match(/^[0-9]+$/)?parseInt(key):key);vals+=this.serialize(okey)+this.serialize(inp[key]);count++}val+=":"+count+":{"+vals+"}";break}if(type!="object"&&type!="array")val+=";";return val; + }, + unserialize:function(inp){ + error=0;if(inp==""||inp.length<2){errormsg="";return}var val,kret,vret,cval;var type=inp.charAt(0);var cont=inp.substring(2);var size=0,divpos=0,endcont=0,rest="",next="";switch(type){case"N":if(inp.charAt(1)!=";"){errormsg=""}rest=cont;break;case"b":if(!/[01];/.test(cont.substring(0,2))){errormsg=""}val=(cont.charAt(0)=="1");rest=cont.substring(2);break;case"s":val="";divpos=cont.indexOf(":");if(divpos==-1){errormsg="";break}size=parseInt(cont.substring(0,divpos));if(size==0){if(cont.length-divpos<4){errormsg="";break}rest=cont.substring(divpos+4);break}if((cont.length-divpos-size)<4){errormsg="";break}if(cont.substring(divpos+2+size,divpos+4+size)!="\";"){errormsg=""}val=cont.substring(divpos+2,divpos+2+size);rest=cont.substring(divpos+4+size);break;case"i":case"d":var dotfound=0;for(var i=0;iasincronous){ + if($this->checkJson()) echo 'jqSajax.data_return=eval(text);'; + else echo 'jqSajax.data_return=text;'; + } + else { + if($this->checkJson()) echo 'var data==eval(text);'; + else echo 'var data=jqSajax.fhasilc(text);'; + echo 'alert(\'Type: \'+typeof data +\', data:\'+data);'; + } + ?> + }, + as_method)echo $this->getCommonMethod(); ?> + do_call:function(func_name, args, obj) { + var i,post_data,target_id,uri; + this.debug("in jqSajax.do_call()...\nRequest Type: " + this.request_type + "\nTarget Id: " + this.target_id); + target_id = this.target_id; + if (typeof(this.request_type) == "undefined" || this.request_type == "")this.request_type = "GET"; + uri = "getUri(); ?>"; + if (this.request_type == "GET") { + if (uri.indexOf("?") == -1 && this.friendly_url==false)uri += "?rs=" + escape(func_name); + else uri += "&rs=" + escape(func_name); + uri += "&rst=" + escape(target_id); + uri += "&rsrnd=" + new Date().getTime(); + uri += "&rsobj=" + obj; + for (i = 0; i < args.length; i++)uri += "&rsargs[]=" + escape(args[i]); + post_data = null; + } + else if (this.request_type == "POST") { + post_data = "rs=" + escape(func_name); + post_data += "&rst=" + escape(this.target_id); + post_data += "&rsrnd=" + new Date().getTime(); + post_data += "&rsobj=" + obj; + for (i = 0; i < args.length; i++)post_data = post_data + "&rsargs[]=" + escape(args[i]); + } + else this.debug("Illegal request type: " + this.request_type); + + this.debug("Do requested page with JQUERY ajax..."); + this.debug("URI: "+uri); + this.debug("Post Data: "+post_data); + $.ajax({ + async:false, + type: this.request_type, + url : uri, + data: post_data, + checkJson()) echo "dataType:\"json\",\n";?> + success:this.fhasil + }); + } + }; + + getCommonJs(); + } + + function getOneStub($func_name,$obj='') { + ob_start(); + if($obj!='')$pobj=$obj.'_'; + else $pobj=''; + ?> + function x_(){jqSajax.do_call("",x_.arguments,"");asincronous)if($this->checkJson()) echo 'return jqSajax.data_return';else echo 'return jqSajax.fhasilc(jqSajax.data_return)';?>} + + x_:function(){this.do_call("",this.x_.arguments,"");asincronous)if($this->checkJson()) echo 'return jqSajax.data_return';else echo 'return jqSajax.fhasilc(jqSajax.data_return)';?>}, + + $.x_=function(){jqSajax.do_call("",$.x_.arguments,"");asincronous)if($this->checkJson()) echo 'return jqSajax.data_return';else echo 'return jqSajax.fhasilc(jqSajax.data_return)';?>}; + export_list[] = func_get_arg($i); + } + } + + function exportObj() { + $n = func_num_args(); + for ($i = 0; $i < $n; $i++) { + $name=func_get_arg($i); + eval("global \$$name;"); + eval("\$method=get_class_methods(\$$name);"); + foreach($method as $value)$this->export_list[] = $name.'->'.$value; + } + } + + function getCommonMethod() + { + $html = ""; + foreach ($this->export_list as $func) { + $dt=explode('->',$func); + if(!isset($dt[1]))$html .= $this->getOneMethod($dt[0]); + else $html .= $this->getOneMethod($dt[1],$dt[0]); + } + return $html; + } + + function getJs() + { + $html = ""; + if($this->as_jquery_plugin)$this->as_method=0; + if($this->as_method)$html .= $this->getCommonJs(); + else{ + if (! $this->js_has_been_shown) { + $html .= $this->getCommonJs(); + $this->js_has_been_shown = 1; + } + foreach ($this->export_list as $func) { + $dt=explode('->',$func); + if($this->as_jquery_plugin){ + if(!isset($dt[1]))$html .= $this->getOneJquery($dt[0]); + else $html .= $this->getOneJquery($dt[1],$dt[0]); + } + if(!$this->as_jquery_plugin && !$this->as_method){ + if(!isset($dt[1]))$html .= $this->getOneStub($dt[0]); + else $html .= $this->getOneStub($dt[1],$dt[0]); + } + } + } + return $html; + } + + function showJs() + { + echo $this->getJs(); + } +} +?> diff --git a/old-source/js/jquery-1.2.6.js b/old-source/js/jquery-1.2.6.js new file mode 100644 index 0000000..88e661e --- /dev/null +++ b/old-source/js/jquery-1.2.6.js @@ -0,0 +1,3549 @@ +(function(){ +/* + * jQuery 1.2.6 - New Wave Javascript + * + * Copyright (c) 2008 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ + * $Rev: 5685 $ + */ + +// Map over jQuery in case of overwrite +var _jQuery = window.jQuery, +// Map over the $ in case of overwrite + _$ = window.$; + +var jQuery = window.jQuery = window.$ = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context ); +}; + +// A simple way to check for HTML strings or ID strings +// (both of which we optimize for) +var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/, + +// Is it a simple selector + isSimple = /^.[^:#\[\.]*$/, + +// Will speed up references to undefined, and allows munging its name. + undefined; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + // Make sure that a selection was provided + selector = selector || document; + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this[0] = selector; + this.length = 1; + return this; + } + // Handle HTML strings + if ( typeof selector == "string" ) { + // Are we dealing with HTML string or an ID? + var match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) + selector = jQuery.clean( [ match[1] ], context ); + + // HANDLE: $("#id") + else { + var elem = document.getElementById( match[3] ); + + // Make sure an element was located + if ( elem ){ + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id != match[3] ) + return jQuery().find( selector ); + + // Otherwise, we inject the element directly into the jQuery object + return jQuery( elem ); + } + selector = []; + } + + // HANDLE: $(expr, [context]) + // (which is just equivalent to: $(content).find(expr) + } else + return jQuery( context ).find( selector ); + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) + return jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector ); + + return this.setArray(jQuery.makeArray(selector)); + }, + + // The current version of jQuery being used + jquery: "1.2.6", + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + // The number of elements contained in the matched element set + length: 0, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == undefined ? + + // Return a 'clean' array + jQuery.makeArray( this ) : + + // Return just the object + this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + // Build a new jQuery matched element set + var ret = jQuery( elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Force the current matched set of elements to become + // the specified array of elements (destroying the stack in the process) + // You should use pushStack() in order to do this, but maintain the stack + setArray: function( elems ) { + // Resetting the length to 0, then using the native Array push + // is a super-fast way to populate an object with array-like properties + this.length = 0; + Array.prototype.push.apply( this, elems ); + + return this; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + var ret = -1; + + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem && elem.jquery ? elem[0] : elem + , this ); + }, + + attr: function( name, value, type ) { + var options = name; + + // Look for the case where we're accessing a style value + if ( name.constructor == String ) + if ( value === undefined ) + return this[0] && jQuery[ type || "attr" ]( this[0], name ); + + else { + options = {}; + options[ name ] = value; + } + + // Check to see if we're setting style values + return this.each(function(i){ + // Set all the styles + for ( name in options ) + jQuery.attr( + type ? + this.style : + this, + name, jQuery.prop( this, options[ name ], type, i, name ) + ); + }); + }, + + css: function( key, value ) { + // ignore negative width and height values + if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) + value = undefined; + return this.attr( key, value, "curCSS" ); + }, + + text: function( text ) { + if ( typeof text != "object" && text != null ) + return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); + + var ret = ""; + + jQuery.each( text || this, function(){ + jQuery.each( this.childNodes, function(){ + if ( this.nodeType != 8 ) + ret += this.nodeType != 1 ? + this.nodeValue : + jQuery.fn.text( [ this ] ); + }); + }); + + return ret; + }, + + wrapAll: function( html ) { + if ( this[0] ) + // The elements to wrap the target around + jQuery( html, this[0].ownerDocument ) + .clone() + .insertBefore( this[0] ) + .map(function(){ + var elem = this; + + while ( elem.firstChild ) + elem = elem.firstChild; + + return elem; + }) + .append(this); + + return this; + }, + + wrapInner: function( html ) { + return this.each(function(){ + jQuery( this ).contents().wrapAll( html ); + }); + }, + + wrap: function( html ) { + return this.each(function(){ + jQuery( this ).wrapAll( html ); + }); + }, + + append: function() { + return this.domManip(arguments, true, false, function(elem){ + if (this.nodeType == 1) + this.appendChild( elem ); + }); + }, + + prepend: function() { + return this.domManip(arguments, true, true, function(elem){ + if (this.nodeType == 1) + this.insertBefore( elem, this.firstChild ); + }); + }, + + before: function() { + return this.domManip(arguments, false, false, function(elem){ + this.parentNode.insertBefore( elem, this ); + }); + }, + + after: function() { + return this.domManip(arguments, false, true, function(elem){ + this.parentNode.insertBefore( elem, this.nextSibling ); + }); + }, + + end: function() { + return this.prevObject || jQuery( [] ); + }, + + find: function( selector ) { + var elems = jQuery.map(this, function(elem){ + return jQuery.find( selector, elem ); + }); + + return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ? + jQuery.unique( elems ) : + elems ); + }, + + clone: function( events ) { + // Do the clone + var ret = this.map(function(){ + if ( jQuery.browser.msie && !jQuery.isXMLDoc(this) ) { + // IE copies events bound via attachEvent when + // using cloneNode. Calling detachEvent on the + // clone will also remove the events from the orignal + // In order to get around this, we use innerHTML. + // Unfortunately, this means some modifications to + // attributes in IE that are actually only stored + // as properties will not be copied (such as the + // the name attribute on an input). + var clone = this.cloneNode(true), + container = document.createElement("div"); + container.appendChild(clone); + return jQuery.clean([container.innerHTML])[0]; + } else + return this.cloneNode(true); + }); + + // Need to set the expando to null on the cloned set if it exists + // removeData doesn't work here, IE removes it from the original as well + // this is primarily for IE but the data expando shouldn't be copied over in any browser + var clone = ret.find("*").andSelf().each(function(){ + if ( this[ expando ] != undefined ) + this[ expando ] = null; + }); + + // Copy the events from the original to the clone + if ( events === true ) + this.find("*").andSelf().each(function(i){ + if (this.nodeType == 3) + return; + var events = jQuery.data( this, "events" ); + + for ( var type in events ) + for ( var handler in events[ type ] ) + jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data ); + }); + + // Return the cloned set + return ret; + }, + + filter: function( selector ) { + return this.pushStack( + jQuery.isFunction( selector ) && + jQuery.grep(this, function(elem, i){ + return selector.call( elem, i ); + }) || + + jQuery.multiFilter( selector, this ) ); + }, + + not: function( selector ) { + if ( selector.constructor == String ) + // test special case where just one selector is passed in + if ( isSimple.test( selector ) ) + return this.pushStack( jQuery.multiFilter( selector, this, true ) ); + else + selector = jQuery.multiFilter( selector, this ); + + var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; + return this.filter(function() { + return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; + }); + }, + + add: function( selector ) { + return this.pushStack( jQuery.unique( jQuery.merge( + this.get(), + typeof selector == 'string' ? + jQuery( selector ) : + jQuery.makeArray( selector ) + ))); + }, + + is: function( selector ) { + return !!selector && jQuery.multiFilter( selector, this ).length > 0; + }, + + hasClass: function( selector ) { + return this.is( "." + selector ); + }, + + val: function( value ) { + if ( value == undefined ) { + + if ( this.length ) { + var elem = this[0]; + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type == "select-one"; + + // Nothing was selected + if ( index < 0 ) + return null; + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + if ( option.selected ) { + // Get the specifc value for the option + value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value; + + // We don't need an array for one selects + if ( one ) + return value; + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + + // Everything else, we just grab the value + } else + return (this[0].value || "").replace(/\r/g, ""); + + } + + return undefined; + } + + if( value.constructor == Number ) + value += ''; + + return this.each(function(){ + if ( this.nodeType != 1 ) + return; + + if ( value.constructor == Array && /radio|checkbox/.test( this.type ) ) + this.checked = (jQuery.inArray(this.value, value) >= 0 || + jQuery.inArray(this.name, value) >= 0); + + else if ( jQuery.nodeName( this, "select" ) ) { + var values = jQuery.makeArray(value); + + jQuery( "option", this ).each(function(){ + this.selected = (jQuery.inArray( this.value, values ) >= 0 || + jQuery.inArray( this.text, values ) >= 0); + }); + + if ( !values.length ) + this.selectedIndex = -1; + + } else + this.value = value; + }); + }, + + html: function( value ) { + return value == undefined ? + (this[0] ? + this[0].innerHTML : + null) : + this.empty().append( value ); + }, + + replaceWith: function( value ) { + return this.after( value ).remove(); + }, + + eq: function( i ) { + return this.slice( i, i + 1 ); + }, + + slice: function() { + return this.pushStack( Array.prototype.slice.apply( this, arguments ) ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function(elem, i){ + return callback.call( elem, i, elem ); + })); + }, + + andSelf: function() { + return this.add( this.prevObject ); + }, + + data: function( key, value ){ + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + if ( data === undefined && this.length ) + data = jQuery.data( this[0], key ); + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + } else + return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){ + jQuery.data( this, key, value ); + }); + }, + + removeData: function( key ){ + return this.each(function(){ + jQuery.removeData( this, key ); + }); + }, + + domManip: function( args, table, reverse, callback ) { + var clone = this.length > 1, elems; + + return this.each(function(){ + if ( !elems ) { + elems = jQuery.clean( args, this.ownerDocument ); + + if ( reverse ) + elems.reverse(); + } + + var obj = this; + + if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) ) + obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") ); + + var scripts = jQuery( [] ); + + jQuery.each(elems, function(){ + var elem = clone ? + jQuery( this ).clone( true )[0] : + this; + + // execute all scripts after the elements have been injected + if ( jQuery.nodeName( elem, "script" ) ) + scripts = scripts.add( elem ); + else { + // Remove any inner scripts for later evaluation + if ( elem.nodeType == 1 ) + scripts = scripts.add( jQuery( "script", elem ).remove() ); + + // Inject the elements into the document + callback.call( obj, elem ); + } + }); + + scripts.each( evalScript ); + }); + } +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +function evalScript( i, elem ) { + if ( elem.src ) + jQuery.ajax({ + url: elem.src, + async: false, + dataType: "script" + }); + + else + jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); + + if ( elem.parentNode ) + elem.parentNode.removeChild( elem ); +} + +function now(){ + return +new Date; +} + +jQuery.extend = jQuery.fn.extend = function() { + // copy reference to target object + var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; + + // Handle a deep copy situation + if ( target.constructor == Boolean ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target != "object" && typeof target != "function" ) + target = {}; + + // extend jQuery itself if only one argument is passed + if ( length == i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) + // Extend the base object + for ( var name in options ) { + var src = target[ name ], copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) + continue; + + // Recurse if we're merging object values + if ( deep && copy && typeof copy == "object" && !copy.nodeType ) + target[ name ] = jQuery.extend( deep, + // Never move original objects, clone them + src || ( copy.length != null ? [ ] : { } ) + , copy ); + + // Don't bring in undefined values + else if ( copy !== undefined ) + target[ name ] = copy; + + } + + // Return the modified object + return target; +}; + +var expando = "jQuery" + now(), uuid = 0, windowData = {}, + // exclude the following css properties to add px + exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, + // cache defaultView + defaultView = document.defaultView || {}; + +jQuery.extend({ + noConflict: function( deep ) { + window.$ = _$; + + if ( deep ) + window.jQuery = _jQuery; + + return jQuery; + }, + + // See test/unit/core.js for details concerning this function. + isFunction: function( fn ) { + return !!fn && typeof fn != "string" && !fn.nodeName && + fn.constructor != Array && /^[\s[]?function/.test( fn + "" ); + }, + + // check if an element is in a (or is an) XML document + isXMLDoc: function( elem ) { + return elem.documentElement && !elem.body || + elem.tagName && elem.ownerDocument && !elem.ownerDocument.body; + }, + + // Evalulates a script in a global context + globalEval: function( data ) { + data = jQuery.trim( data ); + + if ( data ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + if ( jQuery.browser.msie ) + script.text = data; + else + script.appendChild( document.createTextNode( data ) ); + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); + }, + + cache: {}, + + data: function( elem, name, data ) { + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ]; + + // Compute a unique ID for the element + if ( !id ) + id = elem[ expando ] = ++uuid; + + // Only generate the data cache if we're + // trying to access or manipulate it + if ( name && !jQuery.cache[ id ] ) + jQuery.cache[ id ] = {}; + + // Prevent overriding the named cache with undefined values + if ( data !== undefined ) + jQuery.cache[ id ][ name ] = data; + + // Return the named cache data, or the ID for the element + return name ? + jQuery.cache[ id ][ name ] : + id; + }, + + removeData: function( elem, name ) { + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ]; + + // If we want to remove a specific section of the element's data + if ( name ) { + if ( jQuery.cache[ id ] ) { + // Remove the section of cache data + delete jQuery.cache[ id ][ name ]; + + // If we've removed all the data, remove the element's cache + name = ""; + + for ( name in jQuery.cache[ id ] ) + break; + + if ( !name ) + jQuery.removeData( elem ); + } + + // Otherwise, we want to remove all of the element's data + } else { + // Clean up the element expando + try { + delete elem[ expando ]; + } catch(e){ + // IE has trouble directly removing the expando + // but it's ok with using removeAttribute + if ( elem.removeAttribute ) + elem.removeAttribute( expando ); + } + + // Completely remove the data cache + delete jQuery.cache[ id ]; + } + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, length = object.length; + + if ( args ) { + if ( length == undefined ) { + for ( name in object ) + if ( callback.apply( object[ name ], args ) === false ) + break; + } else + for ( ; i < length; ) + if ( callback.apply( object[ i++ ], args ) === false ) + break; + + // A special, fast, case for the most common use of each + } else { + if ( length == undefined ) { + for ( name in object ) + if ( callback.call( object[ name ], name, object[ name ] ) === false ) + break; + } else + for ( var value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} + } + + return object; + }, + + prop: function( elem, value, type, i, name ) { + // Handle executable functions + if ( jQuery.isFunction( value ) ) + value = value.call( elem, i ); + + // Handle passing in a number to a CSS property + return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ? + value + "px" : + value; + }, + + className: { + // internal only, use addClass("class") + add: function( elem, classNames ) { + jQuery.each((classNames || "").split(/\s+/), function(i, className){ + if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) ) + elem.className += (elem.className ? " " : "") + className; + }); + }, + + // internal only, use removeClass("class") + remove: function( elem, classNames ) { + if (elem.nodeType == 1) + elem.className = classNames != undefined ? + jQuery.grep(elem.className.split(/\s+/), function(className){ + return !jQuery.className.has( classNames, className ); + }).join(" ") : + ""; + }, + + // internal only, use hasClass("class") + has: function( elem, className ) { + return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1; + } + }, + + // A method for quickly swapping in/out CSS properties to get correct calculations + swap: function( elem, options, callback ) { + var old = {}; + // Remember the old values, and insert the new ones + for ( var name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + callback.call( elem ); + + // Revert the old values + for ( var name in options ) + elem.style[ name ] = old[ name ]; + }, + + css: function( elem, name, force ) { + if ( name == "width" || name == "height" ) { + var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ]; + + function getWH() { + val = name == "width" ? elem.offsetWidth : elem.offsetHeight; + var padding = 0, border = 0; + jQuery.each( which, function() { + padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0; + border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0; + }); + val -= Math.round(padding + border); + } + + if ( jQuery(elem).is(":visible") ) + getWH(); + else + jQuery.swap( elem, props, getWH ); + + return Math.max(0, val); + } + + return jQuery.curCSS( elem, name, force ); + }, + + curCSS: function( elem, name, force ) { + var ret, style = elem.style; + + // A helper method for determining if an element's values are broken + function color( elem ) { + if ( !jQuery.browser.safari ) + return false; + + // defaultView is cached + var ret = defaultView.getComputedStyle( elem, null ); + return !ret || ret.getPropertyValue("color") == ""; + } + + // We need to handle opacity special in IE + if ( name == "opacity" && jQuery.browser.msie ) { + ret = jQuery.attr( style, "opacity" ); + + return ret == "" ? + "1" : + ret; + } + // Opera sometimes will give the wrong display answer, this fixes it, see #2037 + if ( jQuery.browser.opera && name == "display" ) { + var save = style.outline; + style.outline = "0 solid black"; + style.outline = save; + } + + // Make sure we're using the right name for getting the float value + if ( name.match( /float/i ) ) + name = styleFloat; + + if ( !force && style && style[ name ] ) + ret = style[ name ]; + + else if ( defaultView.getComputedStyle ) { + + // Only "float" is needed here + if ( name.match( /float/i ) ) + name = "float"; + + name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); + + var computedStyle = defaultView.getComputedStyle( elem, null ); + + if ( computedStyle && !color( elem ) ) + ret = computedStyle.getPropertyValue( name ); + + // If the element isn't reporting its values properly in Safari + // then some display: none elements are involved + else { + var swap = [], stack = [], a = elem, i = 0; + + // Locate all of the parent display: none elements + for ( ; a && color(a); a = a.parentNode ) + stack.unshift(a); + + // Go through and make them visible, but in reverse + // (It would be better if we knew the exact display type that they had) + for ( ; i < stack.length; i++ ) + if ( color( stack[ i ] ) ) { + swap[ i ] = stack[ i ].style.display; + stack[ i ].style.display = "block"; + } + + // Since we flip the display style, we have to handle that + // one special, otherwise get the value + ret = name == "display" && swap[ stack.length - 1 ] != null ? + "none" : + ( computedStyle && computedStyle.getPropertyValue( name ) ) || ""; + + // Finally, revert the display styles back + for ( i = 0; i < swap.length; i++ ) + if ( swap[ i ] != null ) + stack[ i ].style.display = swap[ i ]; + } + + // We should always get a number back from opacity + if ( name == "opacity" && ret == "" ) + ret = "1"; + + } else if ( elem.currentStyle ) { + var camelCase = name.replace(/\-(\w)/g, function(all, letter){ + return letter.toUpperCase(); + }); + + ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { + // Remember the original values + var left = style.left, rsLeft = elem.runtimeStyle.left; + + // Put in the new values to get a computed value out + elem.runtimeStyle.left = elem.currentStyle.left; + style.left = ret || 0; + ret = style.pixelLeft + "px"; + + // Revert the changed values + style.left = left; + elem.runtimeStyle.left = rsLeft; + } + } + + return ret; + }, + + clean: function( elems, context ) { + var ret = []; + context = context || document; + // !context.createElement fails in IE with an error but returns typeof 'object' + if (typeof context.createElement == 'undefined') + context = context.ownerDocument || context[0] && context[0].ownerDocument || document; + + jQuery.each(elems, function(i, elem){ + if ( !elem ) + return; + + if ( elem.constructor == Number ) + elem += ''; + + // Convert html string into DOM nodes + if ( typeof elem == "string" ) { + // Fix "XHTML"-style tags in all browsers + elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ + return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? + all : + front + ">"; + }); + + // Trim whitespace, otherwise indexOf won't work as expected + var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div"); + + var wrap = + // option or optgroup + !tags.indexOf("", "" ] || + + !tags.indexOf("", "" ] || + + tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && + [ 1, "", "
" ] || + + !tags.indexOf("", "" ] || + + // matched above + (!tags.indexOf("", "" ] || + + !tags.indexOf("", "" ] || + + // IE can't serialize and + + + + + + + + + +

+
+

Cleopatra Minimarket

+
+
+ +
+ Karyawan +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NIK: + + + + +
Nama: + +

Username: + +
Password Lama: + +
Password Baru: + +

ID Pekerjaan: + + +
ID Department: + +

+ +
+
+
+ +
+ +
+
Cari Karyawan
+
+ +
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + diff --git a/old-source/lap_cekpelanggangroup.php b/old-source/lap_cekpelanggangroup.php new file mode 100644 index 0000000..2d10abe --- /dev/null +++ b/old-source/lap_cekpelanggangroup.php @@ -0,0 +1,202 @@ + + + + Cleopatra + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Daftar Pelanggan Group + "; + echo "div#divprint{width:950px; border:0px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:950px;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; background-color : #BABABA;}"; + 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 ""; + + $ktp = $_POST['ktp']; + $nama = $_POST['nama']; + $member = $_POST['member']; + + $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($ktp) and !empty($nama)){ + $querydbh1 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp' and nama like '%$nama%'", $dbh1); + $querydbh2 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp' and nama like '%$nama%'", $dbh2); + $querydbh3 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp' and nama like '%$nama%'", $dbh3); + $querydbh4 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp' and nama like '%$nama%'", $dbh4); + $querydbh5 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp' and nama like '%$nama%'", $dbh5); + $querydbh6 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp' and nama like '%$nama%'", $dbh6); + $querydbh7 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp' and nama like '%$nama%'", $dbh7); + $querydbh8 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp' and nama like '%$nama%'", $dbh8); + $querydbh9 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp' and nama like '%$nama%'", $dbh9); + }elseif(!empty($ktp) and empty($nama)){ + $querydbh1 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp'", $dbh1); + $querydbh2 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp'", $dbh2); + $querydbh3 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp'", $dbh3); + $querydbh4 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp'", $dbh4); + $querydbh5 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp'", $dbh5); + $querydbh6 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp'", $dbh6); + $querydbh7 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp'", $dbh7); + $querydbh8 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp'", $dbh8); + $querydbh9 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where ktp='$ktp'", $dbh9); + }elseif(empty($ktp) and !empty($nama)){ + $querydbh1 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where nama like '%$nama%'", $dbh1); + $querydbh2 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where nama like '%$nama%'", $dbh2); + $querydbh3 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where nama like '%$nama%'", $dbh3); + $querydbh4 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where nama like '%$nama%'", $dbh4); + $querydbh5 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where nama like '%$nama%'", $dbh5); + $querydbh6 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where nama like '%$nama%'", $dbh6); + $querydbh7 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where nama like '%$nama%'", $dbh7); + $querydbh8 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where nama like '%$nama%'", $dbh8); + $querydbh9 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where nama like '%$nama%'", $dbh9); + }elseif(!empty($member)){ + $querydbh1 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where kd_customer = '$member' or alias = '$member'", $dbh1); + $querydbh2 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where kd_customer = '$member' or alias = '$member'", $dbh2); + $querydbh3 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where kd_customer = '$member' or alias = '$member'", $dbh3); + $querydbh4 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where kd_customer = '$member' or alias = '$member'", $dbh4); + $querydbh5 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where kd_customer = '$member' or alias = '$member'", $dbh5); + $querydbh6 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where kd_customer = '$member' or alias = '$member'", $dbh6); + $querydbh7 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where kd_customer = '$member' or alias = '$member'", $dbh7); + $querydbh8 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where kd_customer = '$member' or alias = '$member'", $dbh8); + $querydbh9 = mysql_query("select p.kd_customer,p.alias,DATE_FORMAT(p.member,'%d-%m-%Y') member,p.nama,alamat,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline from pelanggan p where kd_customer = '$member' or alias = '$member'", $dbh9); + }else{ + echo "Masukkan No.KTP atau Nama atau Member"; + } + print("
"); + print(""); + for ($n = 1; $n < 10; $n++){ + if($n == 1){ + $namatoko = "Bimbo"; + }elseif($n == 2){ + $namatoko = "Granada"; + }elseif($n == 3){ + $namatoko = "A.Klaten"; + }elseif($n == 4){ + $namatoko = "Dinasti"; + }elseif($n == 5){ + $namatoko = "A.Pedan"; + }elseif($n == 6){ + $namatoko = "A.Sukoharjo"; + }elseif($n == 7){ + $namatoko = "A.Boyolali"; + }elseif($n == 8){ + $namatoko = "A.Wonosari"; + }elseif($n == 9){ + $namatoko = "A.Karanganyar"; + } + + $query = '$querydbh'.$n; + if($query == '$querydbh1'){ + $querydb = $querydbh1; + }elseif($query == '$querydbh2'){ + $querydb = $querydbh2; + }elseif($query == '$querydbh3'){ + $querydb = $querydbh3; + }elseif($query == '$querydbh4'){ + $querydb = $querydbh4; + }elseif($query == '$querydbh5'){ + $querydb = $querydbh5; + }elseif($query == '$querydbh6'){ + $querydb = $querydbh6; + }elseif($query == '$querydbh7'){ + $querydb = $querydbh7; + }elseif($query == '$querydbh8'){ + $querydb = $querydbh8; + }elseif($query == '$querydbh9'){ + $querydb = $querydbh9; + } + + + if ($n != $n - 1){ + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + } + while($row=mysql_fetch_array($querydb)){ + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + } + + } + print("
$namatoko"; + print "
Kd.CustNo.AMCTgl.MemberNamaAlamatUplineAction
$row[kd_customer]$row[alias]$row[member]$row[nama]$row[alamat]$row[nama_upline]ADOPSI

"); + print("
"); + + + ?> +
+
+ +
+ + + + +?> \ No newline at end of file diff --git a/old-source/lap_cekpoinplg.php b/old-source/lap_cekpoinplg.php new file mode 100644 index 0000000..9369c56 --- /dev/null +++ b/old-source/lap_cekpoinplg.php @@ -0,0 +1,303 @@ + + + + Cleopatra + + + + + + + + + + + + + + + +
+
+

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("
"); + + + ?> +
+
+ +
+ + + + +?> \ No newline at end of file diff --git a/old-source/lap_historyplg.php b/old-source/lap_historyplg.php new file mode 100644 index 0000000..bd2dee0 --- /dev/null +++ b/old-source/lap_historyplg.php @@ -0,0 +1,277 @@ + + + + Cleopatra + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ History Pelanggan + "; + echo "div#divprint{width:900px; border:0px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:875px;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 "table.tbl1 {width:900px;border-width:0 0 0 0;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:left;}"; + echo "table.tbl1,table.tbl1 td {border-color:#000;border-style:solid;}"; + echo "table.tbl1 td {margin:0;padding:2px;border-width:0 0 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 ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $kdplg = $_POST['kodeplg']; + + $dbh = mysql_connect(HOST,USER,PASSWORD); + $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(DATABASE,$dbh); + 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)){ + $querydbhA1 = mysql_query("SELECT p.kd_customer,p.alias,p.ktp,p.nama,p.alamat,p.wilayah,DATE_FORMAT(p.tgl_lahir,'%d-%m-%Y') tanggal_lahir,(year(curdate())-year(tgl_lahir)) as umur, + case agama + when 1 then 'Islam' + when 2 then 'Katholik' + when 3 then 'Kristen' + when 4 then 'Budha' + when 5 then 'Hindu' + when 6 then 'Lainnya' + end as agama, + case pekerjaan + when 1 then 'Ibu Rumah Tangga' + when 2 then 'Profesional' + when 3 then 'TNI / POLRI' + when 4 then 'Guru / Dosen' + when 5 then 'Karyawan / Staf BUM Swasta' + when 6 then 'Buruh' + when 7 then 'Pensiunan / Purnawirawan' + when 8 then 'Pegawai Negeri Sipil' + when 9 then 'Pelajar / Mahasiswa' + when 10 then 'Wiraswasta' + when 11 then 'Belum / Tidak Bekerja' + when 12 then 'Karyawan / Staf BUMN / BUMD' + when 13 then 'Pejabat Pemerintah' + when 14 then 'Rohaniawan' + when 15 then 'Seniman' + end as jns_pekerjaan,(select p2.nama from pelanggan p2 where p2.kd_customer=p.upline) nama_upline + FROM pelanggan p + WHERE p.kd_customer = '$kdplg' OR p.alias = '$kdplg'", $dbh); + + //localhost + print("
"); + print(""); + while($rowdbhA1=mysql_fetch_array($querydbhA1)){ + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + } + print("
Kd.Pelanggan$rowdbhA1[kd_customer]Nama$rowdbhA1[nama]Tgl Lahir,Usia$rowdbhA1[tanggal_lahir], $rowdbhA1[umur]thNama Upline$rowdbhA1[nama_upline]
Kd.Kartu$rowdbhA1[alias]Alamat$rowdbhA1[alamat]Agama$rowdbhA1[agama]
No.KTP$rowdbhA1[ktp]$rowdbhA1[wilayah]Pekerjaan$rowdbhA1[jns_pekerjaan]

"); + print "
"; + + print "
"; + print "Transaksi Tunai periode ".encTgl($startDate) ." s/d ".encTgl($endDate).""; + + $tmp_total1 = 0; + $tmp_poin1 = 0; + $tmp_total2 = 0; + $tmp_poin2 = 0; + $tmp_total = 0; + $tmp_poin = 0; + for ($n = 1; $n < 10; $n++){ + $database = '$dbh'.$n; + + if($database == '$dbh1'){ + $data = $dbh1; + }elseif($database == '$dbh2'){ + $data = $dbh2; + }elseif($database == '$dbh3'){ + $data = $dbh3; + }elseif($database == '$dbh4'){ + $data = $dbh4; + }elseif($database == '$dbh5'){ + $data = $dbh5; + }elseif($database == '$dbh6'){ + $data = $dbh6; + }elseif($database == '$dbh7'){ + $data = $dbh7; + }elseif($database == '$dbh8'){ + $data = $dbh8; + }elseif($database == '$dbh9'){ + $data = $dbh9; + } + + $querydbh[$n] = mysql_query("select m.no_nota,m.tgl_nota, m.kd_customer, m.jumlah_total, floor(jumlah_total/100000) poin + FROM m_nota_tunai m, pelanggan p + where m.status_bayar = 'T' + and m.status_nota = 'S' + and m.no_nota_retur = '' + and p.kd_customer = m.kd_customer + and m.kd_customer != '' + and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate' + and (p.kd_customer = '$kdplg' OR p.alias = '$kdplg') + order by m.tgl_nota", $data); + + print(""); + $query = $querydbh[$n]; + while($row=mysql_fetch_array($query)){ + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + $tmp_total1 += $row[jumlah_total]; + $tmp_poin1 += $row[poin]; + } + print("
$row[no_nota]$row[tgl_nota]".number_format($row[jumlah_total],0,',','.')."".number_format($row[poin],0,',','.')."

"); + + } + + print "
"; + print "
"; +// print "
"; +// print "Transaksi Tukar Tambah periode ".encTgl($startDate) ." s/d ".encTgl($endDate).""; +// +// for ($n = 1; $n < 10; $n++){ +// $dtbase = '$dbh'.$n; +// +// if($dtbase == '$dbh1'){ +// $dta = $dbh1; +// }elseif($dtbase == '$dbh2'){ +// $dta = $dbh2; +// }elseif($dtbase == '$dbh3'){ +// $dta = $dbh3; +// }elseif($dtbase == '$dbh4'){ +// $dta = $dbh4; +// }elseif($dtbase == '$dbh5'){ +// $dta = $dbh5; +// }elseif($dtbase == '$dbh6'){ +// $dta = $dbh6; +// }elseif($dtbase == '$dbh7'){ +// $dta = $dbh7; +// }elseif($dtbase == '$dbh8'){ +// $dta = $dbh8; +// }elseif($dtbase == '$dbh9'){ +// $dta = $dbh9; +// } +// +// $querydbhB[$n] = mysql_query("SELECT m.no_nota,m.tgl_nota, m.kd_customer, m.jumlah_total, +// m.no_nota_retur, m.jumlah_total_retur,floor(m.jumlah_total_retur/100000) poin +// FROM m_nota_tunai m, pelanggan p +// WHERE m.status_bayar = 'T' +// and m.no_nota_retur != '' +// and m.status_nota = 'S' +// and m.kd_customer = p.kd_customer +// and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate' +// and (p.kd_customer = '$kdplg' OR p.alias = '$kdplg') +// ORDER BY m.tgl_nota", $dta); +// print(""); +// $querydb = $querydbhB[$n]; +// while($rowdb=mysql_fetch_array($querydb)){ +// print ""; +// print ""; +// print ""; +// print ""; +// print ""; +// print ""; +// print ""; +// $tmp_total2 += $rowdb[jumlah_total_retur]; +// $tmp_poin2 += $rowdb[poin]; +// } +// print("
$rowdb[no_nota]$rowdb[tgl_nota]$rowdb[no_nota_retur]".number_format($rowdb[jumlah_total_retur],0,',','.')."".number_format($rowdb[poin],0,',','.')."

"); +// } +// print "
"; +// +// $tmp_total = $tmp_total1 + $tmp_total2; +// $tmp_poin = $tmp_poin1 + $tmp_poin2; + + print "
"; + print "TOTAL POIN"; + print(""); + print ""; + print ""; + print("
Rupiah Transaksi".number_format($tmp_total1,0,',','.')."
Total POIN".number_format($tmp_poin1,0,',','.')."

"); + print "
"; + + }else{ + echo "Masukkan kode pelanggan"; + } + + ?> +
+
+ +
+ + + diff --git a/old-source/lap_profitperjnspekerjaan.php b/old-source/lap_profitperjnspekerjaan.php new file mode 100644 index 0000000..ea0fdae --- /dev/null +++ b/old-source/lap_profitperjnspekerjaan.php @@ -0,0 +1,120 @@ + + + + Cleopatra + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Report Pelanggan Tunai + "; + 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 ""; + + require_once 'db_login.inc.php'; + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $stmt = $mysqli->query("SELECT case pekerjaan + when 1 then 'Ibu Rumah Tangga' + when 2 then 'Profesional' + when 3 then 'TNI / POLRI' + when 4 then 'Guru / Dosen' + when 5 then 'Karyawan / Staf BUM Swasta' + when 6 then 'Buruh' + when 7 then 'Pensiunan / Purnawirawan' + when 8 then 'Pegawai Negeri Sipil' + when 9 then 'Pelajar / Mahasiswa' + when 10 then 'Wiraswasta' + when 11 then 'Belum / Tidak Bekerja' + when 12 then 'Karyawan / Staf BUMN / BUMD' + when 13 then 'Pejabat Pemerintah' + when 14 then 'Rohaniawan' + when 15 then 'Seniman' + end as jns_pekerjaan,count(m.no_nota) jmlTransaksi,sum(m.jumlah_total) rpTransaksi, hp,sum(m.jumlah_total)-hp bathi, (sum(m.jumlah_total)-hp)/sum(m.jumlah_total)*100 profit + FROM pelanggan p, m_nota_tunai m,(select p.pekerjaan IDpekerjaan,sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_tunai d,m_nota_tunai m, pelanggan p + where d.no_nota = m.no_nota + and p.kd_customer = m.kd_customer + and d.harga_pokok IS NOT NULL + and m.status_nota = 'S' + and date(m.tgl_nota) between '$startDate' and '$endDate' + group by p.pekerjaan + ) tmpDetail + WHERE + p.pekerjaan = tmpDetail.IDpekerjaan + and p.kd_customer = m.kd_customer + and m.status_nota = 'S' + and date(m.tgl_nota) between '$startDate' and '$endDate' + GROUP BY p.pekerjaan + ORDER BY jns_pekerjaan + "); + if($stmt->num_rows > 0) { + print("
"); + print(""); + print(""); + + while($a = $stmt->fetch_array(MYSQLI_ASSOC)) { + $id_pekerjaan = $a['jns_pekerjaan']; + $juml = $a['jmlTransaksi']; + $rp = $a['rpTransaksi']; + $hp = $a['hp']; + $cwan = $a['bathi']; + $profit = $a['profit']; + + print(" + + + "); + } + print("
Jenis PekerjaanJumlah TransaksiRupiah TransaksiTot Hrg PokokLabaProfit
$id_pekerjaan$juml".number_format($rp, 0, ",", ".")."".number_format($hp, 0, ",", ".")."".number_format($cwan, 0, ",", ".")."".number_format($profit, 2, ",", ".")."

"); + print("
"); + + $stmt->close(); + } + $mysqli->close(); + ?> +
+
+ +
+ + + + +?> \ No newline at end of file diff --git a/old-source/lap_profitperplg.php b/old-source/lap_profitperplg.php new file mode 100644 index 0000000..93a6ef1 --- /dev/null +++ b/old-source/lap_profitperplg.php @@ -0,0 +1,115 @@ + + + + Cleopatra + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Report Pelanggan Tunai + "; + 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 ""; + + require_once 'db_login.inc.php'; + $startDate = decTgl($_POST['startDate']); // '2013-07-01' and '2013-08-31' + $endDate = decTgl($_POST['endDate']); + + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $stmt = $mysqli->query("SELECT p.kd_customer,p.nama,sum(floor(m.jumlah_total/100000)) poin,count(m.no_nota) jmlTransaksi,sum(m.jumlah_total) rpTransaksi, tmpDetail.hp,sum(m.jumlah_total)-tmpDetail.hp bathi, (sum(m.jumlah_total)-tmpDetail.hp)/sum(m.jumlah_total)*100 profit + FROM pelanggan p, m_nota_tunai m, + (select p.kd_customer, p.nama,sum(d.jumlah*REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(d.harga_pokok,'B','1'),'R','2'),'A','3'),'W','4'),'N','5'),'F','6'),'O','7'),'X','8'),'E','9'),'S','0')) hp + from d_nota_tunai d,m_nota_tunai m, pelanggan p + where d.no_nota = m.no_nota + and p.kd_customer = m.kd_customer + and d.harga_pokok IS NOT NULL + and m.status_bayar = 'T' + and m.no_nota_retur = '' + and m.kd_customer != '' + and m.status_nota = 'S' + and date(m.tgl_nota) between '$startDate' and '$endDate' + group by p.kd_customer + ) tmpDetail + WHERE + m.status_bayar = 'T' + and m.no_nota_retur = '' + and m.kd_customer != '' + and m.status_nota = 'S' + and p.kd_customer = tmpDetail.kd_customer + and p.kd_customer = m.kd_customer + and date(m.tgl_nota) between '$startDate' and '$endDate' + GROUP BY p.kd_customer + ORDER BY poin DESC + "); + if($stmt->num_rows > 0) { + print("
"); + print(""); + print(""); + + while($a = $stmt->fetch_array(MYSQLI_ASSOC)) { + $kdplg = $a['kd_customer']; + $nama = $a['nama']; + $point = $a['poin']; + $juml = $a['jmlTransaksi']; + $rp = $a['rpTransaksi']; + $hp = $a['hp']; + $cwan = $a['bathi']; + $profit = $a['profit']; + + print(" + + + + + "); + } + print("
Kd.PlgNamaPOINJML Trans.Rp Trans.Tot HPLabaProfit(%)
$kdplg$nama$point$juml".number_format($rp, 0, ",", ".")."".number_format($hp, 0, ",", ".")."".number_format($cwan, 0, ",", ".")."".number_format($profit, 2, ",", ".")."

"); + print("
"); + + $stmt->close(); + } + $mysqli->close(); + ?> +
+
+ +
+ + + + +?> \ No newline at end of file diff --git a/old-source/lap_transaksiperjnspekerjaan.php b/old-source/lap_transaksiperjnspekerjaan.php new file mode 100644 index 0000000..6e3b35e --- /dev/null +++ b/old-source/lap_transaksiperjnspekerjaan.php @@ -0,0 +1,115 @@ + + + + Cleopatra + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Report Pelanggan Tunai + "; + 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 ""; + + require_once 'db_login.inc.php'; + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $stmt = $mysqli->query("select case pekerjaan + when 1 then 'Ibu Rumah Tangga' + when 2 then 'Profesional' + when 3 then 'TNI / POLRI' + when 4 then 'Guru / Dosen' + when 5 then 'Karyawan / Staf BUM Swasta' + when 6 then 'Buruh' + when 7 then 'Pensiunan / Purnawirawan' + when 8 then 'Pegawai Negeri Sipil' + when 9 then 'Pelajar / Mahasiswa' + when 10 then 'Wiraswasta' + when 11 then 'Belum / Tidak Bekerja' + when 12 then 'Karyawan / Staf BUMN / BUMD' + when 13 then 'Pejabat Pemerintah' + when 14 then 'Rohaniawan' + when 15 then 'Seniman' + end as jns_pekerjaan,count(m.no_nota) jmlTransaksi,sum(m.jumlah_total) rpTransaksi + from pelanggan p, m_nota_tunai m + where p.kd_customer = m.kd_customer + and m.status_nota = 'S' + and date(m.tgl_nota) between '$startDate' and '$endDate' + group by p.pekerjaan + order by jns_pekerjaan"); + $totkosong = 0; + $totisi = 0; + if($stmt->num_rows > 0) { + print("
"); + print(""); + print(""); + + while($a = $stmt->fetch_array(MYSQLI_ASSOC)) { + $id_pekerjaan = $a['jns_pekerjaan']; + $juml = $a['jmlTransaksi']; + $rp = $a['rpTransaksi']; + if ($id_pekerjaan == "") + $totkosong += $juml; + else + $totisi += $juml; + + print(""); + + } + print("
Jenis PekerjaanJumlah TransaksiRupiah Transaksi
$id_pekerjaan$juml".number_format($rp, 0, ",", ".")."

"); + print("
"); + $stmt->close(); + } + $prosenkosong = $totkosong/($totkosong+$totisi)*100; + $prosenisi = $totisi/($totkosong+$totisi)*100; + print("Yang kosong = ". $totkosong." =>".number_format($prosenkosong, 2, ",", ".")."%"); + print("
"); + print("Yang isi = ". $totisi." =>".number_format($prosenisi, 2, ",", ".")."%"); + + $mysqli->close(); + ?> +
+
+ +
+ + + + +?> \ No newline at end of file diff --git a/old-source/lapbayar.php b/old-source/lapbayar.php new file mode 100644 index 0000000..ba99002 --- /dev/null +++ b/old-source/lapbayar.php @@ -0,0 +1,358 @@ + + + + + Cleopatra + + + + + + + + + + + +"; + echo "div#divprint{width:950px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:880px;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:9pt;}"; + echo "div.luar{text-align:left;margin-left:80px;}"; + 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 ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + $kodesupp = $_POST['kdsupp']; + + if(bukaKoneksi()){ + global $conn; + ?> +
+ 0){ + mysqli_stmt_bind_result($stmt,$faktur,$tglMsk,$tglNota,$tglTmp,$kdSup,$nmSup,$ttBeli,$ttRp,$ket); + + print("
"); + print("

Rekap Pembelian Per Supplier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("TANGGAL NOTA : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."


"); + print(""); + print(" + "); + + $ttHP = 0; + while(mysqli_stmt_fetch($stmt)){ + $ttHP += $ttRp; + print(" + + + + + "); + ?> + + + + + "); + print("
No. FakturTanggal MasukTanggal NotaTanggal Jt TempoKode Supp.Nama SupplierJumlah PembelianRupiah PembelianKeteranganPelunasan
.$faktur".encTgl($tglMsk)."".encTgl($tglNota)."".encTgl($tglTmp).".$kdSup$nmSup".number_format($ttBeli,0,',','.')."".number_format($ttRp,0,',','.')."$ket +
Total HP Pembelian".number_format($ttHP,0,',','.')."

"); + print("
"); + }else{ + echo "tidak ada data pembelian"; + echo "
"; + } + } + if (!empty($kodesupp)){ + /*----------------------------------------Retur grouping per supplier*/ + $query2 = "SELECT m.no_nota,m.tgl_retur,m.keterangan,m.kd_supplier,u.nama_supplier, + sum( d.jumlah ) jum,sum(d.jumlah*d.harga_satuan) hp + FROM d_retur_beli d, m_retur_beli m, supplier u,barang b + WHERE d.id_retur = m.id_retur + AND b.kode_barang = d.kd_barang + AND u.kd_supplier = m.kd_supplier + AND m.tgl_retur BETWEEN '$startDate' AND '$endDate' + AND m.kd_supplier = '$kodesupp' + AND m.validasi = '1' + AND m.status_bayar = '0' + GROUP BY m.no_nota + ORDER BY m.tgl_retur"; + } + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$nota,$tglretur,$ketr,$kdsupplier,$nmsupplier,$jmlret,$rpret); + + print("
"); + print("

Rekap Retur Per Supplier



"); + print("
TOKO ".$_SESSION['namatoko']."
"); + print("TANGGAL MASUK : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."


"); + print(""); + print(" + + "); + + $ttHP2 = 0; + while(mysqli_stmt_fetch($stmt2)){ + $ttHP2 += $rpret; + print(""); + ?> + + + "); + print("
No.NotaTgl ReturKode Supp.Nama SupplierJumlah ReturRupiah ReturKeteranganPelunasan
.$nota".encTgl($tglretur)."$kdsupplier$nmsupplier$jmlret".number_format($rpret,0,',','.')."$ketr +
Total HP Retur".number_format($ttHP2,0,',','.')."

"); + print("
"); + }else{ + echo "tidak ada data retur"; + echo "
"; + } + } + +?> + +
+

Form Pembayaran



+
+ + + + + + + + + + + " /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Periode Tgl Faktur:
Tgl Pembayaran:
Supplier:
Jenis Pembayaran: +
: + +
: +
Total Pembelian - Retur: + + + + +
+
+
+ Penyesuaian +
Diskon: Rp.
Penyesuaian: Rp.
Materai: Rp.
+
+
Total Pembayaran Supplier: + +
+ +
+ +
+ + +

"); + } + +?> diff --git a/old-source/lapbayarpersup.php b/old-source/lapbayarpersup.php new file mode 100644 index 0000000..fc275f3 --- /dev/null +++ b/old-source/lapbayarpersup.php @@ -0,0 +1,82 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan Pembayaran Rinci Per Supplier +
+
+
+ + +
Range Tanggal: s/d
+
+
+
+
+
+ +
+ + \ No newline at end of file diff --git a/old-source/lapbayarpersupp.php b/old-source/lapbayarpersupp.php new file mode 100644 index 0000000..6f227d3 --- /dev/null +++ b/old-source/lapbayarpersupp.php @@ -0,0 +1,154 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:700px;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:9pt;}"; + 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 ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + + if(bukaKoneksi()){ + global $conn; + + /*----------------------------------------Laporan pembayaran per supplier*/ + $query = "SELECT + s.kd_supplier,nama_supplier,a.jenis_bayar,a.totalbayartunai,b.totalbayargiro, c.totalbayartransfer + FROM + supplier s + LEFT JOIN + (SELECT kd_supplier,jenis_bayar,tgl_bayar,SUM(total_bayar)totalbayartunai FROM bayar WHERE jenis_bayar = 'cash' AND kd_supplier != '' AND DATE(tgl_cair) BETWEEN '$startDate' AND '$endDate' GROUP BY kd_supplier)a + ON s.`kd_supplier` = a.kd_supplier + LEFT JOIN + (SELECT kd_supplier,SUM(total_bayar)totalbayargiro FROM bayar WHERE jenis_bayar = 'giro' AND kd_supplier != '' AND DATE(tgl_cair) BETWEEN '$startDate' AND '$endDate' GROUP BY kd_supplier)b + ON s.kd_supplier = b.kd_supplier + LEFT JOIN + (SELECT kd_supplier,SUM(total_bayar)totalbayartransfer FROM bayar WHERE jenis_bayar = 'transfer' AND kd_supplier != '' AND DATE(tgl_cair) BETWEEN '$startDate' AND '$endDate' GROUP BY kd_supplier)c + ON s.kd_supplier = c.kd_supplier + where a.totalbayartunai is not null + or b.totalbayargiro is not null + or c.totalbayartransfer is not null"; + + + + + + // "SELECT b.kd_supplier,b.jenis_bayar,s.nama_supplier,b.tgl_bayar,b.total_bayar from bayar b + // join + // supplier s on b.kd_supplier=s.kd_supplier + // where b.kd_supplier != '' AND tgl_bayar BETWEEN '$startDate' AND '$endDate' group by tgl_bayar order by kd_supplier,tgl_bayar,jenis_bayar"; + + + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kd_supplier,$namasupp,$jnsbyr,$totalbayartunai,$totalbayargiro,$totalbayartransfer); + //mysqli_stmt_bind_result($stmt,$kd_supplier,$jnsbyr,$namasupp,$tgl_bayar,$totalbyr); + + print("
"); + print("

Laporan Jumlah Pembayaran Berdasarkan Jenis Bayar per Supplier


"); + print("PADA TANGGAL : ".encTgl($startDate) ." s/d ".encTgl($endDate)."

"); + /*iprint("
TOKO ".$_SESSION['namatoko']."
"); + print("TANGGAL MASUK : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."


");*/ + print(""); + print(" + "); + + $ttHP = 0; + $totalbyrtunai=0; + $totalbyrgiro=0; + $totalbyrtransfer=0; + while(mysqli_stmt_fetch($stmt)){ + + IF($kd_supplier != ""){ + print(""); + $totalbyrtunai+=$totalbayartunai; + $totalbyrgiro+=$totalbayargiro; + $totalbyrtransfer+=$totalbayartransfer; + } + + // } + /*if($kd_supplier != ""){ + IF($jnsbyr == "cash" ){ + + print(""); + $totalbyrtunai+=$totalbyr; + } + + IF($jnsbyr == "giro"){ + print(""); + $totalbyrgiro+=$totalbyr; + } + + IF($jnsbyr == "transfer" ){ + print(""); + $totalbyrtransfer+=$totalbyr; + } + + }*/ + + //} + + + + /* if($kd_supplier != ""){ + IF($jnsbyr == "cash" ){ + + print(""); + //$totalbyrtunai+=$totalbayartunai; + $totalbyrtunai+=intval($totalbayartunai); + + } + + IF($jnsbyr == "giro"){ + print(""); + //$totalbyrgiro+=$totalbayargiro; + $totalbyrgiro+=intval($totalbayargiro); + } + + IF($jnsbyr == "transfer"){ + print(""); + $totalbyrtransfer+=$totalbayartransfer; + //$totalbyrtransfer+=intval($totalbayartransfer); + + } + + } */ + + } + + + print(""); + + + /*print("");*/ + print("
Kode SupplierNama SupplierTotal Bayar TunaiTotal Bayar GiroTotal Bayar Transfer
$kd_supplier$namasupp".number_format($totalbayartunai,0,',','.')."".number_format($totalbayargiro,0,',','.')."".number_format($totalbayartransfer,0,',','.')."
$kd_supplier$namasupp$tgl_bayar".number_format($totalbyr,0,',','.')."".number_format(0,0,',','.')."".number_format(0,0,',','.')."
$kd_supplier$namasupp$tgl_bayar".number_format(0,0,',','.')."".number_format($totalbyr,0,',','.')."".number_format(0,0,',','.')."
$kd_supplier$namasupp$tgl_bayar".number_format(0,0,',','.')."".number_format(0,0,',','.')."".number_format($totalbyr,0,',','.')."
$kd_supplier$namasupp".number_format($totalbayartunai,0,',','.')."".number_format($totalbayargiro,0,',','.')."".number_format($totalbayartransfer,0,',','.')."
$kd_supplier$namasupp".number_format($totalbayargiro,0,',','.')."".number_format($totalbayargiro,0,',','.')."".number_format($totalbayartransfer,0,',','.')."
$kd_supplier$namasupp".number_format($totalbayartransfer,0,',','.')."".number_format($totalbayargiro,0,',','.')."".number_format($totalbayartransfer,0,',','.')."
Sub Total".number_format($totalbyrtunai, 0, ",", ".")."".number_format($totalbyrgiro, 0, ",", ".")."".number_format($totalbyrtransfer, 0, ",", ".")."
Total Pembayaran".number_format($ttHP,0,',','.')."

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } +} +?> diff --git a/old-source/laprincbayarpersupp.php b/old-source/laprincbayarpersupp.php new file mode 100644 index 0000000..1ccf1e4 --- /dev/null +++ b/old-source/laprincbayarpersupp.php @@ -0,0 +1,117 @@ +"; + echo "div#divprint{width:850px; border:1px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:700px;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:9pt;}"; + 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 ""; + + $startDate = decTgl($_POST['startDate']); + $endDate = decTgl($_POST['endDate']); + + + if(bukaKoneksi()){ + global $conn; + + /*----------------------------------------Laporan pembayaran per supplier*/ + $query = /*"SELECT + a.kd_supplier,a.jenis_bayar,nama_supplier,a.tgl_bayar,a.totalbayartunai,b.totalbayargiro, c.totalbayartransfer + FROM + supplier s + LEFT JOIN + (SELECT kd_supplier,jenis_bayar,tgl_bayar,total_bayar as totalbayartunai FROM bayar WHERE jenis_bayar = 'cash' AND kd_supplier != '' AND tgl_bayar BETWEEN '$startDate' AND '$endDate' order by jenis_bayar,tgl_bayar)a + ON s.`kd_supplier` = a.kd_supplier + LEFT JOIN + (SELECT kd_supplier,tgl_bayar,total_bayar as totalbayargiro FROM bayar WHERE jenis_bayar = 'giro' AND kd_supplier != '' AND tgl_bayar BETWEEN '$startDate' AND '$endDate' order by jenis_bayar,tgl_bayar)b + ON s.kd_supplier = b.kd_supplier + LEFT JOIN + (SELECT kd_supplier,tgl_bayar,total_bayar as totalbayartransfer FROM bayar WHERE jenis_bayar = 'transfer' AND kd_supplier != '' AND tgl_bayar BETWEEN '$startDate' AND '$endDate'order by jenis_bayar,tgl_bayar)c + ON s.kd_supplier = c.kd_supplier";*/ + + "SELECT b.kd_supplier,b.jenis_bayar,s.nama_supplier,b.tgl_cair,b.total_bayar from bayar b + join + supplier s on b.kd_supplier=s.kd_supplier + where b.kd_supplier != '' AND date(tgl_cair) BETWEEN '$startDate' AND '$endDate' + order by tgl_cair,kd_supplier,jenis_bayar"; + + + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + /*mysqli_stmt_bind_result($stmt,$kd_supplier,$jnsbyr,$namasupp,$tgl_bayar,$totalbayartunai,$totalbayargiro,$totalbayartransfer);*/ + mysqli_stmt_bind_result($stmt,$kd_supplier,$jnsbyr,$namasupp,$tgl_cair,$totalbyr); + + print("
"); + print("

Laporan Jumlah Pembayaran Rinci per Jenis Bayar per Supplier


"); + print("PADA TANGGAL : ".encTgl($startDate) ." s/d ".encTgl($endDate)."

"); + /*iprint("
TOKO ".$_SESSION['namatoko']."
"); + print("TANGGAL MASUK : ".encTgl($startDate) ." s/d ".encTgl($endDate)."
"); + print("DICETAK TANGGAL : ".date('d-m-Y')." ". date('H:i:s')."


");*/ + print(""); + print(" + "); + + $ttHP = 0; + $totalbyrtunai=0; + $totalbyrgiro=0; + $totalbyrtransfer=0; + while(mysqli_stmt_fetch($stmt)){ + $ttHP += $hp; + /* IF($kd_supplier != ""){ + print(""); + } + + }*/ + if($kd_supplier != ""){ + IF($jnsbyr == "cash" ){ + + print(""); + $totalbyrtunai+=$totalbyr; + } + + IF($jnsbyr == "giro"){ + print(""); + $totalbyrgiro+=$totalbyr; + } + + IF($jnsbyr == "transfer" ){ + print(""); + $totalbyrtransfer+=$totalbyr; + } + + } + + } + + //$ttjmlh=sum($totalbyr); + print(""); + + + /*print("");*/ + print("
Tanggal BayarKode SupplierNama SupplierTotal Bayar TunaiTotal Bayar GiroTotal Bayar Transfer
$kd_supplier$namasupp$tgl_bayar".number_format($totalbayartunai,0,',','.')."".number_format($totalbayargiro,0,',','.')."".number_format($totalbayartransfer,0,',','.')."
$tgl_cair$kd_supplier$namasupp".number_format($totalbyr,0,',','.')."".number_format(0,0,',','.')."".number_format(0,0,',','.')."
$tgl_cair$kd_supplier$namasupp".number_format(0,0,',','.')."".number_format($totalbyr,0,',','.')."".number_format(0,0,',','.')."
$tgl_cair$kd_supplier$namasupp".number_format(0,0,',','.')."".number_format(0,0,',','.')."".number_format($totalbyr,0,',','.')."
Sub Total".number_format($totalbyrtunai, 0, ",", ".")."".number_format($totalbyrgiro, 0, ",", ".")."".number_format($totalbyrtransfer, 0, ",", ".")."
Total Pembayaran".number_format($ttHP,0,',','.')."

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } +} +?> diff --git a/old-source/login.php b/old-source/login.php new file mode 100644 index 0000000..261395a --- /dev/null +++ b/old-source/login.php @@ -0,0 +1,37 @@ +query("SELECT * FROM karyawan WHERE username='$user' AND password='$pass'"); +if($perintah->num_rows > 0) { + + while($row = $perintah->fetch_array(MYSQLI_ASSOC)) { + + $updatelogin = $mysqli->query("UPDATE karyawan SET last_login = now() WHERE username='$user' AND password='$pass'"); +// session_register("useracc"); +// session_register("nik"); +// session_register("job"); +// session_register("validUser"); +// session_register("namatoko"); + $_SESSION["useracc"]=$row['username']; + $_SESSION["nik"]=$row['nik']; + $_SESSION["job"]=$row['id_pekerjaan']; + $_SESSION["namatoko"] = getNmToko($user,$pass); + $_SESSION["validUser"] = TRUE; + header("location:./pelanggan.php"); + + } + +}else{ + + header("location:./index.php"); + exit(); +} + +?> diff --git a/old-source/logout.php b/old-source/logout.php new file mode 100644 index 0000000..3d898f7 --- /dev/null +++ b/old-source/logout.php @@ -0,0 +1,20 @@ +alert('$message');"; + echo ""; + +?> diff --git a/old-source/menu.php b/old-source/menu.php new file mode 100644 index 0000000..c0e3eb8 --- /dev/null +++ b/old-source/menu.php @@ -0,0 +1,133 @@ + + + + + +
+ +
diff --git a/old-source/pelanggan.php b/old-source/pelanggan.php new file mode 100644 index 0000000..8f65238 --- /dev/null +++ b/old-source/pelanggan.php @@ -0,0 +1,270 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Pelanggan Baru +
+ + query("SELECT kd_customer FROM pelanggan ORDER BY kd_customer DESC limit 1"); + $dt = $data->fetch_array(MYSQLI_ASSOC); + $nourut = $dt['kd_customer']; + $nourut++; + + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Kode Pelanggan: + + + +
No.KTP: *
Nama: * +
Jenis Kelamin: + +
Tempat Tanggal Lahir: , + +
Status Nikah: + +
Agama: + +
Alamat: *
Wilayah: kelurahan,kecamatan,kabupaten,propinsi
Telepon:
HP:
E-mail:
Jenis Pelanggan: + +
Pekerjaan: + +
Upline: +
Nilai BON:
Batas BON:
Batas BON Istimewa:
Komisi:
Komisi yang diambil:

+ + +
+
+
+ +
+ close(); ?> + +
+
Cari Pelanggan
+
+
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+
+ +
+ +
+
Cari Pelanggan
+
+
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+
+ +
+ + diff --git a/old-source/plgjobkosong.php b/old-source/plgjobkosong.php new file mode 100644 index 0000000..66668b6 --- /dev/null +++ b/old-source/plgjobkosong.php @@ -0,0 +1,78 @@ + + + + Pelanggan + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Pelanggan yg jenis pekerjaannya kosong + "; + 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 ""; + + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $stmt = $mysqli->query("SELECT p.`kd_customer`, p.`nama`, p.`alamat`, p.`kd_lokasi`, p.`telp` FROM pelanggan p where pekerjaan = '' or pekerjaan = '-' or pekerjaan is null"); + if($stmt->num_rows > 0) { + print("
"); + print(""); + print(""); + + while($a = $stmt->fetch_array(MYSQLI_ASSOC)) { + $kd_customer = $a['kd_customer']; + $nama = $a['nama']; + $alamat = $a['alamat']; + $wilayah = $a['wilayah']; + $telp = $a['telp']; + + print(""); + } + print("
Kode PelangganNamaAlamatWilayahTelp
$kd_customer$nama$alamat$wilayah$telp

"); + print("
"); + + $stmt->close(); + } + $mysqli->close(); + ?> +
+
+ +
+ + + + +?> \ No newline at end of file diff --git a/old-source/plgperjnspekerjaan.php b/old-source/plgperjnspekerjaan.php new file mode 100644 index 0000000..9fbe1d0 --- /dev/null +++ b/old-source/plgperjnspekerjaan.php @@ -0,0 +1,94 @@ + + + + Pelanggan + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Report 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 ""; + + require_once 'db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $stmt = $mysqli->query("select pekerjaan, + case pekerjaan + when 1 then 'Ibu Rumah Tangga' + when 2 then 'Profesional' + when 3 then 'TNI / POLRI' + when 4 then 'Guru / Dosen' + when 5 then 'Karyawan / Staf BUM Swasta' + when 6 then 'Buruh' + when 7 then 'Pensiunan / Purnawirawan' + when 8 then 'Pegawai Negeri Sipil' + when 9 then 'Pelajar / Mahasiswa' + when 10 then 'Wiraswasta' + when 11 then 'Belum / Tidak Bekerja' + when 12 then 'Karyawan / Staf BUMN / BUMD' + when 13 then 'Pejabat Pemerintah' + when 14 then 'Rohaniawan' + when 15 then 'Seniman' + end as jns_pekerjaan, count(*) jml + from pelanggan + group by pekerjaan + order by jns_pekerjaan"); + if($stmt->num_rows > 0) { + print("
"); + print(""); + print(""); + + while($a = $stmt->fetch_array(MYSQLI_ASSOC)) { + $id_pekerjaan = $a['jns_pekerjaan']; + $juml = $a['jml']; + + print(""); + } + print("
Jenis PekerjaanJumlah
$id_pekerjaan$juml

"); + print("
"); + + $stmt->close(); + } + $mysqli->close(); + ?> +
+
+ +
+ + + + +?> \ No newline at end of file diff --git a/old-source/poinplg.php b/old-source/poinplg.php new file mode 100644 index 0000000..6116bff --- /dev/null +++ b/old-source/poinplg.php @@ -0,0 +1,58 @@ + + + + Pelanggan + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ + + +
Kode Pelanggan:
+
+
+
+ +
+ +
+ + + diff --git a/old-source/proses_lini.php b/old-source/proses_lini.php new file mode 100644 index 0000000..237333a --- /dev/null +++ b/old-source/proses_lini.php @@ -0,0 +1,24 @@ + + + + + + + + + + + +
+
diff --git a/old-source/proses_negara.php b/old-source/proses_negara.php new file mode 100644 index 0000000..874b203 --- /dev/null +++ b/old-source/proses_negara.php @@ -0,0 +1,18 @@ + diff --git a/old-source/proses_supp.php b/old-source/proses_supp.php new file mode 100644 index 0000000..2cb3f3c --- /dev/null +++ b/old-source/proses_supp.php @@ -0,0 +1,21 @@ + diff --git a/old-source/purchase.php b/old-source/purchase.php new file mode 100644 index 0000000..4c817a7 --- /dev/null +++ b/old-source/purchase.php @@ -0,0 +1,259 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Data Pengadaan Barang +
+ + + + + + + + + + + + + + + +
Nomor Faktur: + + + Tanggal Nota: Tanggal Jatuh Tempo: *
Kode Supplier: + + User: " readonly />* perhitungan berdasarkan tgl nota
Status + : +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Barcode: *ID Barang: + +
Nama barang: * +
Group Product: + +
Sub Group Product: + +
Hrg Pokok Lama: Pcs Max II: Pcs Max III:
Hrg Jual Lama: Harga Jual II: Harga Jual III:
Satuan: + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Jumlah Beli: * Diskon %: % PPN: Hrg Pokok Baru: Expired Date: +
Sub Total: * Diskon Rp: % Profit: Hrg Jual Baru:
+
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+
Cari barang
+
+
+
+ + + + +
Barcode/Nama Brg:
+
+
+ Hasil pencarian +
+
+
+
+ +
+ + + diff --git a/old-source/rak.php b/old-source/rak.php new file mode 100644 index 0000000..00cf693 --- /dev/null +++ b/old-source/rak.php @@ -0,0 +1,92 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Rak +
+ + + + + + + + + + + +
ID Rak: + + + + +
Nama Rak: + +

+ +
+
+
+ +
+ +
+
Cari Rak
+
+ +
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + diff --git a/old-source/report_profitperjnspekerjaan.php b/old-source/report_profitperjnspekerjaan.php new file mode 100644 index 0000000..74ece99 --- /dev/null +++ b/old-source/report_profitperjnspekerjaan.php @@ -0,0 +1,70 @@ + + + + Cleopatra + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ + +
Range Tanggal: s/d
+
+
+
+ +
+ +
+ + + diff --git a/old-source/report_profitperplg.php b/old-source/report_profitperplg.php new file mode 100644 index 0000000..209a4da --- /dev/null +++ b/old-source/report_profitperplg.php @@ -0,0 +1,70 @@ + + + + Cleopatra + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ + +
Range Tanggal: s/d
+
+
+
+ +
+ +
+ + + diff --git a/old-source/report_transaksiperjnspekerjaan.php b/old-source/report_transaksiperjnspekerjaan.php new file mode 100644 index 0000000..0bc4f33 --- /dev/null +++ b/old-source/report_transaksiperjnspekerjaan.php @@ -0,0 +1,70 @@ + + + + Cleopatra + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ + +
Range Tanggal: s/d
+
+
+
+ +
+ +
+ + + diff --git a/old-source/retur_beli (copy)/ambil_barang.php b/old-source/retur_beli (copy)/ambil_barang.php new file mode 100644 index 0000000..2918d10 --- /dev/null +++ b/old-source/retur_beli (copy)/ambil_barang.php @@ -0,0 +1,51 @@ +query("SELECT brg.kode_barang,brg.kode_supplier,d.no_faktur,d.kode_asli,brg.nama_barang,n.harga_pokok, n.harga_jual, n.stok, n.nomor + FROM barang brg inner join no_barang n on brg.id_gabungan = n.id_gabungan,d_pembelian d + WHERE n.nomor = '$_REQUEST[nobarang]' + AND (brg.kode_barang = '$_REQUEST[idbarang]' OR brg.kode_lama = '$_REQUEST[idbarang]') + AND (d.kode_barang = brg.kode_barang AND d.nomor = n.nomor) + AND left(d.no_faktur,4) <> 'RVB-' + AND n.stok > 0 + ORDER BY brg.kode_barang,n.nomor"); + } else if(!isset($_REQUEST['nobarang'])) + { + $data = $mysqli->query("SELECT brg.kode_barang,brg.kode_supplier,d.no_faktur,d.kode_asli,brg.nama_barang,n.harga_pokok, n.harga_jual, n.stok, n.nomor + FROM barang brg inner join no_barang n on brg.id_gabungan = n.id_gabungan,d_pembelian d + WHERE (brg.kode_barang = '$_REQUEST[idbarang]' OR brg.kode_lama = '$_REQUEST[idbarang]') + AND (brg.kode_barang = d.kode_barang AND d.nomor = n.nomor) + AND left(d.no_faktur,4) <> 'RVB-' + AND n.stok > 0 + ORDER BY brg.kode_barang,n.nomor"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'],'kode_supp' => $a['kode_supplier'],'no_faktur' => $a['no_faktur'],'kode_asli' => $a['kode_asli'],'nama_barang' => $a['nama_barang'], + 'harga_beli' => $a['harga_pokok'],'harga_jual' => $a['harga_jual'], 'stok' => $a['stok'], 'nomor_barang' => $a['nomor'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/retur_beli (copy)/ambil_barang_kembali.php b/old-source/retur_beli (copy)/ambil_barang_kembali.php new file mode 100644 index 0000000..a6a95fb --- /dev/null +++ b/old-source/retur_beli (copy)/ambil_barang_kembali.php @@ -0,0 +1,49 @@ +query("SELECT brg.kode_barang,brg.kode_supplier,d.no_faktur,d.kode_asli,brg.nama_barang,n.harga_pokok, n.harga_jual, n.stok, n.nomor + FROM barang brg inner join no_barang n on brg.id_gabungan = n.id_gabungan,d_pembelian d + WHERE n.nomor = '$_REQUEST[nobarang]' + AND brg.kode_barang = '$_REQUEST[idbarang]' + AND (d.kode_barang = brg.kode_barang AND d.nomor = n.nomor) + AND left(d.no_faktur,4) <> 'RVB-' + ORDER BY brg.kode_barang,n.nomor"); + } else if(!isset($_REQUEST['nobarang'])) + { + $data = $mysqli->query("SELECT brg.kode_barang,brg.kode_supplier,d.no_faktur,d.kode_asli,brg.nama_barang,n.harga_pokok, n.harga_jual, n.stok, n.nomor + FROM barang brg inner join no_barang n on brg.id_gabungan = n.id_gabungan,d_pembelian d + WHERE brg.kode_barang = '$_REQUEST[idbarang]' + AND (brg.kode_barang = d.kode_barang AND d.nomor = n.nomor) + AND left(d.no_faktur,4) <> 'RVB-' + ORDER BY brg.kode_barang,n.nomor"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'],'kode_supp' => $a['kode_supplier'],'no_faktur' => $a['no_faktur'],'kode_asli' => $a['kode_asli'],'nama_barang' => $a['nama_barang'], + 'harga_beli' => $a['harga_pokok'],'harga_jual' => $a['harga_jual'], 'stok' => $a['stok'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/retur_beli (copy)/ambil_kode_barang.php b/old-source/retur_beli (copy)/ambil_kode_barang.php new file mode 100644 index 0000000..c918f36 --- /dev/null +++ b/old-source/retur_beli (copy)/ambil_kode_barang.php @@ -0,0 +1,53 @@ +query("SELECT DISTINCT d.kode_barang, m.kd_supplier, b.nama_barang, sup.nama_supplier, + m.tgl_nota, m.tgl_masuk, m.tgl_jatuh_tempo, m.status, m.keterangan, m.nik + FROM m_pembelian m, d_pembelian d, barang b, supplier sup, no_barang n + WHERE m.no_faktur = d.no_faktur + AND d.kode_barang = b.kode_barang + AND b.id_gabungan = n.id_gabungan + AND m.kd_supplier = sup.kd_supplier + AND n.stok > 0 + AND m.no_faktur='$_REQUEST[nofaktur]' + ORDER BY d.kode_barang"); + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + $jdata = $mysqli->query("SELECT count(*) + FROM m_pembelian m, d_pembelian d, barang b, supplier sup, no_barang n + WHERE m.no_faktur = d.no_faktur + AND d.kode_barang = b.kode_barang + AND b.id_gabungan = n.id_gabungan + AND m.kd_supplier = sup.kd_supplier + AND n.stok > 0 + AND m.no_faktur='$_REQUEST[nofaktur]'"); + $j = $jdata->fetch_array(MYSQL_NUM); + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'], 'kd_supplier' => $a['kd_supplier'], + 'nama_barang' => $a['nama_barang'], 'supplier' => $a['nama_supplier'], + 'tglnota' => $a['tgl_nota'],'tglmasuk' => $a['tgl_masuk'],'tgljthtempo' => $a['tgl_jatuh_tempo'], + 'status' => $a['status'],'keterangan' => $a['keterangan'],'nik' => $a['nik'], + 'jdata' => $j[0] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/retur_beli (copy)/ambil_nomor.php b/old-source/retur_beli (copy)/ambil_nomor.php new file mode 100644 index 0000000..b5c6157 --- /dev/null +++ b/old-source/retur_beli (copy)/ambil_nomor.php @@ -0,0 +1,36 @@ +query("SELECT DISTINCT nomor FROM d_pembelian WHERE kode_barang='$_REQUEST[idbarang]' ORDER BY nomor"); + $data = $mysqli->query("SELECT n.nomor FROM d_pembelian d, no_barang n, barang b + WHERE (b.kode_barang ='$_REQUEST[idbarang]' OR b.kode_lama = '$_REQUEST[idbarang]') + AND b.id_gabungan = n.id_gabungan + AND (d.kode_barang = b.kode_barang and d.nomor = n.nomor) + AND left(d.no_faktur,4) <> 'RVB-' + AND n.stok > 0 + ORDER BY nomor"); + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_NUM)) + { + $harray[$idx] = array('nomor' => $a[0]); + $idx++; + } + } + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/retur_beli (copy)/cari_nota.php b/old-source/retur_beli (copy)/cari_nota.php new file mode 100644 index 0000000..cd4d735 --- /dev/null +++ b/old-source/retur_beli (copy)/cari_nota.php @@ -0,0 +1,94 @@ +query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur != "" && $tglawal != "" && $tglakhir != "" && $kdsup == "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur != "" && $tglawal == "" && $tglakhir == "" && $kdsup != "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur != "" && $tglawal == "" && $tglakhir == "" && $kdsup == "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur == "" && $tglawal != "" && $tglakhir != "" && $kdsup != "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur == "" && $tglawal != "" && $tglakhir != "" && $kdsup == "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur == "" && $tglawal == "" && $tglakhir == "" && $kdsup != "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + + $harray[$idx] = array( + 'no_faktur' => $a['no_faktur'], 'tgl_nota' => substr($a['tgl_nota'],8,2)."-".substr($a['tgl_nota'],5,2)."-".substr($a['tgl_nota'],0,4), 'rp_beli' => $a['rp_beli'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/retur_beli (copy)/fungsi_retur.php b/old-source/retur_beli (copy)/fungsi_retur.php new file mode 100644 index 0000000..9bd5d44 --- /dev/null +++ b/old-source/retur_beli (copy)/fungsi_retur.php @@ -0,0 +1,567 @@ + ".$nofaktur; + $stmt = $mysqli->prepare("INSERT INTO m_pembelian VALUES (?, now(), now(), '-', now(), ?, 'T', 0, ?, ?, 0, '1', '$ket', now(), ?, ?)"); + $stmt->bind_param("sssiss", $norhp, $kd_supplier, $nik, $rpbeli, $nofaktur, $statusrvb); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} + +function insert_d_pembelian($norhp, $kode_barang, $kode_lama, $nomor, $stok, $stokrev, $hplama, $hjlama, $hpbaru, $hjbaru, $nama, $idgabungan) +{ + $hasil = FALSE; + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if(!mysqli_connect_errno()) + { + for ($i = 0; $i < count($kode_barang); $i++) + { + /* insert data lama */ + $hplm = decode_hp($hplama[$i]); + $profitlama = ceil((($hjlama[$i] - $hplm) / $hplm) * 100); + $stoklama = -1 * $stok[$i]; + $faktur_asli = get_kode_faktur_asli($kode_barang[$i]); + $stmt = $mysqli->prepare("INSERT INTO d_pembelian(no_faktur, kode_barang, kode_baranglama, nomor, jumlah, harga_satuan, harga_pokok, harga_jual, profit, kode_asli, jum_fisik, jenis, lokasi, hj_final, nm_brg) + VALUES (?, ?, ?, ?, ?, 0, ?, ?, ?, '-', ?, 'S', '1A', ?, ?)"); + $stmt->bind_param("ssssisiiiis", $norhp, $kode_barang[$i], $kode_lama[$i], $nomor[$i], $stoklama, $hplama[$i], $hjlama[$i], $profitlama, $stoklama, $hjlama[$i], $nama[$i]); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + + /* insert data baru */ + if ($hasil) + { + $hpbr = decode_hp($hpbaru[$i]); + $profitbaru = ceil((($hjbaru[$i] - $hpbr) / $hpbr) * 100); + $stmt = $mysqli->prepare("INSERT INTO d_pembelian(no_faktur, kode_barang, kode_baranglama, nomor, jumlah, harga_satuan, harga_pokok, harga_jual, profit, kode_asli, jum_fisik, jenis, lokasi, hj_final, nm_brg) + VALUES (?, ?, ?, ?, ?, 0, ?, ?, ?, '-', ?, 'S', '1A', ?, ?)"); + $stmt->bind_param("ssssisiiiis", $norhp, $kode_barang[$i], $kode_lama[$i], $nomor[$i], $stokrev[$i], $hpbaru[$i], $hjbaru[$i], $profitbaru, $stokrev[$i], $hjbaru[$i], $nama[$i]); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* update barang*/ + if ($hasil) + { + $update2 = update_barang($idgabungan[$i], $nama[$i]); + if($update2) + { + $hasil = TRUE; + } else + { + $hasil = FALSE; + } + } + + /* update no_barang*/ + if ($hasil) + { + $update = update_no_barang($idgabungan[$i], $nomor[$i], $hpbaru[$i], $hjbaru[$i], $stokrev[$i]); + if($update) + { + $hasil = TRUE; + } else + { + $hasil = FALSE; + } + } + $faktur_asli = ""; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} + +/** + * + * @param $id + * @param $nomor + * @param $hp + * @param $hj + * @return unknown_type + */ +function update_no_barang($id, $nomor, $hp, $hj, $stokrev) +{ + $hasil = FALSE; + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if(!mysqli_connect_errno()) + { + // isi table master + $stmt = $mysqli->prepare("UPDATE no_barang SET stok = ?,harga_pokok = ?, harga_jual = ? WHERE id_gabungan = ? AND nomor = ?"); + $stmt->bind_param("isiss", $stokrev, $hp, $hj, $id, $nomor); + $stmt->execute(); + if($stmt->affected_rows >= 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} + +function update_barang($id, $nama) +{ + $hasil = FALSE; + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if(!mysqli_connect_errno()) + { + // isi table master + $stmt = $mysqli->prepare("UPDATE barang SET nama_barang = ? WHERE id_gabungan = ?"); + $stmt->bind_param("ss", $nama, $id); + $stmt->execute(); + if($stmt->affected_rows >= 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} +/** + * + * @param $kdsupplier + * @return unknown_type + */ +function get_no_rhp($kdsupplier) +{ + $urutbaru = 0; + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + // cek ada atau tidak + if(cek_data($kdsupplier)) + { + $data_faktur = $mysqli->query("SELECT MAX(RIGHT(no_faktur, 3)) FROM m_pembelian WHERE LEFT(no_faktur, 10) = 'RVB-{$kdsupplier}'"); + if($data_faktur->num_rows > 0) + { + $urut = $data_faktur->fetch_array(); + $urutbaru = (int)$urut[0] + 1; + if(strlen($urutbaru) == 1) + { + $urutbaru = "00".$urutbaru; + } + if(strlen($urutbaru) == 2) + { + $urutbaru = "0".$urutbaru; + } + /* tutup hasil query */ + $data_faktur->close(); + } + } else + { + $urutbaru = "000"; + } + $hasil[0] = "RVB-".$kdsupplier."-".$urutbaru; + echo json_encode($hasil); + /* tutup koneksi */ + $mysqli->close(); +} + +/** + * + * @param $kodesupplier + * @return unknown_type + */ +function cek_data($kodesupplier) +{ + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + // cek ada atau tidak + $data = $mysqli->query("SELECT COUNT(*) FROM m_pembelian WHERE LEFT(no_faktur, 10) = 'RVB-{$kodesupplier}'"); + $dt = $data->fetch_array(); + if($dt[0] > 0) + { + return true; + } else + { + return false; + } + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); +} + +/** + * + * @param $kode + * @param $nomor + * @param $kd_supplier + * @return unknown_type + */ +function ambil_barang($kode, $nomor, $nofaktur) +{ + if($kode != "" || $nomor != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if($nomor != "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.kode_lama, brg.nama_barang, brg.id_gabungan, nb.stok, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, supplier s, d_pembelian dp + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND brg.kode_barang = '{$kode}' AND nb.nomor = '{$nomor}' + AND brg.kode_supplier = s.kd_supplier AND dp.no_faktur = '{$nofaktur}' LIMIT 1"); + } else if($nomor == "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.kode_lama, brg.nama_barang, brg.id_gabungan, nb.stok, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, supplier s, d_pembelian dp + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND brg.kode_barang = '{$kode}' + AND brg.kode_supplier = s.kd_supplier AND dp.no_faktur = '{$nofaktur}' LIMIT 1"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('kode_barang' => $a['kode_barang'], 'kode_lama' => $a['kode_lama'], 'nama_barang' => $a['nama_barang'], + 'supplier' => $a['nama_supplier'], 'id_gabungan' => $a['id_gabungan'], 'stok' => $a['stok'], + 'kd_supplier' => $a['kode_supplier'], 'hp' => $a['harga_pokok'], 'hj' => $a['harga_jual'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kode + * @param $nomor + * @param $kd_supplier + * @return unknown_type + */ +function cek_barang($kode, $nomor, $nofaktur) +{ + if($kode != "" || $nomor != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + + if($nomor != "") + { + $data = $mysqli->query("SELECT count(*) + FROM barang brg, no_barang nb, d_pembelian dp + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND brg.kode_barang = '{$kode}' AND nb.nomor = '{$nomor}' + AND dp.no_faktur = '{$nofaktur}'"); + } else if($nomor == "") + { + $data = $mysqli->query("SELECT count(*) + FROM barang brg + WHERE brg.kode_barang = '{$kode}'"); + } + if($data->num_rows > 0) + { + $jum = $data->fetch_array(); + if($jum[0] > 0) + { + $harray[0] = "true"; + } else + { + $harray[0] = "false"; + } + /* tutup hasil query */ + $data->close(); + } else + { + $harray[0] = "false"; + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kode + * @param $nama + * @param $kd_supplier + * @return unknown_type + */ +function cari_barang($kode, $nama) +{ + if($kode != "" || $nama != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + + if($nama != "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.nama_barang, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, d_pembelian dp, supplier s + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND brg.kode_supplier = s.kd_supplier + AND brg.nama_barang LIKE '%{$nama}%'"); + } else if($nama == "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.nama_barang, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, d_pembelian dp, supplier s + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang AND brg.kode_supplier = s.kd_supplier + AND (brg.kode_barang LIKE '{$kode}%' OR brg.kode_lama LIKE '{$kode}')"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'], 'nama_barang' => $a['nama_barang'], 'supplier' => $a['nama_supplier'], + 'kd_supplier' => $a['kode_supplier'], 'hp' => $a['harga_pokok'], 'hj' => $a['harga_jual'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kode + * @param $nama + * @return unknown_type + */ +function get_supplier($kode, $nama) +{ + if($kode != "" || $nama != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + + if($nama != "") + { + $data = $mysqli->query("SELECT s.kd_supplier, s.nama_supplier + FROM supplier s + WHERE s.kd_supplier LIKE '%{$kode}%' AND s.nama_supplier LIKE '%{$nama}%'"); + } else if($nama == "") + { + $data = $mysqli->query("SELECT s.kd_supplier, s.nama_supplier + FROM supplier s + WHERE s.kd_supplier LIKE '%{$kode}%'"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('kode_supplier' => $a['kd_supplier'], 'nama_supplier' => $a['nama_supplier']); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kodebarang + * @return unknown_type + */ +function get_kode_faktur_asli($kodebarang) +{ + $faktur = ""; + if($kodebarang != "" ) + { + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + + $data = $mysqli->query("SELECT d.no_faktur FROM d_pembelian d WHERE d.kode_barang = '{$kodebarang}'"); + if($data->num_rows > 0) + { + $faktur = $data->fetch_array(MYSQLI_NUM); + $faktur = $faktur[0]; + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + return $faktur; +} +/** + * + * @param $data + * @return unknown_type + */ +function hitung_total_hp($data, $stok) +{ + $total = 0; + for ($i = 0; $i < count($data); $i++) + { + $total += decode_hp($data[$i]) * $stok[$i]; + } + return $total; +} + +/** + * + * @param $hp + * @return int hasil decode + */ +function decode_hp($hp) +{ + $dt = ""; + for($i = 0; $i < strlen($hp); $i++) + { + $chr = substr($hp, $i, 1); + switch($chr) + { + case "B" : $dt .= "1";break; + case "R" : $dt .= "2";break; + case "A" : $dt .= "3";break; + case "W" : $dt .= "4";break; + case "N" : $dt .= "5";break; + case "F" : $dt .= "6";break; + case "O" : $dt .= "7";break; + case "X" : $dt .= "8";break; + case "E" : $dt .= "9";break; + case "S" : $dt .= "0";break; + } + } + return (int) $dt; +} +?> diff --git a/old-source/retur_beli (copy)/hmenu.php~ b/old-source/retur_beli (copy)/hmenu.php~ new file mode 100644 index 0000000..ed1d5c8 --- /dev/null +++ b/old-source/retur_beli (copy)/hmenu.php~ @@ -0,0 +1,128 @@ + diff --git a/old-source/retur_beli (copy)/menu.php b/old-source/retur_beli (copy)/menu.php new file mode 100644 index 0000000..bb01ae5 --- /dev/null +++ b/old-source/retur_beli (copy)/menu.php @@ -0,0 +1,138 @@ + + + + + +
+ +
diff --git a/old-source/retur_beli (copy)/retur_ambil_alasan.php b/old-source/retur_beli (copy)/retur_ambil_alasan.php new file mode 100644 index 0000000..1a6ef74 --- /dev/null +++ b/old-source/retur_beli (copy)/retur_ambil_alasan.php @@ -0,0 +1,28 @@ +query("SELECT DISTINCT(keterangan) FROM m_retur_beli"); +if($data->num_rows > 0) +{ + $idx = 0; + while($ket = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('keterangan' => $ket['keterangan']); + $idx += 1; + } + /* tutup hasil query */ + $data->close(); +} +/* tutup koneksi */ +$mysqli->close(); +/* cetak hasil */ +echo json_encode($harray); diff --git a/old-source/retur_beli (copy)/retur_ambil_barang.php b/old-source/retur_beli (copy)/retur_ambil_barang.php new file mode 100644 index 0000000..54fc25b --- /dev/null +++ b/old-source/retur_beli (copy)/retur_ambil_barang.php @@ -0,0 +1,45 @@ +query("SELECT b.kode_barang, b.kode_lama, n.nomor, b.nama_barang, b.kode_supplier, d.jumlah, d.harga_satuan, (d.jumlah * d.harga_satuan) as jum, m.no_nota, n.stok + FROM d_retur_beli d, m_retur_beli m, barang b, no_barang n + WHERE + b.id_gabungan = n.id_gabungan + AND d.id_retur = m.id_retur + AND (d.kd_barang = b.kode_barang AND d.nomor_barang = n.nomor) + AND d.id_retur = $idretur + ORDER BY b.kode_barang"); + /* tampung jumlah data dalam var hasil */ + if($data->num_rows > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('kd_barang' => $a['kode_barang'], 'kode_asli' => $a['kode_lama'], 'jumlah' => $a['jumlah'], 'nama_barang' => $a['nama_barang'], 'kode_supp' => $a['kode_supplier'], 'harga_satuan' => $a['harga_satuan'], 'nomor_barang' => $a['nomor'], 'no_nota' => $a['no_nota'], 'stokakh' => $a['stok']); + $idx++; + } + + /* tutup hasil query */ + $data->close(); + + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/retur_beli (copy)/retur_ambil_keterangan.php b/old-source/retur_beli (copy)/retur_ambil_keterangan.php new file mode 100644 index 0000000..69159fe --- /dev/null +++ b/old-source/retur_beli (copy)/retur_ambil_keterangan.php @@ -0,0 +1,33 @@ +query("SELECT mp.tgl_nota, mp.kd_supplier + FROM m_pembelian mp + WHERE no_faktur = '$_REQUEST[nonota]'"); + $data2 = $mysqli->query("SELECT SUM( jumlah ) FROM d_retur_beli WHERE id_retur = $_REQUEST[idretur] GROUP BY id_retur"); + if($data1->num_rows > 0 && $data2->num_rows > 0) + { + $ket = $data1->fetch_array(MYSQLI_ASSOC); + $jum = $data2->fetch_array(MYSQLI_NUM); + $harray = array('tgl_nota' => substr($ket['tgl_nota'],8,2)."-".substr($ket['tgl_nota'],5,2)."-".substr($ket['tgl_nota'],0,4), 'kd_supplier' => $ket['kd_supplier'], 'jumlah' => $jum[0]); + /* tutup hasil query */ + $data1->close(); + $data2->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); +} \ No newline at end of file diff --git a/old-source/retur_beli (copy)/retur_cari_nota.php b/old-source/retur_beli (copy)/retur_cari_nota.php new file mode 100644 index 0000000..bdb9085 --- /dev/null +++ b/old-source/retur_beli (copy)/retur_cari_nota.php @@ -0,0 +1,60 @@ +query("SELECT mr.id_retur, mr.no_nota, mr.tgl_retur, mr.keterangan, mr.total_retur, mr.nik, mr.kd_supplier, mr.jml_item + FROM m_retur_beli mr + WHERE mr.id_retur = '$nofaktur' + AND mr.tgl_retur BETWEEN '$tglawal' AND '$tglakhir' + AND mr.validasi = '$valid'"); + else if($nofaktur != "" && $tglawal == "" && $tglakhir == "") + $data = $mysqli->query("SELECT mr.id_retur, mr.no_nota, mr.tgl_retur, mr.keterangan, mr.total_retur, mr.nik, mr.kd_supplier, mr.jml_item + FROM m_retur_beli mr + WHERE mr.id_retur = '$nofaktur' + AND mr.validasi = '$valid'"); + else if($nofaktur == "" && $tglawal != "" && $tglakhir != "") + $data = $mysqli->query("SELECT mr.id_retur, mr.no_nota, mr.tgl_retur, mr.keterangan, mr.total_retur, mr.nik, mr.kd_supplier, mr.jml_item + FROM m_retur_beli mr + WHERE mr.tgl_retur BETWEEN '$tglawal' AND '$tglakhir' + AND mr.validasi = '$valid'"); + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'id_retur' => $a['id_retur'], 'no_nota' => $a['no_nota'], 'tgl_retur' => substr($a['tgl_retur'],8,2)."-".substr($a['tgl_retur'],5,2)."-".substr($a['tgl_retur'],0,4), + 'keterangan' => $a['keterangan'], 'total_retur' => $a['total_retur'], 'nik' => $a['nik'], 'kdsupp' => $a['kd_supplier'], 'jml_item' => $a['jml_item'], + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + + echo json_encode($harray); +} diff --git a/old-source/retur_beli (copy)/retur_fbaru.php b/old-source/retur_beli (copy)/retur_fbaru.php new file mode 100644 index 0000000..5e4efff --- /dev/null +++ b/old-source/retur_beli (copy)/retur_fbaru.php @@ -0,0 +1,233 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ Retur Pembelian - Baru + + + + + + + + + + + + + + + + +
Tanggal Retur: + + Kode Supplier:
No.Faktur Retur: NIK:
Total Retur: Keterangan: +   
Jumlah Item Retur:
+
+ + + + + + + + + + +
KODE BARANGBARCODENAMA BARANGHARGA SATUAN BELISTOK KOMPJML RETUR
+
+
+ + + +
+
+
+
+ +
+ + +
+

+
+ +
+

+
+ +
+ + + + + + + + + + + +
Nomor Faktur:
Rentang Tanggal: + s/d + +
Kode Supplier:
+
+ Hasil pencarian +
+
+
+ + +
+ + + + + + + + +
Kode Barang:
Nama Barang: + +
+
+ Hasil pencarian +
+
+
+ + + + + + + + + + diff --git a/old-source/retur_beli (copy)/retur_fedit.php b/old-source/retur_beli (copy)/retur_fedit.php new file mode 100644 index 0000000..0e230f2 --- /dev/null +++ b/old-source/retur_beli (copy)/retur_fedit.php @@ -0,0 +1,241 @@ + + + + + :: Pengadaan Barang + + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ Retur Pembelian - Edit + + + + + + + + + + + + + + + + + + + + + +
ID Retur: + + Kode Supplier:
Tanggal Retur: + NIK:
No.Faktur Retur: Keterangan: +   
Total Retur:
Jumlah Item Retur:
+
+ + + + + + + + + + + +
+
+ + + + + +
+
+
+
+ +
+ + +
+

+
+ +
+

+
+ +
+ + + + + + + + +
ID Retur:
Rentang Tanggal: + s/d + +
+
+ Hasil pencarian +
+
+
+ + + + + + + + diff --git a/old-source/retur_beli (copy)/retur_fprint.php b/old-source/retur_beli (copy)/retur_fprint.php new file mode 100644 index 0000000..dcef9f4 --- /dev/null +++ b/old-source/retur_beli (copy)/retur_fprint.php @@ -0,0 +1,214 @@ + + + + + :: Pengadaan Barang + + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ Retur Pembelian - Print + + + + + + + + + + + + + + + + + + + + + +
ID Retur: + + Kode Supplier:
Tanggal Retur: + NIK:
No.Faktur Retur: Keterangan:
Total Retur:
Jumlah Item Retur:
+
+ + + + + + + + + + +
+
+ +
+
+
+
+ +
+ + +
+

+
+ +
+

+
+ +
+ + + + + + + + +
ID Retur:
Rentang Tanggal: + s/d + +
+
+ Hasil pencarian +
+
+
+ + + + + + + diff --git a/old-source/retur_beli (copy)/retur_hapus.php b/old-source/retur_beli (copy)/retur_hapus.php new file mode 100644 index 0000000..ef60bad --- /dev/null +++ b/old-source/retur_beli (copy)/retur_hapus.php @@ -0,0 +1,30 @@ +prepare("DELETE FROM d_retur_beli WHERE id_retur = ? AND kd_barang = ? AND jumlah = ? AND harga_satuan = ? LIMIT 1"); + $stmt->bind_param("isii",$retur_id, $kode, $jumlah, $harga); + $stmt->execute(); + if($stmt->affected_rows > 0) $hasil = 1; + else $hasil = 0; + $stmt->close(); + } + $harray = array('hasil' => $hasil); + echo json_encode($harray); +} +/* end file */ diff --git a/old-source/retur_beli (copy)/retur_print.php b/old-source/retur_beli (copy)/retur_print.php new file mode 100644 index 0000000..37f58c0 --- /dev/null +++ b/old-source/retur_beli (copy)/retur_print.php @@ -0,0 +1,163 @@ +query("SELECT nama_supplier, alamat1 + FROM supplier + WHERE kd_supplier = '$_POST[supp]'"); + if ($supplierdata->num_rows > 0) + { + while($s = $supplierdata->fetch_array(MYSQLI_ASSOC)) + { + $namasupp = $s['nama_supplier']; + $alamatsupp = $s['alamat1']; + } + $supplierdata->close(); + } + // ambil item barang yang diretur + $idretur = $_POST['idretur']; + + $returdata = $mysqli->query("SELECT b.kode_barang, b.kode_lama, n.nomor, b.nama_barang, b.kode_supplier, d.jumlah, d.harga_satuan, (d.jumlah * d.harga_satuan) as jum, m.no_nota, n.stok + FROM d_retur_beli d, m_retur_beli m, barang b, no_barang n + WHERE + b.id_gabungan = n.id_gabungan + AND d.id_retur = m.id_retur + AND (d.kd_barang = b.kode_barang AND d.nomor_barang = n.nomor) + AND d.id_retur = $idretur + ORDER BY b.kode_barang"); + + $tabledetil = ""; + if($returdata->num_rows > 0) + { + while($a = $returdata->fetch_array(MYSQLI_ASSOC)) + { + $tabledetil .= " + + + + + "; + $tot=$tot+$a['jum']; + $vol=$vol+$a['jumlah']; + } + $tabledetil .= ""; + /* tutup hasil query */ + $returdata->close(); + } + $tabledetil .= "
BanyakJenis BarangKode AsliHarga SatuanJumlah
".$a['jumlah']."   ".$a['nama_barang']."   ".$a['kode_lama']."".number_format($a['harga_satuan'],0,',','.')."   ".number_format($a['jum'],0,',','.')."  
".$vol."".number_format($tot,0,',','.')."  
"; + echo ""; + echo ""; + + echo "
"; + echo "

"; + echo "
"; + echo "
"; + echo "Kepada Yth, ". $namasupp ."
"; + echo "     ".$alamatsupp."
"; + echo "
"; + echo "Tanggal cetak: ".date('d-m-Y').""; + echo "
"; + echo "


"; + echo "     Dengan hormat,
"; + echo "

     Bersama ini kami kirimkan kembali sebagian barang yang telah kami terima dengan pertimbangan ".$_POST['ketretur'].".
"; + echo "Ada pun barang-barang yang kami kirimkan adalah sebagai berikut :

"; + echo $tabledetil; + echo "

     Demikian, mohon berkenan untuk menerima kembali dengan baik, dan mohon maaf atas pengembalian ini. Terima Kasih.

"; + echo "
"; + + echo "
"; + echo "

"; + echo "
"; + echo "
"; + echo "Kepada Yth, ". $namasupp ."
"; + echo "     ".$alamatsupp."
"; + echo "
"; + echo "Tanggal cetak: ".date('d-m-Y').""; + echo "
"; + echo "


"; + echo "     Dengan hormat,
"; + echo "

     Bersama ini kami kirimkan kembali sebagian barang yang telah kami terima dengan pertimbangan ".$_POST['ketretur'].".
"; + echo "Ada pun barang-barang yang kami kirimkan adalah sebagai berikut :

"; + echo $tabledetil; + echo "

     Demikian, mohon berkenan untuk menerima kembali dengan baik, dan mohon maaf atas pengembalian ini. Terima Kasih.

"; + echo "
"; + + echo "
"; + echo "

"; + echo "
"; + echo "
"; + echo "Kepada Yth, ". $namasupp ."
"; + echo "     ".$alamatsupp."
"; + echo "
"; + echo "Tanggal cetak: ".date('d-m-Y')."
"; + echo "


"; + echo "     Dengan hormat,
"; + echo "

     Bersama ini kami kirimkan kembali sebagian barang yang telah kami terima dengan pertimbangan ".$_POST['ketretur'].".
"; + echo "Ada pun barang-barang yang kami kirimkan adalah sebagai berikut :

"; + echo $tabledetil; + echo "

     Demikian, mohon berkenan untuk menerima kembali dengan baik, dan mohon maaf atas pengembalian ini. Terima Kasih.

"; + echo "
"; + + } +} +?> diff --git a/old-source/retur_beli (copy)/retur_simpan.php b/old-source/retur_beli (copy)/retur_simpan.php new file mode 100644 index 0000000..357805a --- /dev/null +++ b/old-source/retur_beli (copy)/retur_simpan.php @@ -0,0 +1,97 @@ + $kode[$id], 'nomor' => $no_barang[$id], 'kodeasli' => $kodeasli[$id], 'hb' => $hb_satuan[$id], 'jumlah' => $jumlah[$id], 'kodesupp' => $kd_supplier[$id], 'nofaktur' => $no_retur[$id]); + + // urutkan datanya + sort($aDataTransfer); + + // proses penggabungan data yang sama + $aHasil = array(); + $co = 0; + $c=0; + for ($i=0;$iprepare("INSERT INTO m_retur_beli(no_nota, tgl_retur, keterangan, total_retur, nik, jml_item, kd_supplier) + VALUES (?, ?, ?, ?, ?, ?, ?)"); + $stmt->bind_param("sssisis",$nota_retur, $tgl_retur, $ket_retur, $total_retur, $nik, $jumlah_retur, $id_supplier); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = 1; + $retur_id = $mysqli->insert_id; + } + else $hasil = 0; + $stmt->close(); + + // isi table detil retur + for($i=0; $iprepare("INSERT INTO d_retur_beli(id_retur, kd_barang, jumlah, harga_satuan, nomor_barang) + VALUES (?, ?, ?, ?, ?)"); + $stmt->bind_param("isiis",$retur_id, $aHasil[$i]['kode'], $aHasil[$i]['jumlah'], $aHasil[$i]['hb'], $aHasil[$i]['nomor']); + $stmt->execute(); + if($stmt->affected_rows > 0) $hasil = 1; + else $hasil = 0; + $stmt->close(); + } + } + + $harray = array('hasil' => $hasil, 'id_retur' => $retur_id); + echo json_encode($harray); +} diff --git a/old-source/retur_beli (copy)/retur_update.php b/old-source/retur_beli (copy)/retur_update.php new file mode 100644 index 0000000..c50ac3d --- /dev/null +++ b/old-source/retur_beli (copy)/retur_update.php @@ -0,0 +1,124 @@ +prepare("UPDATE m_retur_beli SET no_nota = ?, total_retur = ?, jml_item = ?, kd_supplier = ?, tgl_retur = ?, keterangan = ? WHERE id_retur = ?"); + $stmt->bind_param("siisssi", $no_nota, $total_retur, $jumlah_retur, $kdsupp, $tgl_retur, $ket_retur, $retur_id); + $stmt->execute(); + if($stmt->affected_rows > 0) + $hasilm = 1; + else $hasilm = 0; + $stmt->close(); + // --> end update data table master + + // begin update data table detail <-- + $aDataBaru = array(); + // masukkan semua data baru dalam satu array + for($id=0; $id $kode[$id], 'nomor' => $no_barang[$id], 'hb' => $hb_satuan[$id], 'jumlah' => $jumlah[$id]); + + // urutkan datanya + sort($aDataBaru); + + // proses penggabungan data yang sama + $aBaru = array(); + $co = 0; + $c=0; + for ($i=0;$iquery("SELECT jumlah + FROM d_retur_beli + WHERE id_retur = $retur_id + AND kd_barang = '$k' + AND harga_satuan = $h + AND nomor_barang = '$n'"); + if($dt->num_rows > 0) + { + $a = $dt->fetch_array(MYSQLI_NUM); + // kalau jumlahnya tidak sama, update jumlah + if($aBaru[$x]['jumlah'] != $a[0]) + { + $stmt = $mysqli->prepare("UPDATE d_retur_beli SET jumlah = ? WHERE id_retur = ? AND kd_barang = ? AND harga_satuan = ? AND nomor_barang = ?"); + $stmt->bind_param("iisis", $aBaru[$x]['jumlah'], $retur_id, $aBaru[$x]['kode'], $aBaru[$x]['hb'], $aBaru[$x]['nomor']); + $stmt->execute(); + if($stmt->affected_rows > 0) $hasild = 1; + else $hasild = 0; + $stmt->close(); + } + /* tutup hasil query */ + $dt->close(); + }else + { + // jika data belum ada, insert data baru. + $stmt = $mysqli->prepare("INSERT INTO d_retur_beli(id_retur, kd_barang, jumlah, harga_satuan, nomor_barang) + VALUES (?, ?, ?, ?, ?)"); + $stmt->bind_param("isiis", $retur_id, $aBaru[$x]['kode'], $aBaru[$x]['jumlah'], $aBaru[$x]['hb'], $aBaru[$x]['nomor']); + $stmt->execute(); + if($stmt->affected_rows > 0) $hasild = 1; + else $hasild = 0; + $stmt->close(); + } + } + // --> end update data table detail + } + /* tutup koneksi */ + $mysqli->close(); + $harray = array('hasilm' => $hasilm, 'hasild' => $hasild, 'id_retur' => $retur_id); + echo json_encode($harray); +} + +/* end file */ diff --git a/old-source/retur_beli (copy)/retur_validasi.php b/old-source/retur_beli (copy)/retur_validasi.php new file mode 100644 index 0000000..1654cbd --- /dev/null +++ b/old-source/retur_beli (copy)/retur_validasi.php @@ -0,0 +1,66 @@ +prepare("UPDATE m_retur_beli SET tgl_retur = ?, validasi = '1' WHERE id_retur = ?"); + $stmt->bind_param("si",$tgl_retur, $id_retur); + $stmt->execute(); + if($stmt->affected_rows > 0) + $hasil = 1; + else $hasil = 0; + $stmt->close(); + + // ambil barang yang akan diupdate stok nya. + $barang = array(); + $dataBarang = $mysqli->query("SELECT dr.jumlah, dr.nomor_barang, br.id_gabungan + FROM d_retur_beli dr, m_retur_beli mr, barang br + WHERE dr.id_retur = mr.id_retur + AND mr.id_retur = $id_retur + AND mr.validasi = '1' + AND dr.kd_barang = br.kode_barang"); + $jumBarang = $dataBarang->num_rows; + if($jumBarang > 0) + { + $idx = 0; + while($db = $dataBarang->fetch_array(MYSQLI_ASSOC)) + { + $barang[$idx] = array('id_gabungan' => $db['id_gabungan'], 'jumlah' => $db['jumlah'], 'nomor' => $db['nomor_barang']); + $idx++; + } + /* tutup hasil query */ + $dataBarang->close(); + } + // update stok + for($i=0; $i<$jumBarang; $i++) + { + // update stok barang + $stmt = $mysqli->prepare("UPDATE no_barang SET stok = stok-? WHERE id_gabungan = ? AND nomor = ?"); + $stmt->bind_param("iss",$barang[$i]['jumlah'], $barang[$i]['id_gabungan'], $barang[$i]['nomor']); + $stmt->execute(); + if($stmt->affected_rows > 0) + $hasil = 1; + else + $hasil = 0; + $stmt->close(); + } + + } + $harray = array('hasil' => $hasil); + echo json_encode($harray); +} diff --git a/old-source/retur_beli/ambil_barang.php b/old-source/retur_beli/ambil_barang.php new file mode 100644 index 0000000..2918d10 --- /dev/null +++ b/old-source/retur_beli/ambil_barang.php @@ -0,0 +1,51 @@ +query("SELECT brg.kode_barang,brg.kode_supplier,d.no_faktur,d.kode_asli,brg.nama_barang,n.harga_pokok, n.harga_jual, n.stok, n.nomor + FROM barang brg inner join no_barang n on brg.id_gabungan = n.id_gabungan,d_pembelian d + WHERE n.nomor = '$_REQUEST[nobarang]' + AND (brg.kode_barang = '$_REQUEST[idbarang]' OR brg.kode_lama = '$_REQUEST[idbarang]') + AND (d.kode_barang = brg.kode_barang AND d.nomor = n.nomor) + AND left(d.no_faktur,4) <> 'RVB-' + AND n.stok > 0 + ORDER BY brg.kode_barang,n.nomor"); + } else if(!isset($_REQUEST['nobarang'])) + { + $data = $mysqli->query("SELECT brg.kode_barang,brg.kode_supplier,d.no_faktur,d.kode_asli,brg.nama_barang,n.harga_pokok, n.harga_jual, n.stok, n.nomor + FROM barang brg inner join no_barang n on brg.id_gabungan = n.id_gabungan,d_pembelian d + WHERE (brg.kode_barang = '$_REQUEST[idbarang]' OR brg.kode_lama = '$_REQUEST[idbarang]') + AND (brg.kode_barang = d.kode_barang AND d.nomor = n.nomor) + AND left(d.no_faktur,4) <> 'RVB-' + AND n.stok > 0 + ORDER BY brg.kode_barang,n.nomor"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'],'kode_supp' => $a['kode_supplier'],'no_faktur' => $a['no_faktur'],'kode_asli' => $a['kode_asli'],'nama_barang' => $a['nama_barang'], + 'harga_beli' => $a['harga_pokok'],'harga_jual' => $a['harga_jual'], 'stok' => $a['stok'], 'nomor_barang' => $a['nomor'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/retur_beli/ambil_barang_kembali.php b/old-source/retur_beli/ambil_barang_kembali.php new file mode 100644 index 0000000..a6a95fb --- /dev/null +++ b/old-source/retur_beli/ambil_barang_kembali.php @@ -0,0 +1,49 @@ +query("SELECT brg.kode_barang,brg.kode_supplier,d.no_faktur,d.kode_asli,brg.nama_barang,n.harga_pokok, n.harga_jual, n.stok, n.nomor + FROM barang brg inner join no_barang n on brg.id_gabungan = n.id_gabungan,d_pembelian d + WHERE n.nomor = '$_REQUEST[nobarang]' + AND brg.kode_barang = '$_REQUEST[idbarang]' + AND (d.kode_barang = brg.kode_barang AND d.nomor = n.nomor) + AND left(d.no_faktur,4) <> 'RVB-' + ORDER BY brg.kode_barang,n.nomor"); + } else if(!isset($_REQUEST['nobarang'])) + { + $data = $mysqli->query("SELECT brg.kode_barang,brg.kode_supplier,d.no_faktur,d.kode_asli,brg.nama_barang,n.harga_pokok, n.harga_jual, n.stok, n.nomor + FROM barang brg inner join no_barang n on brg.id_gabungan = n.id_gabungan,d_pembelian d + WHERE brg.kode_barang = '$_REQUEST[idbarang]' + AND (brg.kode_barang = d.kode_barang AND d.nomor = n.nomor) + AND left(d.no_faktur,4) <> 'RVB-' + ORDER BY brg.kode_barang,n.nomor"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'],'kode_supp' => $a['kode_supplier'],'no_faktur' => $a['no_faktur'],'kode_asli' => $a['kode_asli'],'nama_barang' => $a['nama_barang'], + 'harga_beli' => $a['harga_pokok'],'harga_jual' => $a['harga_jual'], 'stok' => $a['stok'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/retur_beli/ambil_kode_barang.php b/old-source/retur_beli/ambil_kode_barang.php new file mode 100644 index 0000000..c918f36 --- /dev/null +++ b/old-source/retur_beli/ambil_kode_barang.php @@ -0,0 +1,53 @@ +query("SELECT DISTINCT d.kode_barang, m.kd_supplier, b.nama_barang, sup.nama_supplier, + m.tgl_nota, m.tgl_masuk, m.tgl_jatuh_tempo, m.status, m.keterangan, m.nik + FROM m_pembelian m, d_pembelian d, barang b, supplier sup, no_barang n + WHERE m.no_faktur = d.no_faktur + AND d.kode_barang = b.kode_barang + AND b.id_gabungan = n.id_gabungan + AND m.kd_supplier = sup.kd_supplier + AND n.stok > 0 + AND m.no_faktur='$_REQUEST[nofaktur]' + ORDER BY d.kode_barang"); + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + $jdata = $mysqli->query("SELECT count(*) + FROM m_pembelian m, d_pembelian d, barang b, supplier sup, no_barang n + WHERE m.no_faktur = d.no_faktur + AND d.kode_barang = b.kode_barang + AND b.id_gabungan = n.id_gabungan + AND m.kd_supplier = sup.kd_supplier + AND n.stok > 0 + AND m.no_faktur='$_REQUEST[nofaktur]'"); + $j = $jdata->fetch_array(MYSQL_NUM); + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'], 'kd_supplier' => $a['kd_supplier'], + 'nama_barang' => $a['nama_barang'], 'supplier' => $a['nama_supplier'], + 'tglnota' => $a['tgl_nota'],'tglmasuk' => $a['tgl_masuk'],'tgljthtempo' => $a['tgl_jatuh_tempo'], + 'status' => $a['status'],'keterangan' => $a['keterangan'],'nik' => $a['nik'], + 'jdata' => $j[0] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/retur_beli/ambil_nomor.php b/old-source/retur_beli/ambil_nomor.php new file mode 100644 index 0000000..b5c6157 --- /dev/null +++ b/old-source/retur_beli/ambil_nomor.php @@ -0,0 +1,36 @@ +query("SELECT DISTINCT nomor FROM d_pembelian WHERE kode_barang='$_REQUEST[idbarang]' ORDER BY nomor"); + $data = $mysqli->query("SELECT n.nomor FROM d_pembelian d, no_barang n, barang b + WHERE (b.kode_barang ='$_REQUEST[idbarang]' OR b.kode_lama = '$_REQUEST[idbarang]') + AND b.id_gabungan = n.id_gabungan + AND (d.kode_barang = b.kode_barang and d.nomor = n.nomor) + AND left(d.no_faktur,4) <> 'RVB-' + AND n.stok > 0 + ORDER BY nomor"); + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_NUM)) + { + $harray[$idx] = array('nomor' => $a[0]); + $idx++; + } + } + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/retur_beli/cari_nota.php b/old-source/retur_beli/cari_nota.php new file mode 100644 index 0000000..cd4d735 --- /dev/null +++ b/old-source/retur_beli/cari_nota.php @@ -0,0 +1,94 @@ +query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur != "" && $tglawal != "" && $tglakhir != "" && $kdsup == "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur != "" && $tglawal == "" && $tglakhir == "" && $kdsup != "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur != "" && $tglawal == "" && $tglakhir == "" && $kdsup == "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur == "" && $tglawal != "" && $tglakhir != "" && $kdsup != "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur == "" && $tglawal != "" && $tglakhir != "" && $kdsup == "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur == "" && $tglawal == "" && $tglakhir == "" && $kdsup != "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + + $harray[$idx] = array( + 'no_faktur' => $a['no_faktur'], 'tgl_nota' => substr($a['tgl_nota'],8,2)."-".substr($a['tgl_nota'],5,2)."-".substr($a['tgl_nota'],0,4), 'rp_beli' => $a['rp_beli'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/retur_beli/fungsi_retur.php b/old-source/retur_beli/fungsi_retur.php new file mode 100644 index 0000000..9bd5d44 --- /dev/null +++ b/old-source/retur_beli/fungsi_retur.php @@ -0,0 +1,567 @@ + ".$nofaktur; + $stmt = $mysqli->prepare("INSERT INTO m_pembelian VALUES (?, now(), now(), '-', now(), ?, 'T', 0, ?, ?, 0, '1', '$ket', now(), ?, ?)"); + $stmt->bind_param("sssiss", $norhp, $kd_supplier, $nik, $rpbeli, $nofaktur, $statusrvb); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} + +function insert_d_pembelian($norhp, $kode_barang, $kode_lama, $nomor, $stok, $stokrev, $hplama, $hjlama, $hpbaru, $hjbaru, $nama, $idgabungan) +{ + $hasil = FALSE; + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if(!mysqli_connect_errno()) + { + for ($i = 0; $i < count($kode_barang); $i++) + { + /* insert data lama */ + $hplm = decode_hp($hplama[$i]); + $profitlama = ceil((($hjlama[$i] - $hplm) / $hplm) * 100); + $stoklama = -1 * $stok[$i]; + $faktur_asli = get_kode_faktur_asli($kode_barang[$i]); + $stmt = $mysqli->prepare("INSERT INTO d_pembelian(no_faktur, kode_barang, kode_baranglama, nomor, jumlah, harga_satuan, harga_pokok, harga_jual, profit, kode_asli, jum_fisik, jenis, lokasi, hj_final, nm_brg) + VALUES (?, ?, ?, ?, ?, 0, ?, ?, ?, '-', ?, 'S', '1A', ?, ?)"); + $stmt->bind_param("ssssisiiiis", $norhp, $kode_barang[$i], $kode_lama[$i], $nomor[$i], $stoklama, $hplama[$i], $hjlama[$i], $profitlama, $stoklama, $hjlama[$i], $nama[$i]); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + + /* insert data baru */ + if ($hasil) + { + $hpbr = decode_hp($hpbaru[$i]); + $profitbaru = ceil((($hjbaru[$i] - $hpbr) / $hpbr) * 100); + $stmt = $mysqli->prepare("INSERT INTO d_pembelian(no_faktur, kode_barang, kode_baranglama, nomor, jumlah, harga_satuan, harga_pokok, harga_jual, profit, kode_asli, jum_fisik, jenis, lokasi, hj_final, nm_brg) + VALUES (?, ?, ?, ?, ?, 0, ?, ?, ?, '-', ?, 'S', '1A', ?, ?)"); + $stmt->bind_param("ssssisiiiis", $norhp, $kode_barang[$i], $kode_lama[$i], $nomor[$i], $stokrev[$i], $hpbaru[$i], $hjbaru[$i], $profitbaru, $stokrev[$i], $hjbaru[$i], $nama[$i]); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* update barang*/ + if ($hasil) + { + $update2 = update_barang($idgabungan[$i], $nama[$i]); + if($update2) + { + $hasil = TRUE; + } else + { + $hasil = FALSE; + } + } + + /* update no_barang*/ + if ($hasil) + { + $update = update_no_barang($idgabungan[$i], $nomor[$i], $hpbaru[$i], $hjbaru[$i], $stokrev[$i]); + if($update) + { + $hasil = TRUE; + } else + { + $hasil = FALSE; + } + } + $faktur_asli = ""; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} + +/** + * + * @param $id + * @param $nomor + * @param $hp + * @param $hj + * @return unknown_type + */ +function update_no_barang($id, $nomor, $hp, $hj, $stokrev) +{ + $hasil = FALSE; + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if(!mysqli_connect_errno()) + { + // isi table master + $stmt = $mysqli->prepare("UPDATE no_barang SET stok = ?,harga_pokok = ?, harga_jual = ? WHERE id_gabungan = ? AND nomor = ?"); + $stmt->bind_param("isiss", $stokrev, $hp, $hj, $id, $nomor); + $stmt->execute(); + if($stmt->affected_rows >= 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} + +function update_barang($id, $nama) +{ + $hasil = FALSE; + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if(!mysqli_connect_errno()) + { + // isi table master + $stmt = $mysqli->prepare("UPDATE barang SET nama_barang = ? WHERE id_gabungan = ?"); + $stmt->bind_param("ss", $nama, $id); + $stmt->execute(); + if($stmt->affected_rows >= 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} +/** + * + * @param $kdsupplier + * @return unknown_type + */ +function get_no_rhp($kdsupplier) +{ + $urutbaru = 0; + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + // cek ada atau tidak + if(cek_data($kdsupplier)) + { + $data_faktur = $mysqli->query("SELECT MAX(RIGHT(no_faktur, 3)) FROM m_pembelian WHERE LEFT(no_faktur, 10) = 'RVB-{$kdsupplier}'"); + if($data_faktur->num_rows > 0) + { + $urut = $data_faktur->fetch_array(); + $urutbaru = (int)$urut[0] + 1; + if(strlen($urutbaru) == 1) + { + $urutbaru = "00".$urutbaru; + } + if(strlen($urutbaru) == 2) + { + $urutbaru = "0".$urutbaru; + } + /* tutup hasil query */ + $data_faktur->close(); + } + } else + { + $urutbaru = "000"; + } + $hasil[0] = "RVB-".$kdsupplier."-".$urutbaru; + echo json_encode($hasil); + /* tutup koneksi */ + $mysqli->close(); +} + +/** + * + * @param $kodesupplier + * @return unknown_type + */ +function cek_data($kodesupplier) +{ + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + // cek ada atau tidak + $data = $mysqli->query("SELECT COUNT(*) FROM m_pembelian WHERE LEFT(no_faktur, 10) = 'RVB-{$kodesupplier}'"); + $dt = $data->fetch_array(); + if($dt[0] > 0) + { + return true; + } else + { + return false; + } + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); +} + +/** + * + * @param $kode + * @param $nomor + * @param $kd_supplier + * @return unknown_type + */ +function ambil_barang($kode, $nomor, $nofaktur) +{ + if($kode != "" || $nomor != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if($nomor != "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.kode_lama, brg.nama_barang, brg.id_gabungan, nb.stok, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, supplier s, d_pembelian dp + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND brg.kode_barang = '{$kode}' AND nb.nomor = '{$nomor}' + AND brg.kode_supplier = s.kd_supplier AND dp.no_faktur = '{$nofaktur}' LIMIT 1"); + } else if($nomor == "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.kode_lama, brg.nama_barang, brg.id_gabungan, nb.stok, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, supplier s, d_pembelian dp + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND brg.kode_barang = '{$kode}' + AND brg.kode_supplier = s.kd_supplier AND dp.no_faktur = '{$nofaktur}' LIMIT 1"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('kode_barang' => $a['kode_barang'], 'kode_lama' => $a['kode_lama'], 'nama_barang' => $a['nama_barang'], + 'supplier' => $a['nama_supplier'], 'id_gabungan' => $a['id_gabungan'], 'stok' => $a['stok'], + 'kd_supplier' => $a['kode_supplier'], 'hp' => $a['harga_pokok'], 'hj' => $a['harga_jual'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kode + * @param $nomor + * @param $kd_supplier + * @return unknown_type + */ +function cek_barang($kode, $nomor, $nofaktur) +{ + if($kode != "" || $nomor != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + + if($nomor != "") + { + $data = $mysqli->query("SELECT count(*) + FROM barang brg, no_barang nb, d_pembelian dp + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND brg.kode_barang = '{$kode}' AND nb.nomor = '{$nomor}' + AND dp.no_faktur = '{$nofaktur}'"); + } else if($nomor == "") + { + $data = $mysqli->query("SELECT count(*) + FROM barang brg + WHERE brg.kode_barang = '{$kode}'"); + } + if($data->num_rows > 0) + { + $jum = $data->fetch_array(); + if($jum[0] > 0) + { + $harray[0] = "true"; + } else + { + $harray[0] = "false"; + } + /* tutup hasil query */ + $data->close(); + } else + { + $harray[0] = "false"; + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kode + * @param $nama + * @param $kd_supplier + * @return unknown_type + */ +function cari_barang($kode, $nama) +{ + if($kode != "" || $nama != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + + if($nama != "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.nama_barang, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, d_pembelian dp, supplier s + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND brg.kode_supplier = s.kd_supplier + AND brg.nama_barang LIKE '%{$nama}%'"); + } else if($nama == "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.nama_barang, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, d_pembelian dp, supplier s + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang AND brg.kode_supplier = s.kd_supplier + AND (brg.kode_barang LIKE '{$kode}%' OR brg.kode_lama LIKE '{$kode}')"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'], 'nama_barang' => $a['nama_barang'], 'supplier' => $a['nama_supplier'], + 'kd_supplier' => $a['kode_supplier'], 'hp' => $a['harga_pokok'], 'hj' => $a['harga_jual'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kode + * @param $nama + * @return unknown_type + */ +function get_supplier($kode, $nama) +{ + if($kode != "" || $nama != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + + if($nama != "") + { + $data = $mysqli->query("SELECT s.kd_supplier, s.nama_supplier + FROM supplier s + WHERE s.kd_supplier LIKE '%{$kode}%' AND s.nama_supplier LIKE '%{$nama}%'"); + } else if($nama == "") + { + $data = $mysqli->query("SELECT s.kd_supplier, s.nama_supplier + FROM supplier s + WHERE s.kd_supplier LIKE '%{$kode}%'"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('kode_supplier' => $a['kd_supplier'], 'nama_supplier' => $a['nama_supplier']); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kodebarang + * @return unknown_type + */ +function get_kode_faktur_asli($kodebarang) +{ + $faktur = ""; + if($kodebarang != "" ) + { + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + + $data = $mysqli->query("SELECT d.no_faktur FROM d_pembelian d WHERE d.kode_barang = '{$kodebarang}'"); + if($data->num_rows > 0) + { + $faktur = $data->fetch_array(MYSQLI_NUM); + $faktur = $faktur[0]; + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + return $faktur; +} +/** + * + * @param $data + * @return unknown_type + */ +function hitung_total_hp($data, $stok) +{ + $total = 0; + for ($i = 0; $i < count($data); $i++) + { + $total += decode_hp($data[$i]) * $stok[$i]; + } + return $total; +} + +/** + * + * @param $hp + * @return int hasil decode + */ +function decode_hp($hp) +{ + $dt = ""; + for($i = 0; $i < strlen($hp); $i++) + { + $chr = substr($hp, $i, 1); + switch($chr) + { + case "B" : $dt .= "1";break; + case "R" : $dt .= "2";break; + case "A" : $dt .= "3";break; + case "W" : $dt .= "4";break; + case "N" : $dt .= "5";break; + case "F" : $dt .= "6";break; + case "O" : $dt .= "7";break; + case "X" : $dt .= "8";break; + case "E" : $dt .= "9";break; + case "S" : $dt .= "0";break; + } + } + return (int) $dt; +} +?> diff --git a/old-source/retur_beli/hmenu.php~ b/old-source/retur_beli/hmenu.php~ new file mode 100644 index 0000000..ed1d5c8 --- /dev/null +++ b/old-source/retur_beli/hmenu.php~ @@ -0,0 +1,128 @@ + diff --git a/old-source/retur_beli/menu.php b/old-source/retur_beli/menu.php new file mode 100644 index 0000000..47cf73f --- /dev/null +++ b/old-source/retur_beli/menu.php @@ -0,0 +1,130 @@ + + + + + +
+ +
diff --git a/old-source/retur_beli/retur_ambil_alasan.php b/old-source/retur_beli/retur_ambil_alasan.php new file mode 100644 index 0000000..1a6ef74 --- /dev/null +++ b/old-source/retur_beli/retur_ambil_alasan.php @@ -0,0 +1,28 @@ +query("SELECT DISTINCT(keterangan) FROM m_retur_beli"); +if($data->num_rows > 0) +{ + $idx = 0; + while($ket = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('keterangan' => $ket['keterangan']); + $idx += 1; + } + /* tutup hasil query */ + $data->close(); +} +/* tutup koneksi */ +$mysqli->close(); +/* cetak hasil */ +echo json_encode($harray); diff --git a/old-source/retur_beli/retur_ambil_barang.php b/old-source/retur_beli/retur_ambil_barang.php new file mode 100644 index 0000000..54fc25b --- /dev/null +++ b/old-source/retur_beli/retur_ambil_barang.php @@ -0,0 +1,45 @@ +query("SELECT b.kode_barang, b.kode_lama, n.nomor, b.nama_barang, b.kode_supplier, d.jumlah, d.harga_satuan, (d.jumlah * d.harga_satuan) as jum, m.no_nota, n.stok + FROM d_retur_beli d, m_retur_beli m, barang b, no_barang n + WHERE + b.id_gabungan = n.id_gabungan + AND d.id_retur = m.id_retur + AND (d.kd_barang = b.kode_barang AND d.nomor_barang = n.nomor) + AND d.id_retur = $idretur + ORDER BY b.kode_barang"); + /* tampung jumlah data dalam var hasil */ + if($data->num_rows > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('kd_barang' => $a['kode_barang'], 'kode_asli' => $a['kode_lama'], 'jumlah' => $a['jumlah'], 'nama_barang' => $a['nama_barang'], 'kode_supp' => $a['kode_supplier'], 'harga_satuan' => $a['harga_satuan'], 'nomor_barang' => $a['nomor'], 'no_nota' => $a['no_nota'], 'stokakh' => $a['stok']); + $idx++; + } + + /* tutup hasil query */ + $data->close(); + + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/retur_beli/retur_ambil_keterangan.php b/old-source/retur_beli/retur_ambil_keterangan.php new file mode 100644 index 0000000..69159fe --- /dev/null +++ b/old-source/retur_beli/retur_ambil_keterangan.php @@ -0,0 +1,33 @@ +query("SELECT mp.tgl_nota, mp.kd_supplier + FROM m_pembelian mp + WHERE no_faktur = '$_REQUEST[nonota]'"); + $data2 = $mysqli->query("SELECT SUM( jumlah ) FROM d_retur_beli WHERE id_retur = $_REQUEST[idretur] GROUP BY id_retur"); + if($data1->num_rows > 0 && $data2->num_rows > 0) + { + $ket = $data1->fetch_array(MYSQLI_ASSOC); + $jum = $data2->fetch_array(MYSQLI_NUM); + $harray = array('tgl_nota' => substr($ket['tgl_nota'],8,2)."-".substr($ket['tgl_nota'],5,2)."-".substr($ket['tgl_nota'],0,4), 'kd_supplier' => $ket['kd_supplier'], 'jumlah' => $jum[0]); + /* tutup hasil query */ + $data1->close(); + $data2->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); +} \ No newline at end of file diff --git a/old-source/retur_beli/retur_beli_fbaru.php b/old-source/retur_beli/retur_beli_fbaru.php new file mode 100644 index 0000000..5e4efff --- /dev/null +++ b/old-source/retur_beli/retur_beli_fbaru.php @@ -0,0 +1,233 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ Retur Pembelian - Baru + + + + + + + + + + + + + + + + +
Tanggal Retur: + + Kode Supplier:
No.Faktur Retur: NIK:
Total Retur: Keterangan: +   
Jumlah Item Retur:
+
+ + + + + + + + + + +
KODE BARANGBARCODENAMA BARANGHARGA SATUAN BELISTOK KOMPJML RETUR
+
+
+ + + +
+
+
+
+ +
+ + +
+

+
+ +
+

+
+ +
+ + + + + + + + + + + +
Nomor Faktur:
Rentang Tanggal: + s/d + +
Kode Supplier:
+
+ Hasil pencarian +
+
+
+ + +
+ + + + + + + + +
Kode Barang:
Nama Barang: + +
+
+ Hasil pencarian +
+
+
+ + + + + + + + + + diff --git a/old-source/retur_beli/retur_beli_fedit.php b/old-source/retur_beli/retur_beli_fedit.php new file mode 100644 index 0000000..0e230f2 --- /dev/null +++ b/old-source/retur_beli/retur_beli_fedit.php @@ -0,0 +1,241 @@ + + + + + :: Pengadaan Barang + + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ Retur Pembelian - Edit + + + + + + + + + + + + + + + + + + + + + +
ID Retur: + + Kode Supplier:
Tanggal Retur: + NIK:
No.Faktur Retur: Keterangan: +   
Total Retur:
Jumlah Item Retur:
+
+ + + + + + + + + + + +
+
+ + + + + +
+
+
+
+ +
+ + +
+

+
+ +
+

+
+ +
+ + + + + + + + +
ID Retur:
Rentang Tanggal: + s/d + +
+
+ Hasil pencarian +
+
+
+ + + + + + + + diff --git a/old-source/retur_beli/retur_beli_fprint.php b/old-source/retur_beli/retur_beli_fprint.php new file mode 100644 index 0000000..dcef9f4 --- /dev/null +++ b/old-source/retur_beli/retur_beli_fprint.php @@ -0,0 +1,214 @@ + + + + + :: Pengadaan Barang + + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ Retur Pembelian - Print + + + + + + + + + + + + + + + + + + + + + +
ID Retur: + + Kode Supplier:
Tanggal Retur: + NIK:
No.Faktur Retur: Keterangan:
Total Retur:
Jumlah Item Retur:
+
+ + + + + + + + + + +
+
+ +
+
+
+
+ +
+ + +
+

+
+ +
+

+
+ +
+ + + + + + + + +
ID Retur:
Rentang Tanggal: + s/d + +
+
+ Hasil pencarian +
+
+
+ + + + + + + diff --git a/old-source/retur_beli/retur_cari_nota.php b/old-source/retur_beli/retur_cari_nota.php new file mode 100644 index 0000000..bdb9085 --- /dev/null +++ b/old-source/retur_beli/retur_cari_nota.php @@ -0,0 +1,60 @@ +query("SELECT mr.id_retur, mr.no_nota, mr.tgl_retur, mr.keterangan, mr.total_retur, mr.nik, mr.kd_supplier, mr.jml_item + FROM m_retur_beli mr + WHERE mr.id_retur = '$nofaktur' + AND mr.tgl_retur BETWEEN '$tglawal' AND '$tglakhir' + AND mr.validasi = '$valid'"); + else if($nofaktur != "" && $tglawal == "" && $tglakhir == "") + $data = $mysqli->query("SELECT mr.id_retur, mr.no_nota, mr.tgl_retur, mr.keterangan, mr.total_retur, mr.nik, mr.kd_supplier, mr.jml_item + FROM m_retur_beli mr + WHERE mr.id_retur = '$nofaktur' + AND mr.validasi = '$valid'"); + else if($nofaktur == "" && $tglawal != "" && $tglakhir != "") + $data = $mysqli->query("SELECT mr.id_retur, mr.no_nota, mr.tgl_retur, mr.keterangan, mr.total_retur, mr.nik, mr.kd_supplier, mr.jml_item + FROM m_retur_beli mr + WHERE mr.tgl_retur BETWEEN '$tglawal' AND '$tglakhir' + AND mr.validasi = '$valid'"); + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'id_retur' => $a['id_retur'], 'no_nota' => $a['no_nota'], 'tgl_retur' => substr($a['tgl_retur'],8,2)."-".substr($a['tgl_retur'],5,2)."-".substr($a['tgl_retur'],0,4), + 'keterangan' => $a['keterangan'], 'total_retur' => $a['total_retur'], 'nik' => $a['nik'], 'kdsupp' => $a['kd_supplier'], 'jml_item' => $a['jml_item'], + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + + echo json_encode($harray); +} diff --git a/old-source/retur_beli/retur_hapus.php b/old-source/retur_beli/retur_hapus.php new file mode 100644 index 0000000..ef60bad --- /dev/null +++ b/old-source/retur_beli/retur_hapus.php @@ -0,0 +1,30 @@ +prepare("DELETE FROM d_retur_beli WHERE id_retur = ? AND kd_barang = ? AND jumlah = ? AND harga_satuan = ? LIMIT 1"); + $stmt->bind_param("isii",$retur_id, $kode, $jumlah, $harga); + $stmt->execute(); + if($stmt->affected_rows > 0) $hasil = 1; + else $hasil = 0; + $stmt->close(); + } + $harray = array('hasil' => $hasil); + echo json_encode($harray); +} +/* end file */ diff --git a/old-source/retur_beli/retur_print.php b/old-source/retur_beli/retur_print.php new file mode 100644 index 0000000..37f58c0 --- /dev/null +++ b/old-source/retur_beli/retur_print.php @@ -0,0 +1,163 @@ +query("SELECT nama_supplier, alamat1 + FROM supplier + WHERE kd_supplier = '$_POST[supp]'"); + if ($supplierdata->num_rows > 0) + { + while($s = $supplierdata->fetch_array(MYSQLI_ASSOC)) + { + $namasupp = $s['nama_supplier']; + $alamatsupp = $s['alamat1']; + } + $supplierdata->close(); + } + // ambil item barang yang diretur + $idretur = $_POST['idretur']; + + $returdata = $mysqli->query("SELECT b.kode_barang, b.kode_lama, n.nomor, b.nama_barang, b.kode_supplier, d.jumlah, d.harga_satuan, (d.jumlah * d.harga_satuan) as jum, m.no_nota, n.stok + FROM d_retur_beli d, m_retur_beli m, barang b, no_barang n + WHERE + b.id_gabungan = n.id_gabungan + AND d.id_retur = m.id_retur + AND (d.kd_barang = b.kode_barang AND d.nomor_barang = n.nomor) + AND d.id_retur = $idretur + ORDER BY b.kode_barang"); + + $tabledetil = ""; + if($returdata->num_rows > 0) + { + while($a = $returdata->fetch_array(MYSQLI_ASSOC)) + { + $tabledetil .= " + + + + + "; + $tot=$tot+$a['jum']; + $vol=$vol+$a['jumlah']; + } + $tabledetil .= ""; + /* tutup hasil query */ + $returdata->close(); + } + $tabledetil .= "
BanyakJenis BarangKode AsliHarga SatuanJumlah
".$a['jumlah']."   ".$a['nama_barang']."   ".$a['kode_lama']."".number_format($a['harga_satuan'],0,',','.')."   ".number_format($a['jum'],0,',','.')."  
".$vol."".number_format($tot,0,',','.')."  
"; + echo ""; + echo ""; + + echo "
"; + echo "

"; + echo "
"; + echo "
"; + echo "Kepada Yth, ". $namasupp ."
"; + echo "     ".$alamatsupp."
"; + echo "
"; + echo "Tanggal cetak: ".date('d-m-Y').""; + echo "
"; + echo "


"; + echo "     Dengan hormat,
"; + echo "

     Bersama ini kami kirimkan kembali sebagian barang yang telah kami terima dengan pertimbangan ".$_POST['ketretur'].".
"; + echo "Ada pun barang-barang yang kami kirimkan adalah sebagai berikut :

"; + echo $tabledetil; + echo "

     Demikian, mohon berkenan untuk menerima kembali dengan baik, dan mohon maaf atas pengembalian ini. Terima Kasih.

"; + echo "
"; + + echo "
"; + echo "

"; + echo "
"; + echo "
"; + echo "Kepada Yth, ". $namasupp ."
"; + echo "     ".$alamatsupp."
"; + echo "
"; + echo "Tanggal cetak: ".date('d-m-Y').""; + echo "
"; + echo "


"; + echo "     Dengan hormat,
"; + echo "

     Bersama ini kami kirimkan kembali sebagian barang yang telah kami terima dengan pertimbangan ".$_POST['ketretur'].".
"; + echo "Ada pun barang-barang yang kami kirimkan adalah sebagai berikut :

"; + echo $tabledetil; + echo "

     Demikian, mohon berkenan untuk menerima kembali dengan baik, dan mohon maaf atas pengembalian ini. Terima Kasih.

"; + echo "
"; + + echo "
"; + echo "

"; + echo "
"; + echo "
"; + echo "Kepada Yth, ". $namasupp ."
"; + echo "     ".$alamatsupp."
"; + echo "
"; + echo "Tanggal cetak: ".date('d-m-Y')."
"; + echo "


"; + echo "     Dengan hormat,
"; + echo "

     Bersama ini kami kirimkan kembali sebagian barang yang telah kami terima dengan pertimbangan ".$_POST['ketretur'].".
"; + echo "Ada pun barang-barang yang kami kirimkan adalah sebagai berikut :

"; + echo $tabledetil; + echo "

     Demikian, mohon berkenan untuk menerima kembali dengan baik, dan mohon maaf atas pengembalian ini. Terima Kasih.

"; + echo "
"; + + } +} +?> diff --git a/old-source/retur_beli/retur_simpan.php b/old-source/retur_beli/retur_simpan.php new file mode 100644 index 0000000..357805a --- /dev/null +++ b/old-source/retur_beli/retur_simpan.php @@ -0,0 +1,97 @@ + $kode[$id], 'nomor' => $no_barang[$id], 'kodeasli' => $kodeasli[$id], 'hb' => $hb_satuan[$id], 'jumlah' => $jumlah[$id], 'kodesupp' => $kd_supplier[$id], 'nofaktur' => $no_retur[$id]); + + // urutkan datanya + sort($aDataTransfer); + + // proses penggabungan data yang sama + $aHasil = array(); + $co = 0; + $c=0; + for ($i=0;$iprepare("INSERT INTO m_retur_beli(no_nota, tgl_retur, keterangan, total_retur, nik, jml_item, kd_supplier) + VALUES (?, ?, ?, ?, ?, ?, ?)"); + $stmt->bind_param("sssisis",$nota_retur, $tgl_retur, $ket_retur, $total_retur, $nik, $jumlah_retur, $id_supplier); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = 1; + $retur_id = $mysqli->insert_id; + } + else $hasil = 0; + $stmt->close(); + + // isi table detil retur + for($i=0; $iprepare("INSERT INTO d_retur_beli(id_retur, kd_barang, jumlah, harga_satuan, nomor_barang) + VALUES (?, ?, ?, ?, ?)"); + $stmt->bind_param("isiis",$retur_id, $aHasil[$i]['kode'], $aHasil[$i]['jumlah'], $aHasil[$i]['hb'], $aHasil[$i]['nomor']); + $stmt->execute(); + if($stmt->affected_rows > 0) $hasil = 1; + else $hasil = 0; + $stmt->close(); + } + } + + $harray = array('hasil' => $hasil, 'id_retur' => $retur_id); + echo json_encode($harray); +} diff --git a/old-source/retur_beli/retur_update.php b/old-source/retur_beli/retur_update.php new file mode 100644 index 0000000..c50ac3d --- /dev/null +++ b/old-source/retur_beli/retur_update.php @@ -0,0 +1,124 @@ +prepare("UPDATE m_retur_beli SET no_nota = ?, total_retur = ?, jml_item = ?, kd_supplier = ?, tgl_retur = ?, keterangan = ? WHERE id_retur = ?"); + $stmt->bind_param("siisssi", $no_nota, $total_retur, $jumlah_retur, $kdsupp, $tgl_retur, $ket_retur, $retur_id); + $stmt->execute(); + if($stmt->affected_rows > 0) + $hasilm = 1; + else $hasilm = 0; + $stmt->close(); + // --> end update data table master + + // begin update data table detail <-- + $aDataBaru = array(); + // masukkan semua data baru dalam satu array + for($id=0; $id $kode[$id], 'nomor' => $no_barang[$id], 'hb' => $hb_satuan[$id], 'jumlah' => $jumlah[$id]); + + // urutkan datanya + sort($aDataBaru); + + // proses penggabungan data yang sama + $aBaru = array(); + $co = 0; + $c=0; + for ($i=0;$iquery("SELECT jumlah + FROM d_retur_beli + WHERE id_retur = $retur_id + AND kd_barang = '$k' + AND harga_satuan = $h + AND nomor_barang = '$n'"); + if($dt->num_rows > 0) + { + $a = $dt->fetch_array(MYSQLI_NUM); + // kalau jumlahnya tidak sama, update jumlah + if($aBaru[$x]['jumlah'] != $a[0]) + { + $stmt = $mysqli->prepare("UPDATE d_retur_beli SET jumlah = ? WHERE id_retur = ? AND kd_barang = ? AND harga_satuan = ? AND nomor_barang = ?"); + $stmt->bind_param("iisis", $aBaru[$x]['jumlah'], $retur_id, $aBaru[$x]['kode'], $aBaru[$x]['hb'], $aBaru[$x]['nomor']); + $stmt->execute(); + if($stmt->affected_rows > 0) $hasild = 1; + else $hasild = 0; + $stmt->close(); + } + /* tutup hasil query */ + $dt->close(); + }else + { + // jika data belum ada, insert data baru. + $stmt = $mysqli->prepare("INSERT INTO d_retur_beli(id_retur, kd_barang, jumlah, harga_satuan, nomor_barang) + VALUES (?, ?, ?, ?, ?)"); + $stmt->bind_param("isiis", $retur_id, $aBaru[$x]['kode'], $aBaru[$x]['jumlah'], $aBaru[$x]['hb'], $aBaru[$x]['nomor']); + $stmt->execute(); + if($stmt->affected_rows > 0) $hasild = 1; + else $hasild = 0; + $stmt->close(); + } + } + // --> end update data table detail + } + /* tutup koneksi */ + $mysqli->close(); + $harray = array('hasilm' => $hasilm, 'hasild' => $hasild, 'id_retur' => $retur_id); + echo json_encode($harray); +} + +/* end file */ diff --git a/old-source/retur_beli/retur_validasi.php b/old-source/retur_beli/retur_validasi.php new file mode 100644 index 0000000..1654cbd --- /dev/null +++ b/old-source/retur_beli/retur_validasi.php @@ -0,0 +1,66 @@ +prepare("UPDATE m_retur_beli SET tgl_retur = ?, validasi = '1' WHERE id_retur = ?"); + $stmt->bind_param("si",$tgl_retur, $id_retur); + $stmt->execute(); + if($stmt->affected_rows > 0) + $hasil = 1; + else $hasil = 0; + $stmt->close(); + + // ambil barang yang akan diupdate stok nya. + $barang = array(); + $dataBarang = $mysqli->query("SELECT dr.jumlah, dr.nomor_barang, br.id_gabungan + FROM d_retur_beli dr, m_retur_beli mr, barang br + WHERE dr.id_retur = mr.id_retur + AND mr.id_retur = $id_retur + AND mr.validasi = '1' + AND dr.kd_barang = br.kode_barang"); + $jumBarang = $dataBarang->num_rows; + if($jumBarang > 0) + { + $idx = 0; + while($db = $dataBarang->fetch_array(MYSQLI_ASSOC)) + { + $barang[$idx] = array('id_gabungan' => $db['id_gabungan'], 'jumlah' => $db['jumlah'], 'nomor' => $db['nomor_barang']); + $idx++; + } + /* tutup hasil query */ + $dataBarang->close(); + } + // update stok + for($i=0; $i<$jumBarang; $i++) + { + // update stok barang + $stmt = $mysqli->prepare("UPDATE no_barang SET stok = stok-? WHERE id_gabungan = ? AND nomor = ?"); + $stmt->bind_param("iss",$barang[$i]['jumlah'], $barang[$i]['id_gabungan'], $barang[$i]['nomor']); + $stmt->execute(); + if($stmt->affected_rows > 0) + $hasil = 1; + else + $hasil = 0; + $stmt->close(); + } + + } + $harray = array('hasil' => $hasil); + echo json_encode($harray); +} diff --git a/old-source/rincian_jual.php b/old-source/rincian_jual.php new file mode 100644 index 0000000..0737383 --- /dev/null +++ b/old-source/rincian_jual.php @@ -0,0 +1,351 @@ + + + + Cleopatra + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+"; + echo "div#divprint{width:900px; border:0px solid #000; padding:20px 0; margin-bottom:25px;}"; + echo "table.tbl {width:875px;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 "table.tbl1 {width:900px;border-width:0 0 0 0;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:left;}"; + echo "table.tbl1,table.tbl1 td {border-color:#000;border-style:solid;}"; + echo "table.tbl1 td {margin:0;padding:2px;border-width:0 0 0 0;}"; + echo "body {font-size:10pt;}"; + echo "div.luar{text-align:left;margin-left:20px;}"; + 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 ""; + + $nonota = $_GET['nota']; + if(substr($_GET['nota'],0,2) == 'B-'): + $nonotabon = $nonota; + bon($nonotabon); + elseif(substr($_GET['nota'],0,2) == 'W-'): + $nonotabawa = $nonota; + bawa($nonotabawa); + elseif(substr($_GET['nota'],0,2) == 'R-'): + $nonotaretur = $nonota; + retur($nonotaretur); + else: + $nonotatunai = $nonota; + tunai($nonotatunai); + endif; + +function bon($nonotabon) +{ + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Rekap Bon*/ + $query = "SELECT d.`kd_brg`, d.`nomor`, b.nama_barang,d.`jumlah`, d.`diskon`, + d.`hrg_satuan`,(d.`hrg_satuan`*d.`jumlah`) subtotal,d.`kd_pram` + FROM d_bon d,barang b + where d.`kd_brg`=b.kode_barang + and d.no_bon = '$nonotabon'"; + $query2 = "select m.no_bon,m.tgl_bon,m.kode_plg, + m.jumlah_total,m.diskon, + m.bank,m.no_kartu,m.kasir + from m_bon m + where m.no_bon = '$nonotabon'"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdbrg,$nomor,$nmbrg,$jum,$diskon,$hj,$subtotal,$kdpram); + + print("
"); + print("

Rincian Penjualan


"); + print("

"); + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$nota,$tglnota,$kdcust,$tot,$disc,$bank,$kartu,$kasir); + while(mysqli_stmt_fetch($stmt2)){ + print("Nomor Nota : ".$nota."
"); + print("Tanggal Nota : ".$tglnota."
"); + print("Plg : ".$kdcust."
"); + print("Total : ".number_format($tot,0,',','.')."
"); + print("Jumlah uang : ".number_format($totuang,0,',','.')."
"); + print("Discount : ".$disc."
"); + print("Bank : ".$bank."
"); + print("No.kartu : ".$kartu."
"); + print("Kasir : ".$kasir."

"); + } + } + } + + + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + print(""); + } + + print("
Kode Brg.NomorNamaJumlDiscHJSub TotalKd Pram
$kdbrg$nomor$nmbrg$jum".$diskon."".number_format($hj,0,',','.')."".number_format($subtotal,0,',','.')."$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + //print("

"); + } +} + +function bawa($nonotabawa) +{ + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Rekap Bawa*/ + $query = "SELECT d.`kd_barang`, d.`no_barang`, b.nama_barang,d.`jumlah`, + d.`harga_satuan`,(d.`harga_satuan`*d.`jumlah`) subtotal,d.`kode_pram` + FROM d_nota_bawa d,barang b + where d.`kd_barang`=b.kode_barang + and d.no_nota = '$nonotabawa'"; + $query2 = "select m.no_nota,m.tgl_nota,m.kd_customer, + m.jumlah_total,m.kasir + from m_nota_bawa m + where m.no_nota = '$nonotabawa'"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdbrg,$nomor,$nmbrg,$jum,$hj,$subtotal,$kdpram); + + print("
"); + print("

Rincian Penjualan


"); + print("

"); + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$nota,$tglnota,$kdcust,$tot,$kasir); + while(mysqli_stmt_fetch($stmt2)){ + print("Nomor Nota : ".$nota."
"); + print("Tanggal Nota : ".$tglnota."
"); + print("Plg : ".$kdcust."
"); + print("Total : ".number_format($tot,0,',','.')."
"); + print("Kasir : ".$kasir."

"); + } + } + } + + + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + print(""); + } + + print("
Kode Brg.NomorNamaJumlHJSub TotalKd Pram
$kdbrg$nomor$nmbrg$jum".number_format($hj,0,',','.')."".number_format($subtotal,0,',','.')."$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + //print("

"); + } +} + +function retur($nonotaretur) +{ + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Rekap Tunai*/ + $query = "SELECT d.`kd_barang`, d.`no_barang`, b.nama_barang,d.`jumlah`, d.`diskon`, + d.`harga_jual`,(d.`harga_jual`*d.`jumlah`) subtotal,d.no_nota_tunai,d.`kode_pram` + FROM d_nota_retur d,barang b + where d.`kd_barang`=b.kode_barang + and d.no_nota = '$nonotaretur'"; + $query2 = "select m.no_nota,m.tgl_nota,m.kd_customer, + m.jumlah_total,m.total_diskon,m.keterangan,m.kasir + from m_nota_retur m + where m.no_nota = '$nonotaretur'"; + + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$kdbrg,$nomor,$nmbrg,$jum,$diskon,$hj,$subtotal,$notatunai,$kdpram); + + print("
"); + print("

Rincian Penjualan


"); + print("

"); + + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek2 = mysqli_stmt_num_rows($stmt2); + if($cek2 > 0){ + mysqli_stmt_bind_result($stmt2,$nota,$tglnota,$kdcust,$tot,$disc,$keterangan,$kasir); + while(mysqli_stmt_fetch($stmt2)){ + print("Nomor Nota : ".$nota."
"); + print("Tanggal Nota : ".$tglnota."
"); + print("Plg : ".$kdcust."
"); + print("Total : ".number_format($tot,0,',','.')."
"); + print("Keterangan : ".$keterangan."
"); + print("Kasir : ".$kasir."

"); + } + } + } + + + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + print(""); + } + + print("
Kode Brg.NomorNamaJumlDiscHJSub TotalNota tunaiKd Pram
$kdbrg$nomor$nmbrg$jum".$diskon."".number_format($hj,0,',','.')."".number_format($subtotal,0,',','.')."$notatunai$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + //print("

"); + } +} + +function tunai($nonotatunai) +{ + + include "./db_login.inc.php"; + + $toko = substr($nonotatunai,1,1); + $database = '$dbh'.$toko; + + $dbh = mysql_connect(HOST,USER,PASSWORD); + $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(DATABASE,$dbh); + 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($database == '$dbh1'){ + $data = $dbh1; + }elseif($database == '$dbh2'){ + $data = $dbh2; + }elseif($database == '$dbh3'){ + $data = $dbh3; + }elseif($database == '$dbh4'){ + $data = $dbh4; + }elseif($database == '$dbh5'){ + $data = $dbh5; + }elseif($database == '$dbh6'){ + $data = $dbh6; + }elseif($database == '$dbh7'){ + $data = $dbh7; + }elseif($database == '$dbh8'){ + $data = $dbh8; + }elseif($database == '$dbh9'){ + $data = $dbh9; + } + /*----------------------------------------Rekap Tunai*/ + $query = mysql_query("SELECT d.`kd_barang`, d.`no_barang`, b.nama_barang,d.`jumlah`, d.`diskon`, + d.`harga_jual`,(d.`harga_jual`*d.`jumlah`) subtotal,d.`kode_pram` + FROM d_nota_tunai d,barang b + where d.`kd_barang`=b.kode_barang + and d.no_nota = '$nonotatunai'",$data); + $query2 = mysql_query("select m.no_nota,m.tgl_nota,m.kd_customer, + m.jumlah_total,m.total_uang,m.total_diskon, + m.bank,m.no_kartu,m.kasir + from m_nota_tunai m + where m.no_nota = '$nonotatunai'",$data); + + + print("
"); + print("

Rincian Penjualan


"); + print("

"); + + while($rowM=mysql_fetch_array($query2)){ + print("Nomor Nota : ".$rowM['no_nota']."
"); + print("Tanggal Nota : ".$rowM['tgl_nota']."
"); + print("Plg : ".$rowM['tgl_nota']."
"); + print("Total : ".number_format($rowM['jumlah_total'],0,',','.')."
"); + print("Jumlah uang : ".number_format($rowM['total_uang'],0,',','.')."
"); + print("Discount : ".$rowM['total_diskon']."
"); + print("Bank : ".$rowM['bank']."
"); + print("No.kartu : ".$rowM['no_kartu']."
"); + print("Kasir : ".$rowM['kasir']."

"); + } + + print(""); + print(""); + + while($rowD=mysql_fetch_array($query)){ + print(" + + "); + } + + print("
Kode Brg.NomorNamaJumlDiscHJSub TotalKd Pram
$rowD[kd_barang]$rowD[no_barang]$rowD[nama_barang]$rowD[jumlah]$rowD[diskon]".number_format($rowD['harga_jual'],0,',','.')."".number_format($rowD['subtotal'],0,',','.')."$rowD[kode_pram]

"); + print("
"); +} + +?> + +
+ + + + + diff --git a/old-source/rincitrans.php b/old-source/rincitrans.php new file mode 100644 index 0000000..1ddd963 --- /dev/null +++ b/old-source/rincitrans.php @@ -0,0 +1,160 @@ +"; + echo "table.tbl {width:950px;border-width:1px 1px 1px 1px;border-spacing:0;border-collapse:collapse;font-size:9pt;text-align:center;}"; + echo "table.tbl td {margin:0;padding:2px;border-width:1px 1px 0 0;}"; + echo "body {font-size:9pt;}"; + echo "div.luar{text-align:left;margin-left:150px;}"; + echo ".header{font-weight:bold;text-align:center;}"; + echo ".isi{text-align:left;}"; + echo ""; + +// $kodebarang = $_GET['n']; +// if(strlen($_GET['n']) > 12): +// $kodebarang = substr($_GET['n'],0,12); +// $nomor = substr($_GET['n'],12); +// elseif(strlen($_GET['n']) > 9): +// $kodebarang = substr($_GET['n'],0,9); +// $nomor = substr($_GET['n'],9); +// endif; + $startDate = decTgl($_POST['startDate2']); + $endDate = decTgl($_POST['endDate2']); + + if(bukaKoneksi()){ + global $conn; + /*----------------------------------------Rekap Tunai*/ + $query = "SELECT m.tgl_nota,d.no_nota,d.kd_barang,b.nama_barang,s.nama_supplier,d.no_barang,d.jumlah,d.diskon,d.harga_jual,d.kode_pram + FROM d_nota_tunai d,barang b,m_nota_tunai m, supplier s + WHERE d.kd_barang = b.kode_barang + and b.kode_supplier = s.kd_supplier + and d.no_nota = m.no_nota + and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate' + order by m.tgl_nota"; + if($stmt = mysqli_prepare($conn,$query)){ + mysqli_stmt_execute($stmt); + mysqli_stmt_store_result($stmt); + $cek = mysqli_stmt_num_rows($stmt); + if($cek > 0){ + mysqli_stmt_bind_result($stmt,$tgl,$nota,$kdbrg,$nmbrg,$kdlama,$no,$jml,$disc,$hj,$kdpram); + + print("
"); + print("

Rekap Transaksi Tunai



"); + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt)){ + print(""); + } + + print("
Tanggal NotaNo.NotaKode Brg.Nama Brg.SupplierNomorJumlDiscHJKd Pram
$tgl$nota$kdbrg$nmbrg$kdlama$no$jml$disc".number_format($hj,0,',','.')."$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + /*----------------------------------------Rekap bon barang*/ + $query2 = "SELECT m.tgl_bon,d.no_bon,m.kode_plg,d.kd_brg,b.nama_barang,s.nama_supplier,d.nomor,d.jumlah,d.diskon,d.hrg_satuan,d.kd_pram + FROM d_bon d, barang b, m_bon m, supplier s + WHERE d.kd_brg = b.kode_barang + and b.kode_supplier = s.kd_supplier + and d.no_bon = m.no_bon + and date(m.tgl_bon) BETWEEN '$startDate' AND '$endDate' + order by m.tgl_bon"; + if($stmt2 = mysqli_prepare($conn,$query2)){ + mysqli_stmt_execute($stmt2); + mysqli_stmt_store_result($stmt2); + $cek = mysqli_stmt_num_rows($stmt2); + if($cek > 0){ + mysqli_stmt_bind_result($stmt2,$tgl,$nota,$kdplg,$kdbrg,$nmbrg,$kdlama,$no,$jml,$disc,$hj,$kdpram); + + print("
"); + print("

Rekap Transaksi Bon



"); + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt2)){ + print(""); + } + + print("
Tanggal NotaNo.NotaKd.PlgKode Brg.Nama Brg.SupplierNomorJumlDiscHJKd Pram
$tgl$nota$kdplg$kdbrg$nmbrg$kdlama$no$jml$disc".number_format($hj,0,',','.')."$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + /*----------------------------------------Rekap Bawa */ + $query3 = "SELECT m.tgl_nota,d.no_nota,m.kd_customer,d.kd_barang,b.nama_barang,d.status_barang,s.nama_supplier,d.no_barang,d.jumlah,d.harga_satuan,d.kode_pram + FROM d_nota_bawa d,barang b,m_nota_bawa m, supplier s + WHERE d.kd_barang = b.kode_barang + and d.no_nota = m.no_nota + and b.kode_supplier = s.kd_supplier + and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate' + order by m.tgl_nota"; + //and status_barang is null + if($stmt3 = mysqli_prepare($conn,$query3)){ + mysqli_stmt_execute($stmt3); + mysqli_stmt_store_result($stmt3); + $cek = mysqli_stmt_num_rows($stmt3); + if($cek > 0){ + mysqli_stmt_bind_result($stmt3,$tgl,$nota,$kd_customer,$kdbrg,$nmbrg,$status,$kdlama,$no,$jml,$hj,$kdpram); + + print("
"); + print("

Rekap Transaksi Bawa



"); + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt3)){ + print(""); + } + + print("
Tanggal NotaNo.NotaKd. PlgKode Brg.Nama Brg.StatusSupplierNomorJumlHJKd Pram
$tgl$nota$kd_customer$kdbrg$nmbrg$status$kdlama$no$jml".number_format($hj,0,',','.')."$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + /*----------------------------------------Rekap retur */ + $query4 = "SELECT m.tgl_nota,d.no_nota,d.kd_barang,b.nama_barang,s.nama_supplier,d.no_barang,d.jumlah,d.diskon,d.harga_jual,d.kode_pram + FROM d_nota_retur d,barang b,m_nota_retur m, supplier s + WHERE d.kd_barang = b.kode_barang + and d.no_nota = m.no_nota + and b.kode_supplier = s.kd_supplier + and date(m.tgl_nota) BETWEEN '$startDate' AND '$endDate' + order by m.tgl_nota"; + if($stmt4 = mysqli_prepare($conn,$query4)){ + mysqli_stmt_execute($stmt4); + mysqli_stmt_store_result($stmt4); + $cek = mysqli_stmt_num_rows($stmt4); + if($cek > 0){ + mysqli_stmt_bind_result($stmt4,$tgl,$nota,$kdbrg,$nmbrg,$kdlama,$no,$jml,$disc,$hj,$kdpram); + + print("
"); + print("

Rekap Transaksi Retur



"); + print("

"); + print(""); + print(""); + + while(mysqli_stmt_fetch($stmt4)){ + print(""); + } + + print("
Tanggal NotaNo.NotaKode Brg.Nama Brg.Kode LamaNomorJumlDiscHJKd Pram
$tgl$nota$kdbrg$nmbrg$kdlama$no$jml$disc".number_format($hj,0,',','.')."$kdpram

"); + print("
"); + }else{ + echo "data tdk ada!"; + echo "
"; + } + } + + print("
"); + } +?> diff --git a/old-source/satuanbrg.php b/old-source/satuanbrg.php new file mode 100644 index 0000000..c63094e --- /dev/null +++ b/old-source/satuanbrg.php @@ -0,0 +1,92 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Satuan Barang +
+ + + + + + + + + + + +
ID Satuan Barang: + + + + +
Nama Satuan Barang: + +

+ +
+
+
+ +
+ +
+
Cari Satuan Barang
+
+ +
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + diff --git a/old-source/strip.php b/old-source/strip.php new file mode 100644 index 0000000..1bd5a9a --- /dev/null +++ b/old-source/strip.php @@ -0,0 +1,180 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Group Product +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group Product: + + + + +
Nama Group Product: + +

Batas Bawah Murah: + +
Batas Atas Murah: + +

Batas Bawah Sedang: + +
Batas Atas Sedang: + +

Batas Bawah Mahal: + +
Batas Atas Mahal: + +

Bonus Benik Murah: + +
Bonus Benik Sedang: + +
Bonus Benik Mahal: + +
Kelompok Barang: + +
Kategori: + (P,W,A,S) +
Persen Thiwul: + +

+ +
+
+
+ +
+ +
+
Cari Group Product
+
+ +
+
+ + + + +
Kode Lini Produk:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + diff --git a/old-source/supp_barang.php b/old-source/supp_barang.php new file mode 100644 index 0000000..d362492 --- /dev/null +++ b/old-source/supp_barang.php @@ -0,0 +1,60 @@ + + + + + Cleopatra + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Tambah Supp Barang +
+ + + + + + + + + + + + + + + + +
Kode Supplier:
Lini Produk:
Ranking:

+ +
+
+
+ +
+ + diff --git a/old-source/supplier.php b/old-source/supplier.php new file mode 100644 index 0000000..61032d2 --- /dev/null +++ b/old-source/supplier.php @@ -0,0 +1,183 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Supplier +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Kode Supplier: + + + + +
Supplier: + * +
Alamat: + * +
Nama rekening: + +
Nomor Rekening: + +
Bank: + +
Alamat 2: + +
Nomor Rekening 2: + +
Bank 2: + +
Telp: + +
Ponsel: + +
Email: + +
Fax: + +
Jenis pembayaran: + [H]utang,[T]unai,[K]onsinyasi +
Lama tempo: + +

+ +
+
+
+ +
+ +
+
Cari Supplier
+
+ +
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + diff --git a/old-source/tmplapbyrpersup.php b/old-source/tmplapbyrpersup.php new file mode 100644 index 0000000..fa45711 --- /dev/null +++ b/old-source/tmplapbyrpersup.php @@ -0,0 +1,82 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+ Laporan Pembayaran Per Supplier +
+
+
+ + +
Range Tanggal: s/d
+
+
+
+
+
+ +
+ + \ No newline at end of file diff --git a/old-source/transfer_barang/ambil_barang.php b/old-source/transfer_barang/ambil_barang.php new file mode 100644 index 0000000..e8ad9e5 --- /dev/null +++ b/old-source/transfer_barang/ambil_barang.php @@ -0,0 +1,51 @@ +query("SELECT brg.kode_barang,brg.kode_supplier,d.no_faktur,d.kode_asli,brg.nama_barang,n.harga_pokok, n.harga_jual, n.stok, n.nomor + FROM barang brg inner join no_barang n on brg.id_gabungan = n.id_gabungan,d_pembelian d + WHERE n.nomor = '$_REQUEST[nobarang]' + AND brg.kode_barang = '$_REQUEST[idbarang]' + AND (d.kode_barang = brg.kode_barang AND d.nomor = n.nomor) + AND left(d.no_faktur,4) <> 'RVB-' + AND n.stok > 0 + ORDER BY brg.kode_barang,n.nomor"); + } else if(!isset($_REQUEST['nobarang'])) + { + $data = $mysqli->query("SELECT brg.kode_barang,brg.kode_supplier,d.no_faktur,d.kode_asli,brg.nama_barang,n.harga_pokok, n.harga_jual, n.stok, n.nomor + FROM barang brg inner join no_barang n on brg.id_gabungan = n.id_gabungan,d_pembelian d + WHERE brg.kode_barang = '$_REQUEST[idbarang]' + AND (brg.kode_barang = d.kode_barang AND d.nomor = n.nomor) + AND left(d.no_faktur,4) <> 'RVB-' + AND n.stok > 0 + ORDER BY brg.kode_barang,n.nomor"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'],'kode_supp' => $a['kode_supplier'],'no_faktur' => $a['no_faktur'],'kode_asli' => $a['kode_asli'],'nama_barang' => $a['nama_barang'], + 'harga_beli' => $a['harga_pokok'],'harga_jual' => $a['harga_jual'], 'stok' => $a['stok'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/transfer_barang/ambil_barang_kembali.php b/old-source/transfer_barang/ambil_barang_kembali.php new file mode 100644 index 0000000..a6a95fb --- /dev/null +++ b/old-source/transfer_barang/ambil_barang_kembali.php @@ -0,0 +1,49 @@ +query("SELECT brg.kode_barang,brg.kode_supplier,d.no_faktur,d.kode_asli,brg.nama_barang,n.harga_pokok, n.harga_jual, n.stok, n.nomor + FROM barang brg inner join no_barang n on brg.id_gabungan = n.id_gabungan,d_pembelian d + WHERE n.nomor = '$_REQUEST[nobarang]' + AND brg.kode_barang = '$_REQUEST[idbarang]' + AND (d.kode_barang = brg.kode_barang AND d.nomor = n.nomor) + AND left(d.no_faktur,4) <> 'RVB-' + ORDER BY brg.kode_barang,n.nomor"); + } else if(!isset($_REQUEST['nobarang'])) + { + $data = $mysqli->query("SELECT brg.kode_barang,brg.kode_supplier,d.no_faktur,d.kode_asli,brg.nama_barang,n.harga_pokok, n.harga_jual, n.stok, n.nomor + FROM barang brg inner join no_barang n on brg.id_gabungan = n.id_gabungan,d_pembelian d + WHERE brg.kode_barang = '$_REQUEST[idbarang]' + AND (brg.kode_barang = d.kode_barang AND d.nomor = n.nomor) + AND left(d.no_faktur,4) <> 'RVB-' + ORDER BY brg.kode_barang,n.nomor"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'],'kode_supp' => $a['kode_supplier'],'no_faktur' => $a['no_faktur'],'kode_asli' => $a['kode_asli'],'nama_barang' => $a['nama_barang'], + 'harga_beli' => $a['harga_pokok'],'harga_jual' => $a['harga_jual'], 'stok' => $a['stok'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/transfer_barang/ambil_kode_barang.php b/old-source/transfer_barang/ambil_kode_barang.php new file mode 100644 index 0000000..c918f36 --- /dev/null +++ b/old-source/transfer_barang/ambil_kode_barang.php @@ -0,0 +1,53 @@ +query("SELECT DISTINCT d.kode_barang, m.kd_supplier, b.nama_barang, sup.nama_supplier, + m.tgl_nota, m.tgl_masuk, m.tgl_jatuh_tempo, m.status, m.keterangan, m.nik + FROM m_pembelian m, d_pembelian d, barang b, supplier sup, no_barang n + WHERE m.no_faktur = d.no_faktur + AND d.kode_barang = b.kode_barang + AND b.id_gabungan = n.id_gabungan + AND m.kd_supplier = sup.kd_supplier + AND n.stok > 0 + AND m.no_faktur='$_REQUEST[nofaktur]' + ORDER BY d.kode_barang"); + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + $jdata = $mysqli->query("SELECT count(*) + FROM m_pembelian m, d_pembelian d, barang b, supplier sup, no_barang n + WHERE m.no_faktur = d.no_faktur + AND d.kode_barang = b.kode_barang + AND b.id_gabungan = n.id_gabungan + AND m.kd_supplier = sup.kd_supplier + AND n.stok > 0 + AND m.no_faktur='$_REQUEST[nofaktur]'"); + $j = $jdata->fetch_array(MYSQL_NUM); + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'], 'kd_supplier' => $a['kd_supplier'], + 'nama_barang' => $a['nama_barang'], 'supplier' => $a['nama_supplier'], + 'tglnota' => $a['tgl_nota'],'tglmasuk' => $a['tgl_masuk'],'tgljthtempo' => $a['tgl_jatuh_tempo'], + 'status' => $a['status'],'keterangan' => $a['keterangan'],'nik' => $a['nik'], + 'jdata' => $j[0] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/transfer_barang/ambil_nomor.php b/old-source/transfer_barang/ambil_nomor.php new file mode 100644 index 0000000..cde9905 --- /dev/null +++ b/old-source/transfer_barang/ambil_nomor.php @@ -0,0 +1,36 @@ +query("SELECT DISTINCT nomor FROM d_pembelian WHERE kode_barang='$_REQUEST[idbarang]' ORDER BY nomor"); + $data = $mysqli->query("SELECT n.nomor FROM d_pembelian d, no_barang n, barang b + WHERE d.kode_barang='$_REQUEST[idbarang]' + AND b.id_gabungan = n.id_gabungan + AND (d.kode_barang = b.kode_barang and d.nomor = n.nomor) + AND left(d.no_faktur,4) <> 'RVB-' + AND n.stok > 0 + ORDER BY nomor"); + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_NUM)) + { + $harray[$idx] = array('nomor' => $a[0]); + $idx++; + } + } + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} \ No newline at end of file diff --git a/old-source/transfer_barang/ambil_nomor_kembali.php b/old-source/transfer_barang/ambil_nomor_kembali.php new file mode 100644 index 0000000..4bbf87f --- /dev/null +++ b/old-source/transfer_barang/ambil_nomor_kembali.php @@ -0,0 +1,35 @@ +query("SELECT DISTINCT nomor FROM d_pembelian WHERE kode_barang='$_REQUEST[idbarang]' ORDER BY nomor"); + $data = $mysqli->query("SELECT n.nomor FROM d_pembelian d, no_barang n, barang b + WHERE d.kode_barang='$_REQUEST[idbarang]' + AND b.id_gabungan = n.id_gabungan + AND (d.kode_barang = b.kode_barang and d.nomor = n.nomor) + AND left(d.no_faktur,4) <> 'RVB-' + ORDER BY nomor"); + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_NUM)) + { + $harray[$idx] = array('nomor' => $a[0]); + $idx++; + } + } + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} \ No newline at end of file diff --git a/old-source/transfer_barang/cari_nota.php b/old-source/transfer_barang/cari_nota.php new file mode 100644 index 0000000..cd4d735 --- /dev/null +++ b/old-source/transfer_barang/cari_nota.php @@ -0,0 +1,94 @@ +query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur != "" && $tglawal != "" && $tglakhir != "" && $kdsup == "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur != "" && $tglawal == "" && $tglakhir == "" && $kdsup != "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur != "" && $tglawal == "" && $tglakhir == "" && $kdsup == "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur == "" && $tglawal != "" && $tglakhir != "" && $kdsup != "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur == "" && $tglawal != "" && $tglakhir != "" && $kdsup == "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur == "" && $tglawal == "" && $tglakhir == "" && $kdsup != "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + + $harray[$idx] = array( + 'no_faktur' => $a['no_faktur'], 'tgl_nota' => substr($a['tgl_nota'],8,2)."-".substr($a['tgl_nota'],5,2)."-".substr($a['tgl_nota'],0,4), 'rp_beli' => $a['rp_beli'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/transfer_barang/fungsi_transfer.php b/old-source/transfer_barang/fungsi_transfer.php new file mode 100644 index 0000000..c4a46c9 --- /dev/null +++ b/old-source/transfer_barang/fungsi_transfer.php @@ -0,0 +1,567 @@ + ".$nofaktur; + $stmt = $mysqli->prepare("INSERT INTO m_pembelian VALUES (?, now(), now(), '-', now(), ?, 'T', 0, ?, ?, 0, '1', '$ket', now(), ?, ?)"); + $stmt->bind_param("sssiss", $norhp, $kd_supplier, $nik, $rpbeli, $nofaktur, $statusrvb); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} + +function insert_d_pembelian($norhp, $kode_barang, $kode_lama, $nomor, $stok, $stokrev, $hplama, $hjlama, $hpbaru, $hjbaru, $nama, $idgabungan) +{ + $hasil = FALSE; + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if(!mysqli_connect_errno()) + { + for ($i = 0; $i < count($kode_barang); $i++) + { + /* insert data lama */ + $hplm = decode_hp($hplama[$i]); + $profitlama = ceil((($hjlama[$i] - $hplm) / $hplm) * 100); + $stoklama = -1 * $stok[$i]; + $faktur_asli = get_kode_faktur_asli($kode_barang[$i]); + $stmt = $mysqli->prepare("INSERT INTO d_pembelian(no_faktur, kode_barang, kode_baranglama, nomor, jumlah, harga_satuan, harga_pokok, harga_jual, profit, kode_asli, jum_fisik, jenis, lokasi, hj_final, nm_brg) + VALUES (?, ?, ?, ?, ?, 0, ?, ?, ?, '-', ?, 'S', '1A', ?, ?)"); + $stmt->bind_param("ssssisiiiis", $norhp, $kode_barang[$i], $kode_lama[$i], $nomor[$i], $stoklama, $hplama[$i], $hjlama[$i], $profitlama, $stoklama, $hjlama[$i], $nama[$i]); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + + /* insert data baru */ + if ($hasil) + { + $hpbr = decode_hp($hpbaru[$i]); + $profitbaru = ceil((($hjbaru[$i] - $hpbr) / $hpbr) * 100); + $stmt = $mysqli->prepare("INSERT INTO d_pembelian(no_faktur, kode_barang, kode_baranglama, nomor, jumlah, harga_satuan, harga_pokok, harga_jual, profit, kode_asli, jum_fisik, jenis, lokasi, hj_final, nm_brg) + VALUES (?, ?, ?, ?, ?, 0, ?, ?, ?, '-', ?, 'S', '1A', ?, ?)"); + $stmt->bind_param("ssssisiiiis", $norhp, $kode_barang[$i], $kode_lama[$i], $nomor[$i], $stokrev[$i], $hpbaru[$i], $hjbaru[$i], $profitbaru, $stokrev[$i], $hjbaru[$i], $nama[$i]); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* update barang*/ + if ($hasil) + { + $update2 = update_barang($idgabungan[$i], $nama[$i]); + if($update2) + { + $hasil = TRUE; + } else + { + $hasil = FALSE; + } + } + + /* update no_barang*/ + if ($hasil) + { + $update = update_no_barang($idgabungan[$i], $nomor[$i], $hpbaru[$i], $hjbaru[$i], $stokrev[$i]); + if($update) + { + $hasil = TRUE; + } else + { + $hasil = FALSE; + } + } + $faktur_asli = ""; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} + +/** + * + * @param $id + * @param $nomor + * @param $hp + * @param $hj + * @return unknown_type + */ +function update_no_barang($id, $nomor, $hp, $hj, $stokrev) +{ + $hasil = FALSE; + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if(!mysqli_connect_errno()) + { + // isi table master + $stmt = $mysqli->prepare("UPDATE no_barang SET stok = ?,harga_pokok = ?, harga_jual = ? WHERE id_gabungan = ? AND nomor = ?"); + $stmt->bind_param("isiss", $stokrev, $hp, $hj, $id, $nomor); + $stmt->execute(); + if($stmt->affected_rows >= 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} + +function update_barang($id, $nama) +{ + $hasil = FALSE; + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if(!mysqli_connect_errno()) + { + // isi table master + $stmt = $mysqli->prepare("UPDATE barang SET nama_barang = ? WHERE id_gabungan = ?"); + $stmt->bind_param("ss", $nama, $id); + $stmt->execute(); + if($stmt->affected_rows >= 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} +/** + * + * @param $kdsupplier + * @return unknown_type + */ +function get_no_rhp($kdsupplier) +{ + $urutbaru = 0; + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + // cek ada atau tidak + if(cek_data($kdsupplier)) + { + $data_faktur = $mysqli->query("SELECT MAX(RIGHT(no_faktur, 3)) FROM m_pembelian WHERE LEFT(no_faktur, 10) = 'RVB-{$kdsupplier}'"); + if($data_faktur->num_rows > 0) + { + $urut = $data_faktur->fetch_array(); + $urutbaru = (int)$urut[0] + 1; + if(strlen($urutbaru) == 1) + { + $urutbaru = "00".$urutbaru; + } + if(strlen($urutbaru) == 2) + { + $urutbaru = "0".$urutbaru; + } + /* tutup hasil query */ + $data_faktur->close(); + } + } else + { + $urutbaru = "000"; + } + $hasil[0] = "RVB-".$kdsupplier."-".$urutbaru; + echo json_encode($hasil); + /* tutup koneksi */ + $mysqli->close(); +} + +/** + * + * @param $kodesupplier + * @return unknown_type + */ +function cek_data($kodesupplier) +{ + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + // cek ada atau tidak + $data = $mysqli->query("SELECT COUNT(*) FROM m_pembelian WHERE LEFT(no_faktur, 10) = 'RVB-{$kodesupplier}'"); + $dt = $data->fetch_array(); + if($dt[0] > 0) + { + return true; + } else + { + return false; + } + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); +} + +/** + * + * @param $kode + * @param $nomor + * @param $kd_supplier + * @return unknown_type + */ +function ambil_barang($kode, $nomor, $nofaktur) +{ + if($kode != "" || $nomor != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if($nomor != "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.kode_lama, brg.nama_barang, brg.id_gabungan, nb.stok, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, supplier s, d_pembelian dp + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND brg.kode_barang = '{$kode}' AND nb.nomor = '{$nomor}' + AND brg.kode_supplier = s.kd_supplier AND dp.no_faktur = '{$nofaktur}' LIMIT 1"); + } else if($nomor == "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.kode_lama, brg.nama_barang, brg.id_gabungan, nb.stok, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, supplier s, d_pembelian dp + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND brg.kode_barang = '{$kode}' + AND brg.kode_supplier = s.kd_supplier AND dp.no_faktur = '{$nofaktur}' LIMIT 1"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('kode_barang' => $a['kode_barang'], 'kode_lama' => $a['kode_lama'], 'nama_barang' => $a['nama_barang'], + 'supplier' => $a['nama_supplier'], 'id_gabungan' => $a['id_gabungan'], 'stok' => $a['stok'], + 'kd_supplier' => $a['kode_supplier'], 'hp' => $a['harga_pokok'], 'hj' => $a['harga_jual'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kode + * @param $nomor + * @param $kd_supplier + * @return unknown_type + */ +function cek_barang($kode, $nomor, $nofaktur) +{ + if($kode != "" || $nomor != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + + if($nomor != "") + { + $data = $mysqli->query("SELECT count(*) + FROM barang brg, no_barang nb, d_pembelian dp + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND brg.kode_barang = '{$kode}' AND nb.nomor = '{$nomor}' + AND dp.no_faktur = '{$nofaktur}'"); + } else if($nomor == "") + { + $data = $mysqli->query("SELECT count(*) + FROM barang brg + WHERE brg.kode_barang = '{$kode}'"); + } + if($data->num_rows > 0) + { + $jum = $data->fetch_array(); + if($jum[0] > 0) + { + $harray[0] = "true"; + } else + { + $harray[0] = "false"; + } + /* tutup hasil query */ + $data->close(); + } else + { + $harray[0] = "false"; + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kode + * @param $nama + * @param $kd_supplier + * @return unknown_type + */ +function cari_barang($kode, $nama) +{ + if($kode != "" || $nama != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + + if($nama != "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.nama_barang, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, d_pembelian dp, supplier s + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND brg.kode_supplier = s.kd_supplier + AND brg.nama_barang LIKE '%{$nama}%'"); + } else if($nama == "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.nama_barang, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, d_pembelian dp, supplier s + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang AND brg.kode_supplier = s.kd_supplier + AND brg.kode_barang LIKE '{$kode}%'"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'], 'nama_barang' => $a['nama_barang'], 'supplier' => $a['nama_supplier'], + 'kd_supplier' => $a['kode_supplier'], 'hp' => $a['harga_pokok'], 'hj' => $a['harga_jual'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kode + * @param $nama + * @return unknown_type + */ +function get_supplier($kode, $nama) +{ + if($kode != "" || $nama != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + + if($nama != "") + { + $data = $mysqli->query("SELECT s.kd_supplier, s.nama_supplier + FROM supplier s + WHERE s.kd_supplier LIKE '%{$kode}%' AND s.nama_supplier LIKE '%{$nama}%'"); + } else if($nama == "") + { + $data = $mysqli->query("SELECT s.kd_supplier, s.nama_supplier + FROM supplier s + WHERE s.kd_supplier LIKE '%{$kode}%'"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('kode_supplier' => $a['kd_supplier'], 'nama_supplier' => $a['nama_supplier']); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kodebarang + * @return unknown_type + */ +function get_kode_faktur_asli($kodebarang) +{ + $faktur = ""; + if($kodebarang != "" ) + { + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + + $data = $mysqli->query("SELECT d.no_faktur FROM d_pembelian d WHERE d.kode_barang = '{$kodebarang}'"); + if($data->num_rows > 0) + { + $faktur = $data->fetch_array(MYSQLI_NUM); + $faktur = $faktur[0]; + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + return $faktur; +} +/** + * + * @param $data + * @return unknown_type + */ +function hitung_total_hp($data, $stok) +{ + $total = 0; + for ($i = 0; $i < count($data); $i++) + { + $total += decode_hp($data[$i]) * $stok[$i]; + } + return $total; +} + +/** + * + * @param $hp + * @return int hasil decode + */ +function decode_hp($hp) +{ + $dt = ""; + for($i = 0; $i < strlen($hp); $i++) + { + $chr = substr($hp, $i, 1); + switch($chr) + { + case "B" : $dt .= "1";break; + case "R" : $dt .= "2";break; + case "A" : $dt .= "3";break; + case "W" : $dt .= "4";break; + case "N" : $dt .= "5";break; + case "F" : $dt .= "6";break; + case "O" : $dt .= "7";break; + case "X" : $dt .= "8";break; + case "E" : $dt .= "9";break; + case "S" : $dt .= "0";break; + } + } + return (int) $dt; +} +?> \ No newline at end of file diff --git a/old-source/transfer_barang/hmenu.php~ b/old-source/transfer_barang/hmenu.php~ new file mode 100644 index 0000000..d85bac3 --- /dev/null +++ b/old-source/transfer_barang/hmenu.php~ @@ -0,0 +1,128 @@ + diff --git a/old-source/transfer_barang/menu.php b/old-source/transfer_barang/menu.php new file mode 100644 index 0000000..ee6ae61 --- /dev/null +++ b/old-source/transfer_barang/menu.php @@ -0,0 +1,130 @@ + + + + + +
+ +
diff --git a/old-source/transfer_barang/transfer_ambil_barang.php b/old-source/transfer_barang/transfer_ambil_barang.php new file mode 100644 index 0000000..ec0ec20 --- /dev/null +++ b/old-source/transfer_barang/transfer_ambil_barang.php @@ -0,0 +1,45 @@ +query("SELECT dt.kode_barang_nota, d.kode_asli,b.nama_barang, dt.jumlah, dt.harga_satuan, dt.nomor, dt.kd_supplier, dt.no_nota, n.stok + FROM d_transfer dt, barang b,d_pembelian d, no_barang n + WHERE (dt.kode_barang_nota = b.kode_barang AND dt.nomor = d.nomor) + AND (d.kode_barang = b.kode_barang AND d.nomor = n.nomor) + AND b.id_gabungan = n.id_gabungan + AND left(d.no_faktur,4) <> 'RVB-' + AND dt.id_transfer = $_REQUEST[idtransfer] + ORDER BY dt.kode_barang_nota,dt.nomor"); + if($data->num_rows > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kd_barang' => $a['kode_barang_nota'], 'nama_barang' => $a['nama_barang'], 'kode_asli' => $a['kode_asli'], + 'jumlah' => $a['jumlah'], 'harga_satuan' => $a['harga_satuan'], 'nomor_barang' => $a['nomor'], 'kd_supp' => $a['kd_supplier'], 'no_nota' => $a['no_nota'], 'stok' => $a['stok']); + $idx++; + } + + /* tutup hasil query */ + $data->close(); + + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} \ No newline at end of file diff --git a/old-source/transfer_barang/transfer_cari_nota.php b/old-source/transfer_barang/transfer_cari_nota.php new file mode 100644 index 0000000..085ac7c --- /dev/null +++ b/old-source/transfer_barang/transfer_cari_nota.php @@ -0,0 +1,61 @@ +query("SELECT mt.id_transfer, mt.tgl_transfer, mt.toko_asal, mt.toko_tujuan, mt.diskon, mt.jml_item, mt.total_transfer + FROM m_transfer mt + WHERE mt.id_transfer LIKE '%$nofaktur%' + AND mt.tgl_transfer BETWEEN '$tglawal' AND '$tglakhir' + AND mt.validasi = '$valid'"); + else if($nofaktur != "" && $tglawal == "" && $tglakhir == "") + $data = $mysqli->query("SELECT mt.id_transfer, mt.tgl_transfer, mt.toko_asal, mt.toko_tujuan, mt.diskon, mt.jml_item, mt.total_transfer + FROM m_transfer mt + WHERE mt.id_transfer LIKE '%$nofaktur%' + AND mt.validasi = '$valid'"); + else if($nofaktur == "" && $tglawal != "" && $tglakhir != "") + $data = $mysqli->query("SELECT mt.id_transfer, mt.tgl_transfer, mt.toko_asal, mt.toko_tujuan, mt.diskon, mt.jml_item, mt.total_transfer + FROM m_transfer mt + WHERE mt.tgl_transfer BETWEEN '$tglawal' AND '$tglakhir' + AND mt.validasi = '$valid'"); + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'id_transfer' => $a['id_transfer'], 'tgl_transfer' => substr($a['tgl_transfer'],8,2)."-".substr($a['tgl_transfer'],5,2)."-".substr($a['tgl_transfer'],0,4), + 'toko_asal' => $a['toko_asal'], 'toko_tujuan' => $a['toko_tujuan'], 'diskon' => $a['diskon'], 'jml_item' => $a['jml_item'], 'total_transfer' => $a['total_transfer'], + 'faktur_oper' => $_SESSION["kodetoko"]."-".substr($a['tgl_transfer'],5,2)."-".substr($a['tgl_transfer'],0,4)."-".$a['id_transfer'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + + echo json_encode($harray); +} \ No newline at end of file diff --git a/old-source/transfer_barang/transfer_fbaru.php b/old-source/transfer_barang/transfer_fbaru.php new file mode 100644 index 0000000..a0867e5 --- /dev/null +++ b/old-source/transfer_barang/transfer_fbaru.php @@ -0,0 +1,215 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ Transfer Barang - Baru + + + + + + + + + + + + + + + +
Tanggal Transfer: + + Toko Asal:
Diskon: %Toko Tujuan:
Total Oper:
Jumlah Item Oper:
+
+ + + + + + + + + + + +
KODE BARANGKODE ASLINAMA BARANGNOMORHARGA SATUAN BELISTOK KOMPJML TRANSFER
+
+
+ + + +
+
+
+
+ +
+ + +
+

+
+ +
+

+
+ +
+ + + + + + + + + + + +
Nomor Faktur:
Rentang Tanggal: + s/d + +
Kode Supplier:
+
+ Hasil pencarian +
+
+
+ + +
+ + + + + + + + +
Kode Barang:
Nama Barang: + +
+
+ Hasil pencarian +
+
+
+ + + + + + + + + + diff --git a/old-source/transfer_barang/transfer_fedit.php b/old-source/transfer_barang/transfer_fedit.php new file mode 100644 index 0000000..a7f1fae --- /dev/null +++ b/old-source/transfer_barang/transfer_fedit.php @@ -0,0 +1,230 @@ + + + + + :: Pengadaan Barang + + + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ Transfer Barang - Edit + + + + + + + + + + + + + + + + + + + + +
ID Transfer: + + No.Faktur Transfer:
Tanggal Transfer: + Toko Asal:
Diskon: %Toko Tujuan:
Total Oper:
Jumlah Item Oper:
+
+ + + + + + + + + + + +
KODE BARANGKODE ASLINAMA BARANGNOMORHARGA SATUAN BELISTOK KOMPJML TRANSFER
+
+
+ + + + + +
+
+
+
+ +
+ + +
+

+
+ +
+

+
+ +
+ + + + + + + + +
ID Transfer:
Rentang Tanggal: + s/d + +
+
+ Hasil pencarian +
+
+
+ + +
+ + + + + + + +
Kode Barang:
Nama Barang:
+
+ Hasil pencarian +
+
+
+ + + + + + + + + diff --git a/old-source/transfer_barang/transfer_fprint.php b/old-source/transfer_barang/transfer_fprint.php new file mode 100644 index 0000000..b78653b --- /dev/null +++ b/old-source/transfer_barang/transfer_fprint.php @@ -0,0 +1,195 @@ + + + + + :: Pengadaan Barang + + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ Transfer Barang - Print + + + + + + + + + + + + + + + + + + + + +
ID Transfer: + + No.Faktur Transfer:
Tanggal Transfer: Toko Asal:
Diskon: %Toko Tujuan:
Total Oper:
Jumlah Item Oper:
+
+ + + + + + + + + + + +
+
+ +
+
+
+
+ +
+ + +
+

+
+ +
+

+
+ +
+ + + + + + + + +
ID Transfer:
Rentang Tanggal: + s/d + +
+
+ Hasil pencarian +
+
+
+ + + + + + + diff --git a/old-source/transfer_barang/transfer_hapus.php b/old-source/transfer_barang/transfer_hapus.php new file mode 100644 index 0000000..dccdb02 --- /dev/null +++ b/old-source/transfer_barang/transfer_hapus.php @@ -0,0 +1,31 @@ +prepare("DELETE FROM d_transfer WHERE id_transfer = ? AND kode_barang_nota = ? AND jumlah = ? AND harga_satuan = ? AND nomor = ? LIMIT 1"); + $stmt->bind_param("isiis",$transfer_id, $kode, $jumlah, $harga, $no); + $stmt->execute(); + if($stmt->affected_rows > 0) $hasil = 1; + else $hasil = 0; + $stmt->close(); + } + $harray = array('hasil' => $hasil); + echo json_encode($harray); +} +/* end file */ \ No newline at end of file diff --git a/old-source/transfer_barang/transfer_kembali.php b/old-source/transfer_barang/transfer_kembali.php new file mode 100644 index 0000000..6eb2386 --- /dev/null +++ b/old-source/transfer_barang/transfer_kembali.php @@ -0,0 +1,224 @@ + + + + + :: Pengadaan Barang + + + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ Transfer Barang - Kembali + + + + + + + + + + + + + + + + + + + + +
ID Transfer: + + No.Faktur Transfer:
Tanggal Transfer: + Toko Asal:
Diskon: %Toko Tujuan:
Total Kembali:
Jumlah Item Kembali:
+
+ + + + + + + + + + +
KODE BARANGNAMA BARANGNOMORHARGA SATUAN BELISTOK KOMPJML TRANSFERJML BRG KEMBALI
+
+
+ + + +
+
+
+
+ +
+ + +
+

+
+ +
+

+
+ +
+ + + + + + + + +
ID Transfer:
Rentang Tanggal: + s/d + +
+
+ Hasil pencarian +
+
+
+ + +
+ + + + + + + +
Kode Barang:
Nama Barang:
+
+ Hasil pencarian +
+
+
+ + + + + + + + + diff --git a/old-source/transfer_barang/transfer_print.php b/old-source/transfer_barang/transfer_print.php new file mode 100644 index 0000000..0a5e742 --- /dev/null +++ b/old-source/transfer_barang/transfer_print.php @@ -0,0 +1,165 @@ +query("SELECT d.jumlah, d.kode_barang_nota, b.nama_barang, d.nomor, d.harga_satuan, d.jumlah * d.harga_satuan as jum, + d.kd_supplier,s.nama_supplier,d.no_nota + FROM d_transfer d, barang b,supplier s + WHERE d.kode_barang_nota = b.kode_barang + AND d.kd_supplier = s.kd_supplier + AND d.id_transfer = $_POST[idtransfer]"); + + $tabledetil = "" + . "" + . "" + . "" + . "" + . "" + . "" + . "" + . "" + . "" + . ""; + + if($transferdata->num_rows > 0) + { + $subtotal = 0; + while($a = $transferdata->fetch_array(MYSQLI_ASSOC)) + { + $tabledetil .= "" + . "" + . "" + . "" + . "" + . "" + . "" + . "" + . "" + . ""; + + $subtotal += $a['jum']; + $vol += $a['jumlah']; + } + $jdiskon = $subtotal*($_POST['diskon']/100); + $tabledetil .= "" + . "" + . "" + . ""; + $tabledetil .= "" + . "" + . ""; + $tabledetil .= "" + . "" + . ""; + + /* tutup hasil query */ + $transferdata->close(); + } + $tabledetil .= "
Jml BarangKd BarangNama BarangNomorKd SuppNama SuppNo FakturHarga SatuanJumlah
".$a['jumlah']."".$a['kode_barang_nota']."".$a['nama_barang']."".$a['nomor']."".$a['kd_supplier']."".$a['nama_supplier']."".$a['no_nota']."".number_format($a['harga_satuan'],0,',','.')."".number_format($a['jum'],0,',','.')." 
".$vol."Sub Total  ".number_format($subtotal,0,',','.')." 
Disc. ".$_POST['diskon']." %  ".number_format($jdiskon,0,',','.')." 
Netto  ".number_format(($subtotal-$jdiskon),0,',','.')." 
"; + echo ""; + echo ""; + + /*lembar 1***************************************************************************************************/ + echo "
"; + echo "

"; + echo "
"; + echo "
"; + echo " "; + echo "
DARI TOKO:". $_POST['tokoasal'] ."
OPER KE:".$_POST['tokotujuan']."
"; + echo "
"; + echo " "; + echo " "; + echo "
NO.FAKTUR OPER:". $_POST['fakturoper'] ."
TANGGAL NOTA:". $_POST['tgltransfer'] ."
"; + echo "


"; + echo $tabledetil; + echo "
"; + echo "
"; + + /*lembar 2***************************************************************************************************/ + echo "
"; + echo "

"; + echo "
"; + echo "
"; + echo " "; + echo "
DARI TOKO:". $_POST['tokoasal'] ."
OPER KE:".$_POST['tokotujuan']."
"; + echo "
"; + echo " "; + echo " "; + echo "
NO.FAKTUR OPER:". $_POST['fakturoper'] ."
TANGGAL NOTA:". $_POST['tgltransfer'] ."
"; + echo "


"; + echo $tabledetil; + echo "
"; + echo "
"; + + /*lembar 3***************************************************************************************************/ + echo "
"; + echo "

"; + echo "
"; + echo "
"; + echo " "; + echo "
DARI TOKO:". $_POST['tokoasal'] ."
OPER KE:".$_POST['tokotujuan']."
"; + echo "
"; + echo " "; + echo " "; + echo "
NO.FAKTUR OPER:". $_POST['fakturoper'] ."
TANGGAL NOTA:". $_POST['tgltransfer'] ."
"; + echo "


"; + echo $tabledetil; + echo "
"; + echo "
"; + + } +} +?> \ No newline at end of file diff --git a/old-source/transfer_barang/transfer_simpan.php b/old-source/transfer_barang/transfer_simpan.php new file mode 100644 index 0000000..ced26ef --- /dev/null +++ b/old-source/transfer_barang/transfer_simpan.php @@ -0,0 +1,91 @@ + $kode[$id], 'nomor' => $no_barang[$id], 'kodeasli' => $kodeasli[$id], 'hb' => $hb_satuan[$id], 'jumlah' => $jumlah[$id], 'kodesupp' => $kd_supplier[$id], 'nofaktur' => $no_faktur[$id]); + + // urutkan datanya + sort($aDataTransfer); + + // proses penggabungan data yang sama + $aHasil = array(); + $co = 0; + $c=0; + for ($i=0;$iprepare("INSERT INTO m_transfer(tgl_transfer, toko_asal, toko_tujuan, diskon, jml_item, total_transfer) + VALUES (?, ?, ?, ?, ?, ?)"); + $stmt->bind_param("sssiii", $tgl_transfer, $tokoasal, $tokotujuan, $diskon, $jml_oper, $tot_oper); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = 1; + $transfer_id = $mysqli->insert_id; + } + else $hasil = 0; + $stmt->close(); + + // isi table detil transfer + for($i=0; $iprepare("INSERT INTO d_transfer(id_transfer, kode_barang_nota, jumlah, harga_satuan, nomor, kd_supplier, no_nota) + VALUES (?,?,?,?,?,?,?)"); + $stmt->bind_param("isiisss",$transfer_id, $aHasil[$i]['kode'], $aHasil[$i]['jumlah'], $aHasil[$i]['hb'], $aHasil[$i]['nomor'], $aHasil[$i]['kodesupp'], $aHasil[$i]['nofaktur']); + $stmt->execute(); + if($stmt->affected_rows > 0) $hasil = 1; + else $hasil = 0; + $stmt->close(); + } + } + + $harray = array('hasil' => $hasil, 'id_transfer' => $transfer_id); + echo json_encode($harray); +} \ No newline at end of file diff --git a/old-source/transfer_barang/transfer_simpan_kembali.php b/old-source/transfer_barang/transfer_simpan_kembali.php new file mode 100644 index 0000000..6fb9b7d --- /dev/null +++ b/old-source/transfer_barang/transfer_simpan_kembali.php @@ -0,0 +1,94 @@ + $kode[$id], 'nomor' => $no_barang[$id], 'kodeasli' => $kodeasli[$id], 'hb' => $hb_satuan[$id], 'jumlah' => $jumlah[$id], 'kodesupp' => $kd_supplier[$id], 'nofaktur' => $no_faktur[$id]); + + // urutkan datanya + sort($aDataTransfer); + + // proses penggabungan data yang sama + $aHasil = array(); + $co = 0; + $c=0; + for ($i=0;$iprepare("INSERT INTO m_transfer_kembali(tgl_transfer, tgl_kembali, toko_asal, toko_tujuan, diskon, jml_item, total_transfer, faktur_oper) + VALUES (?, ?, ?, ?, ?, ?, ?, ?)"); + $stmt->bind_param("ssssiiis", $tgl_transfer, $tgl_kembali, $tokoasal, $tokotujuan, $diskon, $jml_oper, $tot_oper, $faktur_oper); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = 1; + $transfer_id = $mysqli->insert_id; + } + else $hasil = 0; + $stmt->close(); + + // isi table detil transfer + for($i=0; $iprepare("INSERT INTO d_transfer_kembali(id_transfer, kode_barang_nota, jumlah, harga_satuan, nomor, kd_supplier, no_nota) + VALUES (?,?,?,?,?,?,?)"); + $stmt->bind_param("isiisss",$transfer_id, $aHasil[$i]['kode'], $aHasil[$i]['jumlah'], $aHasil[$i]['hb'], $aHasil[$i]['nomor'], $aHasil[$i]['kodesupp'], $aHasil[$i]['nofaktur']); + $stmt->execute(); + if($stmt->affected_rows > 0) $hasil = 1; + else $hasil = 0; + $stmt->close(); + } + } + + $harray = array('hasil' => $hasil, 'id_transfer' => $transfer_id); + echo json_encode($harray); +} \ No newline at end of file diff --git a/old-source/transfer_barang/transfer_update.php b/old-source/transfer_barang/transfer_update.php new file mode 100644 index 0000000..86b4458 --- /dev/null +++ b/old-source/transfer_barang/transfer_update.php @@ -0,0 +1,132 @@ +prepare("UPDATE m_transfer SET tgl_transfer = ? , toko_tujuan = ?, diskon = ?, jml_item = ?, total_transfer = ? + WHERE id_transfer = ?"); + $stmt->bind_param("ssiiii", $tgl_transfer, $tokotujuan, $diskon, $jml_oper, $tot_oper, $transfer_id); + $stmt->execute(); + if($stmt->affected_rows > 0) $hasilmaster = 1; + else $hasilmaster = 0; + $stmt->close(); + + // begin update data table detail <-- + $aDataBaru = array(); + // masukkan semua data baru dalam satu array + for($id=0; $id $kode[$id], 'nomor' => $no_barang[$id], 'kodeasli' => $kodeasli[$id], 'hb' => $hb_satuan[$id], 'jumlah' => $jumlah[$id], 'kodesupp' => $kd_supplier[$id], 'nofaktur' => $no_faktur[$id] ); + + // urutkan datanya + sort($aDataBaru); + // proses penggabungan data yang sama + + $aBaru = array(); + $co = 0; + $c=0; + for ($i=0;$iquery("SELECT kode_barang_nota + FROM d_transfer + WHERE id_transfer = $transfer_id + AND kode_barang_nota = '$k' + AND harga_satuan = $h + AND nomor = '$n'"); + if($dt->num_rows > 0) + { + $a = $dt->fetch_array(MYSQLI_NUM); + $stmt = $mysqli->prepare("UPDATE d_transfer SET jumlah = ? WHERE id_transfer = ? AND kode_barang_nota = ? AND harga_satuan = ? AND nomor = ?"); + $stmt->bind_param("iisis", $aBaru[$x]['jumlah'], $transfer_id, $aBaru[$x]['kode'], $aBaru[$x]['hb'], $aBaru[$x]['nomor']); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasild = 1; + } + else + { + $hasild = 0; + } + $stmt->close(); + /* tutup hasil query */ + $dt->close(); + }else{ + // jika data belum ada, insert data baru. + $stmt = $mysqli->prepare("INSERT INTO d_transfer(id_transfer, kode_barang_nota, jumlah, harga_satuan, nomor, kd_supplier, no_nota) + VALUES (?,?,?,?,?,?,?)"); + $stmt->bind_param("isiisss",$transfer_id, $aBaru[$x]['kode'], $aBaru[$x]['jumlah'], $aBaru[$x]['hb'], $aBaru[$x]['nomor'], $aBaru[$x]['kodesupp'], $aBaru[$x]['nofaktur']); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasild = 1; + } + else + { + $hasild = 0; + } + + $stmt->close(); + } + } + // --> end update data table detail + } + $mysqli->close(); +// $harray = array('hasilmaster' => $hasilmaster, 'hasild' => $hasild, 'id_transfer' => $transfer_id); + $harray = array($aBaru); + echo json_encode($harray); +} + +/* end file */ diff --git a/old-source/transfer_barang/transfer_validasi.php b/old-source/transfer_barang/transfer_validasi.php new file mode 100644 index 0000000..a7bc738 --- /dev/null +++ b/old-source/transfer_barang/transfer_validasi.php @@ -0,0 +1,69 @@ +prepare("UPDATE m_transfer SET faktur_oper = ?, validasi = '1' WHERE id_transfer = ?"); + $stmt->bind_param("si",$faktur_oper, $id_transfer); + $stmt->execute(); + if($stmt->affected_rows > 0) + $hasil = 1; + else $hasil = 0; + $stmt->close(); + + // ambil barang yang akan diupdate stok nya. + $barang = array(); + $dataBarang = $mysqli->query("SELECT dt.jumlah, dt.nomor, br.id_gabungan + FROM d_transfer dt, m_transfer mt, barang br, no_barang n + WHERE dt.id_transfer = mt.id_transfer + AND br.id_gabungan = n.id_gabungan + AND (dt.kode_barang_nota = br.kode_barang AND dt.nomor = n.nomor) + AND mt.id_transfer = $id_transfer + AND mt.validasi = '1' + "); + $jumBarang = $dataBarang->num_rows; + if($jumBarang > 0) + { + $idx = 0; + while($db = $dataBarang->fetch_array(MYSQLI_ASSOC)) + { + $barang[$idx] = array('id_gabungan' => $db['id_gabungan'], 'jumlah' => $db['jumlah'], 'nomor' => $db['nomor']); + $idx++; + } + /* tutup hasil query */ + $dataBarang->close(); + } + // update stok + for($i=0; $i<$jumBarang; $i++) + { + // update stok barang + $stmt = $mysqli->prepare("UPDATE no_barang SET stok = stok-? WHERE id_gabungan = ? AND nomor = ?"); + $stmt->bind_param("iss",$barang[$i]['jumlah'], $barang[$i]['id_gabungan'], $barang[$i]['nomor']); + $stmt->execute(); + if($stmt->affected_rows > 0) + $hasil = 1; + else + $hasil = 0; + $stmt->close(); + } + + } + $harray = array('hasil' => $hasil); + echo json_encode($harray); +} \ No newline at end of file diff --git a/old-source/transfer_barang/transfer_validasi_kembali.php b/old-source/transfer_barang/transfer_validasi_kembali.php new file mode 100644 index 0000000..b27e5b4 --- /dev/null +++ b/old-source/transfer_barang/transfer_validasi_kembali.php @@ -0,0 +1,66 @@ +prepare("UPDATE m_transfer_kembali SET validasi = '1' WHERE faktur_oper = ?"); + $stmt->bind_param("s", $faktur_oper); + $stmt->execute(); + if($stmt->affected_rows > 0) + $hasil = 1; + else + $hasil = 0; + $stmt->close(); + + // ambil barang yang akan diupdate stok nya. + $barang = array(); + $dataBarang = $mysqli->query("SELECT dt.jumlah, dt.nomor, br.id_gabungan + FROM d_transfer_kembali dt, m_transfer_kembali mt, barang br, no_barang n + WHERE dt.id_transfer = mt.id_transfer + AND br.id_gabungan = n.id_gabungan + AND (dt.kode_barang_nota = br.kode_barang AND dt.nomor = n.nomor) + AND mt.id_transfer = $id_transfer + AND mt.validasi = '1' + "); + $jumBarang = $dataBarang->num_rows; + if($jumBarang > 0) + { + $idx = 0; + while($db = $dataBarang->fetch_array(MYSQLI_ASSOC)) + { + $barang[$idx] = array('id_gabungan' => $db['id_gabungan'], 'jumlah' => $db['jumlah'], 'nomor' => $db['nomor']); + $idx++; + } + /* tutup hasil query */ + $dataBarang->close(); + } + // update stok + for($i=0; $i<$jumBarang; $i++) + { + // update stok barang + $stmt = $mysqli->prepare("UPDATE no_barang SET stok = stok+? WHERE id_gabungan = ? AND nomor = ?"); + $stmt->bind_param("iss",$barang[$i]['jumlah'], $barang[$i]['id_gabungan'], $barang[$i]['nomor']); + $stmt->execute(); + $stmt->close(); + } + + } + $harray = array('hasil' => $hasil); + echo json_encode($harray); +} \ No newline at end of file diff --git a/old-source/ubah_hp/ajaxsupplier.php b/old-source/ubah_hp/ajaxsupplier.php new file mode 100644 index 0000000..6393c13 --- /dev/null +++ b/old-source/ubah_hp/ajaxsupplier.php @@ -0,0 +1,134 @@ + +prepare($query); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + //echo count($array_data); + echo json_encode($array_data); + } +} + +function cari_supplier($nama) { + if($nama != "") { + $harray = array(); + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $nama = addslashes($nama); + $data = $mysqli->query("SELECT kd_supplier, nama_supplier, alamat1, lama_tempo FROM supplier WHERE nama_supplier LIKE '%".$nama."%'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_supplier' => $a['kd_supplier'], + 'nama_supplier' => stripcslashes($a['nama_supplier']), + 'alamat1' => $a['alamat1'], + 'lama_tempo' => $a['lama_tempo'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + }else{ + $harray = array(); + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $nama = addslashes($nama); + $data = $mysqli->query("SELECT kd_supplier, nama_supplier, alamat1, lama_tempo FROM supplier"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $harray[$idx] = array( + 'kd_supplier' => $a['kd_supplier'], + 'nama_supplier' => stripcslashes($a['nama_supplier']), + 'alamat1' => $a['alamat1'], + 'lama_tempo' => $a['lama_tempo'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); + } +} + +function ambil_supplier($id_supplier) { + if ($id_supplier != "") { + $array_data = array(); + require_once '../db_login.inc.php'; + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT * FROM supplier WHERE kd_supplier = '".$id_supplier."'"); + if($data->num_rows > 0) { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) { + $array_data[$idx] = array( + 'kd_supplier' => $a['kd_supplier'], + 'nama_supplier' => $a['nama_supplier'], + 'alamat1' => $a['alamat1'], + 'alamat2' => $a['alamat2'], + 'nama_rekening' => $a['nama_rekening'], + 'rekening1' => $a['rekening1'], + 'rekening2' => $a['rekening2'], + 'bank1' => $a['bank1'], + 'bank2' => $a['bank2'], + 'telp' => $a['telp'], + 'ponsel' => $a['ponsel'], + 'email' => $a['email'], + 'fax' => $a['fax'], + 'jns_pembayaran' => $a['jns_pembayaran'], + 'lama_tempo' => $a['lama_tempo'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($array_data); + } +} + + +?> \ No newline at end of file diff --git a/old-source/ubah_hp/fungsi_ubah_hp.php b/old-source/ubah_hp/fungsi_ubah_hp.php new file mode 100644 index 0000000..a3d28c9 --- /dev/null +++ b/old-source/ubah_hp/fungsi_ubah_hp.php @@ -0,0 +1,619 @@ + ".$kd_supplier.")"; + $stmt = $mysqli->prepare("INSERT INTO m_pembelian ( + `no_faktur`, + `tgl_nota`, + `tgl_masuk`, + `no_order`, + `tgl_jatuh_tempo`, + `kd_supplier`, + `status`, + `diskon`, + `nik`, + `rp_beli`, + `total_beli`, + `validasi`, + `keterangan`, + `tgl_entry`, + `referensi`, + `status_revisi`) VALUES + ('$norhp', now(), now(), '-', now(), '$kd_supplier', 'T', 0, '$nik', '$rpbeli', 0, '1', '$ket', now(), '$kd_supplier', '$statusrvb')"); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} + +function insert_d_pembelian($norhp, $kode_barang, $kode_lama, $nomor, $stok, $stokrev, $hplama, $hjlama, $hpbaru, $hjbaru, $nama, $idgabungan) +{ + $hasil = FALSE; + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if(!mysqli_connect_errno()) + { + for ($i = 0; $i < count($kode_barang); $i++) + { + /* insert data lama */ + $hplm = $hplama[$i]; + $hrgPlama = convHrgP($hplama[$i]); + $profitlama = round((($hjlama[$i] - $hplm) / $hplm) * 100); + $stoklama = -1 * $stok[$i]; + //$faktur_asli = get_kode_faktur_asli($kode_barang[$i]); + $stmt = $mysqli->prepare("INSERT INTO d_pembelian( + `id`, + `no_faktur`, + `kode_barang`, + `nomor`, + `harga_satuan`, + `harga_pokok`, + `diskon`, + `diskonrp`, + `ppn`, + `profit`, + `kode_asli`, + `jum_fisik`, + `lokasi`, + `hj_final`, + `nm_brg`) + VALUES (NULL,'$norhp','$kode_barang[$i]','$nomor[$i]','$hjlama[$i]','$hrgPlama','0','0','0','$profitlama','$kode_lama[$i]','$stoklama', '1A',' $hjlama[$i]','$nama[$i]')"); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + + /* insert data baru */ + if ($hasil) + { + $hpbr = $hpbaru[$i]; + $hrgPbaru = convHrgP($hpbaru[$i]); + $profitbaru = round((($hjbaru[$i] - $hpbr) / $hpbr) * 100); + $stmt = $mysqli->prepare("INSERT INTO d_pembelian(`id`, + `no_faktur`, + `kode_barang`, + `nomor`, + `harga_satuan`, + `harga_pokok`, + `diskon`, + `diskonrp`, + `ppn`, + `profit`, + `kode_asli`, + `jum_fisik`, + `lokasi`, + `hj_final`, + `nm_brg`) + VALUES (NULL,'$norhp','$kode_barang[$i]','$nomor[$i]','$hjbaru[$i]','$hrgPbaru','0','0','0','$profitbaru','$kode_lama[$i]',' $stokrev[$i]', '1A',' $hjbaru[$i]','$nama[$i]')"); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* update barang*/ + if ($hasil) + { + $update2 = update_barang($idgabungan[$i], $nama[$i]); + if($update2) + { + $hasil = TRUE; + } else + { + $hasil = FALSE; + } + } + + /* update no_barang*/ + if ($hasil) + { + $update = update_no_barang($idgabungan[$i], $nomor[$i], $hrgPbaru, $hjbaru[$i], $stokrev[$i]); + if($update) + { + $hasil = TRUE; + } else + { + $hasil = FALSE; + } + } + $faktur_asli = ""; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} + +/** + * + * @param $id + * @param $nomor + * @param $hp + * @param $hj + * @return unknown_type + */ +function update_no_barang($id, $nomor, $hp, $hj, $stokrev) +{ + $hasil = FALSE; + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if(!mysqli_connect_errno()) + { + // isi table master + $stmt = $mysqli->prepare("UPDATE no_barang SET stok = ?,harga_pokok = ?, harga_jual = ? WHERE id_gabungan = ? AND nomor = ?"); + $stmt->bind_param("isiss", $stokrev, $hp, $hj, $id, $nomor); + $stmt->execute(); + if($stmt->affected_rows >= 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} + +function update_barang($id, $nama) +{ + $hasil = FALSE; + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if(!mysqli_connect_errno()) + { + // isi table master + $stmt = $mysqli->prepare("UPDATE barang SET nama_barang = ? WHERE id_gabungan = ?"); + $stmt->bind_param("ss", $nama, $id); + $stmt->execute(); + if($stmt->affected_rows >= 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} +/** + * + * @param $kdsupplier + * @return unknown_type + */ +function get_no_rhp($kdsupplier) +{ + $urutbaru = 0; + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if(cek_data($kdsupplier)) + { + $data_faktur = $mysqli->query("SELECT MAX(RIGHT(no_faktur, 3)) FROM m_pembelian WHERE LEFT(no_faktur, 10) = 'RVB-{$kdsupplier}'"); + if($data_faktur->num_rows > 0) + { + $urut = $data_faktur->fetch_array(); + $urutbaru = (int)$urut[0] + 1; + if(strlen($urutbaru) == 1) + { + $urutbaru = "00".$urutbaru; + } + if(strlen($urutbaru) == 2) + { + $urutbaru = "0".$urutbaru; + } + $data_faktur->close(); + } + } else { + $urutbaru = "000"; + } + $hasil[0] = "RVB-".$kdsupplier."-".$urutbaru; + echo json_encode($hasil); + $mysqli->close(); +} + +/** + * + * @param $kodesupplier + * @return unknown_type + */ +function cek_data($kodesupplier) +{ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT COUNT(*) FROM m_pembelian WHERE LEFT(no_faktur, 10) = 'RVB-{$kodesupplier}'"); + $dt = $data->fetch_array(); + if($dt[0] > 0) + { + return true; + } else + { + return false; + } + $data->close(); + $mysqli->close(); +} + +/** + * + * @param $kode + * @param $nomor + * @param $kd_supplier + * @return unknown_type + */ +function ambil_barang($kode, $nomor) +{ + if($kode != "" || $nomor != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if($nomor != "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.kode_lama, brg.nama_barang, brg.id_gabungan, nb.stok, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, supplier s, d_pembelian dp + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND (brg.kode_barang = '{$kode}' OR brg.kode_lama = '{$kode}') AND nb.nomor = '{$nomor}' + AND brg.kode_supplier = s.kd_supplier LIMIT 1"); + } else if($nomor == "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.kode_lama, brg.nama_barang, brg.id_gabungan, nb.stok, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, supplier s, d_pembelian dp + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND (brg.kode_barang = '{$kode}' OR brg.kode_lama = '{$kode}') + AND brg.kode_supplier = s.kd_supplier LIMIT 1"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('kode_barang' => $a['kode_barang'], 'kode_lama' => $a['kode_lama'], 'nama_barang' => $a['nama_barang'], + 'supplier' => $a['nama_supplier'], 'id_gabungan' => $a['id_gabungan'], 'stok' => $a['stok'], + 'kd_supplier' => $a['kode_supplier'], 'hp' => $a['harga_pokok'], 'hj' => $a['harga_jual'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kode + * @param $nomor + * @param $kd_supplier + * @return unknown_type + */ +function cek_barang($kode, $nomor) +{ + if($kode != "" || $nomor != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if($nomor != "") + { + $data = $mysqli->query("SELECT count(*) + FROM barang brg, no_barang nb, d_pembelian dp + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND (brg.kode_barang = '{$kode}' OR brg.kode_lama = '{$kode}') AND nb.nomor = '{$nomor}' + "); + } else if($nomor == "") { + $data = $mysqli->query("SELECT count(*) + FROM barang brg + WHERE (brg.kode_barang = '{$kode}' OR brg.kode_lama = '{$kode}')"); + } + if($data->num_rows > 0) + { + $jum = $data->fetch_array(); + if($jum[0] > 0) + { + $harray[0] = "true"; + } else + { + $harray[0] = "false"; + } + /* tutup hasil query */ + $data->close(); + } else + { + $harray[0] = "false"; + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kode + * @param $nama + * @param $kd_supplier + * @return unknown_type + */ +function cari_barang($kode, $nama) +{ + if($kode != "" || $nama != "") + { + $harray = array(); + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if($nama != "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.nama_barang, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, d_pembelian dp, supplier s + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang AND brg.kode_supplier = s.kd_supplier + AND (brg.kode_lama LIKE '{$kode}%' OR brg.kode_barang LIKE '{$kode}%') AND brg.nama_barang LIKE '%{$nama}%' + "); + } else if($nama == "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.nama_barang, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, d_pembelian dp, supplier s + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang AND brg.kode_supplier = s.kd_supplier + AND (brg.kode_lama LIKE '{$kode}%' OR brg.kode_barang LIKE '{$kode}%') + "); + } + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'], 'nama_barang' => $a['nama_barang'], 'supplier' => $a['nama_supplier'], + 'kd_supplier' => $a['kode_supplier'], 'hp' => $a['harga_pokok'], 'hj' => $a['harga_jual'] + ); + $idx++; + } + $data->close(); + } + $mysqli->close(); + } + echo json_encode($harray); +} + +/** + * + * @param $kode + * @param $nama + * @return unknown_type + */ +function get_supplier($kode, $nama) +{ + if($kode != "" || $nama != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + if($nama != "") + { + $data = $mysqli->query("SELECT s.kd_supplier, s.nama_supplier + FROM supplier s + WHERE s.kd_supplier LIKE '%{$kode}%' AND s.nama_supplier LIKE '%{$nama}%'"); + } else if($nama == "") + { + $data = $mysqli->query("SELECT s.kd_supplier, s.nama_supplier + FROM supplier s + WHERE s.kd_supplier LIKE '%{$kode}%'"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('kode_supplier' => $a['kd_supplier'], 'nama_supplier' => $a['nama_supplier']); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kodebarang + * @return unknown_type + */ +function get_kode_faktur_asli($kodebarang) +{ + $faktur = ""; + if($kodebarang != "" ) + { + /* konfigurasi untuk koneksi ke database */ + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $data = $mysqli->query("SELECT d.no_faktur FROM d_pembelian d WHERE d.kode_barang = '{$kodebarang}'"); + if($data->num_rows > 0) + { + $faktur = $data->fetch_array(MYSQLI_NUM); + $faktur = $faktur[0]; + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + return $faktur; +} +/** + * + * @param $data + * @return unknown_type + */ +function hitung_total_hp($data, $stok) +{ + $total = 0; + for ($i = 0; $i < count($data); $i++) + { + //$total += decode_hp($data[$i]) * $stok[$i]; + $total += $data[$i] * $stok[$i]; + } + return $total; +} + +/** + * + * @param $hp + * @return int hasil decode + */ +function decode_hp($hp) +{ + $dt = ""; + for($i = 0; $i < strlen($hp); $i++) + { + $chr = substr($hp, $i, 1); + switch($chr) + { + case "B" : $dt .= "1";break; + case "R" : $dt .= "2";break; + case "A" : $dt .= "3";break; + case "W" : $dt .= "4";break; + case "N" : $dt .= "5";break; + case "F" : $dt .= "6";break; + case "O" : $dt .= "7";break; + case "X" : $dt .= "8";break; + case "E" : $dt .= "9";break; + case "S" : $dt .= "0";break; + } + } + return (int) $dt; +} + +function convHrgP($hrgP){ + $kode = ""; + for($i=0;$i \ No newline at end of file diff --git a/old-source/ubah_hp/fungsi_ubah_hp.php~ b/old-source/ubah_hp/fungsi_ubah_hp.php~ new file mode 100644 index 0000000..22ce241 --- /dev/null +++ b/old-source/ubah_hp/fungsi_ubah_hp.php~ @@ -0,0 +1,563 @@ +prepare("INSERT INTO m_pembelian VALUES (?, now(), now(), '-', now(), ?, 'T', 0, ?, ?, 0, '1', 'Revisi Barang', now(), ?, ?)"); + $stmt->bind_param("sssiss", $norhp, $kd_supplier, $nik, $rpbeli, $nofaktur, $statusrvb); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} + +function insert_d_pembelian($norhp, $kode_barang, $kode_lama, $nomor, $stok, $stokrev, $hplama, $hjlama, $hpbaru, $hjbaru, $nama, $idgabungan) +{ + $hasil = FALSE; + /* konfigurasi untuk koneksi ke database */ + require_once("../konfig/konfig_db.inc.php"); + $mysqli = new mysqli(NAMA_HOST, NAMA_USER, PASSWORD, NAMA_DB); + if(!mysqli_connect_errno()) + { + for ($i = 0; $i < count($kode_barang); $i++) + { + /* insert data lama */ + $hplm = decode_hp($hplama[$i]); + $profitlama = ceil((($hjlama[$i] - $hplm) / $hplm) * 100); + $stoklama = -1 * $stok[$i]; + $faktur_asli = get_kode_faktur_asli($kode_barang[$i]); + $stmt = $mysqli->prepare("INSERT INTO d_pembelian(no_faktur, kode_barang, kode_baranglama, nomor, jumlah, harga_satuan, harga_pokok, harga_jual, profit, kode_asli, jum_fisik, jenis, lokasi, hj_final, nm_brg) + VALUES (?, ?, ?, ?, ?, 0, ?, ?, ?, '-', ?, 'S', '1A', ?, ?)"); + $stmt->bind_param("ssssisiiiis", $norhp, $kode_barang[$i], $kode_lama[$i], $nomor[$i], $stoklama, $hplama[$i], $hjlama[$i], $profitlama, $stoklama, $hjlama[$i], $nama[$i]); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + + /* insert data baru */ + if ($hasil) + { + $hpbr = decode_hp($hpbaru[$i]); + $profitbaru = ceil((($hjbaru[$i] - $hpbr) / $hpbr) * 100); + $stmt = $mysqli->prepare("INSERT INTO d_pembelian(no_faktur, kode_barang, kode_baranglama, nomor, jumlah, harga_satuan, harga_pokok, harga_jual, profit, kode_asli, jum_fisik, jenis, lokasi, hj_final, nm_brg) + VALUES (?, ?, ?, ?, ?, 0, ?, ?, ?, '-', ?, 'S', '1A', ?, ?)"); + $stmt->bind_param("ssssisiiiis", $norhp, $kode_barang[$i], $kode_lama[$i], $nomor[$i], $stokrev[$i], $hpbaru[$i], $hjbaru[$i], $profitbaru, $stokrev[$i], $hjbaru[$i], $nama[$i]); + $stmt->execute(); + if($stmt->affected_rows > 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* update barang*/ + if ($hasil) + { + $update2 = update_barang($idgabungan[$i], $nama[$i]); + if($update2) + { + $hasil = TRUE; + } else + { + $hasil = FALSE; + } + } + + /* update no_barang*/ + if ($hasil) + { + $update = update_no_barang($idgabungan[$i], $nomor[$i], $hpbaru[$i], $hjbaru[$i], $stokrev[$i]); + if($update) + { + $hasil = TRUE; + } else + { + $hasil = FALSE; + } + } + $faktur_asli = ""; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} + +/** + * + * @param $id + * @param $nomor + * @param $hp + * @param $hj + * @return unknown_type + */ +function update_no_barang($id, $nomor, $hp, $hj, $stokrev) +{ + $hasil = FALSE; + /* konfigurasi untuk koneksi ke database */ + require_once("../konfig/konfig_db.inc.php"); + $mysqli = new mysqli(NAMA_HOST, NAMA_USER, PASSWORD, NAMA_DB); + if(!mysqli_connect_errno()) + { + // isi table master + $stmt = $mysqli->prepare("UPDATE no_barang SET stok = ?,harga_pokok = ?, harga_jual = ? WHERE id_gabungan = ? AND nomor = ?"); + $stmt->bind_param("isiss", $stokrev, $hp, $hj, $id, $nomor); + $stmt->execute(); + if($stmt->affected_rows >= 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} + +function update_barang($id, $nama) +{ + $hasil = FALSE; + /* konfigurasi untuk koneksi ke database */ + require_once("../konfig/konfig_db.inc.php"); + $mysqli = new mysqli(NAMA_HOST, NAMA_USER, PASSWORD, NAMA_DB); + if(!mysqli_connect_errno()) + { + // isi table master + $stmt = $mysqli->prepare("UPDATE barang SET nama_barang = ? WHERE id_gabungan = ?"); + $stmt->bind_param("ss", $nama, $id); + $stmt->execute(); + if($stmt->affected_rows >= 0) + { + $hasil = TRUE; + $stmt->close(); + } else + { + $hasil = FALSE; + } + } + /* tutup koneksi */ + $mysqli->close(); + return $hasil; +} +/** + * + * @param $kdsupplier + * @return unknown_type + */ +function get_no_rhp($kdsupplier) +{ + $urutbaru = 0; + /* konfigurasi untuk koneksi ke database */ + require_once("../konfig/konfig_db.inc.php"); + $mysqli = new mysqli(NAMA_HOST, NAMA_USER, PASSWORD, NAMA_DB); + // cek ada atau tidak + if(cek_data($kdsupplier)) + { + $data_faktur = $mysqli->query("SELECT MAX(RIGHT(no_faktur, 3)) FROM m_pembelian WHERE LEFT(no_faktur, 10) = 'RVB-{$kdsupplier}'"); + if($data_faktur->num_rows > 0) + { + $urut = $data_faktur->fetch_array(); + $urutbaru = (int)$urut[0] + 1; + if(strlen($urutbaru) == 1) + { + $urutbaru = "00".$urutbaru; + } + if(strlen($urutbaru) == 2) + { + $urutbaru = "0".$urutbaru; + } + /* tutup hasil query */ + $data_faktur->close(); + } + } else + { + $urutbaru = "000"; + } + $hasil[0] = "RVB-".$kdsupplier."-".$urutbaru; + echo json_encode($hasil); + /* tutup koneksi */ + $mysqli->close(); +} + +/** + * + * @param $kodesupplier + * @return unknown_type + */ +function cek_data($kodesupplier) +{ + /* konfigurasi untuk koneksi ke database */ + require_once("../konfig/konfig_db.inc.php"); + $mysqli = new mysqli(NAMA_HOST, NAMA_USER, PASSWORD, NAMA_DB); + // cek ada atau tidak + $data = $mysqli->query("SELECT COUNT(*) FROM m_pembelian WHERE LEFT(no_faktur, 10) = 'RVB-{$kodesupplier}'"); + $dt = $data->fetch_array(); + if($dt[0] > 0) + { + return true; + } else + { + return false; + } + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); +} + +/** + * + * @param $kode + * @param $nomor + * @param $kd_supplier + * @return unknown_type + */ +function ambil_barang($kode, $nomor, $nofaktur) +{ + if($kode != "" || $nomor != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../konfig/konfig_db.inc.php"); + $mysqli = new mysqli(NAMA_HOST, NAMA_USER, PASSWORD, NAMA_DB); + if($nomor != "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.kode_lama, brg.nama_barang, brg.id_gabungan, nb.stok, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, supplier s, d_pembelian dp + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND brg.kode_barang = '{$kode}' AND nb.nomor = '{$nomor}' + AND brg.kode_supplier = s.kd_supplier AND dp.no_faktur = '{$nofaktur}' LIMIT 1"); + } else if($nomor == "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.kode_lama, brg.nama_barang, brg.id_gabungan, nb.stok, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, supplier s, d_pembelian dp + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND brg.kode_barang = '{$kode}' + AND brg.kode_supplier = s.kd_supplier AND dp.no_faktur = '{$nofaktur}' LIMIT 1"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('kode_barang' => $a['kode_barang'], 'kode_lama' => $a['kode_lama'], 'nama_barang' => $a['nama_barang'], + 'supplier' => $a['nama_supplier'], 'id_gabungan' => $a['id_gabungan'], 'stok' => $a['stok'], + 'kd_supplier' => $a['kode_supplier'], 'hp' => $a['harga_pokok'], 'hj' => $a['harga_jual'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kode + * @param $nomor + * @param $kd_supplier + * @return unknown_type + */ +function cek_barang($kode, $nomor, $nofaktur) +{ + if($kode != "" || $nomor != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../konfig/konfig_db.inc.php"); + $mysqli = new mysqli(NAMA_HOST, NAMA_USER, PASSWORD, NAMA_DB); + if($nomor != "") + { + $data = $mysqli->query("SELECT count(*) + FROM barang brg, no_barang nb, d_pembelian dp + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang + AND brg.kode_barang = '{$kode}' AND nb.nomor = '{$nomor}' + AND dp.no_faktur = '{$nofaktur}'"); + } else if($nomor == "") + { + $data = $mysqli->query("SELECT count(*) + FROM barang brg + WHERE brg.kode_barang = '{$kode}'"); + } + if($data->num_rows > 0) + { + $jum = $data->fetch_array(); + if($jum[0] > 0) + { + $harray[0] = "true"; + } else + { + $harray[0] = "false"; + } + /* tutup hasil query */ + $data->close(); + } else + { + $harray[0] = "false"; + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kode + * @param $nama + * @param $kd_supplier + * @return unknown_type + */ +function cari_barang($kode, $nama, $nofaktur) +{ + if($kode != "" || $nama != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../konfig/konfig_db.inc.php"); + $mysqli = new mysqli(NAMA_HOST, NAMA_USER, PASSWORD, NAMA_DB); + if($nama != "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.nama_barang, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, d_pembelian dp, supplier s + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang AND brg.kode_supplier = s.kd_supplier + AND brg.kode_barang LIKE '{$kode}%' AND brg.nama_barang LIKE '%{$nama}%' + AND dp.no_faktur = '{$nofaktur}'"); + } else if($nama == "") + { + $data = $mysqli->query("SELECT DISTINCT brg.kode_barang, brg.nama_barang, nb.harga_pokok, nb.harga_jual, brg.kode_supplier, s.nama_supplier + FROM barang brg, no_barang nb, d_pembelian dp, supplier s + WHERE brg.id_gabungan = nb.id_gabungan AND brg.kode_barang = dp.kode_barang AND brg.kode_supplier = s.kd_supplier + AND brg.kode_barang LIKE '{$kode}%' + AND dp.no_faktur = '{$nofaktur}'"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'], 'nama_barang' => $a['nama_barang'], 'supplier' => $a['nama_supplier'], + 'kd_supplier' => $a['kode_supplier'], 'hp' => $a['harga_pokok'], 'hj' => $a['harga_jual'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kode + * @param $nama + * @return unknown_type + */ +function get_supplier($kode, $nama) +{ + if($kode != "" || $nama != "") + { + $harray = array(); + /* konfigurasi untuk koneksi ke database */ + require_once("../konfig/konfig_db.inc.php"); + $mysqli = new mysqli(NAMA_HOST, NAMA_USER, PASSWORD, NAMA_DB); + if($nama != "") + { + $data = $mysqli->query("SELECT s.kd_supplier, s.nama_supplier + FROM supplier s + WHERE s.kd_supplier LIKE '%{$kode}%' AND s.nama_supplier LIKE '%{$nama}%'"); + } else if($nama == "") + { + $data = $mysqli->query("SELECT s.kd_supplier, s.nama_supplier + FROM supplier s + WHERE s.kd_supplier LIKE '%{$kode}%'"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array('kode_supplier' => $a['kd_supplier'], 'nama_supplier' => $a['nama_supplier']); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} + +/** + * + * @param $kodebarang + * @return unknown_type + */ +function get_kode_faktur_asli($kodebarang) +{ + $faktur = ""; + if($kodebarang != "" ) + { + /* konfigurasi untuk koneksi ke database */ + require_once("../konfig/konfig_db.inc.php"); + $mysqli = new mysqli(NAMA_HOST, NAMA_USER, PASSWORD, NAMA_DB); + $data = $mysqli->query("SELECT d.no_faktur FROM d_pembelian d WHERE d.kode_barang = '{$kodebarang}'"); + if($data->num_rows > 0) + { + $faktur = $data->fetch_array(MYSQLI_NUM); + $faktur = $faktur[0]; + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + return $faktur; +} +/** + * + * @param $data + * @return unknown_type + */ +function hitung_total_hp($data, $stok) +{ + $total = 0; + for ($i = 0; $i < count($data); $i++) + { + $total += decode_hp($data[$i]) * $stok[$i]; + } + return $total; +} + +/** + * + * @param $hp + * @return int hasil decode + */ +function decode_hp($hp) +{ + $dt = ""; + for($i = 0; $i < strlen($hp); $i++) + { + $chr = substr($hp, $i, 1); + switch($chr) + { + case "B" : $dt .= "1";break; + case "R" : $dt .= "2";break; + case "A" : $dt .= "3";break; + case "W" : $dt .= "4";break; + case "N" : $dt .= "5";break; + case "F" : $dt .= "6";break; + case "O" : $dt .= "7";break; + case "X" : $dt .= "8";break; + case "E" : $dt .= "9";break; + case "S" : $dt .= "0";break; + } + } + return (int) $dt; +} +?> \ No newline at end of file diff --git a/old-source/ubah_hp/hmenu.php~ b/old-source/ubah_hp/hmenu.php~ new file mode 100644 index 0000000..8aa3046 --- /dev/null +++ b/old-source/ubah_hp/hmenu.php~ @@ -0,0 +1,128 @@ + diff --git a/old-source/ubah_hp/menu.php b/old-source/ubah_hp/menu.php new file mode 100644 index 0000000..cd103bd --- /dev/null +++ b/old-source/ubah_hp/menu.php @@ -0,0 +1,129 @@ + + + + + +
+ +
diff --git a/old-source/ubah_hp/revisifaktur_fbaru.php b/old-source/ubah_hp/revisifaktur_fbaru.php new file mode 100644 index 0000000..fc9ea4b --- /dev/null +++ b/old-source/ubah_hp/revisifaktur_fbaru.php @@ -0,0 +1,185 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ Revisi Faktur Pembelian + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nomor Faktur: + + Tanggal Nota:
Edit No.Faktur: *Tanggal Revisi:
Status: [(H)utang,(T)unai,(K)onsiyasi] Tanggal Masuk:
Kode Supplier: Tanggal Jth Tempo:
Keterangan NIK:
+ +
+ +
+
+ +
+ + +
+

+
+ +
+

+
+ +
+ + + + + + + + + + + +
Nomor Faktur:
Rentang Tanggal: + s/d + +
Kode Supplier:
+
+ Hasil pencarian +
+
+
+ + + + + + + + diff --git a/old-source/ubah_hp/revisifaktur_simpan.php b/old-source/ubah_hp/revisifaktur_simpan.php new file mode 100644 index 0000000..5fb7f6c --- /dev/null +++ b/old-source/ubah_hp/revisifaktur_simpan.php @@ -0,0 +1,119 @@ + ". $tglrf .")"; + $array_data = array(); + + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $stmt = $mysqli->prepare("UPDATE m_pembelian SET no_faktur=?, tgl_nota=?, tgl_masuk=?, tgl_jatuh_tempo=?, kd_supplier=?, status=?, nik=?, keterangan=? WHERE no_faktur = ?"); + $stmt->bind_param("sssssssss", $nofakturedit, $tglnota, $tglmasuk, $tgljthtempo, $kdsupp, $status, $nik, $ketr, $nofaktur); + $stmt->execute(); + if($stmt->affected_rows > 0) { + $stmt2 = $mysqli->prepare("UPDATE d_pembelian SET no_faktur=? WHERE no_faktur = ?"); + $stmt2->bind_param("ss", $nofakturedit, $nofaktur); + $stmt2->execute(); + update_barang(); + $array_data[0] = 1; + } else { + $array_data[0] = 0; + } + $stmt->close(); + $mysqli->close(); + echo json_encode($array_data); +} + +function update_barang() +{ + $barang = array(); + $kdsupp = $_REQUEST['kodesupplier']; + $nofaktur = $_REQUEST['nofaktur']; + require_once("../db_login.inc.php"); + $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); + $stmt3 = $mysqli->query("SELECT DISTINCT kode_barang FROM d_pembelian WHERE no_faktur = '$nofaktur'"); + $jumBarang = $stmt3->num_rows; + if($jumBarang > 0){ + $idx = 0; + while($db = $stmt3->fetch_array(MYSQLI_ASSOC)) + { + $barang[$idx] = array('kode_barang' => $db['kode_barang']); + $idx++; + } + $stmt3->close(); + } + // update kdsupp + for($i=0; $i<$jumBarang; $i++) + { + $stmt = $mysqli->prepare("UPDATE barang SET kode_supplier = ? WHERE kode_barang = ?"); + $stmt->bind_param("ss",$kdsupp, $barang[$i]['kode_barang']); + $stmt->execute(); + $stmt->close(); + } + $mysqli->close(); +} + + +function hitung_total_hp($data, $stok) +{ + $total = 0; + for ($i = 0; $i < count($data); $i++) + { + $total += $data[$i] * $stok[$i]; + } + return $total; +} + +function decode_hp($hp) +{ + $dt = ""; + for($i = 0; $i < strlen($hp); $i++) + { + $chr = substr($hp, $i, 1); + switch($chr) + { + case "B" : $dt .= "1";break; + case "R" : $dt .= "2";break; + case "A" : $dt .= "3";break; + case "W" : $dt .= "4";break; + case "N" : $dt .= "5";break; + case "F" : $dt .= "6";break; + case "O" : $dt .= "7";break; + case "X" : $dt .= "8";break; + case "E" : $dt .= "9";break; + case "S" : $dt .= "0";break; + } + } + return (int) $dt; +} + +function decTgl($tgl){// ke format yyyy-mm-dd + $d = substr($tgl,0,2); + $m = substr($tgl,3,2); + $y = substr($tgl,6,4); + return $y."-".$m."-".$d; +} \ No newline at end of file diff --git a/old-source/ubah_hp/ubahhp.php b/old-source/ubah_hp/ubahhp.php new file mode 100644 index 0000000..34be868 --- /dev/null +++ b/old-source/ubah_hp/ubahhp.php @@ -0,0 +1,248 @@ + + + + + Cleopatra + + + + + + + + + + + + + + + + + + + + + + + +
+
+

Cleopatra Minimarket

+
+
+ +
+
+
+ Revisi Barang + + + + + + + + + + + + + + + + + + +
Nomor Revisi:
Kode Supplier: + + + NIK:
Nama Supplier: Status Revisi + : +
Keterangan  + (max.100 char) +
+
+ + + + + + + + + + + + +
KODE BARANGNOMORNAMA BARANGSTOKHP LAMAHJ LAMAHP BARUHJ BARU
+
+ + +
+
+
+
+
+ +
+ + +
+

+
+ +
+

+
+ + +
+ + + + + + + + +
Kode Barang:
Nama Barang: + +
+
+ Hasil pencarian +
+
+
+ +
+ + + + + + + + + + + +
Nomor Faktur:
Rentang Tanggal: + s/d + +
Kode Supplier:
+
+ Hasil pencarian +
+
+
+ + + + + +
+
Cari Supplier
+
+ +
+
+ + + + +
Nama:
+
+
+ Hasil pencarian +
+
+
+ +
+ +
+ + + diff --git a/old-source/umum/ambil_barang.php b/old-source/umum/ambil_barang.php new file mode 100644 index 0000000..7415059 --- /dev/null +++ b/old-source/umum/ambil_barang.php @@ -0,0 +1,44 @@ +query("SELECT brg.kode_barang, brg.nama_barang,n.harga_pokok, n.harga_jual, n.stok + FROM barang brg inner join no_barang n on brg.id_gabungan = n.id_gabungan + WHERE n.nomor = '$_REQUEST[nobarang]' + AND brg.kode_barang = '$_REQUEST[idbarang]' + ORDER BY brg.kode_barang"); + } else if(!isset($_REQUEST['nobarang'])){ + $data = $mysqli->query("SELECT brg.kode_barang,brg.nama_barang,n.harga_pokok, n.harga_jual, n.stok + FROM barang brg inner join no_barang n on brg.id_gabungan = n.id_gabungan + WHERE brg.kode_barang = '$_REQUEST[idbarang]' + ORDER BY brg.kode_barang"); + } + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'], 'nama_barang' => $a['nama_barang'], + 'harga_beli' => $a['harga_pokok'], 'harga_jual' => $a['harga_jual'], 'stok' => $a['stok'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/umum/ambil_kode_barang.php b/old-source/umum/ambil_kode_barang.php new file mode 100644 index 0000000..3993ba9 --- /dev/null +++ b/old-source/umum/ambil_kode_barang.php @@ -0,0 +1,51 @@ +query("SELECT DISTINCT d.kode_barang, m.kd_supplier, b.nama_barang, sup.nama_supplier, + m.tgl_nota, m.tgl_masuk, m.tgl_jatuh_tempo, m.status, m.keterangan, m.nik + FROM m_pembelian m, d_pembelian d, barang b, supplier sup, no_barang n + WHERE m.no_faktur = d.no_faktur + AND d.kode_barang = b.kode_barang + AND b.id_gabungan = n.id_gabungan + AND m.kd_supplier = sup.kd_supplier + AND m.no_faktur='$_REQUEST[nofaktur]' + ORDER BY d.kode_barang"); + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + $jdata = $mysqli->query("SELECT count(*) + FROM m_pembelian m, d_pembelian d, barang b, supplier sup, no_barang n + WHERE m.no_faktur = d.no_faktur + AND d.kode_barang = b.kode_barang + AND b.id_gabungan = n.id_gabungan + AND m.kd_supplier = sup.kd_supplier + AND n.stok > 0 + AND m.no_faktur='$_REQUEST[nofaktur]'"); + $j = $jdata->fetch_array(MYSQL_NUM); + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + $harray[$idx] = array( + 'kode_barang' => $a['kode_barang'], 'kd_supplier' => $a['kd_supplier'], + 'nama_barang' => $a['nama_barang'], 'supplier' => $a['nama_supplier'], + 'tglnota' => $a['tgl_nota'],'tglmasuk' => $a['tgl_masuk'],'tgljthtempo' => $a['tgl_jatuh_tempo'], + 'status' => $a['status'],'keterangan' => $a['keterangan'],'nik' => $a['nik'], + 'jdata' => $j[0] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/umum/ambil_nomor.php b/old-source/umum/ambil_nomor.php new file mode 100644 index 0000000..b534817 --- /dev/null +++ b/old-source/umum/ambil_nomor.php @@ -0,0 +1,34 @@ +query("SELECT DISTINCT nomor FROM d_pembelian WHERE kode_barang='$_REQUEST[idbarang]' ORDER BY nomor"); + $data = $mysqli->query("SELECT n.nomor FROM d_pembelian d, no_barang n, barang b + WHERE d.kode_barang='$_REQUEST[idbarang]' + AND b.id_gabungan = n.id_gabungan + AND (d.kode_barang = b.kode_barang AND d.nomor = n.nomor) + ORDER BY nomor"); + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_NUM)) + { + $harray[$idx] = array('nomor' => $a[0]); + $idx++; + } + } + /* tutup hasil query */ + $data->close(); + /* tutup koneksi */ + $mysqli->close(); + } + /* cetak hasil */ + echo json_encode($harray); +} \ No newline at end of file diff --git a/old-source/umum/ambil_nota.php b/old-source/umum/ambil_nota.php new file mode 100644 index 0000000..3c8e05a --- /dev/null +++ b/old-source/umum/ambil_nota.php @@ -0,0 +1,84 @@ +prepare($query)) +{ + // lakukan bind parameter; + $result->bind_param("s", $no); + // jalankan query; + $result->execute(); + // simpan hasil query; + $result->store_result(); + // simpan jumlah hasil query dalam var jumlah; + $jumlah = $result->num_rows; + // bind hasil query dalam var, kode barang -kb, jumlah -jmlBarang, kd_supplier -kdSupp; + $result->bind_result($kb, $jmlBarang, $kdSupp, $nb); + + // buat objek dari DOM + $dom = new DOMDocument(); + // buat root xml + $response = $dom->createElement("response"); + $dom->appendChild($response); + + // buat node + $barangbarang = $dom->createElement("barangBarang"); + $response->appendChild($barangbarang); + + $kds = ""; + while($result->fetch()) + { + + // buat node + $barang = $dom->createElement("barang"); + $barangbarang->appendChild($barang); + // buat node yang diisi kode barang dari hasil query; + $kodebarang = $dom->createElement("kodeBarang"); + $barang->appendChild($kodebarang); + $kodeText = $dom->createTextNode("$kb"); + $kodebarang->appendChild($kodeText); + + $kds = $kdSupp; + } + + // buat node + $nofaktur = $dom->createElement("noFaktur"); + $response->appendChild($nofaktur); + $fakturText = $dom->createTextNode("$no"); + $nofaktur->appendChild($fakturText); + // buat node untuk menampung jumlah data + $jumlahdata = $dom->createElement("jumlahData"); + $response->appendChild($jumlahdata); + $jumlahText = $dom->createTextNode("$jumlah"); + $jumlahdata->appendChild($jumlahText); + // buat node untuk menampung kode supplier + $kodesupp = $dom->createElement("kodeSupp"); + $response->appendChild($kodesupp); + $kdText = $dom->createTextNode("$kds"); + $kodesupp->appendChild($kdText); + + // simpan xml; + $xmlString = $dom->saveXML(); + // cetak xml; + print ($xmlString); + // tutup hasil query; + $result->close(); +} else +{ + print(""); + print("0"); + print(""); +} +// tutup koneksi; +$mysqli->close(); +?> \ No newline at end of file diff --git a/old-source/umum/cari_nota.php b/old-source/umum/cari_nota.php new file mode 100644 index 0000000..cd4d735 --- /dev/null +++ b/old-source/umum/cari_nota.php @@ -0,0 +1,94 @@ +query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur != "" && $tglawal != "" && $tglakhir != "" && $kdsup == "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur != "" && $tglawal == "" && $tglakhir == "" && $kdsup != "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur != "" && $tglawal == "" && $tglakhir == "" && $kdsup == "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur == "" && $tglawal != "" && $tglakhir != "" && $kdsup != "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur == "" && $tglawal != "" && $tglakhir != "" && $kdsup == "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + else if($nofaktur == "" && $tglawal == "" && $tglakhir == "" && $kdsup != "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND left(no_faktur,4) <> 'RVB-' + ORDER BY tgl_nota"); + + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + + $harray[$idx] = array( + 'no_faktur' => $a['no_faktur'], 'tgl_nota' => substr($a['tgl_nota'],8,2)."-".substr($a['tgl_nota'],5,2)."-".substr($a['tgl_nota'],0,4), 'rp_beli' => $a['rp_beli'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/umum/cari_nota.php~ b/old-source/umum/cari_nota.php~ new file mode 100644 index 0000000..c22673f --- /dev/null +++ b/old-source/umum/cari_nota.php~ @@ -0,0 +1,93 @@ +query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND referensi = '' + ORDER BY tgl_nota"); + else if($nofaktur != "" && $tglawal != "" && $tglakhir != "" && $kdsup == "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND validasi = '1' + AND referensi = '' + ORDER BY tgl_nota"); + else if($nofaktur != "" && $tglawal == "" && $tglakhir == "" && $kdsup != "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND referensi = '' + ORDER BY tgl_nota"); + else if($nofaktur != "" && $tglawal == "" && $tglakhir == "" && $kdsup == "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE no_faktur LIKE '%{$nofaktur}%' + AND validasi = '1' + AND referensi = '' + ORDER BY tgl_nota"); + else if($nofaktur == "" && $tglawal != "" && $tglakhir != "" && $kdsup != "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + AND referensi = '' + ORDER BY tgl_nota"); + else if($nofaktur == "" && $tglawal != "" && $tglakhir != "" && $kdsup == "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE tgl_nota BETWEEN '$tglawal' AND '$tglakhir' + AND validasi = '1' + AND referensi = '' + ORDER BY tgl_nota"); + else if($nofaktur == "" && $tglawal == "" && $tglakhir == "" && $kdsup != "") + $data = $mysqli->query("SELECT no_faktur, tgl_nota, rp_beli + FROM m_pembelian + WHERE kd_supplier LIKE '%{$kdsup}%' + AND validasi = '1' + ORDER BY tgl_nota"); + + /* tampung jumlah data dalam var hasil */ + $hasil = $data->num_rows; + + if($hasil > 0) + { + $idx = 0; + while($a = $data->fetch_array(MYSQLI_ASSOC)) + { + + $harray[$idx] = array( + 'no_faktur' => $a['no_faktur'], 'tgl_nota' => substr($a['tgl_nota'],8,2)."-".substr($a['tgl_nota'],5,2)."-".substr($a['tgl_nota'],0,4), 'rp_beli' => $a['rp_beli'] + ); + $idx++; + } + /* tutup hasil query */ + $data->close(); + } + /* tutup koneksi */ + $mysqli->close(); + /* cetak hasil */ + echo json_encode($harray); +} diff --git a/old-source/update tabel d_retur_beli.txt b/old-source/update tabel d_retur_beli.txt new file mode 100644 index 0000000..74e0b64 --- /dev/null +++ b/old-source/update tabel d_retur_beli.txt @@ -0,0 +1 @@ +ALTER TABLE `d_retur_beli` ADD `id` INT NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`id`); diff --git a/old-source/viewtmpbeli.php b/old-source/viewtmpbeli.php new file mode 100644 index 0000000..fb742cb --- /dev/null +++ b/old-source/viewtmpbeli.php @@ -0,0 +1,93 @@ + +query("SELECT * FROM `tPembelian$pemakai` ORDER BY id"); +if($qry_select->num_rows > 0){ +?> + + + + + + + + + + + + + + + + + fetch_array(MYSQLI_ASSOC)){ + ?> + + + + + + + + + + + + + + + +
NoKode BarangBarcodeNama BarangJumlah BeliSub TotalProfitHarga PokokHarga JualAction
+ Hapus + Edit +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Total Jumlah Beli: *
Total Rp Beli: *
Diskon(%):
Diskon(Rp):
PPN(%):
Total Rp Beli(Nett): *
Keterangan :  (max.100 char) *
+ + \ No newline at end of file