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


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

var db = window.location.pathname.split("/")[urlarr.length - 2];
function CallEnableUpdateSectionScreen() {
  $("#page_main_div").load(
    "../html_modules/update_studentSection.html",
    function () {
      const val = `<td align="right" style="width: 20px">Students per section:</td>
      <td>
        <input
          type="text"
          class="ElementCount"
          id="batch_no_std"
          style="width: 50px; text-align: center"
          maxlength="2"
          onkeypress="return acceptNumbersOnlyForModule(event);"
        />
      </td>`;
      // db == "dypatil" ||
      if (db == "dypatil" || db == "demo" || db == "sjbit") {
        $("#std_per_bat").html(val);
      }
      document.getElementById("display_module_name").innerHTML =
        "Update Section";
      document.getElementById("module_name_for_save").value = "Update Section";
      getDefaultHeadFooterLinks("Update Section");
      ClearStudentSection();
    }
  );

  getSectionDegree();
}

function getSectionDegree() {
  let cate = $("#SubCategory").val();

  $.ajax({
    type: "GET",
    url: $host_url + "getMarkDegreeName",
    success: function (response) {
      let res = JSON.parse(response);
      console.log(res.data);
      // return;
      if (res.error_code == 0) {
        var mark_degree = `<option>---Select---</option>`;
        for (var i = 0; i < res.data.length; i++) {
          mark_degree += `<option value='${res.data[i].fdegree}'>${res.data[i].fdegree} - ${res.data[i].fdescpn}</option>`;
        }
        $("#stud_section_degree_code").html(mark_degree);
      } else {
        alert(res.data);
        return;
      }
    },
  });
}

function getSectionExam() {
  let degree = $("#stud_section_degree_code").val();

  $.ajax({
    type: "GET",
    data: "&degree=" + degree,
    url: $host_url + "getMarkExamName",

    success: function (response) {
      let res = JSON.parse(response);
      // console.log(res);
      // return;
      if (res.error_code == 0) {
        var mark_sem = `<option>---select---</option>`;
        for (var i = 0; i < res.data.length; i++) {
          mark_sem += `<option value='${res.data[i].fexamno}'>${res.data[i].fexamno} - ${res.data[i].fexamname}</option>`;
        }
        $("#stud_section_Examno").html(mark_sem);
      } else {
        alert(res.data.msg);
        return;
      }
    },
  });
}

function ClearStudentSection() {
  $("#stud_section_degree_code").val("");
  $("#stud_section_degree_name").val("");
  $("#stud_section_Examno").val("");
  $("#stud_section_Examno_name").val("");
  $("#update_stud_section").html("");
}

function studentUpdateSectionList() {
  var degree = $("#stud_section_degree_code").val();
  var exam_no = $("#stud_section_Examno").val();
  var batchNo = $("#batch_no_std").val();
  if (empty(degree)) {
    alert("Degree cannot be empty");
    $("#stud_section_degree_code").focus();
    return;
  }
  if (empty(exam_no)) {
    alert("Exam cannot be empty");
    $("#stud_section_Examno").focus();
    return;
  }
  $.blockUI({
    message:
      "<h1 class='h1' style='font-size:12px'><img src='images/ajax-loader.gif' border='0'></h1>",
  });
  $.ajax({
    type: "POST",
    data: "degree=" + degree + "&examno=" + exam_no + "&batchNo=" + batchNo,
    url: $host_url + "PopulateStudentUpdateSection",
    success: PopulateStudentUpdateSectionResponce,
  });
}

function PopulateStudentUpdateSectionResponce($responce) {
  $responce = eval("(" + $responce + ")");
  $.unblockUI();
  if ($responce.error_code == -1) {
    alert($responce.data);
  } else {
    $("#update_stud_section").show();
    $("#update_stud_section").html($responce.data["html"]);
  }
}

function SaveStudentSection() {
  var att_data = new Object();

  html_objects = $("input[id*='regno_']");
  jQuery.each(html_objects, function (k, v) {
    var internal_code = v["id"].split("_")[1];
    att_data[internal_code] = new Object();
    att_data[internal_code]["c"] = $("#section_" + internal_code).val();
  });

  var myJSONText = encodeURIComponent(JSON.stringify(att_data));
  $list_data = "output_details=" + myJSONText;
  $.ajax({
    type: "POST",
    async: false,
    url: $host_url + "SaveStudentSectionDetails",
    data: $list_data,
    success: SaveStudentSectionDetailsResponce,
  });
} // END SAVE

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

  if ($responce.error_code == 0) {
    alert($responce.data);
    $("#markentry_sub_degree_code").focus;
  } else {
    alert($responce.data);
  }
  $("#update_stud_section").html("");
}

// function CallEnableUpdateSectionScreen()
// {
// 	$("#page_main_div").load('../html_modules/update_studentSection.html',function()
// 	{

// 	document.getElementById('display_module_name').innerHTML = 'Update Section';
// 	document.getElementById('module_name_for_save').value = 'Update Section';
// 	getDefaultHeadFooterLinks("Update Section");
// 	ClearStudentSection();
// 	}
// 	);

// }

// function ClearStudentSection()
// {
// 	$("#stud_section_degree_code").val('');
// 	$("#stud_section_degree_name").val('');
// 	$("#stud_section_Examno").val('');
// 	$("#stud_section_Examno_name").val('');
// 	$("#update_stud_section").html('');

// }

// function studentUpdateSectionList()
// {
// 	var degree=$("#stud_section_degree_code").val();
// 	var exam_no=$("#stud_section_Examno").val();
// 	if(empty(degree))
// 	{
// 	alert("Degree cannot be empty");
// 	$("#stud_section_degree_code").focus();
// 	return;
// 	}
// 	if(empty(exam_no))
// 	{
// 	alert("Exam cannot be empty");
// 	$("#stud_section_Examno").focus();
// 	return;
// 	}
// 	$.blockUI({ message: "<h1 class='h1' style='font-size:12px'><img src='images/ajax-loader.gif' border='0'></h1>" });
// 		 $.ajax({
// 		type: "POST",
// 		data:"degree="+degree+"&examno="+exam_no,
// 		url: $host_url+"PopulateStudentUpdateSection",
// 		success: PopulateStudentUpdateSectionResponce
// 		});

// }

// function PopulateStudentUpdateSectionResponce($responce)
// {
// 	$responce = eval('('+$responce+')');
// 	$.unblockUI();
// 	if($responce.error_code==-1)
// 	{
// 		alert($responce.data);
// 	}
// 	else
// 	{
// 	$("#update_stud_section").show();
// 	$("#update_stud_section").html($responce.data['html']);
// 	}

// }

// function SaveStudentSection()
// {

// 	var att_data = new Object();

// 			html_objects =$("input[id*='regno_']");
// 			jQuery.each(html_objects, function(k, v) {
// 			var internal_code=v['id'].split("_")[1];
// 			att_data[internal_code]=new Object();
// 			att_data[internal_code]['c']=$("#section_"+internal_code).val();

// 	  	});

// 	var myJSONText = encodeURIComponent(JSON.stringify(att_data));
// 	$list_data="output_details="+myJSONText;
// 	$.ajax({
// 				type: "POST",
// 				async:false,
// 				url: $host_url+"SaveStudentSectionDetails",
// 				data:$list_data,
// 				success: SaveStudentSectionDetailsResponce
// 			});
// } // END SAVE

// function SaveStudentSectionDetailsResponce($responce)
// {
// 	$responce = eval('(' + $responce + ')');

// 	if($responce.error_code==0)
// 	{
// 		alert($responce.data);
// 		$('#markentry_sub_degree_code').focus;

// 	}
// 	else
// 	{
// 		alert($responce.data);

// 	}
// 	$("#update_stud_section").html('');
//  }