Spaces:
Running
Aplikasi ini adalah sistem manajemen transaksi Top Up & Withdraw chip berbasis web (Django + Python + HTML + Bootstrap), dengan integrasi Payment Gateway dan fitur toko online + offline seperti Codashop. Customer tidak perlu login — mereka cukup memasukkan nominal uang yang ingin dibayar, lalu sistem otomatis menghitung jumlah chip yang akan diterima.
Browse filesSistem memiliki 3 interface (Customer, Admin, Pemilik/Super Admin).
Chip hanya 1 jenis, tapi mendukung pembelian dalam bentuk decimal:
* ≥ 1.00 → dihitung harga normal/grosir (Chip B)
* < 1.00 → dihitung dengan tabel harga fractional (Chip M)
1B = 1000M → penyimpanan stok tetap dalam format decimal (misal 1.25 = 1B 250M)
Semua transaksi berjalan dengan sistem:
Pending → Paid Pending → Approved / Cancel,
memiliki History log lengkap, dan integrasi Payment Gateway (Top Up otomatis).
👥 Role & Akses
🧑💼 Pemilik (Super Admin)
* Login sebagai Pemilik.
* Mengisi saldo awal Bank.
* Mengisi stok awal ID.
* Melakukan adjustment Bank & ID.
* Melihat semua transaksi & history.
* Bisa override data jika ada kesalahan.
* Akses penuh ke seluruh data.
👨💻 Admin
* Login sebagai Admin.
* Menambahkan Bank baru (saldo awal otomatis Rp 0).
* Menambahkan ID baru (stok awal otomatis 0).
* Mengaktifkan/menonaktifkan Bank & ID.
* Melakukan Top Up, Withdraw, Transfer, Adjustment, DC BOS, Pinjaman.
* Tidak bisa mengisi saldo awal Bank atau stok awal ID.
* Semua transaksi buatan Admin status awalnya Pending.
* Admin sendiri yang melakukan Approve/Cancel.
👤 Customer
* Tidak perlu login.
* Mengakses halaman publik: Form Top Up, Form WD, Cek Status Transaksi.
* Mengisi nominal uang (bukan jumlah chip).
* Sistem otomatis hitung jumlah chip yang diterima.
* Membayar via Payment Gateway (untuk Top Up).
* Melihat status transaksi via kode unik / invoice ID.
🔐 Login System
* Halaman login untuk Admin & Pemilik.
* Password terenkripsi (bcrypt).
* Gagal login → muncul notifikasi error.
🏦 Modul Bank
* Admin dapat menambah bank baru (saldo awal = 0).
* Pemilik dapat mengisi saldo awal.
* Setiap Bank memiliki toggle aktif/nonaktif:
* Aktif → muncul di pilihan pembayaran.
* Nonaktif → disembunyikan.
* Saldo bank tampil di dashboard & transaksi.
🆔 Modul ID (Stok Chip)
* Admin dapat menambah ID baru (stok awal = 0).
* Pemilik dapat mengisi stok awal.
* Setiap ID ada toggle aktif/nonaktif.
* Stok chip disimpan dalam decimal (misal 100.25 = 100B + 250M).
💳 Modul Top Up
🔹 Otomatis (Customer via Web)
1. Customer isi form:
* ID Game
* Nama ID
* Nomor WhatsApp
* Nominal uang (contoh: Rp 100.000)
* Pilih metode pembayaran (Bank/QRIS)
2. Sistem otomatis hitung jumlah chip yang akan diterima:
* Jika nominal ≥ Rp 63.000 → gunakan harga grosir tier:
◦ ◦ Harga/Chip ◦ Hasil
◦ Rp 65.000–Rp 649.999 ◦ Rp 65.000 ◦ Jumlah Chip = nominal / 65.000
◦ Rp 650.000–Rp 1.299.999 ◦ Rp 64.500 ◦ Jumlah Chip = nominal / 64.500
◦ Rp 1.300.000+ ◦ Rp 63.000 ◦ Jumlah Chip = nominal / 63.000
* ◦ Jika nominal < Rp 63.000 → gunakan tabel fractional:
◦ ◦ Chip Diterima
◦ Rp 10.000 ◦ 0.12
◦ Rp 20.000 ◦ 0.25
◦ Rp 30.000 ◦ 0.37
◦ dst... ◦
3. 3 Sistem generate invoice unik dan kirim ke Payment Gateway.
4. Payment Gateway → callback ke sistem:
* Sukses → status jadi PAID_PENDING.
* Gagal/expired → status jadi FAILED.
5. Admin buka dashboard → lihat transaksi PAID_PENDING.
6. Admin Approve → wajib pilih:
* ID pengirim stok (stok berkurang).
* Bank tujuan (saldo bertambah).
7. Status → APPROVED → stok & saldo update otomatis → masuk ke History & Google Sheet (opsional).
🔹 Manual (Admin Input)
* Admin isi: Nomor WA, ID, Nama ID, Nominal Uang.
* Sistem otomatis hitung jumlah chip berdasarkan tier harga.
* Admin wajib pilih:
* Bank tujuan (customer transfer ke bank admin).
* ID pengirim stok.
* Status awal: Pending.
* Saat Approve → stok ID berkurang, saldo bank bertambah.
💸 Modul Withdraw (WD)
🔹 Otomatis (Customer)
1. Customer isi form:
* ID, Nama ID, Nomor WA
* Jumlah chip yang ingin ditarik
* Pilih Bank pribadi + No. Rekening
2. Status awal: Pending.
3. Admin Approve → pilih:
* Tujuan ID (stok bertambah).
* Bank Pembayar (saldo berkurang).
4. Status → APPROVED, update stok & saldo otomatis.
Harga WD: Rp 60.000/chip (fix)
🔹 Manual (Admin)
* Admin input data WD secara manual (untuk pelanggan offline).
* Status awal Pending, lalu diapprove seperti biasa.
🔄 Modul Transfer
* Untuk memindahkan saldo antar bank atau stok antar ID.
* Input: Asal, Tujuan, Nominal.
* Status: Pending → Approve/Cancel.
* Saat Approve → stok/saldo berpindah otomatis.
⚖️ Modul Adjustment
* Koreksi saldo Bank atau stok ID.
* Bisa dilakukan Admin atau Pemilik.
* Adjustment langsung update (tanpa Pending).
📉 Modul DC BOS (Biaya Operasional)
* Input nominal + keterangan.
* Status: Pending → Approve/Cancel.
* Saat Approve: saldo Bank berkurang.
🤝 Modul Pinjaman
* Catatan pinjaman antar toko (chip atau uang).
* Status: Pending → Approve/Cancel.
* Saat Approve: stok ID atau saldo Bank berkurang.
* Ada tabel cicilan untuk pembayaran bertahap.
📜 Modul History (Audit Log)
Semua aktivitas tercatat otomatis:
* Modul (Top Up, WD, Transfer, dll)
* Aksi (create, approve, cancel, update, delete)
* Data lama & baru (JSON)
* User yang melakukan
* Tanggal & jam
* Tidak dapat dihapus.
📊 Dashboard
Menampilkan:
* Total saldo seluruh Bank aktif
* Total stok seluruh ID aktif (decimal)
* Rekap transaksi harian/mingguan/bulanan
* Daftar transaksi Pending
* Grafik penjualan per periode
⚡ Aturan Sistem Inti
* Semua transaksi butuh approval Admin (kecuali Adjustment).
* Harga chip otomatis — tidak bisa diinput manual.
* Stok ID & saldo Bank update otomatis setelah Approve.
* Payment Gateway hanya untuk Top Up otomatis.
* Semua aksi tercatat di History.
* Data bisa disinkronkan ke Google Sheets (opsional).
✨ Interface
🧍 Customer Page (Publik)
* Form Top Up (input nominal → sistem hitung chip otomatis).
* Form Withdraw.
* Cek status transaksi via kode unik.
🧑💻 Admin Page
* Top Up (manual & approve otomatis).
* Withdraw, Transfer, Adjustment, DC BOS, Pinjaman.
* Dashboard + History.
👑 Super Admin Page
* Semua fitur admin.
* Input saldo/stok awal.
* Override data.
* Full History access.
- README.md +9 -5
- customer_topup.html +98 -0
- index.html +33 -17
|
@@ -1,10 +1,14 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: ChipFlow Commander 🚀
|
| 3 |
+
colorFrom: pink
|
| 4 |
+
colorTo: red
|
| 5 |
+
emoji: 🐳
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://deepsite.hf.co).
|
| 14 |
+
|
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>ChipFlow Commander - Top Up</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
| 9 |
+
</head>
|
| 10 |
+
<body class="bg-gray-100">
|
| 11 |
+
<div class="container py-8">
|
| 12 |
+
<div class="max-w-md mx-auto bg-white rounded-xl shadow-md overflow-hidden p-6">
|
| 13 |
+
<div class="text-center mb-6">
|
| 14 |
+
<h1 class="text-2xl font-bold text-gray-800">🔋 Chip Top Up</h1>
|
| 15 |
+
<p class="text-gray-600">Fill the form below to recharge your chips</p>
|
| 16 |
+
</div>
|
| 17 |
+
|
| 18 |
+
<form id="topupForm">
|
| 19 |
+
<div class="mb-4">
|
| 20 |
+
<label class="block text-gray-700 mb-2">Game ID</label>
|
| 21 |
+
<input type="text" class="w-full px-3 py-2 border rounded-lg" placeholder="Enter your game ID" required>
|
| 22 |
+
</div>
|
| 23 |
+
|
| 24 |
+
<div class="mb-4">
|
| 25 |
+
<label class="block text-gray-700 mb-2">Player Name</label>
|
| 26 |
+
<input type="text" class="w-full px-3 py-2 border rounded-lg" placeholder="Your in-game name" required>
|
| 27 |
+
</div>
|
| 28 |
+
|
| 29 |
+
<div class="mb-4">
|
| 30 |
+
<label class="block text-gray-700 mb-2">WhatsApp Number</label>
|
| 31 |
+
<input type="tel" class="w-full px-3 py-2 border rounded-lg" placeholder="+62..." required>
|
| 32 |
+
</div>
|
| 33 |
+
|
| 34 |
+
<div class="mb-4">
|
| 35 |
+
<label class="block text-gray-700 mb-2">Amount (Rp)</label>
|
| 36 |
+
<input type="number" id="amountInput" class="w-full px-3 py-2 border rounded-lg" placeholder="Enter amount" min="10000" required>
|
| 37 |
+
<p class="text-xs text-gray-500 mt-1">Minimum Rp10,000</p>
|
| 38 |
+
</div>
|
| 39 |
+
|
| 40 |
+
<div class="mb-6">
|
| 41 |
+
<label class="block text-gray-700 mb-2">Payment Method</label>
|
| 42 |
+
<select class="w-full px-3 py-2 border rounded-lg" required>
|
| 43 |
+
<option value="">Select payment</option>
|
| 44 |
+
<option>Bank Transfer</option>
|
| 45 |
+
<option>QRIS</option>
|
| 46 |
+
<option>E-Wallet</option>
|
| 47 |
+
</select>
|
| 48 |
+
</div>
|
| 49 |
+
|
| 50 |
+
<div class="bg-blue-50 p-4 rounded-lg mb-6">
|
| 51 |
+
<h3 class="text-lg font-semibold text-blue-800 mb-2">You will receive:</h3>
|
| 52 |
+
<div class="flex justify-between items-center">
|
| 53 |
+
<span class="text-gray-700">Chips:</span>
|
| 54 |
+
<span id="chipResult" class="text-2xl font-bold text-blue-600">0.00</span>
|
| 55 |
+
</div>
|
| 56 |
+
<div class="text-xs text-gray-500 mt-2" id="rateInfo"></div>
|
| 57 |
+
</div>
|
| 58 |
+
|
| 59 |
+
<button type="submit" class="w-full bg-blue-600 hover:bg-blue-700 text-white py-3 px-4 rounded-lg font-bold transition">
|
| 60 |
+
Proceed to Payment
|
| 61 |
+
</button>
|
| 62 |
+
</form>
|
| 63 |
+
|
| 64 |
+
<div class="mt-6 text-center text-sm text-gray-500">
|
| 65 |
+
<p>Need help? <a href="#" class="text-blue-600">Contact Support</a></p>
|
| 66 |
+
</div>
|
| 67 |
+
</div>
|
| 68 |
+
</div>
|
| 69 |
+
|
| 70 |
+
<script>
|
| 71 |
+
document.getElementById('amountInput').addEventListener('input', function() {
|
| 72 |
+
const amount = parseFloat(this.value) || 0;
|
| 73 |
+
let chips = 0;
|
| 74 |
+
let rateText = '';
|
| 75 |
+
|
| 76 |
+
if (amount >= 1300000) {
|
| 77 |
+
chips = amount / 63000;
|
| 78 |
+
rateText = 'Wholesale rate: Rp63,000/chip';
|
| 79 |
+
} else if (amount >= 650000) {
|
| 80 |
+
chips = amount / 64500;
|
| 81 |
+
rateText = 'Wholesale rate: Rp64,500/chip';
|
| 82 |
+
} else if (amount >= 65000) {
|
| 83 |
+
chips = amount / 65000;
|
| 84 |
+
rateText = 'Wholesale rate: Rp65,000/chip';
|
| 85 |
+
} else {
|
| 86 |
+
// Fractional calculation
|
| 87 |
+
if (amount >= 10000) {
|
| 88 |
+
chips = amount * 0.000012; // Example fractional rate
|
| 89 |
+
rateText = 'Fractional chip rate applied';
|
| 90 |
+
}
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
document.getElementById('chipResult').textContent = chips.toFixed(2);
|
| 94 |
+
document.getElementById('rateInfo').textContent = rateText;
|
| 95 |
+
});
|
| 96 |
+
</script>
|
| 97 |
+
</body>
|
| 98 |
+
</html>
|
|
@@ -1,19 +1,35 @@
|
|
| 1 |
-
<!
|
| 2 |
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
<html>
|
| 3 |
+
<head>
|
| 4 |
+
<title>My app</title>
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
+
<meta charset="utf-8">
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
</head>
|
| 9 |
+
<body class="flex justify-center items-center h-screen overflow-hidden bg-white font-sans text-center px-6">
|
| 10 |
+
<div class="w-full max-w-md mx-auto bg-white rounded-xl shadow-md p-8">
|
| 11 |
+
<h1 class="text-3xl font-bold text-center text-gray-800 mb-6">ChipFlow Commander</h1>
|
| 12 |
+
|
| 13 |
+
<div class="space-y-4">
|
| 14 |
+
<a href="/customer_topup.html" class="block w-full bg-blue-600 hover:bg-blue-700 text-white text-center py-3 px-6 rounded-lg font-bold transition">
|
| 15 |
+
💰 Top Up Chips
|
| 16 |
+
</a>
|
| 17 |
+
|
| 18 |
+
<a href="#" class="block w-full bg-green-600 hover:bg-green-700 text-white text-center py-3 px-6 rounded-lg font-bold transition">
|
| 19 |
+
🏧 Withdraw Chips
|
| 20 |
+
</a>
|
| 21 |
+
|
| 22 |
+
<a href="#" class="block w-full bg-purple-600 hover:bg-purple-700 text-white text-center py-3 px-6 rounded-lg font-bold transition">
|
| 23 |
+
🔍 Check Transaction
|
| 24 |
+
</a>
|
| 25 |
+
|
| 26 |
+
<div class="pt-4 border-t border-gray-200">
|
| 27 |
+
<a href="#" class="block w-full bg-gray-800 hover:bg-gray-900 text-white text-center py-3 px-6 rounded-lg font-bold transition">
|
| 28 |
+
👑 Admin Login
|
| 29 |
+
</a>
|
| 30 |
+
</div>
|
| 31 |
+
</div>
|
| 32 |
+
</div>
|
| 33 |
+
<script></script>
|
| 34 |
+
</body>
|
| 35 |
</html>
|