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.147.27.152
Current Path : /var/www/oasis/js/ |
| Current File : /var/www/oasis/js/studnamecorr.js |
function callstudnamecurr() {
$("#page_main_div").load("../html_modules/studnamecorr.html", function () {
document.getElementById("display_module_name").innerHTML =
"Student Name Correction";
document.getElementById("module_name_for_save").value =
"Student Name Correction";
getDefaultHeadFooterLinks("Student Name Correction");
loadstudnamecurr();
});
}
function fetchtab() {
var regno = document.getElementById("regno").value;
console.log(regno);
$.ajax({
type: "GET",
data: "®no=" + regno,
url: $host_url + "fetchtab",
success: function (response) {
var encode = JSON.parse(response);
// console.log(encode);
if (encode.error_code == 0) {
$("#oldname").val(encode.data.fname);
$("#oldname").attr("disabled", "disabled");
$("#degree").val(encode.data.fdegree);
$("#degree").attr("disabled", "disabled");
$("#newname").val(encode.data.fname);
$("#fcollcode").val(encode.data.fcollcode);
} else {
alert(encode.data.msg);
}
},
});
}
function savestudname() {
var file_data = $("#doc").prop("files")[0];
var form_data = new FormData();
form_data.append("file", file_data);
$.ajax({
type: "POST",
url: $host_url + "uploadstuddoc",
dataType: "text",
cache: false,
contentType: false,
processData: false,
data: form_data,
success: function (response) {
var encode = JSON.parse(response);
// console.log(encode.studupload);
// return;
if (encode.err_code == 0) {
$("#doc_upload").val(encode.studupload);
savestuddetails();
} else {
alert(encode.data.msg);
return;
}
},
});
}
function savestuddetails() {
// console.log("hi")
// return;
var regno = document.getElementById("regno").value;
var oldname = document.getElementById("oldname").value;
var degree = document.getElementById("degree").value;
var newname = document.getElementById("newname").value;
var doccument = document.getElementById("doc_upload").value;
var fcollcode = document.getElementById("fcollcode").value;
var doc = document.getElementById("doc").value;
var insert =
"®no=" +
regno +
"&oldname=" +
oldname +
"°ree=" +
degree +
"&newname=" +
newname +
"&doccument=" +
doccument +
"&fcollcode=" +
fcollcode;
// console.log(insert);
// return;
if (regno == "") {
window.alert("please enter Register number");
document.getElementById("regno").focus();
return false;
} else if (oldname == "") {
window.alert("please enter oldname");
document.getElementById("oldname").focus();
return false;
} else if (degree == "") {
window.alert("please enter degree");
document.getElementById("degree").focus();
return false;
} else if (newname == "") {
window.alert("please enter newname");
document.getElementById("newname").focus();
return false;
} else if (doc == "") {
window.alert("please select a file...");
document.getElementById("newname").focus();
return false;
} else {
$.ajax({
type: "POST",
data: insert,
url: $host_url + "savestuddetails",
success: function (response) {
var encode = JSON.parse(response);
if (encode.error_code == 0) {
alert(encode.data.msg);
callstudnamecurr();
} else {
alert(encode.data.msg);
return;
}
},
});
}
}
function loadstudnamecurr() {
$.ajax({
type: "GET",
url: $host_url + "loadstudnamecurr",
success: function (response) {
var encode = JSON.parse(response);
var table = `<table align="center" width="100%" cellspacing="0" cellpadding="1" border="1" style="border-radius:5px">
<tbody>
<tr>
<th align="left" colspan="7" class="ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper"
style="font-size:12px; padding-left:6px; height:24px;">Student Name Correction Details</th>
</tr>
<tr class="ui-state-default ui-jqgrid-hdiv">
<td align="center" style="width:30px; font-size:12px;
border-left:1px solid #C5DBEC;border-right:1px solid #C5DBEC;
border-bottom:1px solid #C5DBEC;">App.<br>No.</td>
<td align="center" style="width:85px; font-size:12px;
border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">Reg. No.</td>
<td align="center" style="width:255px; font-size:12px; padding:5px 5px;
border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">Old Name</td>
<td align="center" style="width:255px; font-size:12px; padding:5px 5px;
border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">New Name</td>
<td align="center" style="width:100px; font-size:12px; padding:5px 5px;
border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">Degree</td>
<td align="center" style="width:200px; font-size:12px; padding:5px 5px;
border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">Status</td>
<td align="center" style="width:70px; font-size:12px;
border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;">Action</td>
</tr>`;
if (encode.error_code == 0) {
for (var i = 0; i < encode.data.length; i++) {
// console.log(encode.data[i].fstatus);
// return;
table += `<tr class="ui-widget-content jqgrow">
<td class="tbl_row_new" style="border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;">${encode.data[i].fapp}</td>
<td class="tbl_row_new" style="text-align:initial;border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;">${encode.data[i].fregno}</td>
<td class="tbl_row_new" style="text-align:initial; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">${encode.data[i].foldname}</td>
<td class="tbl_row_new" style="text-align:initial; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;">${encode.data[i].fnewname}</td>
<td class="tbl_row_new" style="text-align:initial; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;">${encode.data[i].fdegree}</td>
<td class="tbl_row_new" style="text-align:initial; border-right:1px solid #C5DBEC; padding:2px; font-size:15px;text-align:center;">${encode.data[i].fstatus}</td>`;
if (encode.data[i].fstatus == "pending") {
table += `<td><span id="btnedit" onclick="editDetails('${encode.data[i].fregno}')" style="background-color: #008CBA; border: none; color: white; padding: 5px 20px; text-align: center; text-decoration: none; display: inline-block; font-size: 12px; cursor: pointer;"">Edit</span></td>`;
}
table += `</tr>`;
}
table += `</table>`;
$("#tabledata").html(table);
}
},
});
}
function editDetails(regno) {
addcorrectionname();
$.ajax({
type: "GET",
data: "®no=" + regno,
url: $host_url + "editDetails",
success: function (response) {
var encode = JSON.parse(response);
if (encode.error_code == 0) {
$("#oldname").val(encode.data.foldname);
$("#newname").val(encode.data.fnewname);
$("#degree").val(encode.data.fdegree);
$("#regno").val(encode.data.fregno);
$("#oldname").attr("disabled", "disabled");
$("#degree").attr("disabled", "disabled");
$("#regno").attr("disabled", "disabled");
}
},
});
}
function addcorrectionname() {
$("#page_main_div").load(
"../html_modules/addnamecorrection.html",
function () {
document.getElementById("display_module_name").innerHTML =
"Student Name Correction";
document.getElementById("module_name_for_save").value =
"Student Name Correction";
getDefaultHeadFooterLinks("Student Name Correction");
}
);
}
|