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


Current Path : /var/www/student/vskub/js/
Upload File :
Current File : //var/www/student/vskub/js/jscript.js

var path_name = window.location.pathname;
var funivcode = getCookie("univcode");
path_name = path_name.replace("result.php", "");
path_name = path_name.replace("index.php", "");
path_name = path_name.replace("student.php", "");
path_name = path_name.replace("payment_gate_way_responce.php", "");
// var $host_url =
//   "http://" + window.location.host + "/" + path_name + "/app.php?a=";
  
  var $host_url =
  window.location.protocol +
  "//" +
  window.location.host +
  "/" +
  path_name +
  "/app.php?a=";

$g_dropdown_data = "";
$g_edit_app_code = 0;

function GetUrlParameters() {
  var url_object = new Object();
  var data_set = window.location.href.split("?");
  if (data_set.length > 1) {
    var params_set = data_set[1].split("&");
    for (i = 0; i < params_set.length; i++) {
      var pv = params_set[i];
      var pvv = pv.split("=");
      url_object[pvv[0]] = pvv[1];
    }
  }
  return url_object;
}

function date_format($str) {
  if (trim($str) == "" || $str == "undefined") $date = "0000-00-00";
  else {
    var indx = $str.indexOf("/");
    if (indx == -1) return $str;
    else {
      $date = $str.split("/");
      return $date[2] + "-" + $date[1] + "-" + $date[0];
    }
  }
}

function home() {
  window.location.href = "index.php";
}

function PopulateCategoryList() {
  $.ajax({
    type: "POST",
    async: false,
    url: $host_url + "PopulateCategoryList",
    success: PopulateCategoryListResponce
  });
}

function PopulateCategoryListResponce(responce) {
  responce = eval("(" + responce + ")");
  document.getElementById("category").options.length = 0;
  document.getElementById("FCONSTYPE").options.length = 0;
  var category = responce.data["category"];
  var mess_data = responce.data["mess_data"];

  var funivcode = responce.data["FUNIVCODE"];
  setCookie("funivcode", funivcode, 1);

  var FCONSTYPE = responce.data["FCONSTYPE"];
  for ($i = 0; $i < category.length; $i++) {
    $op = new Option(category[$i]["value"], category[$i]["internal_code"]);
    $op.id = category[$i]["internal_code"]; //specifying the id  for options
    document.getElementById("category").options.add($op);
  }

  for ($i = 0; $i < FCONSTYPE.length; $i++) {
    $op = new Option(FCONSTYPE[$i]["value"], FCONSTYPE[$i]["internal_code"]);
    $op.id = FCONSTYPE[$i]["internal_code"]; //specifying the id  for options
    document.getElementById("FCONSTYPE").options.add($op);
  }
  $("#main_message_board").html(mess_data);
  document.getElementById("reg_no").focus();
}

function ValidateRegNo() {
  var reg_no = trim($("#reg_no").val());
  // var category = $("#category").val();
  // var FCONSTYPE = $("#FCONSTYPE").val();

  if (empty(reg_no)) {
    alert("Register number should be entered");
    return false;
  }
  $.ajax({
    type: "POST",
    async: false,
    data: "&r=" + reg_no,
    url: $host_url + "validateCandidateRegno",
    success: function($responce) {
      $responce = eval("(" + $responce + ")");
      if ($responce.error_code == 0) {
        //alert("aa");
        window.location.href =
          "student.php?r=" +
          reg_no +
          "&c=" +
          $responce.data["category"] +
          "&li=" +
          $responce.data["fconstype"];
      } else {
        alert($responce.data);
      }
    }
  });
}

//########################################################
function DisplayApplications() {
  var funivcode = getCookie("univcode");
  url_object = GetUrlParameters();
  var r = url_object["r"];

  $.ajax({
    type: "POST",
    async: false,
    data: "r=" + r,
    url: $host_url + "DisplayApplications",
    success: DisplayApplicationsResponce
  });
}

function DisplayApplicationsResponce(responce) {
  var funivcode = getCookie("univcode");

  responce = eval("(" + responce + ")");
  var html = responce.data["html"];
  if (responce.error_code == 0) {
    var student_info = "";
    if (
      trim($("#student_info").html()) != "undefined" &&
      !empty($("#student_info").html())
    ) {
      student_info =
        '<table width="100%" align="center" class="result_table_header">' +
        $("#student_info").html() +
        "</table><br><br>";
    }
    $("#applications").html(student_info + html);
  } else {
  }
}

function trim($str) {
  return jQuery.trim($str);
}

function empty(mixed_var) {
  var key;
  if (
    mixed_var === "" ||
    mixed_var === 0 ||
    mixed_var === "0" ||
    mixed_var === null ||
    mixed_var === false ||
    typeof mixed_var === "undefined"
  ) {
    return true;
  }
  if (typeof mixed_var == "object") {
    for (key in mixed_var) {
      return false;
    }
    return true;
  }

  return false;
}

function in_array(needle, haystack, argStrict) {
  var key = "",
    strict = !!argStrict;

  if (strict) {
    for (key in haystack) {
      if (haystack[key] === needle) {
        return true;
      }
    }
  } else {
    for (key in haystack) {
      if (haystack[key] == needle) {
        return true;
      }
    }
  }

  return false;
}
//downloadFileFromServer
function DownLoadUpload() {
  $("#tabs").load("src/download_upload.html");
}

function downloadFileFromServer() {
  if (trim(document.getElementById("download_upload_path").value) == "") {
    alert("Please Enter the Path.");
    document.getElementById("download_upload_path").focus();
    return;
  } else {
    window.location.href =
      $host_url +
      "downloadFileFromServer&download_file_path=" +
      $("#download_upload_path").val();
  }
}

function UploadFileToServer() {
  if (trim(document.getElementById("upload_to_server_file_name").value) == "") {
    alert("Please Enter the File Path.");
    document.getElementById("upload_to_server_file_name").focus();
    return;
  } else {
    ext = document.getElementById("upload_to_server_file_name").value;
    filepath = ext;
    ext = ext.substring(ext.length - 3, ext.length);
    ext = ext.toLowerCase();
    if (ext != "") {
      document.getElementById("form_upload_download_details").action =
        $host_url +
        "UploadFileToServer&filepath=" +
        filepath +
        "&storage_path=" +
        $("#download_upload_file_path").val();
      document.getElementById("form_upload_download_details").target = "_new";
      // document.getElementById('form_module_details_upload').target='report_display';
      document.getElementById("form_upload_download_details").submit();
    } else {
      alert("Please select a File");
    }
  }
}

function ValidateStudentMobileNo() {
  var FMOBILE = $("#FMOBILE").val();
  if (empty(FMOBILE)) {
    alert(FMOBILE);
    return false;
  }
  url_object = GetUrlParameters();
  var r = url_object["r"];
  var e = url_object["e"];
  $.ajax({
    type: "POST",
    async: false,
    data: "r=" + r + "&e=" + e + "&FMOBILE=" + FMOBILE,
    url: $host_url + "ValidateStudentMobileNo",
    success: ValidateStudentMobileNoResponce
  });
}

// function MakeOnlinePayment(app_no)
// {
// 	window.location.href="payment_gateway.php?productinfo="+app_no;
// }

function ValidateStudentMobileNoResponce(responce) {
  responce = eval("(" + responce + ")");
  if (responce.error_code == 0) {
    DisplayRevalutionApplications();
  } else {
    alert("Invalid Mobile No");
    $("#your_app_div").html("");
  }
}

function setCookie(c_name, value, expiredays) {
  var exdate = new Date();
  exdate.setDate(exdate.getDate() + expiredays);
  document.cookie =
    c_name +
    "=" +
    escape(value) +
    (expiredays == null ? "" : ";expires=" + exdate.toGMTString());
}

function getCookie(c_name) {
  if (document.cookie.length > 0) {
    c_start = document.cookie.indexOf(c_name + "=");
    if (c_start != -1) {
      c_start = c_start + c_name.length + 1;
      c_end = document.cookie.indexOf(";", c_start);
      if (c_end == -1) c_end = document.cookie.length;
      return unescape(document.cookie.substring(c_start, c_end));
    }
  }
  return "";
}