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.26.8
Current Path : /var/www/oasis/js/ |
| Current File : /var/www/oasis/js/practicalMarks.js |
function callEnablePracticalMarksSetup() {
$("#page_main_div").load("../html_modules/practicalMarks.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("BCA1");
$("#batch_sub_degree_name").val(
"Bachelor of Computer Application (2018 Batch Only)"
);
$("#batch_sub_Examno").val("E");
$("#batch_sub_Exam_name").val("V Semseter");
$("#batch_sub_final_subcode").val("EP220");
$("#batch_sub_fsubname").val("Assembly Language Programming Lab");
$("#batch_sub_maxmark").val("35");
$("#batch_no").val("01");
}
loadDegreeMP();
});
}
function loadDegreeMP() {
$.ajax({
type: "GET",
url: $host_url + "getBatchWisePRDegree",
success: function (res) {
var response = JSON.parse(res);
if (response.error_code == 0) {
var degree = "";
degree += `<option>---select---</option>`;
for (var i = 0; i < response.data.length; i++) {
degree += `<option value="${response.data[i].fdegree}">${response.data[i].fdegree} - ${response.data[i].fdescpn}</option>`;
}
$("#batch_sub_degree_code").html(degree);
} else {
alert(response.data.data);
return;
}
},
});
}
function getBatchWiseSemesterDetailsMP() {
let degree = $("#batch_sub_degree_code").val();
if (degree == "---select---" || degree == "" || degree == null) {
alert("Please Select Degree");
return;
}
$.ajax({
type: "GET",
url: $host_url + "getBatchWisePRSemister",
data: "degree=" + degree,
success: function (res) {
let response = JSON.parse(res);
if (response.error_code == 0) {
var sem = "";
sem += `<option>---select---</option>`;
for (var i in response.data) {
sem += `<option value="${response.data[i].fexamno}">${response.data[i].fexamno} - ${response.data[i].fexamname}</option>`;
i++;
}
$("#batch_sub_Examno").html(sem);
} else {
alert(response.data.data);
return;
}
},
});
}
function getBatchWiseSubjectDetailsMP() {
let degree = $("#batch_sub_degree_code").val();
let sem = $("#batch_sub_Examno").val();
if (degree == "" || degree == null || degree == "---select---") {
alert("Please Select Degree");
return;
}
if (sem == "" || sem == null || sem == "---select---") {
alert("Please Select Semester");
return;
}
$.ajax({
type: "GET",
url: $host_url + "getBatchWisePRSubject",
data: "degree=" + degree + "&examno=" + sem,
success: function (res) {
let response = JSON.parse(res);
console.log(response);
if (response.error_code == 0) {
var subject = `<option>---select---</option>`;
var i = 0;
while (i < response.data.length) {
subject += `<option value=${response.data[i].fcsubcode}>${response.data[i].fsubname}</option>`;
i++;
}
$("#batch_sub_final_subcode").html(subject);
} else {
alert(response.data);
return;
}
},
});
}
function GetVivaSubjectDetails() {
let degree = $("#batch_sub_degree_code").val();
let sem = $("#batch_sub_Examno").val();
let subject = $("#batch_sub_final_subcode").val();
if (degree == "" || degree == null || degree == "---select---") {
alert("Please Select Degree");
return;
}
if (sem == "" || sem == null || sem == "---select---") {
alert("Please Select Semester");
return;
}
if (subject == "" || subject == null || subject == "---select---") {
alert("Please Select Subject");
return;
}
$.ajax({
type: "GET",
url: $host_url + "GetVivaSubjectPR",
data: "degcode=" + degree + "&subcode=" + subject + "&exam_no=" + sem,
success: function (res) {
let response = JSON.parse(res);
console.log(response);
if (response.error_code == 0) {
$("#batch_sub_maxmark").val(response.data.fvalmax);
$("#batch_viva_subject_code").val(response.data.viva.FVVCODE);
$("#batch_viva_subject_name").val(response.data.viva.FSUBNAME);
$("#batch_viva_subject_max_marks").val(response.data.viva.fsmaxmarks);
}
if (response.data.viva.length == "0") {
$("#batch_viva_subject_code").val("");
$("#batch_viva_subject_name").val("");
$("#batch_viva_subject_max_marks").val("0");
}
},
});
}
function GetPracticalMarksRegNos() {
$("#mes_default_reg_div").hide();
if ($("#batch_sub_degree_code").val() == "---select---") {
alert("Please Select Degree ");
$("#batch_sub_degree_code").focus();
return;
}
if ($("#batch_sub_final_subcode").val() == "---select---") {
alert("Please Select Subject");
$("#batch_sub_final_subcode").focus();
return;
}
if ($("#batch_sub_Examno").val() == "---select---") {
alert("Please Select 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("");
console.log("Enter Data");
if ($responce.error_code == 0) {
$("#btc_default_reg_div").load($responce.data.filenme);
} else {
alert($responce.data);
}
}
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());
console.log(sub, trim($("#batch_sub_fssubname").val()), "anita");
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 = "°ree=" + degree;
str += "°ree_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 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 (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);
}
|