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


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

// $geditinternalcode=1;CallEnableTeacherEntry("Edit");
function CallEnableCollegeInformation() {
  $("#page_main_div").load("../html_modules/college_info.html", function() {
    document.getElementById("display_module_name").innerHTML =
      "College Information";
    document.getElementById("module_name_for_save").value =
      "College Information";
    getDefaultHeadFooterLinks("College Information");
    AssignExistingCollegeData();
  });
}

function AssignExistingCollegeData() {
  $.ajax({
    type: "POST",
    url: $host_url + "AssignExistingCollegeData",
    success: AssignExistingCollegeDataSuccess
  });
}
function AssignExistingCollegeDataSuccess($responce) {
  $responce = eval("(" + $responce + ")");

  $("#college_code").val($responce.data.FCOLLCODE);
  $("#college_name").val($responce.data.FCOLLNAME);
  $("#college_place").val($responce.data.FTOWN);
  $("#principal_name").val($responce.data.FPRINCIPALNAME);
  $("#coll_phone_no").val($responce.data.FPHONE);
  $("#coll_e_mail").val($responce.data.FEMAIL);
  $("#coll_fax_mail").val($responce.data.FFAX);
  $("#mobile_1").val($responce.data.FMOBILE);
  $("#mobile_2").val($responce.data.FALTMOBILE);
  $("#addr1").val($responce.data.FCOLLADD1);
  $("#addr2").val($responce.data.FCOLLADD2);
  $("#addr3").val($responce.data.FCOLLADD3);
  $("#addr4").val($responce.data.FCOLLADD4);
}

function SaveCollegeInfoData() {
  $lstr_data = "";

  if (trim(document.getElementById("college_code").value) == "") {
    alert("Enter College code");
    document.getElementById("college_code").focus();
    return;
  }
  if (trim(document.getElementById("college_name").value) == "") {
    alert("Enter College Name");
    document.getElementById("college_name").focus();
    return;
  }
  if (trim(document.getElementById("college_place").value) == "") {
    alert("Enter College Place");
    document.getElementById("college_place").focus();
    return;
  }
  if (trim(document.getElementById("principal_name").value) == "") {
    alert("Enter Principal Name");
    document.getElementById("principal_name").focus();
    return;
  }
  if (trim(document.getElementById("coll_phone_no").value) == "") {
    alert("Enter Phone No");
    document.getElementById("coll_phone_no").focus();
    return;
  }
  if (trim(document.getElementById("coll_e_mail").value) == "") {
    alert("Enter the College Email");
    document.getElementById("coll_e_mail").focus();
    return;
  } else {
    var x = trim(document.getElementById("coll_e_mail").value);
    var atpos = x.indexOf("@");
    var dotpos = x.lastIndexOf(".");
    if (atpos < 1 || dotpos < atpos + 2 || dotpos + 2 >= x.length) {
      alert("Not a valid e-mail address");
      return false;
    }
  }
  if (trim(document.getElementById("coll_fax_mail").value) == "") {
    alert("Enter College Fax");
    document.getElementById("coll_fax_mail").focus();
    return;
  }
  if (trim(document.getElementById("mobile_1").value) == "") {
    alert(" Enter Mobile Number");
    document.getElementById("mobile_1").focus();
    return;
  }
  if (trim(document.getElementById("mobile_2").value) == "") {
    alert("Enter Alternate Mobile Number");
    document.getElementById("mobile_2").focus();
    return;
  }
  if (trim(document.getElementById("addr1").value) == "") {
    alert(" Enter College Address");
    document.getElementById("addr1").focus();
    return;
  }

  $lstr_data += "&college_code=" + encodeURIComponent($("#college_code").val());
  $lstr_data += "&college_name=" + encodeURIComponent($("#college_name").val());
  $lstr_data +=
    "&college_place=" + encodeURIComponent($("#college_place").val());
  $lstr_data +=
    "&principal_name=" + encodeURIComponent($("#principal_name").val());
  $lstr_data +=
    "&coll_phone_no=" + encodeURIComponent($("#coll_phone_no").val());
  $lstr_data += "&coll_e_mail=" + encodeURIComponent($("#coll_e_mail").val());
  $lstr_data +=
    "&coll_fax_mail=" + encodeURIComponent($("#coll_fax_mail").val());
  $lstr_data += "&mobile_1=" + encodeURIComponent($("#mobile_1").val());
  $lstr_data += "&mobile_2=" + encodeURIComponent($("#mobile_2").val());
  $lstr_data += "&addr1=" + encodeURIComponent($("#addr1").val());
  $lstr_data += "&addr2=" + encodeURIComponent($("#addr2").val());
  $lstr_data += "&addr3=" + encodeURIComponent($("#addr3").val());
  $lstr_data += "&addr4=" + encodeURIComponent($("#addr4").val());
  //alert($lstr_data);

  $.ajax({
    type: "POST",
    url: $host_url + "SaveCollegeInfoData",
    data: $lstr_data,
    success: SaveCollegeInfoDataSuccess
  });
}

function SaveCollegeInfoDataSuccess($responce) {
  $responce = eval("(" + $responce + ")");
  if ($responce.error_code == 0) {
    alert($responce.data);
  } else alert($responce.data);
}