PATH: //home/hwyuvbry/sahabat.waroenkhoki123.web.id/blacklist/template/page/qris
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 edit_qris.php
↓
X
📄 hapus_qris.php
↓
X
📄 proses_edit_qris.php
↓
X
📄 qris.php
↓
X
📄 qris.php#
↓
X
📄 tambah_qris.php
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: tambah_qris.php
<?php if ($c['level'] == "superadmin") { if (isset($_POST['upload'])) { $allowed_ext = array('png','jpg','jpeg','gif'); $nama_file = $_FILES['file']['name']; $tmp_file = $_FILES['file']['tmp_name']; $ukuran_file = $_FILES['file']['size']; $status = 'active'; // cek file dipilih if ($nama_file == "") { echo "<script>alert('Pilih gambar terlebih dahulu!'); window.location='?page=qris';</script>"; exit; } // ambil ekstensi $ext = strtolower(pathinfo($nama_file, PATHINFO_EXTENSION)); // validasi ekstensi if (!in_array($ext, $allowed_ext)) { echo "<script>alert('Format harus PNG, JPG, JPEG, GIF'); window.location='?page=qris';</script>"; exit; } // validasi ukuran (max 2MB) if ($ukuran_file > 2000000) { echo "<script>alert('Ukuran file terlalu besar! Max 2MB'); window.location='?page=qris';</script>"; exit; } // buat nama unik $nama_baru = uniqid('qris_') . '.' . $ext; // upload file if (move_uploaded_file($tmp_file, '../../uploads/qris/' . $nama_baru)) { // simpan ke database (WAJIB pakai nama kolom) $query = mysqli_query($koneksi, "INSERT INTO tb_qris (gambar, status) VALUES ('$nama_baru', '$status')"); if ($query) { echo "<script>alert('Berhasil menambahkan gambar'); window.location='?page=qris';</script>"; } else { echo "<script>alert('Gagal simpan ke database'); window.location='?page=qris';</script>"; } } else { echo "<script>alert('Upload file gagal'); window.location='?page=qris';</script>"; } } } else { echo "<script>window.location='?page=dashboard';</script>"; } ?>
SIMPAN PERUBAHAN