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


Current Path : /var/www/oasis/custom_js/
Upload File :
Current File : /var/www/oasis/custom_js/practical_entry_freezing.js

var g_freeze_data = "";
var g_freeze_time = ""; // FREEZE TIMETABLE
function LoadEnablePracticalEntryFreezing(type) {
  g_freeze_time = type;
  $("#page_main_div").load(
    "../html_modules/practical_entry_freezing.html",
    function () {
      $geditinternalcode = 0;
      window.enable_proper_module = "enableLoadRevaluationt";
      if (g_freeze_time == "FREEZE") {
        document.getElementById("display_module_name").innerHTML =
          "Practical Entry Freezing";
        getDefaultHeadFooterLinks("Practical Entry Freezing");
      } else {
        document.getElementById("display_module_name").innerHTML =
          "Batch Wise Time Table";
        $("#a_pr_id").html("Batchwise Time Table");
        getDefaultHeadFooterLinks("Batch Wise Time Table");
      }
      document.getElementById("module_name_for_save").value =
        "SavePracticalEntryFreezing";
      document.getElementById("is_add_edit").value = "Edit";

      if (db == "demo") {
        $("#fmacas_degree_code").val("BTCS1");
        $("#fmacas_degree_name").val("B.Tech (Computer Science & Engineering)");
        $("#fmacas_sub_Examno").val("A");
        $("#fmacas_sub_Exam_name").val("First Semester");
        $("#fmacas_sub_final_subcode").val("A0910");
        $("#fmacas_sub_fsubname").val("Constitution of India");
        $("#fmacas_sub_maxmark").val("50");
   
      }
      if (db == "dypatil") {
        $("#lsubcode").html("Course : ");
        $("#ldegcode").html("Programme : ");
      }
    }
  );
}
function getPracticalEntryFreezeDetails() {
  if (empty(trim($("#fmacas_degree_code").val()))) {
    alert("Please Enter Degree");
    return false;
  }
  if (empty(trim($("#fmacas_sub_Examno").val()))) {
    alert("Please Enter Exam");
    return false;
  }

  var str = "&degree_code=" + trim($("#fmacas_degree_code").val());
  str += "&exam_no=" + trim($("#fmacas_sub_Examno").val());
  str += "&subject=" + trim($("#fmacas_sub_final_subcode").val());
  str += "&g_freeze_time=" + g_freeze_time;
  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'>Batchwise time table... <img src='images/spinner.gif' border='0'></h1>",
  });
  $.ajax({
    type: "POST",
    url: $host_url + "getPracticalEntryFreezeDetails",
    data: str,
    success: getPracticalEntryFreezeDetailsResponce,
  });
}
function getPracticalEntryFreezeDetailsResponce(responce) {
  responce = eval("(" + responce + ")");
  $.unblockUI();
  g_freeze_data = responce.data.freeze_data;
  if (responce.error_code == "0") {
    $("#fmacas_module_subject_data").html(responce.data.html_data);
    $("#fmacas_module_subject_data").show();
  } else {
    $("#fmacas_module_subject_data").html(
      "<div align='left'>No Records Found</left>"
    );
    $("#fmacas_module_subject_data").show();
  }
  $("#batch_sl_no_0").focus();
}

function GenerateAttendanceSheetPreparation() {
  degree = trim($("#fmacas_degree_code").val());
  exam = trim($("#fmacas_sub_Examno").val());
  sub = trim($("#fmacas_sub_final_subcode").val());
  from_batch = trim($("#from_batch").val());
  to_batch = trim($("#to_batch").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;
  }

  var str = "&degree=" + degree;
  str += "&degree_name=" + trim($("#fmacas_degree_code").val());
  str += "&exam=" + exam;
  str += "&sub=" + sub;
  str += "&from_batch=" + from_batch;
  str += "&to_batch=" + to_batch;
  str +=
    "&sub_name=" + encodeURIComponent(trim($("#fmacas_sub_fsubname").val()));
  str +=
    "&fs_sub_name=" + encodeURIComponent(trim($("#fmacas_sub_fsubname").val()));
  window.open($host_url + "GenerateAttendanceSheets" + str);
}

function FreezePracticalMaks() {
  if (empty(trim($("#fmacas_degree_code").val()))) {
    alert("Please Enter Degree");
    return false;
  }
  if (empty(trim($("#fmacas_sub_Examno").val()))) {
    alert("Please Enter Exam");
    return false;
  }
  if (empty(trim($("#fmacas_sub_final_subcode").val()))) {
    alert("Please Enter Subject");
    return false;
  }
  var freeze_obj = new Object();
  j = 0;
  var sub_code_freeze = $("input[id*='fmacas_FCSTATUS_check']");
  jQuery.each(sub_code_freeze, function (ke, v) {
    var check_box_id = v["id"];
    check_box_id_arr = check_box_id.split("fmacas_FCSTATUS_check_");
    int_code = check_box_id_arr[1];
    checked = "F";
    if (document.getElementById(check_box_id).checked == true) checked = "T";
    freeze_obj[j] = new Object();
    freeze_obj[j]["sub_code_freeze"] = trim(
      $("#fmacas_FSUBCODE_" + int_code).html()
    );
    freeze_obj[j]["batch"] = trim($("#batch_" + int_code).html());
    freeze_obj[j]["date"] = date_format(
      $("#practical_entry_freeze_exam_date_" + int_code).val()
    );

    //if( date_format($("#practical_entry_freeze_exam_date_"+int_code).val()) == "0000-00-00")
    //{
    //alert("enter the Exam date.");
    var ldate = $("#practical_entry_freeze_exam_date_" + int_code).val();
    var id = "practical_entry_freeze_exam_date_" + int_code;
    // validateDate(ldate, id);
    //$("#practical_entry_freeze_exam_date_"+int_code).focus();
    //exit(1);
    //	}
    if ($("#time_" + int_code).val() == "") {
      alert("enter the Exam Time.");
      $("#time_" + int_code).focus();
      exit("0");
    }
    p_id = "fmacas_print_check_" + int_code;
    p_checked = "F";
    if (document.getElementById(p_id).checked == true) p_checked = "T";

    freeze_obj[j]["time"] = $("#time_" + int_code).val();
    freeze_obj[j]["roomname"] = $("#roomname_" + int_code).val();

    freeze_obj[j]["fexaminer1"] = $("#fexaminer1_" + int_code).val();
    freeze_obj[j]["fexaminer2"] = $("#fexaminer2_" + int_code).val();
    freeze_obj[j]["fexaminer3"] = $("#fexaminer3_" + int_code).val();
    freeze_obj[j]["fexaminer4"] = $("#fexaminer4_" + int_code).val();
    freeze_obj[j]["fexaminer5"] = $("#fexaminer5_" + int_code).val();
    freeze_obj[j]["fexaminer6"] = $("#fexaminer6_" + int_code).val();

    freeze_obj[j]["checked"] = checked;
    freeze_obj[j]["p_checked"] = p_checked;
    j++;
  });

  var myJSONText = JSON.stringify(freeze_obj);
  console.log("str: ", str);
  var str = "&degree_code=" + trim($("#fmacas_degree_code").val());
  str += "&exam_no=" + trim($("#fmacas_sub_Examno").val());
  str += "&subject=" + trim($("#fmacas_sub_final_subcode").val());
  str += "&output_details=" + myJSONText;
  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'>Saving... <img src='images/spinner.gif' border='0'></h1>",
  });
  $.ajax({
    type: "POST",
    url: $host_url + "FreezePracticalMaks",
    data: str,
    success: FreezePracticalMaksResponce,
  });
}

function FreezePracticalMaksResponce(responce) {
  responce = eval("(" + responce + ")");
  $.unblockUI();
  $("#fmacas_module_subject_data").html("");
  alert(responce.data);
  getPracticalEntryFreezeDetails();
}

function GenerateBatchWorkSheetsFromLink(id) {
  degree = trim($("#fmacas_degree_code").val());
  exam = trim($("#fmacas_sub_Examno").val());
  sub = trim($("#fmacas_sub_final_subcode").val());
  from_batch = trim($("#batch_" + id).html());
  to_batch = trim($("#batch_" + id).html());

  var str = "&degree=" + degree;
  str += "&degree_name=" + trim($("#fmacas_degree_name").val());
  str +=
    "&sub_name=" + encodeURIComponent(trim($("#fmacas_sub_fsubname").val()));
  str += "&exam=" + exam;
  str += "&sub=" + sub;
  str +=
    "&fs_sub_name=" +
    encodeURIComponent(trim($("#fmacas_sub_fssubname").val()));
  str += "&from_batch=" + from_batch;
  str += "&to_batch=" + to_batch;
  window.open($host_url + "GenerateBatchWorkSheets" + str);
}
function GeneratePracticalMarksReportsFromLink(id) {
  degree = trim($("#fmacas_degree_code").val());
  exam = trim($("#fmacas_sub_Examno").val());
  sub = trim($("#fmacas_sub_final_subcode").val());
  from_qp_code = sub;
  to_qp_code = sub;
  batch_no = trim($("#batch_" + id).html());
  time = $("#time_" + id).val();
  date_value = $("#practical_entry_freeze_exam_date_" + id).val();
  var str = "&degree=" + degree;
  str +=
    "&degree_name=" +
    encodeURIComponent(trim($("#batch_sub_degree_name").val()));
  str +=
    "&sub_name=" + encodeURIComponent(trim($("#batch_sub_fsubname").val()));
  str += "&batch_no=" + batch_no;
  str += "&time=" + time;
  str += "&date_value=" + date_value;
  str +=
    "&sub_name=" + encodeURIComponent(trim($("#fmacas_sub_fsubname").val()));
  str += "&exam=" + exam;
  str += "&sub=" + sub;
  str +=
    "&fs_sub_name=" +
    encodeURIComponent(trim($("#fmacas_sub_fssubname").val()));
  str += "&from_qp_code=" + from_qp_code;
  str += "&to_qp_code=" + to_qp_code;
  window.open($host_url + "GeneratePracticalMarksReports" + str);
}

function GenerateFromBatchBatchTimeTable() {
  degree = trim($("#fmacas_degree_code").val());
  exam = trim($("#fmacas_sub_Examno").val());
  sub = trim($("#fmacas_sub_final_subcode").val());
  from_batch = trim($("#from_batch").val());
  to_batch = trim($("#to_batch").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;
  }

  var str = "&degree=" + degree;
  str += "&degree_name=" + trim($("#fmacas_degree_code").val());
  //str+="&sub_name="+trim($("#fmacas_sub_fsubname").val());
  str += "&exam=" + exam;
  str += "&sub=" + sub;
  str += "&from_batch=" + from_batch;
  str += "&to_batch=" + to_batch;
  str +=
    "&fs_sub_name=" + encodeURIComponent(trim($("#fmacas_sub_fsubname").val()));
  $("#batch_dialog").dialog("close");
  //alert(str);
  window.open($host_url + "GenerateBatchSetupDetails" + str);
}
function GenerateBatchWorkSheetsFromBatchTimeTable() {
  degree = trim($("#fmacas_degree_code").val());
  exam = trim($("#fmacas_sub_Examno").val());
  sub = trim($("#fmacas_sub_final_subcode").val());
  from_batch = trim($("#from_batch").val());
  to_batch = trim($("#to_batch").val());
  //alert('hi');
  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;
  }

  var str = "&degree=" + degree;
  str += "&degree_name=" + trim($("#fmacas_degree_code").val());
  str +=
    "&fs_sub_name=" + encodeURIComponent(trim($("#fmacas_sub_fsubname").val()));
  str += "&exam=" + exam;
  str += "&sub=" + sub;
  str += "&from_batch=" + from_batch;
  str += "&to_batch=" + to_batch;
  str +=
    "&sub_name=" + encodeURIComponent(trim($("#fmacas_sub_fsubname").val()));

  window.open($host_url + "GenerateBatchWorkSheets" + str);
}
//GenerateBatchDairy

function GenerateBatchpreparation() {
  document.getElementById("module_name_for_save").value = "bacthpreparation";
  GenerateBatchDairy();
}
function GenerateBatchpreparationDairy() {
  degree = trim($("#fmacas_degree_code").val());
  exam = trim($("#fmacas_sub_Examno").val());
  sub = trim($("#fmacas_sub_final_subcode").val());
  from_batch = trim($("#from_batch").val());
  to_batch = trim($("#to_batch").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;
  }

  var str = "&degree=" + degree;
  str += "&degree_name=" + trim($("#fmacas_degree_code").val());
  str +=
    "&sub_name=" + encodeURIComponent(trim($("#fmacas_sub_fsubname").val()));
  str +=
    "&fs_sub_name=" + encodeURIComponent(trim($("#fmacas_sub_fsubname").val()));
  str += "&exam=" + exam;
  str += "&sub=" + sub;
  str += "&from_batch=" + from_batch;
  str += "&to_batch=" + to_batch;
  window.open($host_url + "GenerateBatchDairy" + str);
}

function GeneratePracticalMarksReportsFromFreezeModule() {
  degree = trim($("#fmacas_degree_code").val());
  exam = trim($("#fmacas_sub_Examno").val());
  sub = trim($("#fmacas_sub_final_subcode").val());
  from_qp_code = trim($("#fmacas_sub_final_subcode").val());
  to_qp_code = trim($("#fmacas_sub_final_subcode").val());
  batch_no = "";
  date_value = "";
  time = "";
  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;
  }
  var str = "&degree=" + degree;
  str += "&degree_name=" + trim($("#fmacas_degree_name").val());
  str +=
    "&sub_name=" + encodeURIComponent(trim($("#fmacas_sub_fsubname").val()));
  str +=
    "&fs_sub_name=" +
    encodeURIComponent(trim($("#fmacas_sub_fssubname").val()));
  str += "&batch_no=" + batch_no;
  str += "&date_value=" + date_value;
  str += "&exam=" + exam;
  str += "&time=" + time;
  str += "&sub=" + sub;
  str += "&from_qp_code=" + from_qp_code;
  str += "&to_qp_code=" + to_qp_code;

  window.open($host_url + "GeneratePracticalMarksReports" + str);
}

function validateDate(ldate, id) {
  var pattern = /^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/;

  if (ldate == null || ldate == "" || !pattern.test(ldate)) {
    errMessage = "Invalid date\n";
    alert(errMessage);
    $("#" + id).focus();
    exit(0);
  } else {
    var matchArray = ldate;
    var day = matchArray.substring(0, 2);
    var month = matchArray.substring(3, 5);
    var year = matchArray.substring(6, 10);

    if (month < 1 || month > 12) {
      alert("Month must be between 1 and 12.");
      $("#" + id).focus();
      exit(0);
    }
    if (day < 1 || day > 31) {
      alert("Day must be between 1 and 31.");
      $("#" + id).focus();
      exit(0);
    }
    return;
  }
}

function dmydateformat(e, id) {
  if (e.keyCode != 8) {
    if ($("#" + id).val().length == 2) {
      $("#" + id).val($("#" + id).val() + "/");
    } else if ($("#" + id).val().length == 5) {
      $("#" + id).val($("#" + id).val() + "/");
    }
  }
}