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.21.244.240


Current Path : /proc/thread-self/root/var/www/oasis/js/
Upload File :
Current File : //proc/thread-self/root/var/www/oasis/js/upload_doc_demo.js

function load_demo_doc() {
  $("#page_main_div").load(
    "../html_modules/upload_photo_demo.html?v=1122",
    function () {
      document.getElementById("display_module_name").innerHTML = "Update Photo";
      document.getElementById("module_name_for_save").value = "Update Photo";
      getDefaultHeadFooterLinks("Update Photo");
    }
  );
}

async function uploadPhoto() {
  console.log("@fdsdkljsk");

  $.ajax({
    url: $host_url + "uploadPhotodemo",
    success: function (res) {
      console.log(res);
    },
  });
  // let formData = new FormData();
  // formData.append("file", photoupload.files[0]);
  // await fetch("src/upload_photo_demo.php", {
  //   method: "POST",
  //   body: formData,
  // });
  // alert("The file has been uploaded successfully.");
}

async function uploadIDProof() {
  let formData = new FormData();
  formData.append("file", idupload.files[0]);
  await fetch("src/upload_photo_demo.php", {
    method: "POST",
    body: formData,
  });
  alert("The file has been uploaded successfully.");
}

function photoURL(input) {
  if (input.files && input.files[0]) {
    var photo = new FileReader();

    photo.onload = function (e) {
      $("#photouploads").attr("src", e.target.result).width(150).height(200);
    };

    photo.readAsDataURL(input.files[0]);
  }
}

function idURL(input) {
  if (input.files && input.files[0]) {
    var id = new FileReader();

    id.onload = function (e) {
      $("#iduploads").attr("src", e.target.result);
    };

    id.readAsDataURL(input.files[0]);
  }
}

function savedata() {
  var regnos = document.getElementById("regno").value;
  var name = document.getElementById("uname").value;
  var udegree = document.getElementById("degree").value;
  var uphoto = document.getElementById("photouploads").value;
  var idproof = document.getElementById("iduploads").value;
  console.log(uphoto);

  $.ajax({
    type: "POST",
    url: "",
    success: function (response) {
      var res = JSON.parse(response);
    },
  });
}