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


Current Path : /var/www/oasis/js_old/
Upload File :
Current File : /var/www/oasis/js_old/uploadzip.js

function calluploadzip() {
  $("#page_main_div").load("../html_modules/uploadzip.html", function() {
    document.getElementById("display_module_name").innerHTML =
      "Upload Zip File";
    document.getElementById("module_name_for_save").value = "Upload Zip File";
    //clearCalluploadStudentPhotos();
    getDefaultHeadFooterLinks("Upload Zip");
  });
  // $('#module_details_div').hide();
}

function clearCalluploadStudentPhotos() {
  $("#degree_code").val("");
  //document.getElementById('it_module').innerHTML = '';
  $("#degree_code").focus();
}

function viewUploadStudentPhoto() {
  if (trim($("#degree_code").val()) == "") {
    alert("Enter Degree Code ");
    $("#degree_code").focus();
    return;
  }
  var dataString =
    "degreeCode=" +
    $("#degree_code").val() +
    "&regStart=" +
    $("#uploadPhoto_regno_start_from").val() +
    "&regEnd=" +
    $("#uploadPhoto_regno_end_to").val();
  $.ajax({
    type: "POST",
    data: dataString,
    url: $host_url + "viewStudInfoToupload",
    success: viewStudInfoTouploadResponse
  });
}

function viewStudInfoTouploadResponse($responce) {
  $responce = eval("(" + $responce + ")");
  if ($responce.error_code == -1) {
    alert($responce.data);
  } else {
    $("#uploadPh_studlist").show();
    $("#uploadPh_studlist").html($responce.data["html"]);
  }
}

var row_index = 0;
var filepath;
var regnumb;
function UserSelectedPhotoDisplay(index) {
  row_index = index;
  var valid_file_extentions = new Array("jpeg", "jpg", "png", "gif");

  var ext = $("#student_entry_upload_" + index).val();

  filepath = ext;

  ext = ext.substring(ext.length - 3, ext.length);

  ext = ext.toLowerCase();

  if (ext != "" && !in_array(ext, valid_file_extentions)) {
    alert("Please Select the Valid Photo!");

    return false;
  }

  var lstr_data = "&filepath=" + filepath + "&index=" + index;

  $upload = $host_url + "UserSelectedPhotoDisplay&" + lstr_data;

  document
    .getElementById("form_module_image_upload")
    .setAttribute("action", $upload);
  return AIM.submit(
    document.getElementById("form_module_image_upload"),
    "report_display",
    { onComplete: UserSelectedPhotoDisplayResponse }
  );
}

function UserSelectedPhotoDisplayResponse($responce) {
  $responce = eval("(" + $responce + ")");

  if ($responce.error_code == 0)
    $("#student_entry_photo_" + row_index).attr("src", $responce.data);
  else if ($responce.error_code == -1)
    $("#student_entry_photo_" + row_index).attr(
      "src",
      "images/default_photo.jpg"
    );
  else if ($responce.error_code == -2) {
    alert($responce.data);
    $("#student_entry_photo_" + row_index).attr(
      "src",
      "images/default_photo.jpg"
    );
    $("#student_entry_upload_" + row_index).val("");
  }
}

function UserSelectedPhotoUpload() {
  var valid_file_extentions = new Array("jpeg", "jpg", "png", "gif");
  var ext = $("#student_entry_upload").val();
  var type = $("#type").val();
  var examination = $("#examination").val();

  //var regno=$("#hd_regno_"+index).val();
  filepath = ext;

  ext = ext.substring(ext.length - 3, ext.length);
  ext = ext.toLowerCase();

  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'><img src='images/ajax-loader.gif' border='0'></h1>"
  });
  $lstr_data =
    "filepath=" + filepath + "&type=" + type + "&examination=" + examination;
  $upload = $host_url + "saveuserselectedfile&" + $lstr_data;
  document
    .getElementById("form_module_image_upload")
    .setAttribute("action", $upload);
  return AIM.submit(
    document.getElementById("form_module_image_upload"),
    "report_display",
    { onComplete: UserSelectedPhotoUploadResponse }
  );
}

function UserSelectedPhotoUploadResponse($responce) {
  $.unblockUI();
  $responce = eval("(" + $responce + ")");
  alert($responce.data);
  calluploadzip();
}

function onlyAlphabets(e, t) {
  try {
    if (window.event) {
      var charCode = window.event.keyCode;
    } else if (e) {
      var charCode = e.which;
    } else {
      return true;
    }
    if (
      (charCode > 64 && charCode < 91) ||
      (charCode > 96 && charCode < 123) ||
      charCode == 8 ||
      charCode == 0
    )
      return true;
    else return false;
  } catch (err) {
    alert(err.Description);
  }
}