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.146.37.217
Current Path : /var/www/html/oums/js/ |
| Current File : /var/www/html/oums/js/pg_app_edit.js |
function load_page() {
load_page_data(
window.location.href.substr(window.location.href.lastIndexOf("/") + 1)
);
clrs_data();
}
function clrs_data() {
document.getElementById("txtapplnumb").value = "";
document.getElementById("txtapplname").value = "";
document.getElementById("txtapplmobl").value = "";
document.getElementById("txtapplmail").value = "";
document.getElementById("txtmaximark").value = "";
document.getElementById("txtsecrmark").value = "";
document.getElementById("txttotlperc").value = "";
document.getElementById("txtsubjcode1").value = "";
document.getElementById("txtsubjname1").value = "";
document.getElementById("txtmaxmark11").value = "";
document.getElementById("txtsecmark11").value = "";
document.getElementById("txtmaxmark21").value = "";
document.getElementById("txtsecmark21").value = "";
document.getElementById("txtmaxmark31").value = "";
document.getElementById("txtsecmark31").value = "";
document.getElementById("txtmaxmark41").value = "";
document.getElementById("txtsecmark41").value = "";
document.getElementById("txtmaxmark51").value = "";
document.getElementById("txtsecmark51").value = "";
document.getElementById("txtmaxmark61").value = "";
document.getElementById("txtsecmark61").value = "";
document.getElementById("txtmaxtotal1").value = "";
document.getElementById("txtsectotal1").value = "";
document.getElementById("txtsubjperc1").value = "";
document.getElementById("txtsubjcode2").value = "";
document.getElementById("txtsubjname2").value = "";
document.getElementById("txtmaxmark12").value = "";
document.getElementById("txtsecmark12").value = "";
document.getElementById("txtmaxmark22").value = "";
document.getElementById("txtsecmark22").value = "";
document.getElementById("txtmaxmark32").value = "";
document.getElementById("txtsecmark32").value = "";
document.getElementById("txtmaxmark42").value = "";
document.getElementById("txtsecmark42").value = "";
document.getElementById("txtmaxmark52").value = "";
document.getElementById("txtsecmark52").value = "";
document.getElementById("txtmaxmark62").value = "";
document.getElementById("txtsecmark62").value = "";
document.getElementById("txtmaxtotal2").value = "";
document.getElementById("txtsectotal2").value = "";
document.getElementById("txtsubjperc2").value = "";
document.getElementById("txtsubjcode3").value = "";
document.getElementById("txtsubjname3").value = "";
document.getElementById("txtmaxmark13").value = "";
document.getElementById("txtsecmark13").value = "";
document.getElementById("txtmaxmark23").value = "";
document.getElementById("txtsecmark23").value = "";
document.getElementById("txtmaxmark33").value = "";
document.getElementById("txtsecmark33").value = "";
document.getElementById("txtmaxmark43").value = "";
document.getElementById("txtsecmark43").value = "";
document.getElementById("txtmaxmark53").value = "";
document.getElementById("txtsecmark53").value = "";
document.getElementById("txtmaxmark63").value = "";
document.getElementById("txtsecmark63").value = "";
document.getElementById("txtmaxtotal3").value = "";
document.getElementById("txtsectotal3").value = "";
document.getElementById("txtsubjperc3").value = "";
document.getElementById("txtsubjcode4").value = "";
document.getElementById("txtsubjname4").value = "";
document.getElementById("txtmaxmark14").value = "";
document.getElementById("txtsecmark14").value = "";
document.getElementById("txtmaxmark24").value = "";
document.getElementById("txtsecmark24").value = "";
document.getElementById("txtmaxmark34").value = "";
document.getElementById("txtsecmark34").value = "";
document.getElementById("txtmaxmark44").value = "";
document.getElementById("txtsecmark44").value = "";
document.getElementById("txtmaxmark54").value = "";
document.getElementById("txtsecmark54").value = "";
document.getElementById("txtmaxmark64").value = "";
document.getElementById("txtsecmark64").value = "";
document.getElementById("txtmaxtotal4").value = "";
document.getElementById("txtsectotal4").value = "";
document.getElementById("txtsubjperc4").value = "";
document.getElementById("txtsubjcode5").value = "";
document.getElementById("txtsubjname5").value = "";
document.getElementById("txtmaxmark15").value = "";
document.getElementById("txtsecmark15").value = "";
document.getElementById("txtmaxmark25").value = "";
document.getElementById("txtsecmark25").value = "";
document.getElementById("txtmaxmark35").value = "";
document.getElementById("txtsecmark35").value = "";
document.getElementById("txtmaxmark45").value = "";
document.getElementById("txtsecmark45").value = "";
document.getElementById("txtmaxmark55").value = "";
document.getElementById("txtsecmark55").value = "";
document.getElementById("txtmaxmark65").value = "";
document.getElementById("txtsecmark65").value = "";
document.getElementById("txtmaxtotal5").value = "";
document.getElementById("txtsectotal5").value = "";
document.getElementById("txtsubjperc5").value = "";
}
function load_appl_data() {
$.ajax({
type: "POST",
url: "src/pg_app_edit.php",
data: {
load_data: "appl_data",
appl_numb: document.getElementById("txtapplnumb").value
},
cache: false,
beforeSend: function () {
show_process();
},
success: function (data) {
var data = JSON.parse(data);
clrs_data();
document.getElementById("txtapplnumb").value = data.FAPPNO;
document.getElementById("txtregrnumb").value = data.FQREGNO;
document.getElementById("txtapplname").value = data.FNAME;
document.getElementById("txtapplmobl").value = data.FMOBILENO;
document.getElementById("txtapplpass").value = data.FPASSWD;
document.getElementById("txtapplmail").value = data.FEMAIL;
document.getElementById("txtmaximark").value = data.FQMAXMARKS;
document.getElementById("txtsecrmark").value = data.FQSECMARKS;
document.getElementById("txttotlperc").value = data.FQPERCENTAGE;
load_mark_data();
hide_process();
},
error: function (data) {
hide_process();
},
});
}
function load_mark_data() {
$.ajax({
type: "POST",
url: "src/pg_app_edit.php",
data: {
load_data: "mark_data",
appl_numb: document.getElementById("txtapplnumb").value,
},
cache: false,
beforeSend: function () {
show_process();
},
success: function (data) {
hide_process();
var data = JSON.parse(data);
document.getElementById("txtsubjcode1").value = data[0].fsubcode;
document.getElementById("txtsubjname1").value = data[0].fsubname;
document.getElementById("txtmaxmark11").value = data[0].famm;
document.getElementById("txtsecmark11").value = data[0].famo;
document.getElementById("txtmaxmark21").value = data[0].fbmm;
document.getElementById("txtsecmark21").value = data[0].fbmo;
document.getElementById("txtmaxmark31").value = data[0].fcmm;
document.getElementById("txtsecmark31").value = data[0].fcmo;
document.getElementById("txtmaxmark41").value = data[0].fdmm;
document.getElementById("txtsecmark41").value = data[0].fdmo;
document.getElementById("txtmaxmark51").value = data[0].femm;
document.getElementById("txtsecmark51").value = data[0].femo;
document.getElementById("txtmaxmark61").value = data[0].ffmm;
document.getElementById("txtsecmark61").value = data[0].ffmo;
document.getElementById("txtmaxtotal1").value = data[0].fmaxmarks;
document.getElementById("txtsectotal1").value = data[0].fsecmarks;
document.getElementById("txtsubjperc1").value = data[0].fpercent;
// 2nd subject
document.getElementById("txtsubjcode2").value = data[1].fsubcode;
document.getElementById("txtsubjname2").value = data[1].fsubname;
document.getElementById("txtmaxmark12").value = data[1].famm;
document.getElementById("txtsecmark12").value = data[1].famo;
document.getElementById("txtmaxmark22").value = data[1].fbmm;
document.getElementById("txtsecmark22").value = data[1].fbmo;
document.getElementById("txtmaxmark32").value = data[1].fcmm;
document.getElementById("txtsecmark32").value = data[1].fcmo;
document.getElementById("txtmaxmark42").value = data[1].fdmm;
document.getElementById("txtsecmark42").value = data[1].fdmo;
document.getElementById("txtmaxmark52").value = data[1].femm;
document.getElementById("txtsecmark52").value = data[1].femo;
document.getElementById("txtmaxmark62").value = data[1].ffmm;
document.getElementById("txtsecmark62").value = data[1].ffmo;
document.getElementById("txtmaxtotal2").value = data[1].fmaxmarks;
document.getElementById("txtsectotal2").value = data[1].fsecmarks;
document.getElementById("txtsubjperc2").value = data[1].fpercent;
// 3 subject
document.getElementById("txtsubjcode3").value = data[2].fsubcode;
document.getElementById("txtsubjname3").value = data[2].fsubname;
document.getElementById("txtmaxmark13").value = data[2].famm;
document.getElementById("txtsecmark13").value = data[2].famo;
document.getElementById("txtmaxmark23").value = data[2].fbmm;
document.getElementById("txtsecmark23").value = data[2].fbmo;
document.getElementById("txtmaxmark33").value = data[2].fcmm;
document.getElementById("txtsecmark33").value = data[2].fcmo;
document.getElementById("txtmaxmark43").value = data[2].fdmm;
document.getElementById("txtsecmark43").value = data[2].fdmo;
document.getElementById("txtmaxmark53").value = data[2].femm;
document.getElementById("txtsecmark53").value = data[2].femo;
document.getElementById("txtmaxmark63").value = data[2].ffmm;
document.getElementById("txtsecmark63").value = data[2].ffmo;
document.getElementById("txtmaxtotal3").value = data[2].fmaxmarks;
document.getElementById("txtsectotal3").value = data[2].fsecmarks;
document.getElementById("txtsubjperc3").value = data[2].fpercent;
// 4 subject
document.getElementById("txtsubjcode4").value = data[3].fsubcode;
document.getElementById("txtsubjname4").value = data[3].fsubname;
document.getElementById("txtmaxmark14").value = data[3].famm;
document.getElementById("txtsecmark14").value = data[3].famo;
document.getElementById("txtmaxmark24").value = data[3].fbmm;
document.getElementById("txtsecmark24").value = data[3].fbmo;
document.getElementById("txtmaxmark34").value = data[3].fcmm;
document.getElementById("txtsecmark34").value = data[3].fcmo;
document.getElementById("txtmaxmark44").value = data[3].fdmm;
document.getElementById("txtsecmark44").value = data[3].fdmo;
document.getElementById("txtmaxmark54").value = data[3].femm;
document.getElementById("txtsecmark54").value = data[3].femo;
document.getElementById("txtmaxmark64").value = data[3].ffmm;
document.getElementById("txtsecmark64").value = data[3].ffmo;
document.getElementById("txtmaxtotal4").value = data[3].fmaxmarks;
document.getElementById("txtsectotal4").value = data[3].fsecmarks;
document.getElementById("txtsubjperc4").value = data[3].fpercent;
// 5 subject
document.getElementById("txtsubjcode5").value = data[4].fsubcode;
document.getElementById("txtsubjname5").value = data[4].fsubname;
document.getElementById("txtmaxmark15").value = data[4].famm;
document.getElementById("txtsecmark15").value = data[4].famo;
document.getElementById("txtmaxmark25").value = data[4].fbmm;
document.getElementById("txtsecmark25").value = data[4].fbmo;
document.getElementById("txtmaxmark35").value = data[4].fcmm;
document.getElementById("txtsecmark35").value = data[4].fcmo;
document.getElementById("txtmaxmark45").value = data[4].fdmm;
document.getElementById("txtsecmark45").value = data[4].fdmo;
document.getElementById("txtmaxmark55").value = data[4].femm;
document.getElementById("txtsecmark55").value = data[4].femo;
document.getElementById("txtmaxmark65").value = data[4].ffmm;
document.getElementById("txtsecmark65").value = data[4].ffmo;
document.getElementById("txtmaxtotal5").value = data[4].fmaxmarks;
document.getElementById("txtsectotal5").value = data[4].fsecmarks;
document.getElementById("txtsubjperc5").value = data[4].fpercent;
},
error: function (data) {
hide_process();
},
});
}
function save_data() {
if (document.getElementById("txtapplnumb").value == "") {
alert("Please enter application number");
document.getElementById("txtapplnumb").focus();
return false;
}
$.ajax({
type: "POST",
url: "src/pg_app_edit.php",
dataType: "json",
data: {
load_data: "save_data",
appl_numb: document.getElementById("txtapplnumb").value,
maxi_mark: document.getElementById("txtmaximark").value,
secr_mark: document.getElementById("txtsecrmark").value,
totl_perc: document.getElementById("txttotlperc").value
},
cache: false,
beforeSend: function () {
show_process();
},
success: function (data) {
hide_process();
},
});
}
function save_mark() {
if (document.getElementById("txtapplnumb").value == "") {
alert("Please enter application number");
document.getElementById("txtapplnumb").focus();
return false;
}
$.ajax({
type: "POST",
url: "src/pg_app_edit.php",
dataType: "json",
data: {
load_data: "save_mark",
appl_numb: document.getElementById("txtapplnumb").value,
subj_code1: document.getElementById("txtsubjcode1").value,
secr_mar11: document.getElementById("txtsecmark11").value,
maxi_mar11: document.getElementById("txtmaxmark11").value,
secr_mar21: document.getElementById("txtsecmark21").value,
maxi_mar21: document.getElementById("txtmaxmark21").value,
secr_mar31: document.getElementById("txtsecmark31").value,
maxi_mar31: document.getElementById("txtmaxmark31").value,
secr_mar41: document.getElementById("txtsecmark41").value,
maxi_mar41: document.getElementById("txtmaxmark41").value,
secr_mar51: document.getElementById("txtsecmark51").value,
maxi_mar51: document.getElementById("txtmaxmark51").value,
secr_mar61: document.getElementById("txtsecmark61").value,
maxi_mar61: document.getElementById("txtmaxmark61").value,
subj_secr1: document.getElementById("txtsectotal1").value,
subj_maxi1: document.getElementById("txtmaxtotal1").value,
subj_perc1: document.getElementById("txtsubjperc1").value,
subj_code2: document.getElementById("txtsubjcode2").value,
secr_mar12: document.getElementById("txtsecmark12").value,
maxi_mar12: document.getElementById("txtmaxmark12").value,
secr_mar22: document.getElementById("txtsecmark22").value,
maxi_mar22: document.getElementById("txtmaxmark22").value,
secr_mar32: document.getElementById("txtsecmark32").value,
maxi_mar32: document.getElementById("txtmaxmark32").value,
secr_mar42: document.getElementById("txtsecmark42").value,
maxi_mar42: document.getElementById("txtmaxmark42").value,
secr_mar52: document.getElementById("txtsecmark52").value,
maxi_mar52: document.getElementById("txtmaxmark52").value,
secr_mar62: document.getElementById("txtsecmark62").value,
maxi_mar62: document.getElementById("txtmaxmark62").value,
subj_secr2: document.getElementById("txtsectotal2").value,
subj_maxi2: document.getElementById("txtmaxtotal2").value,
subj_perc2: document.getElementById("txtsubjperc2").value,
subj_code3: document.getElementById("txtsubjcode3").value,
secr_mar13: document.getElementById("txtsecmark13").value,
maxi_mar13: document.getElementById("txtmaxmark13").value,
secr_mar23: document.getElementById("txtsecmark23").value,
maxi_mar23: document.getElementById("txtmaxmark23").value,
secr_mar33: document.getElementById("txtsecmark33").value,
maxi_mar33: document.getElementById("txtmaxmark33").value,
secr_mar43: document.getElementById("txtsecmark43").value,
maxi_mar43: document.getElementById("txtmaxmark43").value,
secr_mar53: document.getElementById("txtsecmark53").value,
maxi_mar53: document.getElementById("txtmaxmark53").value,
secr_mar63: document.getElementById("txtsecmark63").value,
maxi_mar63: document.getElementById("txtmaxmark63").value,
subj_secr3: document.getElementById("txtsectotal3").value,
subj_maxi3: document.getElementById("txtmaxtotal3").value,
subj_perc3: document.getElementById("txtsubjperc3").value,
subj_code4: document.getElementById("txtsubjcode4").value,
secr_mar14: document.getElementById("txtsecmark14").value,
maxi_mar14: document.getElementById("txtmaxmark14").value,
secr_mar24: document.getElementById("txtsecmark24").value,
maxi_mar24: document.getElementById("txtmaxmark24").value,
secr_mar34: document.getElementById("txtsecmark34").value,
maxi_mar34: document.getElementById("txtmaxmark34").value,
secr_mar44: document.getElementById("txtsecmark44").value,
maxi_mar44: document.getElementById("txtmaxmark44").value,
secr_mar54: document.getElementById("txtsecmark54").value,
maxi_mar54: document.getElementById("txtmaxmark54").value,
secr_mar64: document.getElementById("txtsecmark64").value,
maxi_mar64: document.getElementById("txtmaxmark64").value,
subj_secr4: document.getElementById("txtsectotal4").value,
subj_maxi4: document.getElementById("txtmaxtotal4").value,
subj_perc4: document.getElementById("txtsubjperc4").value,
subj_code5: document.getElementById("txtsubjcode5").value,
secr_mar15: document.getElementById("txtsecmark15").value,
maxi_mar15: document.getElementById("txtmaxmark15").value,
secr_mar25: document.getElementById("txtsecmark25").value,
maxi_mar25: document.getElementById("txtmaxmark25").value,
secr_mar35: document.getElementById("txtsecmark35").value,
maxi_mar35: document.getElementById("txtmaxmark35").value,
secr_mar45: document.getElementById("txtsecmark45").value,
maxi_mar45: document.getElementById("txtmaxmark45").value,
secr_mar55: document.getElementById("txtsecmark55").value,
maxi_mar55: document.getElementById("txtmaxmark55").value,
secr_mar65: document.getElementById("txtsecmark65").value,
maxi_mar65: document.getElementById("txtmaxmark65").value,
subj_secr5: document.getElementById("txtsectotal5").value,
subj_maxi5: document.getElementById("txtmaxtotal5").value,
subj_perc5: document.getElementById("txtsubjperc5").value
},
cache: false,
beforeSend: function () {
// show_process();
},
success: function (data) {
hide_process();
alert(data.mesg);
clrs_data();
},
});
}
function calc_perc(){
totl_perc = document.getElementById("txtsecrmark").value / document.getElementById("txtmaximark").value*100;
totl_perc = totl_perc.toFixed(2);
document.getElementById("txttotlperc").value = totl_perc;
}
function calc_subj_mark1(){
document.getElementById("txtmaxtotal1").value =
parseInt(document.getElementById("txtmaxmark11").value) +
parseInt(document.getElementById("txtmaxmark21").value) +
parseInt(document.getElementById("txtmaxmark31").value) +
parseInt(document.getElementById("txtmaxmark41").value) +
parseInt(document.getElementById("txtmaxmark51").value) +
parseInt(document.getElementById("txtmaxmark61").value);
document.getElementById("txtsectotal1").value =
parseInt(document.getElementById("txtsecmark11").value) +
parseInt(document.getElementById("txtsecmark21").value) +
parseInt(document.getElementById("txtsecmark31").value) +
parseInt(document.getElementById("txtsecmark41").value) +
parseInt(document.getElementById("txtsecmark51").value) +
parseInt(document.getElementById("txtsecmark61").value);
subj_perc = document.getElementById("txtsectotal1").value / document.getElementById("txtmaxtotal1").value*100;
subj_perc = subj_perc.toFixed(2);
document.getElementById("txtsubjperc1").value = subj_perc;
}
function calc_subj_mark2(){
document.getElementById("txtmaxtotal2").value =
parseInt(document.getElementById("txtmaxmark12").value) +
parseInt(document.getElementById("txtmaxmark22").value) +
parseInt(document.getElementById("txtmaxmark32").value) +
parseInt(document.getElementById("txtmaxmark42").value) +
parseInt(document.getElementById("txtmaxmark52").value) +
parseInt(document.getElementById("txtmaxmark62").value);
document.getElementById("txtsectotal2").value =
parseInt(document.getElementById("txtsecmark12").value) +
parseInt(document.getElementById("txtsecmark22").value) +
parseInt(document.getElementById("txtsecmark32").value) +
parseInt(document.getElementById("txtsecmark42").value) +
parseInt(document.getElementById("txtsecmark52").value) +
parseInt(document.getElementById("txtsecmark62").value);
subj_perc = document.getElementById("txtsectotal2").value / document.getElementById("txtmaxtotal2").value*100;
subj_perc = subj_perc.toFixed(2);
document.getElementById("txtsubjperc2").value = subj_perc;
}
function calc_subj_mark3(){
document.getElementById("txtmaxtotal3").value =
parseInt(document.getElementById("txtmaxmark13").value) +
parseInt(document.getElementById("txtmaxmark23").value) +
parseInt(document.getElementById("txtmaxmark33").value) +
parseInt(document.getElementById("txtmaxmark43").value) +
parseInt(document.getElementById("txtmaxmark53").value) +
parseInt(document.getElementById("txtmaxmark63").value);
document.getElementById("txtsectotal3").value =
parseInt(document.getElementById("txtsecmark13").value) +
parseInt(document.getElementById("txtsecmark23").value) +
parseInt(document.getElementById("txtsecmark33").value) +
parseInt(document.getElementById("txtsecmark43").value) +
parseInt(document.getElementById("txtsecmark53").value) +
parseInt(document.getElementById("txtsecmark63").value);
subj_perc = document.getElementById("txtsectotal3").value / document.getElementById("txtmaxtotal3").value*100;
subj_perc = subj_perc.toFixed(2);
document.getElementById("txtsubjperc3").value = subj_perc;
}
function calc_subj_mark4(){
document.getElementById("txtmaxtotal4").value =
parseInt(document.getElementById("txtmaxmark14").value) +
parseInt(document.getElementById("txtmaxmark24").value) +
parseInt(document.getElementById("txtmaxmark34").value) +
parseInt(document.getElementById("txtmaxmark44").value) +
parseInt(document.getElementById("txtmaxmark54").value) +
parseInt(document.getElementById("txtmaxmark64").value);
document.getElementById("txtsectotal4").value =
parseInt(document.getElementById("txtsecmark14").value) +
parseInt(document.getElementById("txtsecmark24").value) +
parseInt(document.getElementById("txtsecmark34").value) +
parseInt(document.getElementById("txtsecmark44").value) +
parseInt(document.getElementById("txtsecmark54").value) +
parseInt(document.getElementById("txtsecmark64").value);
subj_perc = document.getElementById("txtsectotal4").value / document.getElementById("txtmaxtotal4").value*100;
subj_perc = subj_perc.toFixed(2);
document.getElementById("txtsubjperc4").value = subj_perc;
}
function calc_subj_mark5(){
document.getElementById("txtmaxtotal5").value =
parseInt(document.getElementById("txtmaxmark15").value) +
parseInt(document.getElementById("txtmaxmark25").value) +
parseInt(document.getElementById("txtmaxmark35").value) +
parseInt(document.getElementById("txtmaxmark45").value) +
parseInt(document.getElementById("txtmaxmark55").value) +
parseInt(document.getElementById("txtmaxmark65").value);
document.getElementById("txtsectotal5").value =
parseInt(document.getElementById("txtsecmark15").value) +
parseInt(document.getElementById("txtsecmark25").value) +
parseInt(document.getElementById("txtsecmark35").value) +
parseInt(document.getElementById("txtsecmark45").value) +
parseInt(document.getElementById("txtsecmark55").value) +
parseInt(document.getElementById("txtsecmark65").value);
subj_perc = document.getElementById("txtsectotal5").value / document.getElementById("txtmaxtotal5").value*100;
subj_perc = subj_perc.toFixed(2);
document.getElementById("txtsubjperc5").value = subj_perc;
}
|