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 : 18.224.43.98


Current Path : /proc/thread-self/root/var/www/html/mcu/js/
Upload File :
Current File : //proc/thread-self/root/var/www/html/mcu/js/createAdmission.js

function CallEnableCreateAdmission() {
  $("#page_main_div").load("html_modules/createAdmission.html", function() {
    document.getElementById("display_module_name").innerHTML =
      "Create Admission Basic Data";
    document.getElementById("module_name_for_save").value =
      "Create Admission Basic Data";
    getDefaultHeadFooterLinks("Create Admission Data");
    loadDegree();
  });
}

function loadDegree() {
  $.ajax({
    type: "POST",
    async: false,
    url: $host_url + "loaddegree",
    success: function($responceCat) {
      $responceCat = eval("(" + $responceCat + ")");
      if ($responceCat.error_code == 0) {
        var optionsAsString = "<option value=''>--Select Degree--</option>";
        for (var i = 0; i < $responceCat.data.length; i++) {
          optionsAsString +=
            "<option value='" +
            $responceCat.data[i].internal_code +
            "'>" +
            $responceCat.data[i].internal_code +
            "-" +
            $responceCat.data[i].value +
            "</option>";
        }

        $("#fdegree").append(optionsAsString);
      }
    },
    error: function(data) {
      alert(data);
    }
  });
}

function loaddegreeResponse($responceCat) {
  $responceCat = eval("(" + $responceCat + ")");
  if ($responceCat.error_code == 0) {
    var optionsAsString = "<option value=''>--Select Degree--</option>";
    for (var i = 0; i < $responceCat.data.length; i++) {
      optionsAsString +=
        "<option value='" +
        $responceCat.data[i].internal_code +
        "'>" +
        $responceCat.data[i].internal_code +
        "-" +
        $responceCat.data[i].value +
        "</option>";
    }

    $("#fdegree").append(optionsAsString);
  }
}

function savestudentdata() {
  var fdegree = $("#fdegree").val();
  var fname = $("#fname").val();
  var femail = $("#femail").val();
  var fmobileno = $("#fmobileno").val();
  var wom = "F";
  if (document.getElementById("wom").checked == true) {
    wom = "T";
    document.getElementById("fmobileno").disabled = true;
  }
  if (empty(fdegree)) {
    alert("Please Select Degree");
    $("#fdegree").focus();
    return false;
  }
  if (fname == "") {
    alert("Please Enter Student Name");
    $("#fname").focus();
    return false;
  }
  /*if(femail == '')
	{
		alert("Please Enter Email Id");
		$("#femail").focus();
		return false;
	}*/
  if (wom == "F") {
    if (fmobileno.length < 10) {
      alert("Please Enter Mobile Number Correclty");
      $("#fmobileno").focus();
      return false;
    }
    if (fmobileno == "") {
      alert("Please Enter Mobile Number");
      $("#fmobileno").focus();
      return false;
    }
  }

  if ($("#LT").val() == "T") {
    var degree = $("#fdegree").val();
    if (degree[degree.length - 1] == 2) {
      alert(`For ${degree} 1st semester, the degree code is ${degree}`);
      return;
    }
  }

  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>"
  });
  var parameters = `&fdegree=${$("#fdegree").val()}
						&fname=${$("#fname").val()}
						&femail=${$("#femail").val()}
						&fmobileno=${$("#fmobileno").val()}
						&LT=${$("#LT").val()}
						&wom=${wom}`;
  $.ajax({
    type: "POST",
    data: parameters,
    url: $host_url + "savestudentdata",
    success: savestudentdataResponce
  });
}

function savestudentdataResponce(responce) {
  responce = eval("(" + responce + ")");
  $.unblockUI();
  if (responce.error_code == "-1") {
    var msg = "Updation Failure. The Given Mobile Number Exist in \n";
    msg += `\t College Code : ${responce.data.fcollcode} \n`;
    msg += `\t Degree Code : ${responce.data.fdegree} \n`;
    msg += `\t Name : ${responce.data.fname} \n`;
    msg += `\t Email Id : ${responce.data.femail} \n`;
    msg += `\t Mobile Number : ${responce.data.fmobileno} \n`;

    alert(msg);
    $("#fname").val("");
    $("#femail").val("");
    $("#fmobileno").val("");
    $("#fname").focus();
    return;
  } else if (responce.error_code == "-2") {
    alert(responce.data);

    $("#fname").val("");
    $("#femail").val("");
    $("#fmobileno").val("");
    $("#fname").focus();
    return;
  } else if (responce.error_code == "0") {
    alert(responce.data);
    $("#fname").val("");
    $("#femail").val("");
    $("#fmobileno").val("");
    $("#fname").focus();
    return;
  }
}

function checkwob() {
  document.getElementById("fmobileno").disabled = false;
  if (document.getElementById("wom").checked == true)
    document.getElementById("fmobileno").disabled = true;
}