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.141.201.46
Current Path : /var/www/html/stph/js/ |
| Current File : /var/www/html/stph/js/subjectfreez.js |
function LoadfreezeSubject()
{
$("#page_main_div").load('html_modules/subjectfreez.html',function()
{
document.getElementById('display_module_name').innerHTML = 'Freeze Subject';
document.getElementById('module_name_for_save').value = 'Freeze Subject';
getDefaultHeadFooterLinks("Freeze Subject");
$('#practicalFreeze').hide();
$("#fmacas_module_subject_data").hide();
}
);
}
function getpopup()
{
$.ajax({
type: "POST",
url: $host_url+"getcollege.demo",
success: getcollegeResponce
});
}
function getcollegeResponce(responce)
{
responce = eval('(' + responce + ')');
document.getElementById("fcollcode").options.length = 0;
var fcollege =responce.data['college'];
$op = new Option("Select",0);
$op.id=0;//specifying the id for options
document.getElementById("fcollcode").options.add($op);
for($i=0;$i < fcollege.length;$i++)
{
$op = new Option(fcollege[$i]['value'], fcollege[$i]['internal_code']);
$op.id=fcollege[$i]['internal_code'];//specifying the id for options
document.getElementById("fcollcode").options.add($op);
}
}
function getdegname()
{
if(trim(document.getElementById('fcollcode').value) == '' )
{
alert('Please enter the College Code');
$("#fcollcode").focus();
return;
}
$.ajax({
type: "POST",
data:"&fcollcode="+$("#fcollcode").val(),
url: $host_url+"getdegname.demo",
success: getdegnameResponce
});
}
function getdegnameResponce(responce)
{
responce = eval('(' + responce + ')');
document.getElementById("fdegree").options.length = 0;
var degree =responce.data['degree'];
$op = new Option("Select",0);
$op.id=0;//specifying the id for options
document.getElementById("fdegree").options.add($op);
for($i=0;$i < degree.length;$i++)
{
$op = new Option(degree[$i]['value'], degree[$i]['internal_code']);
$op.id=degree[$i]['internal_code'];//specifying the id for options
document.getElementById("fdegree").options.add($op);
}
}
function getexamname()
{
$.ajax({
type: "POST",
data:"&fcollcode="+$("#fcollcode").val()+"&fdegree="+$("#fdegree").val(),
url: $host_url+"getexamname.demo",
success: getexamnameResponce
});
}
function getexamnameResponce(responce)
{
responce = eval('(' + responce + ')');
document.getElementById("fexamno").options.length = 0;
var exam =responce.data['exam'];
$op = new Option("Select",0);
$op.id=0;//specifying the id for options
document.getElementById("fexamno").options.add($op);
for($i=0;$i < exam.length;$i++)
{
$op = new Option(exam[$i]['value'], exam[$i]['internal_code']);
$op.id=exam[$i]['internal_code'];//specifying the id for options
document.getElementById("fexamno").options.add($op);
}
}
function displayDatesDetails()
{
if(trim(document.getElementById('fcollcode').value) == '' )
{
alert('Please Select College');
$("#fcollcode").focus();
return;
}
/* if(trim(document.getElementById('fdegree').value) == '' )
{
alert('Please Select Degree');
$("#fdegree").focus();
return;
} */
if(trim(document.getElementById('fexamno').value) == '' )
{
alert('Please Select examno');
$("#fexamno").focus();
return;
}
if(trim(document.getElementById('fevent').value) == '' )
{
alert('Please Select Event');
$("#fevent").focus();
return;
}
$.ajax({
type: "POST",
data:"°ree="+$("#fdegree").val()+"&exam_no="+$("#fexamno").val()+"&college="+$("#fcollcode").val()+"&fevent="+$("#fevent").val(),
url: $host_url+"getfreezsubject.demo",
success: getFmacasSubjectDetailsResponce
});
}
var totallength = '';
function getFmacasSubjectDetailsResponce($responce)
{
$responce = eval('(' + $responce + ')');
if($responce.error_code==0)
{
if($responce.data.fevent == 'IAM' )
{
$("#fmacas_module_subject_data").show();
$('#practicalFreeze').hide();
$("#fmacas_module_subject_data").html("");
$("#fmacas_module_subject_data").html($responce.data.html_data);
$g_fmacas_total_row_count = $responce.data.total_count;
$g_fmacas_org_rem_sub = $responce.data.rem_sub;
$g_fmacas_rem_sub = $responce.data.rem_sub;
}
if($responce.data.fevent == 'PRM')
{
$('#practicalFreeze').show();
$("#fmacas_module_subject_data").hide();
$("#practicalFreeze").load('html_modules/practicalfreeze.html',function()
{
totallength = $responce.data.totallength;
$('#practiacl_table').append($responce.data.details);
});
}
}
else
{
alert('No Details Found For Given Data');
$('#practicalFreeze').hide();
$("#fmacas_module_subject_data").hide();
document.getElementById('fcollcode').value = '';
document.getElementById('fdegree').value = '';
document.getElementById('fexamno').value = '';
document.getElementById('fevent').value = '';
document.getElementById('fcollcode').focus();
}
}
/* function savefreezeSubject()
{
var fcollcode = document.getElementById('fcollcode').value;
var fdegree = document.getElementById('fdegree').value;
var fexamno = document.getElementById('fexamno').value;
var fevent = document.getElementById('fevent').value;
alert(fevent);
if(fcollcode == '' )
{
alert('Please Select College');
$("#fcollcode").focus();
return;
}
if(fdegree == '' )
{
alert('please select degree');
document.getelementbyid('fdegree').focus();
return;
}
if(fexamno == '' )
{
alert('Please Select Exam');
document.getElementById('fexamno').focus();
return;
}
if(fevent == '' )
{
alert('Please Select Event');
document.getElementById('fevent').focus();
return;
}
//var datastring = "degree="+$("#fdegree").val()+"&exam_no="+document.getElementById('fexamno').value+"&rem_sub="+$g_fmacas_rem_sub+"&rem_unsub="+$unchecked_subjects+"&collcode="+document.getElementById('fcollcode').value+"fevent="+$('#event').val();
if(fevent == 'IAM')
{
$checked_subjects = '';
$unchecked_subjects = '';
$arr = new Object();
for($k=0;$k<$g_fmacas_total_row_count;$k++)
{
if(document.getElementById("fmacas_FCSTATUS_check_"+$k).checked != document.getElementById("fmacas_FCSTATUS_checkH_"+$k).checked)
{
if(document.getElementById("fmacas_FCSTATUS_check_"+$k).checked)
$checked_subjects += trim($("#fmacas_FSUBCODE_"+$k).html())+'*';
if(!document.getElementById("fmacas_FCSTATUS_check_"+$k).checked)
$unchecked_subjects += trim($("#fmacas_FSUBCODE_"+$k).html())+'*';
}
}
$g_fmacas_rem_sub =$checked_subjects;
` var datastring = "degree="+$("#fdegree").val()+"&exam_no="+document.getElementById('fexamno').value+"&rem_sub="+$g_fmacas_rem_sub+"&rem_unsub="+$unchecked_subjects+"&collcode="+document.getElementById('fcollcode').value+"fevent="+fevent;
alert(datastring);
$.ajax({
type: "POST",
data:"degree="+$("#fdegree").val()+"&exam_no="+document.getElementById('fexamno').value+"&rem_sub="+$g_fmacas_rem_sub+"&rem_unsub="+$unchecked_subjects+"&collcode="+document.getElementById('fcollcode').value+"fevent="+fevent,
url: $host_url+"savefreezeSubject.demo",
success: savefreezeSubjectResponce
});
}if(fevent == 'PRM')
{
var chkCnt = 0;
var j =0;
var freeze = new Array();
var printfreeze = new Array();
var inputFileds = document.getElementsByTagName('input');
for (var counter=0; counter < inputFileds.length; counter++)
{
if ( inputFileds[counter].type.toUpperCase()=='TEXT' && inputFileds[counter].name == "rowid" )
{
freeze[j]=encodeURIComponent($("#freeze"+chkCnt).val());
printfreeze[j]=encodeURIComponent($("#printfreeze"+chkCnt).val());
chkCnt++;
j++;
}
}
var datastring = "&fcollcode="+fcollcode+"&fdegree="+fdegree+"&fexamno="+fexamno+"&fevent="+fevent+"&freeze="+freeze+"&printfreeze="+printfreeze;
}
$.ajax({
type: "POST",
data: datastring,
url: $host_url+"savefreezeSubject.demo",
success: savefreezeSubjectResponce
});
} */
function savefreezeSubject()
{
if(trim(document.getElementById('fcollcode').value) == '' )
{
alert('Please enter the College Code');
$("#fcollcode").focus();
return;
}
/* if(trim(document.getElementById('fdegree').value) == '' )
{
alert('Please enter the Degree Code');
document.getElementById('fdegree').focus();
return;
} */
if(trim(document.getElementById('fexamno').value) == '' )
{
alert('Please enter the Examno Code');
document.getElementById('fexamno').focus();
return;
}
if(trim(document.getElementById('fevent').value) == '' )
{
alert('Please enter the Examno Code');
document.getElementById('fevent').focus();
return;
}
if(document.getElementById('fevent').value == 'IAM' )
{
$checked_subjects = '';
$unchecked_subjects = '';
$arr = new Object();
for($k=0;$k<$g_fmacas_total_row_count;$k++)
{
if(document.getElementById("fmacas_FCSTATUS_check_"+$k).checked != document.getElementById("fmacas_FCSTATUS_checkH_"+$k).checked)
{
if(document.getElementById("fmacas_FCSTATUS_check_"+$k).checked)
$checked_subjects += trim($("#fmacas_FSUBCODE_"+$k).html())+'*';
if(!document.getElementById("fmacas_FCSTATUS_check_"+$k).checked)
$unchecked_subjects += trim($("#fmacas_FSUBCODE_"+$k).html())+'*';
}
}
$g_fmacas_rem_sub = $checked_subjects;
$.ajax({
type: "POST",
data:"degree="+$("#fdegree").val()+"&exam_no="+document.getElementById('fexamno').value+"&rem_sub="+$g_fmacas_rem_sub+"&rem_unsub="+$unchecked_subjects+"&collcode="+document.getElementById('fcollcode').value+"&fevent="+document.getElementById('fevent').value,
url: $host_url+"savefreezeSubject.demo",
success: savefreezeSubjectResponce
});
}
if(document.getElementById('fevent').value == 'PRM')
{
var chkCnt = 0;
var j =0;
//alert(totallength);
var freeze = new Array();
var printfreeze = new Array();
var batch = new Array();
var subcode = new Array();
$freez_subjects = '';
$unfreez_subjects = '';
$prifreez_subjects = '';
$unprifreez_subjects = '';
$arr = new Object();
for($k=0;$k<totallength;$k++)
{
if(document.getElementById("freeze"+$k).checked != document.getElementById("freezeH"+$k).checked)
{
if(document.getElementById("freeze"+$k).checked)
$freez_subjects += trim($("#freeze"+$k).val())+'*';
if(!document.getElementById("freeze"+$k).checked)
$unfreez_subjects += trim($("#freeze"+$k).val())+'*';
}
if(document.getElementById("printfreeze"+$k).checked != document.getElementById("printfreezeH"+$k).checked)
{
if(document.getElementById("printfreeze"+$k).checked)
$prifreez_subjects += trim($("#printfreeze"+$k).val())+'*';
if(!document.getElementById("printfreeze"+$k).checked)
$unprifreez_subjects += trim($("#printfreeze"+$k).val())+'*';
}
}
$.ajax({
type: "POST",
data:"degree="+$("#fdegree").val()+"&exam_no="+$("#fexamno").val()+"&collcode="+$("#fcollcode").val()+"&prfreezesub="+$freez_subjects+"&printfreeze="+$prifreez_subjects+"&unprfreezsub="+$unfreez_subjects+"&unprintfreeze="+$unprifreez_subjects,
url: $host_url+"saveprfreezeSubject.demo",
success: savefreezeSubjectResponce
});
}
}
function savefreezeSubjectResponce($responce)
{
$responce = eval('(' + $responce + ')');
alert($responce.data);
document.getElementById('fmacas_module_subject_data').innerHTML = '';
}
function checkAllFamuFcSubjects($id)
{
if(document.getElementById($id).checked)
{
for($k=0;$k<$g_fmacas_total_row_count;$k++)
{
document.getElementById("fmacas_FCSTATUS_check_"+$k).checked=true;
}
}
else
{
for($k=0;$k<$g_fmacas_total_row_count;$k++)
{
document.getElementById("fmacas_FCSTATUS_check_"+$k).checked=false;
}
}
}
function to_upperx(id)
{
var x = document.getElementById(id).value;
document.getElementById(id).value = x.toUpperCase();
}
|