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


Current Path : /var/www/oasis/js/
Upload File :
Current File : /var/www/oasis/js/daterange.js

function EnableDateRange() {
  $("#page_main_div").load("../html_modules/datesrange.html", function() {
    document.getElementById("display_module_name").innerHTML =
      "Update Last Date ";
    document.getElementById("module_name_for_save").value = "Update Last Date ";
    getDefaultHeadFooterLinks("Update Last Date ");
    document.getElementById("fdate").value = getCookie("curdate");
    document.getElementById("tdate").value = getCookie("curdate");
    $("#dates").hide();
    loaddeggrp();
  });
}

function displayDatesDetails() {
  if (document.getElementById("fdeggrp").value == "") {
    alert("please select degree group");
    document.getElementById("fdeggrp").focus();
    return false;
  } else if (document.getElementById("fdaterange").value == "") {
    alert("please select event date");
    document.getElementById("fdaterange").focus();
    return false;
  } else if (document.getElementById("college_code_from").value == "") {
    alert("please select college range");
    document.getElementById("college_code_from").focus();
    return false;
  } else if (document.getElementById("degree_code_from").value == "") {
    alert("please select degree range");
    document.getElementById("degree_code_from").focus();
    return false;
  } else if (document.getElementById("Examno_from").value == "") {
    alert("please select Exam range");
    document.getElementById("Examno_from").focus();
    return false;
  }
  $("#dates").show();
  $("#dates").load("../html_modules/datedetails.html", function() {
    /* document.getElementById('fdaterange').disabled = true;
		document.getElementById('college_code_from').disabled = true;
		document.getElementById('college_code_to').disabled = true;
		document.getElementById('degree_code_from').disabled = true;
		document.getElementById('degree_code_to').disabled = true;
		document.getElementById('Examno_from').disabled = true;
		document.getElementById('Examno_to').disabled = true; */
  });
}

function SaveDateRange() {
  if (document.getElementById("fdeggrp").value == "") {
    alert("please select degree group");
    document.getElementById("fdeggrp").focus();
    return false;
  } else if (document.getElementById("fdaterange").value == "") {
    alert("please select event date");
    document.getElementById("fdaterange").focus();
    $("#fdaterange").focus();
    return;
  } else if (document.getElementById("college_code_from").value == "") {
    alert("please select college range");
    document.getElementById("college_code_from").focus();
    $("#college_code_from").focus();
    return;
  } else if (document.getElementById("college_code_to").value == "") {
    alert("please select college range");
    document.getElementById("college_code_to").focus();
    $("#college_code_to").focus();
    return;
  } else if (document.getElementById("degree_code_from").value == "") {
    alert("please select degree range");
    document.getElementById("degree_code_from").focus();
    $("#degree_code_from").focus();
    return;
  } else if (document.getElementById("degree_code_to").value == "") {
    alert("please select degree range");
    document.getElementById("degree_code_to").focus();
    $("#degree_code_to").focus();
    return;
  } else if (document.getElementById("Examno_from").value == "") {
    alert("please select exam range");
    document.getElementById("Examno_from").focus();
    $("#Examno_from").focus();
    return;
  } else if ((fdaterange = document.getElementById("Examno_to").value == "")) {
    alert("please select exam range");
    document.getElementById("Examno_to").focus();
    $("#Examno_to").focus();
    return;
  } else if (document.getElementById("fdate").value == "") {
    alert("please select from date");
    document.getElementById("fdate").focus();
    $("#fdate").focus();
    return;
  } else if ((fdaterange = document.getElementById("tdate").value == "")) {
    alert("please select to date");
    document.getElementById("tdate").focus();
    $("#tdate").focus();
    return;
  }

  var fdaterange = document.getElementById("fdaterange").value;
  var college_code_from = document.getElementById("college_code_from").value;
  var college_code_to = document.getElementById("college_code_to").value;
  var degree_code_from = document.getElementById("degree_code_from").value;
  var degree_code_to = document.getElementById("degree_code_to").value;
  var Examno_from = document.getElementById("Examno_from").value;
  var Examno_to = document.getElementById("Examno_to").value;
  var fdate = document.getElementById("fdate").value;
  var tdate = document.getElementById("tdate").value;
  var fdeggrp = document.getElementById("fdeggrp").value;

  var datastring =
    "&fdaterange=" +
    fdaterange +
    "&college_code_from=" +
    college_code_from +
    "&college_code_to=" +
    college_code_to +
    "&degree_code_to=" +
    degree_code_to +
    "&degree_code_from=" +
    degree_code_from +
    "&Examno_from=" +
    Examno_from +
    "&Examno_to=" +
    Examno_to +
    "&fdate=" +
    fdate +
    "&tdate=" +
    tdate +
    "&fdeggrp=" +
    fdeggrp;

  $.ajax({
    type: "POST",
    url: $host_url + "SaveDateRange",
    data: datastring,
    success: SaveDateRangeResponse
  });
}

function SaveDateRangeResponse($responce) {
  $responce = eval("(" + $responce + ")");
  alert($responce.data);
}

function getdatedetails() {
  var fdaterange = document.getElementById("fdaterange").value;
  var college_code_from = document.getElementById("college_code_from").value;
  var college_code_to = document.getElementById("college_code_to").value;
  var degree_code_from = document.getElementById("degree_code_from").value;
  var degree_code_to = document.getElementById("degree_code_to").value;
  var Examno_from = document.getElementById("Examno_from").value;
  var Examno_to = document.getElementById("Examno_to").value;
  var fdeggrp = document.getElementById("fdeggrp").value;

  var datastring =
    "&fdaterange=" +
    fdaterange +
    "&college_code_from=" +
    college_code_from +
    "&college_code_to=" +
    college_code_to +
    "&degree_code_to=" +
    degree_code_to +
    "&degree_code_from=" +
    degree_code_from +
    "&Examno_from=" +
    Examno_from +
    "&Examno_to=" +
    Examno_to +
    "&fdeggrp=" +
    fdeggrp;

  $.ajax({
    type: "POST",
    url: $host_url + "getdatedetails",
    data: datastring,
    success: getdatedetailsResponse
  });
}

function getdatedetailsResponse($responce) {
  $responce = eval("(" + $responce + ")");
  $("#ftable").empty();
  $("#dates").show();
  $("#dates").load("../html_modules/datedetails.html", function() {
    /* document.getElementById('fdaterange').disabled = true;
		document.getElementById('college_code_from').disabled = true;
		document.getElementById('college_code_to').disabled = true;
		document.getElementById('degree_code_from').disabled = true;
		document.getElementById('degree_code_to').disabled = true;
		document.getElementById('Examno_from').disabled = true;
		document.getElementById('Examno_to').disabled = true; */

    if ($responce.error_code == 0) {
      $("#ftable").append($responce.data["table"]);
    }
  });
}

function to_upperx(id) {
  var x = document.getElementById(id).value;
  document.getElementById(id).value = x.toUpperCase();
}

function loaddeggrp() {
  $.ajax({
    type: "POST",
    url: $host_url + "loaddeggrp",
    success: loaddeggrpResponse
  });
}

function loaddeggrpResponse($responce) {
  $responce = eval("(" + $responce + ")");
  if ($responce.error_code == -1) {
    alert($responce.data);
    return;
  } else {
    var deggrp = $responce.data;

    $op = new Option("--SELECT--", "");
    document.getElementById("fdeggrp").options.add($op);
    for ($i = 0; $i < deggrp.length; $i++) {
      $op = new Option(deggrp[$i]["value"], deggrp[$i]["code"]);
      $op.id = deggrp[$i]["code"];
      document.getElementById("fdeggrp").options.add($op);
    }
  }
}