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


Current Path : /proc/thread-self/root/var/www/oasis/custom_js/
Upload File :
Current File : //proc/thread-self/root/var/www/oasis/custom_js/practical_marks.js

function LoadPracticalMarksSetup() {
  $("#page_main_div").load("../html_modules/practical_marks.html", function () {
    $geditinternalcode = 0;

    document.getElementById("display_module_name").innerHTML =
      "Marks Entry/Printing";
    document.getElementById("module_name_for_save").value = "SaveBatchSetup";
    document.getElementById("is_add_edit").value = "Edit";
    getDefaultHeadFooterLinks("Marks Entry/Printing");
    if (db == "demo") {
      $("#batch_sub_degree_code").val("BTCS1");
      $("#batch_sub_degree_name").val(
        "B.Tech (Computer Science & Engineering)"
      );
      $("#batch_sub_Examno").val("A");
      $("#batch_sub_Exam_name").val("First Semester");
      $("#batch_sub_final_subcode").val("A0910");
      $("#batch_sub_fsubname").val("Constitution of India");
      $("#batch_sub_maxmark").val("50");
      $("#batch_no").val("02");

     
    }
    if (db == "dypatil") {
      $("#lsubcode").html("Course : ");
      $("#ldegcode").html("Programme : ");
    }
  });
}

function GenerateBatchSetupPopup() {
  var win_width = window.screen.width;
  $("#batch_dialog").dialog("open");
  $("#batch_dialog").data("width.dialog", 400);
  $("#batch_dialog").data("position.dialog", [(win_width - 400) / 2, 90]);
  $("#ui-dialog-title-batch_dialog").html("Batch Setup");
  var path = "../html_modules/batch_setup_popup.html";
  $("#batch_dialog").load(path, function () {
    $("#from_qp_code").val(trim($("#batch_sub_final_subcode").val()));
    $("#to_qp_code").val(trim($("#batch_sub_final_subcode").val()));
  });
}

function GetPracticalMarksRegNos() {
  $("#mes_default_reg_div").hide();

  if ($("#batch_sub_degree_code").val() == "") {
    alert("Please Enter Degree Name");
    $("#batch_sub_degree_code").focus();
    return;
  }
  if ($("#batch_sub_final_subcode").val() == "") {
    alert("Please Enter Subject Code");
    $("#batch_sub_final_subcode").focus();
    return;
  }
  if ($("#batch_sub_Examno").val() == "") {
    alert("Please Enter Examno");
    $("#batch_sub_Examno").focus();
    return;
  }
  if ($("#batch_no").val() == "") {
    alert("Please Enter Batch No");
    $("#batch_no").focus();
    return;
  }

  var bw_condition;
  if ($("#batch_sub_range").val() == "B/W") {
    condition_name = " between ";
    condition_val =
      "'" +
      $("#batch_sub_range_from").val() +
      "'" +
      " and " +
      "'" +
      $("#batch_sub_range_to").val() +
      "'";
  } else {
    condition_name = "like ";
    condition_val = $("#batch_sub_range_bw").val();
  }

  var list_data = "Degcode=" + $("#batch_sub_degree_code").val();
  list_data += "&Subcode=" + $("#batch_sub_final_subcode").val();
  list_data += "&Examno=" + $("#batch_sub_Examno").val();
  list_data += "&viva_sub_code=" + $("#batch_viva_subject_code").val();
  list_data += "&batch_no=" + $("#batch_no").val();
  list_data += "&pract_max_marks=" + $("#batch_sub_maxmark").val();
  list_data += "&viva_max_marks=" + $("#batch_viva_subject_max_marks").val();

  list_data += "&condition_name=" + condition_name;
  list_data += "&condition_val=" + condition_val;

  $.ajax({
    type: "POST",
    //async:false,
    url: $host_url + "validatelastdate.demo",
    data: list_data,
    success: function ($responce) {
      $responce = eval("(" + $responce + ")");

      if ($responce.error_code != 0) {
        alert($responce.data);
        return false;
      } else {
        $.ajax({
          type: "POST",
          //async:false,
          url: $host_url + "GetPracticalMarksRegNos",
          data: list_data,
          success: GetPracticalMarksRegNosResponse,
        });
      }
    },
  });
}

function GetPracticalMarksRegNosResponse($responce) {
  $responce = eval("(" + $responce + ")");
  $("#btc_default_reg_div").html("");

  if ($responce.error_code == 0) {
    $("#btc_default_reg_div").load($responce.data.filenme);
  } else {
    alert($responce.data);
  }
}

function CancelBatchSetup() {
  $("#batch_dialog").dialog("close");
}
function SavePracticalEntryMarks() {
  var list_data = "&Degcode=" + $("#batch_sub_degree_code").val();
  list_data += "&Subcode=" + $("#batch_sub_final_subcode").val();
  list_data += "&VivaSubcode=" + $("#batch_viva_subject_code").val();
  list_data += "&Examno=" + $("#batch_sub_Examno").val();
  var pract_sub_code = $("#batch_sub_final_subcode").val();
  var viva_sub_code = $("#batch_viva_subject_code").val();
  var errorstatus = true;
  //console.log(pract_sub_code);
  //console.log(viva_sub_code);
  pra_save_obj = new Object();
  viva_save_obj = new Object();

  pract_html_objects = $("input[id*='" + pract_sub_code + "_']");
  viva_html_objects = $("input[id*='" + viva_sub_code + "_']");
  var i = 0;
  console.log(pract_html_objects);
  jQuery.each(pract_html_objects, function (k, v) {
    /* var reg_no = v['id'].split("_")[2];	 
			var marks = parseFloat($("#"+v['id']).val());
			if(marks < -2 || isNaN(marks))
			{
				alert('Enter valid marks');
				$("#"+v['id']).val('');
				$("#"+v['id']).focus();
				errorstatus = false;
				return false;
			} */
    //console.log(v);
    var reg_no = v["id"].split("_")[2];
    var marks = $("#" + v["id"]).val();
    if (marks.toUpperCase() == "AB") marks = "-2";
    if (marks == "0") marks = "0";
    else if (empty(marks)) marks = "-1";

    pra_save_obj[i] = new Object();
    pra_save_obj[i]["reg_no"] = reg_no;
    pra_save_obj[i]["marks"] = marks;
    i++;
  });
  var i = 0;
  jQuery.each(viva_html_objects, function (k, v) {
    /* var reg_no = v['id'].split("_")[2];	 
			var marks = parseFloat($("#"+v['id']).val());
			if(marks < -2 || isNaN(marks))
			{
				alert('Enter valid marks');
				$("#"+v['id']).val('');
				$("#"+v['id']).focus();
				errorstatus = false;
				return false;
			} */

    var reg_no = v["id"].split("_")[2];
    var marks = $("#" + v["id"]).val();
    if (marks.toUpperCase() == "AB") marks = "-2";
    if (empty(marks)) marks = "-1";

    viva_save_obj[i] = new Object();
    viva_save_obj[i]["reg_no"] = reg_no;
    viva_save_obj[i]["marks"] = marks;
    i++;
  });
  if (errorstatus) {
    var pra_save_obj = encodeURIComponent(JSON.stringify(pra_save_obj));
    var viva_save_obj = encodeURIComponent(JSON.stringify(viva_save_obj));
    list_data += "&pra_save_obj=" + pra_save_obj;
    list_data += "&viva_save_obj=" + viva_save_obj;
    $.blockUI({
      message:
        "<h1 class='h1' style='font-size:12px'>Saving... <img src='images/spinner.gif' border='0'></h1>",
    });
    $.ajax({
      type: "POST",
      async: false,
      url: $host_url + "SavePracticalEntryMarks",
      data: list_data,
      success: SavePracticalEntryMarksResponce,
    });
  }
}
function SavePracticalEntryMarksResponce(responce) {
  responce = eval("(" + responce + ")");
  $.unblockUI();
  alert(responce.data);
}
/*##################### REPORT PART ##################################*/
function GeneratePracticalMarksReports() {
  degree = trim($("#batch_sub_degree_code").val());
  exam = trim($("#batch_sub_Examno").val());
  sub = trim($("#batch_sub_final_subcode").val());
  from_qp_code = trim($("#batch_sub_final_subcode").val());
  to_qp_code = trim($("#batch_sub_final_subcode").val());
  batch_no = trim($("#batch_no").val());
  if (empty(degree)) {
    alert("Please Select Degree!!");
    return false;
  } else if (empty(exam)) {
    alert("Please Select exam!!");
    return false;
  } else if (empty(sub)) {
    alert("Please Select sub!!");
    return false;
  } else if (empty(from_qp_code)) {
    alert("Please Select from_qp_code!!");
    return false;
  } else if (empty(batch_no)) {
    alert("Please Select batch_no!!");
    return false;
  }
  var str = "&degree=" + degree;
  str += "&degree_name=" + trim($("#batch_sub_degree_name").val());
  str += "&sub_name=" + trim($("#batch_sub_fsubname").val());
  str += "&fs_sub_name=" + trim($("#batch_sub_fssubname").val());
  str += "&batch_no=" + trim($("#batch_no").val());
  str += "&exam=" + exam;
  str += "&sub=" + sub;
  str += "&from_qp_code=" + from_qp_code;
  str += "&to_qp_code=" + to_qp_code;
  window.open($host_url + "GeneratePracticalMarksReports" + str);
}
function GetPracticalMarksReports() {
  var win_width = window.screen.width;
  $("#batch_dialog").dialog("open");
  $("#batch_dialog").data("width.dialog", 400);
  $("#batch_dialog").data("position.dialog", [(win_width - 400) / 2, 90]);
  $("#ui-dialog-title-batch_dialog").html("Mark Entry");
  var path = "../html_modules/mark_set_up_popup.html";
  $("#batch_dialog").load(path, function () {
    $("#from_qp_code").val(trim($("#batch_sub_final_subcode").val()));
    $("#to_qp_code").val(trim($("#batch_sub_final_subcode").val()));
  });
}
function CancelBatchSetup() {
  $("#batch_dialog").dialog("close");
}