0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.144.112.202


Current Path : /var/www/website/bkmh/
Upload File :
Current File : /var/www/website/bkmh/dasboardimg.js

// document
//   .getElementById("loginForm")
//   .addEventListener("submit", function (event) {
//     event.preventDefault();

//     var username = document.getElementById("username").value;
//     var password = document.getElementById("password").value;

//     if (username === "user" && password === "password") {
//       window.location.href = "dashboard.html";
//     } else {
//       alert("Invalid username or password");
//     }
//   });

// function dragOverHandler(event) {
//   event.preventDefault();
// }

// function dropHandler(event) {
//   event.preventDefault();

//   const files = event.dataTransfer.files;

//   if (files.length > 0) {
//     const file = files[0];

//     const formData = new FormData();
//     formData.append("file", file);
//     fetch("/upload", {
//       method: "POST",
//       body: formData,
//     })
//       .then((response) => response.json())
//       .then((data) => {
//         console.log("Upload successful:", data);
//         alert("File uploaded successfully");
//       })
//       .catch((error) => {
//         console.error("Error uploading file:", error);
//         alert("Error uploading file");
//       });
//   }
// }
// function uploadPhoto() {
//   var fileInput = document.getElementById("fileInput");
//   var file = fileInput.files[0];

//   if (file) {
//     var reader = new FileReader();
//     reader.onload = function (e) {
//       var preview = document.getElementById("preview");
//       var img = document.createElement("img");
//       img.src = e.target.result;
//       preview.innerHTML = "";
//       preview.appendChild(img);
//     };
//     reader.readAsDataURL(file);
//   }
// }

function allowDrop(ev) {
  ev.preventDefault();
}

function drag(ev) {
  ev.dataTransfer.setData("text", ev.target.id);
}

function drop(ev) {
  ev.preventDefault();
  var data = ev.dataTransfer.getData("text");

  // Get the dropped file
  var file = ev.dataTransfer.files[0];

  // Perform file upload here (you can implement your upload logic)
  if (file) {
    // You can use fetch API or XMLHttpRequest to upload the file to the server
    // For demonstration, let's just log the file details
    console.log("File uploaded:", file);
  }
}