asdasd

function allowPhpUpload() {
  const fileInput = document.querySelector('input[type="file"]'); // Cari input file di grid
  if (!fileInput) {
    console.log("Input file tidak ditemukan. Pastikan di halaman upload.");
    return;
  }

  // Override onchange untuk cek extension
  fileInput.addEventListener('change', function(e) {
    const file = e.target.files[0];
    if (!file) return;

    const ext = file.name.split('.').pop().toLowerCase();
    const allowed = ['pdf', 'doc', 'docx', 'zip', 'txt', 'php']; // Tambah php

    if (!allowed.includes(ext)) {
      alert('Tipe file tidak diizinkan: .' + ext + '\nHanya: ' + allowed.join(', '));
      e.target.value = ''; // Kosongkan input
      return;
    }

    console.log('File OK di client: ' + file.name + ' (' + ext + ')');
    // Kalau mau auto-rename client-side (tidak efektif