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


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

var $g_ref_data_arr = "";

$host_url = getCookie("host_url");
$image_path = getCookie("image_path");

function POpupExamnohtml($degree_code, $exam_no) {
  $("#dialog").dialog("open");
  $(".ui-dialog").data("height.dialog", 175);
  $(".ui-dialog").css({ width: 450 });
  $("#dialog").css({ height: 176 });
  $("#ui-dialog-title-dialog").html("Examno Details");

  document.getElementById("dialog").style.display = "";
  $main =
    "<table id='exam_grid' class='scroll' ondblclick='selectMarkEntrySubExamCode();'></table> <div  id='sub_grid_div3' class='scroll' style='text-align:center;'></div>";
  document.getElementById("dialog").innerHTML = $main;

  var exam = jQuery("#exam_grid")
    .jqGrid({
      url:
        $host_url +
        "ExamnoDetailsPopup.demo&DegCode=" +
        $degree_code +
        "&Examno=" +
        $exam_no +
        "'",
      //url:+$host_url+'ExamnoDetailsPopup.demo&DegCode='+trim($degcode)+'&searchField='+trim($Examno)+,
      datatype: "json",
      colNames: ["ExamNo", "Exam Name"],
      colModel: [
        { name: "fexamno", index: "fexamno", width: 75 },
        { name: "fexamname", index: "fexamname", width: 115 }
      ],
      rowNum: 10,
      rowList: [5, 10, 15, 20, 25, 30],
      pager: jQuery("#sub_grid_div3"),
      sortname: "id",
      imgpath: $image_path,
      height: "100",
      width: "445",
      viewrecords: true,
      sortorder: "asc",
      multiselect: false,
      cellEdit: true,
      addCaption: "Add Record"
    })
    .navGrid(
      "#sub_grid_div3",
      { edit: false, add: false, del: false, search: false },
      {},
      {},
      {},
      { multipleSearch: true }
    )
    .navButtonAdd("#sub_grid_div3", {
      caption: "",
      buttonicon: "ui-icon-search",
      onClickButton: function() {
        exam[0].toggleToolbar();
      }
    })
    .navButtonAdd("#sub_grid_div3", {
      caption: "Select",
      onClickButton: function() {
        selectMarkEntrySubExamCode();
      }
    });
  exam.filterToolbar();
  $("#gs_fexamno").focus();
  $(".ui-search-toolbar").bind("keydown", function(evt) {
    var kC = evt.which ? evt.which : evt.keyCode;
    if (kC == 40) jQuery("#exam_grid").editCell(0, 0, false);
    /* 	if(kC==39) 
			 $('#'+evt.target.id).focusNextInputField();
			 if(kC==37) 
			 $('#'+evt.target.id).focusPreviousInputField();	 */
  });
}

function selectMarkEntrySubExamCode() {
  var id = jQuery("#exam_grid").getGridParam("selrow");
  if (id != null) {
    $.ajax({
      type: "POST",
      async: false,
      data: "ExamNo=" + id + "&degree=" + window.location.g_popup_degree_code,
      url: $host_url + "getExamNo.demo",
      success: PopulateExamNoResponse
    });
    $("#dialog").dialog("close");
  } else {
    alert("Please select row");
  }
  return;
}

function getmonths(degree, examno, module) {
  $.ajax({
    type: "POST",
    async: false,
    data: "degree=" + degree + "&examno=" + examno,
    url: $host_url + "getmonthrange",
    success: function($responce) {
      $responce = eval("(" + $responce + ")");
      var frommonth = $responce.data["fattfrommth"];
      var tomonth = $responce.data["fatttomth"];
      var months = [
        "JAN",
        "FEB",
        "MAR",
        "APR",
        "MAY",
        "JUN",
        "JUL",
        "AUG",
        "SEP",
        "OCT",
        "NOV",
        "DEC"
      ];
      var a = months.indexOf(frommonth);
      var b = months.indexOf(tomonth);
      var options = "";
      var result = [];
      if (a < b) {
        result = months.slice(a, b + 1);
      } else {
        var result1 = months.slice(0, b + 1);
        var result2 = months.slice(a, 12);
        result = result2.concat(result1);
      }
      for (let month of result) {
        options += '<option value="' + month + '">' + month + "</option>";
      }
      if (module == "saveAttendanceSummary") {
        $("#from_month_name").empty();
        $("#from_month_name").append(options);
        $("#to_month_name").empty();
        $("#to_month_name").append(options);
      }
      if (module == "SaveAttendanceEntry") {
        $("#month_name").empty();
        $("#month_name").append(options);
      }
    }
  });
}

function PopulateExamNoResponse($responce) {
  $responce = eval("(" + $responce + ")");

  if ($responce.error_code == 0) {
    //alert(document.getElementById('module_name_for_save').value);
    switch (document.getElementById("module_name_for_save").value) {
      case "SaveMarkEntrySubjectwise":
        document.getElementById("markentry_sub_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("markentry_sub_Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("markentry_sub_final_subcode").focus();
        document.getElementById("markentry_sub_Examno").focus();
        getSection();
        break;
      case "SaveMarkEntryStudentwise":
        document.getElementById("markentry_stu_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("markentry_stu_Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("markentry_stu_Examno").focus();
        getSection();
        break;

      case "Practical marks misc":
        document.getElementById("Examno").value = $responce.data["fexamno"];
        document.getElementById("Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("Examno").focus();
        break;
      case "Subjectwise Invigilators Dairy":
        document.getElementById("examno").value = $responce.data["fexamno"];
        document.getElementById("exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("examno").focus();
        break;
      case "attendancefreezeing":
        document.getElementById("fmacas_sub_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("fmacas_sub_Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("fmacas_sub_Examno").focus();
        break;
      case "SaveAbsentEntrySubjectwise":
        document.getElementById("abs_sub_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("abs_sub_Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("abs_sub_Examno").focus();
        break;

      case "freezeModuleAtAdminCollegeSubject":
        document.getElementById("fmacas_sub_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("fmacas_sub_Exam_name").value =
          $responce.data["fexamname"];
        break;

      case "SavePracticalEntryFreezing":
        document.getElementById("fmacas_sub_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("fmacas_sub_Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("fmacas_sub_Examno").focus();
        break;
      case "saveSubjectListGeneral":
        document.getElementById("report_sublist_general_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("report_sublist_general_Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("report_sublist_general_Examno").focus();
        break;
      case "saveMarklistSubjectWise":
        document.getElementById("report_marklist_subject_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("report_marklist_subject_Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("report_marklist_subject_Examno").focus();
        break;
      case "saveMarklistStudentWise":
        document.getElementById("report_marklist_student_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("report_marklist_student_Examno_name").value =
          $responce.data["fexamname"];
        document.getElementById("report_marklist_student_Examno").focus();
        break;
      case "saveDatewar":
        document.getElementById("report_marklist_subject_wise_Examno").value =
          $responce.data["fexamno"];
        document.getElementById(
          "report_marklist_subject_wise_Exam_name"
        ).value = $responce.data["fexamname"];
        document.getElementById("report_marklist_subject_wise_Examno").focus();
        break;

      case "saveDispatchAnswersScript":
        if ($g_dispatch_popup == 2) {
          $Textbox = document.getElementsByName("dispatch_ans_degree");
          $NumTextBox = $Textbox.length;
          $("#dispatch_exam_" + $NumTextBox).val($responce.data.fexamno);
          document.getElementById("dispatch_exam_" + $NumTextBox).focus();
        } else {
          $("#dispatch_exam_1").val($responce.data.fexamno);
          document.getElementById("dispatch_exam_1").focus();
        }
        break;
      case "saveDailyReport":
        $id = window.location.g_daliy_id;
        document.getElementById($id).value = $responce.data["fexamno"];

        break;
      case "ReportAdmissionList":
        document.getElementById("report_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("report_Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("report_Examno").focus();
        break;
      case "SaveBatchSetup":
        document.getElementById("batch_sub_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("batch_sub_Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("batch_sub_Examno").focus();
        break;
      case "Batch Close":
        document.getElementById("batch_sub_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("batch_sub_Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("batch_sub_Examno").focus();
        break;
      case "IdentifySubjFreshEx":
        document.getElementById("fresh_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("fresh_Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("fresh_Examno").focus();
        break;
      case "Subject Wise Block":
        document.getElementById("markentry_sub_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("markentry_sub_Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("markentry_sub_Examno").focus();
        var degree_code = document.getElementById("markentry_sub_degree_code")
          .value;
        getmonths(degree_code, $responce.data["fexamno"], "Subject Wise Block");
        break;
      case "SaveAttendanceEntry":
        document.getElementById("markentry_sub_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("markentry_sub_Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("markentry_sub_Examno").focus();
        var degree_code = document.getElementById("markentry_sub_degree_code")
          .value;
        getmonths(
          degree_code,
          $responce.data["fexamno"],
          "SaveAttendanceEntry"
        );
        break;

      case "saveAttendanceSummary":
        document.getElementById("report_marklist_subject_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("report_marklist_subject_Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("report_marklist_subject_Examno").focus();
        var degree_code = document.getElementById(
          "report_marklist_subject_degree_code"
        ).value;
        getmonths(
          degree_code,
          $responce.data["fexamno"],
          "saveAttendanceSummary"
        );
        break;
      case "Update Section":
        document.getElementById("stud_section_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("stud_section_Examno_name").value =
          $responce.data["fexamname"];
        document.getElementById("stud_section_Examno").focus();
        break;
      case "Section List":
        document.getElementById("stud_section_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("stud_section_Examno_name").value =
          $responce.data["fexamname"];
        document.getElementById("stud_section_Examno").focus();
        break;

      case "ECHblk":
        document.getElementById("ech_sub_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("ech_sub_Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("ech_sub_Examno").focus();
        break;

      case "Marks List (Elements)":
        document.getElementById("report_marklist_subject_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("report_marklist_subject_Exam_name").value =
          $responce.data["fexamname"];
        document.getElementById("report_marklist_subject_Examno").focus();
        break;
      case "batch preparation Dairy":
        document.getElementById("report_batch_prepation_examno_code").value =
          $responce.data["fexamno"];
        document.getElementById("report_batch_prepation_examno_name").value =
          $responce.data["fexamname"];
        document.getElementById("report_batch_prepation_examno_code").focus();
        break;
      case "I.A Marks Pending":
        document.getElementById("report_marklist_student_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("report_marklist_student_Examno_name").value =
          $responce.data["fexamname"];
        document.getElementById("report_marklist_student_Examno").focus();
        break;
      case "Practical Daily Report":
        document.getElementById("report_topsheet_Examno").value =
          $responce.data["fexamno"];
        document.getElementById("report_topsheet_Examno_name").value =
          $responce.data["fexamname"];
        document.getElementById("report_topsheet_Examno").focus();
        break;
      case "addmistion degree":
        document.getElementById("Examno").value = $responce.data["fexamno"];
        document.getElementById("Exam_name").value =
          $responce.data["fexamname"];
        //document.getElementById('report_topsheet_Examno').focus();
        break;

      case "iaemptyformat":
        document.getElementById("ia_empty_examno").value =
          $responce.data["fexamno"];
        document.getElementById("ia_empty_examno_name").value =
          $responce.data["fexamname"];
        //document.getElementById('report_topsheet_Examno').focus();
        break;
    }
  } else {
    alert("failed");
  }
}