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.118.164.100
Current Path : /var/www/oasis/js/ |
| Current File : /var/www/oasis/js/savesemster.js |
function callsavesemster() {
$('#page_main_div').load(
'../html_modules/savesemster.html?v=1001',
function () {
document.getElementById('display_module_name').innerHTML =
'Update Student Semester'
document.getElementById('module_name_for_save').value =
'Update Student Semester'
getDefaultHeadFooterLinks('Update Student Semester')
loadDegreeGroups()
}
)
}
function loadDegreeGroups() {
$.ajax({
type: 'GET',
url: $host_url + 'loadciedeggrp',
success: function (response) {
let res = JSON.parse(response)
console.log(res, 'degeregrp')
if (res.error_code === 0) {
var opt = `<option value=''>--Select--</option>`
for (var i = 0; i < res.data.length; i++) {
opt += `<option value='${res.data[i].fdeggrp}'>${
res.data[i].fdeggrp + ' - ' + res.data[i].fdescpn
}</option>`
}
$('#deggrp').html(opt)
} else {
alert(res.data.msg)
return
}
},
})
}
function getExamdateExamName() {
var deggrp = document.getElementById('deggrp').value
$.ajax({
type: 'GET',
url: $host_url + 'loadciedegree',
data: 'deggrp=' + deggrp,
success: function (response) {
let res = JSON.parse(response)
console.log(res, 'degeregrp')
if (res.error_code === 0) {
var opt = `<option value='all'>All</option>`
for (var i = 0; i < res.data.length; i++) {
opt += `<option value='${res.data[i].FDEGREE}'>${
res.data[i].FDEGREE + ' - ' + res.data[i].FDESCPN
}</option>`
}
$('#degree').html(opt);
semesterHandler();
} else {
var opt = `<option value='all'>All</option>`;
$('#degree').html(opt);
return
}
},
})
}
function semesterHandler() {
var degree = document.getElementById('degree').value
$.ajax({
type: 'GET',
url: $host_url + 'updatestudentsem',
data: 'degree=' + degree,
success: function (response) {
let res = JSON.parse(response)
if (res.error_code === 0) {
var opt = `<option value=''>--Select--</option>`
for (var i = 0; i < res.data.data.length; i++) {
opt += `<option value='${res.data.data[i].fexamno}'>${
res.data.data[i].fexamno +
' - ' +
res.data.data[i].fexamname
}</option>`
}
$('#semester').html(opt)
} else {
}
},
})
}
function savestudentsemester() {
var deggrp = document.getElementById('deggrp').value;
var degree = document.getElementById('degree').value;
var regfrom = document.getElementById('reg_no_from').value;
var regto = document.getElementById('reg_no_to').value;
var semester = document.getElementById('semester').value;
var module = document.getElementById('module').value;
var year = document.getElementById('year').value;
var examtype = document.getElementById('examtype').value;
if (deggrp == '') {
alert('Select Degree Group')
document.getElementById('deggrp').focus()
return
}
if (degree == '') {
alert('Select Degree')
document.getElementById('degree').focus()
return
}
if (regfrom == '') {
alert('Give Reg.NO Range')
document.getElementById('reg_no_from').focus()
return
}
if (regto == '') {
alert('Give Reg.NO Range')
document.getElementById('reg_no_to').focus()
return
}
if (semester == '') {
alert('Select Semester')
document.getElementById('semester').focus()
return
}
if (module == '') {
alert('Select Module')
document.getElementById('module').focus()
return
}
if (year == '') {
alert('Select Year')
document.getElementById('year').focus()
return
}
if (examtype == '') {
alert('Select Exam Type')
document.getElementById('examtype').focus()
return
}
$.ajax({
type: 'POST',
url: $host_url + 'saveupdatesemester',
data:
'degree=' +
degree +
'®_no_from=' +
regfrom +
'®_no_to=' +
regto +
'&semester=' +
semester+"&module="+module+"&year="+year+"&examtype="+examtype,
success: function (res) {
console.log(res)
alert('Semester Updated Successfully')
return
},
})
}
function clearstudentupdatesemester() {
callsavesemster()
}
|