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.144.255.247
Current Path : /var/www/oasis/js/ |
| Current File : /var/www/oasis/js/subblock.js |
function callSubBlock() {
$("#page_main_div").load(
"../html_modules/subblock.html?v=31072017",
function () {
document.getElementById("display_module_name").innerHTML =
"Subject Wise Block";
document.getElementById("module_name_for_save").value =
"Subject Wise Block";
getDefaultHeadFooterLinks("Subject Wise Block");
$("#main_mark_entry_div").hide();
$("#markentry_sub_degree_code").focus();
}
);
$("#module_details_div").hide();
}
function saveSubBlock() {
$list_data = "Fdegree=" + $("#markentry_sub_degree_code").val();
$list_data += "&FExamno=" + $("#markentry_sub_Examno").val();
$list_data += "&Fsubcode=" + $("#markentry_sub_final_subcode").val();
var att_data = new Object();
var validstatus = false;
html_objects = $("input[id*='short_']");
jQuery.each(html_objects, function (k, v) {
var internal_code = v["id"].split("_")[1];
if ($("#hregno_" + internal_code).val() == "T") {
att_data[internal_code] = new Object();
var short = "F";
if (document.getElementById("short_" + internal_code).checked == true) {
short = "T";
}
att_data[internal_code]["short"] = short;
att_data[internal_code]["resmarks"] = $(
"#remarks_" + internal_code
).val();
att_data[internal_code]["reg"] = $("#reg_" + internal_code).val();
}
});
if (!validstatus) {
var myJSONText = encodeURIComponent(JSON.stringify(att_data));
$list_data += "&output_details=" + myJSONText;
$.ajax({
type: "POST",
async: false,
url: $host_url + "saveSubBlock",
data: $list_data,
success: saveSubBlockResponce,
});
}
} // END SAVE
function saveSubBlockResponce($responce) {
$responce = eval("(" + $responce + ")");
if ($responce.error_code == 0) {
alert($responce.data);
$("#markentry_sub_degree_code").focus;
} else {
alert($responce.data);
}
}
function GetRegisterNumbers() {
//alert('calling');
$("#mes_default_reg_div").hide();
if ($("#markentry_sub_degree_code").val() == "") {
alert("Enter Degree Name");
$("#markentry_sub_degree_code").focus();
return;
}
if ($("#markentry_sub_final_subcode").val() == "") {
alert("Enter Subject Code");
$("#markentry_sub_final_subcode").focus();
return;
}
if ($("#markentry_sub_Examno").val() == "") {
alert("Enter Examno");
$("#markentry_sub_Examno").focus();
return;
}
$list_data = "Degcode=" + $("#markentry_sub_degree_code").val();
$list_data += "&Subcode=" + $("#markentry_sub_final_subcode").val();
$list_data += "&Examno=" + $("#markentry_sub_Examno").val();
$type = $("#is_add_edit").val();
$.blockUI({
message:
"<h1 class='h1' style='font-size:12px'><img src='images/ajax-loader.gif' border='0'></h1>",
});
$.ajax({
type: "POST",
//async:false,
url: $host_url + "GetRegisterNumbers",
data: $list_data,
success: GetRegisterNumbersResponse,
});
}
function GetRegisterNumbersResponse($responce) {
$responce = eval("(" + $responce + ")");
if ($responce.error_code == 0) {
$.unblockUI();
$("#main_mark_entry_div").hide();
$("#mes_default_reg_div").show();
document.getElementById("markentry_sub_degree_code").disabled = true;
document.getElementById("markentry_sub_final_subcode").disabled = true;
document.getElementById("markentry_sub_Examno").disabled = true;
$("#mes_default_reg_div").html($responce.data.filenme);
}
}
function AssignAttendanceNextTdConductedVal(f_int_code) {
var current_val = $("#conducted_" + f_int_code).val();
var next_input_id = $("#conducted_" + f_int_code)
.parent()
.parent()
.next("tr")
.find("input[id*='conducted_']")[0]["id"];
var next_input_id_val = $("#" + next_input_id).val();
if (empty(next_input_id_val) || next_input_id_val == "0") {
$("#" + next_input_id).val(current_val);
}
}
function subCategoryDropDown() {
$.ajax({
type: "POST",
data: "type=" + "ME",
url: $host_url + "GetSubSubjectCategory.demo",
success: subCategoryDropDownresp,
});
}
function subCategoryDropDownresp($responce) {
$responce = eval("(" + $responce + ")");
document.getElementById("SubCategory").options.length = 0;
for ($i = 0; $i < $responce.data.length; $i++) {
$op = new Option($responce.data[$i]["Name"], $responce.data[$i]["Code"]);
$op.id = $responce.data[$i]["Name"]; //specifying the id for options
document.getElementById("SubCategory").options.add($op);
}
}
function validateAttendedVal(rowid) {
var condval = document.getElementById("conducted_" + rowid).value;
var attendval = document.getElementById("attended_" + rowid).value;
if (parseInt(condval) < parseInt(attendval)) {
alert("Classes Attended cannot be greater than Classes Conducted");
document.getElementById("attended_" + rowid).value = 0;
$("#attended_" + rowid).focus();
return false;
} else AssignAttendanceNextTdConductedVal(rowid);
}
function getcheckboxupd($id) {
document.getElementById("hregno_" + $id).value = "T";
}
|