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.104.118
Current Path : /var/www/oasis/js_old/ |
| Current File : /var/www/oasis/js_old/teachOficerEntry.js |
function callTeachOficerEntry() {
$("#page_main_div").load("../html_modules/teachOficerEntry.html", function() {
document.getElementById("display_module_name").innerHTML =
"Identify Technical Officer";
document.getElementById("module_name_for_save").value =
"Identify Technical Officer";
getDefaultHeadFooterLinks("Identify Technical Officer");
document.getElementById("screen").value = "add";
$.ajax({
type: "POST",
url: $host_url + "getdeggrp",
success: function(responce) {
var responce = eval("(" + responce + ")");
if (responce.error_code == 0) {
var deggrp = responce.data;
var options;
options += `<option value="">--Select--</option>`;
for (var i = 0; i < deggrp.length; i++) {
options += `<option value="${deggrp[i].fdeggrp}">${deggrp[i].fdescpn}</options>`;
}
$("#deggrp").html(options);
}
}
});
});
}
var tablecnt = 0;
function ViewDeatilsto() {
document.getElementById("screen").value = "edit";
$.ajax({
type: "POST",
url: $host_url + "ViewDeatilsto",
success: function(responce) {
var responce = eval("(" + responce + ")");
if (responce.error_code == 0) {
tablecnt = responce.data.rowcnt;
$("#todeatils").html(responce.data.table);
}
}
});
}
function saveto() {
var name = $("#name").val();
var mob = $("#mob").val();
var deggrp = $("#deggrp").val();
var type = $("#screen").val();
if (type == "add") {
if (name == "") {
alert("Please Enter Technical Officer Name");
document.getElementById("name").focus();
return;
}
if (mob == "") {
alert("Please Enter Technical Officer Mobile No.");
document.getElementById("mob").focus();
return;
}
if (deggrp == "") {
alert("Please Select Degree Group");
document.getElementById("deggrp").focus();
return;
}
$.blockUI({
message:
"<h1 class='h1' style='font-size:12px'><img src='images/ajax-loader.gif' border='0'></h1>"
});
$.ajax({
type: "POST",
async: false,
data:
"&name=" + name + "&mob=" + mob + "°grp=" + deggrp + "&type=" + type,
url: $host_url + "saveto",
success: function(responce) {
$.unblockUI();
var responce = eval("(" + responce + ")");
alert(responce.data);
return;
}
});
} else if (type == "edit") {
var tosum = [];
for (var i = 1; i < tablecnt; i++) {
var obj = {};
obj.fmob = $(`#${i}_mob`).val();
obj.fstatus = $(`#${i}_status`).val();
obj.fremarks = $(`#${i}_remarks`).val();
tosum.push(obj);
}
$.ajax({
type: "POST",
async: false,
data: "&type=" + type + "&tosum=" + JSON.stringify(tosum),
url: $host_url + "saveto",
success: function(responce) {
$.unblockUI();
var responce = eval("(" + responce + ")");
alert(responce.data);
callTeachOficerEntry();
return;
}
});
}
}
|