Current File : /home/inlingua/public_html/noida/icentex/jquery/js/certificate_add_olddd.js |
// JavaScript Document
function createRequestObject()
{
var xmlhttp = false;
try
{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E)
{
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
{
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function saveData(id)
{
var request = createRequestObject();
lin="link"+id+"";
divid="divid"+id+"";
studeid1="student_id"+id+"";
studeid=document.getElementById(studeid1).value;
//alert(studeid);
language1="language"+id+"";
language=document.getElementById(language1).value;
courseId1="courseId"+id+"";
courseId=document.getElementById(courseId1).value;
level1="level"+id+"";
level=document.getElementById(level1).value;
startDate1="startDate"+id+"";
startDate=document.getElementById(startDate1).value;
endDate1="endDate"+id+"";
endDate=document.getElementById(endDate1).value;
name_student1="name_student"+id+"";
name_student=document.getElementById(name_student1).value;
clarityandquality1="clarityandquality"+id+"";
clarityandquality=document.getElementById(clarityandquality1).value;
fluency1="fluency"+id+"";
fluency=document.getElementById(fluency1).value;
accuracyenglish1="accuracyenglish"+id+"";
accuracyenglish=document.getElementById(accuracyenglish1).value;
knowledge1="knowledge"+id+"";
knowledge=document.getElementById(knowledge1).value;
abilityunder1="abilityunder"+id+"";
abilityunder=document.getElementById(abilityunder1).value;
listening1="listening"+id+"";
listening=document.getElementById(listening1).value;
general_comment1="general_comment"+id+"";
general_comment=document.getElementById(general_comment1).value;
overall_grade1="overall_grade"+id+"";
overall_grade=document.getElementById(overall_grade1).value;
yes_1="yes_"+id+"";
if(document.getElementById(yes_1).checked)
{
eligibility=document.getElementById(yes_1).value;
}
no_1="no_"+id+"";
if(document.getElementById(no_1).checked)
{
eligibility=no_=document.getElementById(no_1).value;
}
other_1="other_"+id+"";
if(document.getElementById(other_1).checked)
{
eligibility=other_=document.getElementById(other_1).value;
}
//alert(eligibility);
otherelig_1="otherelig_"+id+"";
otherelig_=document.getElementById(otherelig_1).value;
params="studeid="+studeid+"&language="+language+"&courseId="+courseId+"&level="+level+"&startDate="+startDate+"&endDate="+endDate+"&name_student="+name_student+"&clarityandquality="+clarityandquality+"&fluency="+fluency+"&accuracyenglish="+accuracyenglish+"&knowledge="+knowledge+"&abilityunder="+abilityunder+"&listening="+listening+"&general_comment="+general_comment+"&overall_grade="+overall_grade+"&eligibility="+eligibility+"&othereligibility="+otherelig_+"&aC=Save";
if(name_student=="")
{
alert("Name Of Student cannot be blank");
document.getElementById(name_student1).focus();
return false;
}
else if(clarityandquality=="")
{
alert("Clarity and Quality of Pronunciation of "+name_student+" cannot be blank");
document.getElementById(clarityandquality1).focus();
return false;
}
else if(fluency=="")
{
alert("Fluency of "+name_student+" cannot be blank");
document.getElementById(fluency1).focus();
return false;
}
else if(accuracyenglish=="")
{
alert("Accuracy of English Grammar and Structures of "+name_student+" cannot be blank");
document.getElementById(accuracyenglish1).focus();
return false;
}
else if(knowledge=="")
{
alert("Knowledge and Use of Vocabulary of "+name_student+" cannot be blank");
document.getElementById(knowledge1).focus();
return false;
}
else if(abilityunder=="")
{
alert("Ability to Understand and React to Spoken English of "+name_student+" cannot be blank");
document.getElementById(abilityunder1).focus();
return false;
}
else if(listening=="")
{
alert("Listening of "+name_student+" cannot be blank");
document.getElementById(listening1).focus();
return false;
}
else if(general_comment=="")
{
alert("General Comments and Advice for Future Study of "+name_student+" cannot be blank");
document.getElementById(general_comment1).focus();
return false;
}
else if(overall_grade=="")
{
alert("Overall Grade of "+name_student+" cannot be blank");
document.getElementById(overall_grade1).focus();
return false;
}
else if(eligibility=="Other" && otherelig_=="")
{
alert("Eligibility for the next leve "+name_student+" cannot be blank.Please fill some text.");
document.getElementById(otherelig_1).focus();
return false;
}
document.getElementById('submit').disabled=true;
document.getElementById('img_display').innerHTML = "<img src='images/indicator.gif' style='border:none;' height='100'>";
request.open('POST', 'addcertificate2.php', true);
//Send the proper header information along with the request
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.setRequestHeader("Content-length", params.length);
request.setRequestHeader("Connection", "close");
request.onreadystatechange = function()
{
if(request.readyState == 4)
{
if(request.status == 200)
{
document.getElementById('img_display').innerHTML = "";
document.getElementById(divid).focus();
var response = request.responseText;
//alert(response);
document.getElementById(divid).innerHTML = response;
document.getElementById('submit').disabled=false;
document.getElementById(lin).focus();
}
}
}
request.send(params);
}
function saveCertificate1(id)
{
var request = createRequestObject();
lin="link"+id+"";
divid="divid"+id+"";
studeid1="student_id"+id+"";
studeid=document.getElementById(studeid1).value;
//alert(studeid);
language1="language"+id+"";
language=document.getElementById(language1).value;
courseId1="courseId"+id+"";
courseId=document.getElementById(courseId1).value;
level1="level"+id+"";
level=document.getElementById(level1).value;
startDate1="startDate"+id+"";
startDate=document.getElementById(startDate1).value;
endDate1="endDate"+id+"";
endDate=document.getElementById(endDate1).value;
name_student1="name_student"+id+"";
name_student=document.getElementById(name_student1).value;
listening_skill1="listening_skill"+id+"";
listening_skill=document.getElementById(listening_skill1).value;
general_comment1="general_comment"+id+"";
general_comment=document.getElementById(general_comment1).value;
overall_grade1="overall_grade"+id+"";
overall_grade=document.getElementById(overall_grade1).value;
yes_1="yes_"+id+"";
if(document.getElementById(yes_1).checked)
{
eligibility=document.getElementById(yes_1).value;
}
no_1="no_"+id+"";
if(document.getElementById(no_1).checked)
{
eligibility=no_=document.getElementById(no_1).value;
}
other_1="other_"+id+"";
if(document.getElementById(other_1).checked)
{
eligibility=other_=document.getElementById(other_1).value;
}
//alert(eligibility);
otherelig_1="otherelig_"+id+"";
otherelig_=document.getElementById(otherelig_1).value;
params="studeid="+studeid+"&language="+language+"&courseId="+courseId+"&level="+level+"&startDate="+startDate+"&endDate="+endDate+"&name_student="+name_student+"&listening_skill="+listening_skill+"&general_comment="+general_comment+"&overall_grade="+overall_grade+"&eligibility="+eligibility+"&othereligibility="+otherelig_+"&aC=Save";
if(name_student=="")
{
alert("Name Of Student cannot be blank");
document.getElementById(name_student1).focus();
return false;
}
else if(listening_skill=="")
{
alert("Listening and Speaking Skills of "+name_student+" cannot be blank");
document.getElementById(listening_skill1).focus();
return false;
}
else if(general_comment=="")
{
alert("General Comments and Advice for Future Study of "+name_student+" cannot be blank");
document.getElementById(general_comment1).focus();
return false;
}
else if(overall_grade=="")
{
alert("Overall Grade of "+name_student+" cannot be blank");
document.getElementById(overall_grade1).focus();
return false;
}
else if(eligibility=="Other" && otherelig_=="")
{
alert("Eligibility for the next leve "+name_student+" cannot be blank.Please fill some text.");
document.getElementById(otherelig_1).focus();
return false;
}
document.getElementById('submit').disabled=true;
document.getElementById('img_display').innerHTML = "<img src='images/indicator.gif' style='border:none;' height='100'>";
request.open('POST', 'addcertificate1.php', true);
//Send the proper header information along with the request
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.setRequestHeader("Content-length", params.length);
request.setRequestHeader("Connection", "close");
request.onreadystatechange = function()
{
if(request.readyState == 4)
{
if(request.status == 200)
{
document.getElementById('img_display').innerHTML = "";
document.getElementById(divid).focus();
var response = request.responseText;
//alert(response);
document.getElementById(divid).innerHTML = response;
document.getElementById('submit').disabled=false;
document.getElementById(lin).focus();
}
}
}
request.send(params);
}
function saveCertificate3(id)
{
var request = createRequestObject();
lin="link"+id+"";
divid="divid"+id+"";
studeid1="student_id"+id+"";
studeid=document.getElementById(studeid1).value;
//alert(studeid);
language1="language"+id+"";
language=document.getElementById(language1).value;
courseId1="courseId"+id+"";
courseId=document.getElementById(courseId1).value;
level1="level"+id+"";
level=document.getElementById(level1).value;
startDate1="startDate"+id+"";
startDate=document.getElementById(startDate1).value;
endDate1="endDate"+id+"";
endDate=document.getElementById(endDate1).value;
name_student1="name_student"+id+"";
name_student=document.getElementById(name_student1).value;
useStructures1="useStructures"+id+"";
useStructures=document.getElementById(useStructures1).value;
pronFluency1="pronFluency"+id+"";
pronFluency=document.getElementById(pronFluency1).value;
listening_skill1="listening_skill"+id+"";
listening_skill=document.getElementById(listening_skill1).value;
lexical_skill1="lexical_skill"+id+"";
lexical_skill=document.getElementById(lexical_skill1).value;
general_comment1="general_comment"+id+"";
general_comment=document.getElementById(general_comment1).value;
overall_grade1="overall_grade"+id+"";
overall_grade=document.getElementById(overall_grade1).value;
yes_1="yes_"+id+"";
if(document.getElementById(yes_1).checked)
{
eligibility=document.getElementById(yes_1).value;
}
no_1="no_"+id+"";
if(document.getElementById(no_1).checked)
{
eligibility=no_=document.getElementById(no_1).value;
}
other_1="other_"+id+"";
if(document.getElementById(other_1).checked)
{
eligibility=other_=document.getElementById(other_1).value;
}
//alert(eligibility);
otherelig_1="otherelig_"+id+"";
otherelig_=document.getElementById(otherelig_1).value;
params="studeid="+studeid+"&language="+language+"&courseId="+courseId+"&level="+level+"&startDate="+startDate+"&endDate="+endDate+"&name_student="+name_student+"&useStructures="+useStructures+"&pronFluency="+pronFluency+"&lexical_skill="+lexical_skill+"&listening_skill="+listening_skill+"&general_comment="+general_comment+"&overall_grade="+overall_grade+"&eligibility="+eligibility+"&othereligibility="+otherelig_+"&aC=Save";
if(name_student=="")
{
alert("Name Of Student cannot be blank");
document.getElementById(name_student1).focus();
return false;
}
else if(useStructures=="")
{
alert("Use of Structures of"+name_student+" cannot be blank");
document.getElementById(useStructures1).focus();
return false;
}
else if(pronFluency=="")
{
alert("Pronunciation and Fluency of"+name_student+" cannot be blank");
document.getElementById(pronFluency1).focus();
return false;
}
else if(listening_skill=="")
{
alert("Listening Skills of "+name_student+" cannot be blank");
document.getElementById(listening_skill1).focus();
return false;
}
else if(lexical_skill=="")
{
alert("Lexical Skills of"+name_student+" cannot be blank");
document.getElementById(lexical_skill1).focus();
return false;
}
else if(general_comment=="")
{
alert("General Comments and Advice for Future Study of "+name_student+" cannot be blank");
document.getElementById(general_comment1).focus();
return false;
}
else if(overall_grade=="")
{
alert("Overall Grade of "+name_student+" cannot be blank");
document.getElementById(overall_grade1).focus();
return false;
}
else if(eligibility=="Other" && otherelig_=="")
{
alert("Eligibility for the next leve "+name_student+" cannot be blank.Please fill some text.");
document.getElementById(otherelig_1).focus();
return false;
}
document.getElementById('submit').disabled=true;
document.getElementById('img_display').innerHTML = "<img src='images/indicator.gif' style='border:none;' height='100'>";
request.open('POST', 'addcertificate3.php', true);
//Send the proper header information along with the request
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.setRequestHeader("Content-length", params.length);
request.setRequestHeader("Connection", "close");
request.onreadystatechange = function()
{
if(request.readyState == 4)
{
if(request.status == 200)
{
document.getElementById('img_display').innerHTML = "";
document.getElementById(divid).focus();
var response = request.responseText;
//alert(response);
document.getElementById(divid).innerHTML = response;
document.getElementById('submit').disabled=false;
document.getElementById(lin).focus();
}
}
}
request.send(params);
}
function saveCertificate4(id)
{
var request = createRequestObject();
lin="link"+id+"";
divid="divid"+id+"";
studeid1="student_id"+id+"";
studeid=document.getElementById(studeid1).value;
//alert(studeid);
language1="language"+id+"";
language=document.getElementById(language1).value;
courseId1="courseId"+id+"";
courseId=document.getElementById(courseId1).value;
level1="level"+id+"";
level=document.getElementById(level1).value;
startDate1="startDate"+id+"";
startDate=document.getElementById(startDate1).value;
endDate1="endDate"+id+"";
endDate=document.getElementById(endDate1).value;
name_student1="name_student"+id+"";
name_student=document.getElementById(name_student1).value;
useStructures1="useStructures"+id+"";
useStructures=document.getElementById(useStructures1).value;
pronFluency1="pronFluency"+id+"";
pronFluency=document.getElementById(pronFluency1).value;
listening_skill1="listening_skill"+id+"";
listening_skill=document.getElementById(listening_skill1).value;
lexical_skill1="lexical_skill"+id+"";
lexical_skill=document.getElementById(lexical_skill1).value;
general_comment1="general_comment"+id+"";
general_comment=document.getElementById(general_comment1).value;
overall_grade1="overall_grade"+id+"";
overall_grade=document.getElementById(overall_grade1).value;
yes_1="yes_"+id+"";
if(document.getElementById(yes_1).checked)
{
eligibility=document.getElementById(yes_1).value;
}
no_1="no_"+id+"";
if(document.getElementById(no_1).checked)
{
eligibility=no_=document.getElementById(no_1).value;
}
other_1="other_"+id+"";
if(document.getElementById(other_1).checked)
{
eligibility=other_=document.getElementById(other_1).value;
}
//alert(eligibility);
otherelig_1="otherelig_"+id+"";
otherelig_=document.getElementById(otherelig_1).value;
params="studeid="+studeid+"&language="+language+"&courseId="+courseId+"&level="+level+"&startDate="+startDate+"&endDate="+endDate+"&name_student="+name_student+"&useStructures="+useStructures+"&pronFluency="+pronFluency+"&lexical_skill="+lexical_skill+"&listening_skill="+listening_skill+"&general_comment="+general_comment+"&overall_grade="+overall_grade+"&eligibility="+eligibility+"&othereligibility="+otherelig_+"&aC=Save";
if(name_student=="")
{
alert("Name Of Student cannot be blank");
document.getElementById(name_student1).focus();
return false;
}
else if(useStructures=="")
{
alert("Use of Structures of"+name_student+" cannot be blank");
document.getElementById(useStructures1).focus();
return false;
}
else if(pronFluency=="")
{
alert("Pronunciation and Fluency of"+name_student+" cannot be blank");
document.getElementById(pronFluency1).focus();
return false;
}
else if(listening_skill=="")
{
alert("Listening Skills of "+name_student+" cannot be blank");
document.getElementById(listening_skill1).focus();
return false;
}
else if(lexical_skill=="")
{
alert("Lexical Skills of"+name_student+" cannot be blank");
document.getElementById(lexical_skill1).focus();
return false;
}
else if(general_comment=="")
{
alert("General Comments and Advice for Future Study of "+name_student+" cannot be blank");
document.getElementById(general_comment1).focus();
return false;
}
else if(overall_grade=="")
{
alert("Overall Grade of "+name_student+" cannot be blank");
document.getElementById(overall_grade1).focus();
return false;
}
else if(eligibility=="Other" && otherelig_=="")
{
alert("Eligibility for the next leve "+name_student+" cannot be blank.Please fill some text.");
document.getElementById(otherelig_1).focus();
return false;
}
document.getElementById('submit').disabled=true;
document.getElementById('img_display').innerHTML = "<img src='images/indicator.gif' style='border:none;' height='100'>";
request.open('POST', 'addcertificate4.php', true);
//Send the proper header information along with the request
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.setRequestHeader("Content-length", params.length);
request.setRequestHeader("Connection", "close");
request.onreadystatechange = function()
{
if(request.readyState == 4)
{
if(request.status == 200)
{
document.getElementById('img_display').innerHTML = "";
document.getElementById(divid).focus();
var response = request.responseText;
document.getElementById(divid).innerHTML = response;
document.getElementById('submit').disabled=false;
document.getElementById(lin).focus();
}
}
}
request.send(params);
}
function saveCertificate5(id)
{
var request = createRequestObject();
divid="divid"+id+"";
lin="link"+id+"";
studeid1="student_id"+id+"";
studeid=document.getElementById(studeid1).value;
//alert(studeid);
language1="language"+id+"";
language=document.getElementById(language1).value;
courseId1="courseId"+id+"";
courseId=document.getElementById(courseId1).value;
level1="level"+id+"";
level=document.getElementById(level1).value;
startDate1="startDate"+id+"";
startDate=document.getElementById(startDate1).value;
endDate1="endDate"+id+"";
endDate=document.getElementById(endDate1).value;
name_student1="name_student"+id+"";
name_student=document.getElementById(name_student1).value;
useStructures1="useStructures"+id+"";
useStructures=document.getElementById(useStructures1).value;
pronFluency1="pronFluency"+id+"";
pronFluency=document.getElementById(pronFluency1).value;
listening_skill1="listening_skill"+id+"";
listening_skill=document.getElementById(listening_skill1).value;
lexical_skill1="lexical_skill"+id+"";
lexical_skill=document.getElementById(lexical_skill1).value;
general_comment1="general_comment"+id+"";
general_comment=document.getElementById(general_comment1).value;
overall_grade1="overall_grade"+id+"";
overall_grade=document.getElementById(overall_grade1).value;
yes_1="yes_"+id+"";
if(document.getElementById(yes_1).checked)
{
eligibility=document.getElementById(yes_1).value;
}
no_1="no_"+id+"";
if(document.getElementById(no_1).checked)
{
eligibility=no_=document.getElementById(no_1).value;
}
other_1="other_"+id+"";
if(document.getElementById(other_1).checked)
{
eligibility=other_=document.getElementById(other_1).value;
}
//alert(eligibility);
otherelig_1="otherelig_"+id+"";
otherelig_=document.getElementById(otherelig_1).value;
params="studeid="+studeid+"&language="+language+"&courseId="+courseId+"&level="+level+"&startDate="+startDate+"&endDate="+endDate+"&name_student="+name_student+"&useStructures="+useStructures+"&pronFluency="+pronFluency+"&lexical_skill="+lexical_skill+"&listening_skill="+listening_skill+"&general_comment="+general_comment+"&overall_grade="+overall_grade+"&eligibility="+eligibility+"&othereligibility="+otherelig_+"&aC=Save";
if(name_student=="")
{
alert("Name Of Student cannot be blank");
document.getElementById(name_student1).focus();
return false;
}
else if(useStructures=="")
{
alert("Use of Structures of"+name_student+" cannot be blank");
document.getElementById(useStructures1).focus();
return false;
}
else if(pronFluency=="")
{
alert("Pronunciation and Fluency of"+name_student+" cannot be blank");
document.getElementById(pronFluency1).focus();
return false;
}
else if(listening_skill=="")
{
alert("Listening Skills of "+name_student+" cannot be blank");
document.getElementById(listening_skill1).focus();
return false;
}
else if(lexical_skill=="")
{
alert("Lexical Skills of"+name_student+" cannot be blank");
document.getElementById(lexical_skill1).focus();
return false;
}
else if(general_comment=="")
{
alert("General Comments and Advice for Future Study of "+name_student+" cannot be blank");
document.getElementById(general_comment1).focus();
return false;
}
else if(overall_grade=="")
{
alert("Overall Grade of "+name_student+" cannot be blank");
document.getElementById(overall_grade1).focus();
return false;
}
else if(eligibility=="Other" && otherelig_=="")
{
alert("Eligibility for the next leve "+name_student+" cannot be blank.Please fill some text.");
document.getElementById(otherelig_1).focus();
return false;
}
document.getElementById('submit').disabled=true;
document.getElementById('img_display').innerHTML = "<img src='images/indicator.gif' style='border:none;' height='100'>";
request.open('POST', 'addcertificate5.php', true);
//Send the proper header information along with the request
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.setRequestHeader("Content-length", params.length);
request.setRequestHeader("Connection", "close");
request.onreadystatechange = function()
{
if(request.readyState == 4)
{
if(request.status == 200)
{
document.getElementById('img_display').innerHTML = "";
//document.getElementById(divid).focus();
var response = request.responseText;
//alert(response);
document.getElementById(divid).innerHTML = response;
document.getElementById('submit').disabled=false;
document.getElementById(lin).focus();
}
}
}
request.send(params);
}