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.190.239.189
var urlarr = window.location.pathname.split('/');
var $url="http://"+window.location.host+"/";
var $hoststr = '';
for(var j=1;j<urlarr.length-1;j++)
{
$hoststr += window.location.pathname.split('/')[j]+"/";
}
$host_url = $url+$hoststr+"app.php?a=";
$image_path = $url+$hoststr+"jqGrid3.5/cmes/tarka/images/";
function loadhomedropdown()
{
$("#TDISABILITY").hide();
$("#PDISABILITY").hide();
$.ajax({
type: "POST",
async:false,
url:$host_url+'getdropdown',
success: function getcatcoderesponce(responce)
{
responce = eval('(' + responce + ')');
document.getElementById("S3").options.length = 0;
var catcode =responce.data['catcode'];
$op = new Option("Select Category","#");
$op.id=0;//specifying the id for options
document.getElementById("S3").options.add($op)
for($i=0;$i < catcode.length;$i++)
{
$op = new Option(catcode[$i]['value'], catcode[$i]['internal_code']);
$op.id=catcode[$i]['internal_code'];//specifying the id for options
document.getElementById("S3").options.add($op);
}
document.getElementById("1S1").options.length = 0;
var post =responce.data['post'];
setCookie('post',post);
$op = new Option("Select Post","");
$op.id=0;//specifying the id for options
document.getElementById("1S1").options.add($op)
for($i=0;$i < post.length;$i++)
{
$op = new Option(post[$i]['value'], post[$i]['internal_code']);
$op.id=post[$i]['internal_code'];//specifying the id for options
document.getElementById("1S1").options.add($op);
}
document.getElementById("1S2").options.length = 0;
var course =responce.data['course'];
setCookie('course',course);
$op = new Option("Select Qualifying Exam",'');
$op.id=0;//specifying the id for options
document.getElementById("1S2").options.add($op)
for($i=0;$i < course.length;$i++)
{
$op = new Option(course[$i]['value'], course[$i]['internal_code']);
$op.id=course[$i]['internal_code'];//specifying the id for options
document.getElementById("1S2").options.add($op);
}
}
});
getDocumentsTable();
}
function postdeportment()
{
$.ajax({
type: "POST",
async:false,
url:$host_url+'getdropdown',
success: function getcatcoderesponce(responce)
{
responce = eval('(' + responce + ')');
document.getElementById("S3").options.length = 0;
var catcode =responce.data['catcode'];
$op = new Option("Select Category",0);
$op.id=0;//specifying the id for options
document.getElementById("S3").options.add($op)
for($i=0;$i < catcode.length;$i++)
{
$op = new Option(catcode[$i]['value'], catcode[$i]['internal_code']);
$op.id=catcode[$i]['internal_code'];//specifying the id for options
document.getElementById("S3").options.add($op);
}
}
});
}
function enableappeared(id)
{
//$("input[name=fqualify]:checked").val();
if(document.getElementById(id).value == 'T')
{
$("#TDISABILITY").show();
$("#PDISABILITY").show();
}else
{
$("#TDISABILITY").hide();
$("#PDISABILITY").hide();
}
}
function savepersonaldetails()
{
var myobject = {};
fldorder = 'T1,T2,T3,T4,T5,T6,T7,T8,T9,T11,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26';
mandfields = 'T1';
fieldarr = fldorder.split(",");
myobject = onsavevalidate.call(myobject, 999);
if (myobject != 999)
{
document.getElementById(myobject).focus();
return false;
}
var fieldarrval = new Object();
for(i=0; i<fieldarr.length; i++)
{
fieldarrval[fieldarr[i]] = document.getElementById(fieldarr[i]).value;
}
var fqualify = $('input[name=fqualify]:checked').val();
var fcatcode = document.getElementById('S3').value;
var fieldarrvalue = encodeURIComponent(JSON.stringify(fieldarrval));
//var data = "fieldarrvalue="+fieldarrvalue;
var inputFileds = document.getElementsByTagName('input');
var chkCnt = 0;
var rowCnt = 0;
var foreign_arr = {};
for (var counter=0; counter < inputFileds.length; counter++)
{
if ( inputFileds[counter].type.toUpperCase()=='TEXT' && inputFileds[counter].name == "language" )
{
++rowCnt;
if(document.getElementById(rowCnt+'HT3').value != 'T')
{
++chkCnt;
foreign_arr[chkCnt] = new Object();
foreign_arr[chkCnt]['spoken'] = document.getElementById(rowCnt+'HT1').value;
foreign_arr[chkCnt]['written'] = document.getElementById(rowCnt+'HT2').value;
}
}
}
if(Object.size(fieldarrval)>0)
{
$.ajax({
type: "POST",
url: $host_url+"savepersonaldetails",
data:"fieldarrvalue="+fieldarrvalue+"&fqualify="+fqualify+"&fcatcode="+fcatcode+"&foreign_arr="+encodeURIComponent(JSON.stringify(foreign_arr)),
success:savepersonaldetailsuccess
});
}
}
function savepersonaldetailsuccess($responce)
{
$responce = eval('(' + $responce + ')');
if($responce.error_code==0)
{
alert($responce.data);
return;
}
else
{
alert($responce.data);
return;
}
}
/* function saveeducationaldetails()
{
var myobject = {};
fldorder = 'T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44,T45,T46,T47,T48,T49,T50';
fldorder +=',T51,T52,T53,T54,T55,T56,T57,T58,T59,T60,T61,T62,T63,T64,T65,T66,T67,T68,T69,T70,T71,T72,T73,T74,T75,T76,T77,T78,T79,T80';
mandfields = 'T28';
var fieldarrval = new Object();
fieldarr = fldorder.split(",");
myobject = onsavevalidate.call(myobject, 999);
if (myobject != 999)
{
document.getElementById(myobject).focus();
return false;
}
for(i=0; i<fieldarr.length; i++)
{
fieldarrval[fieldarr[i]] = document.getElementById(fieldarr[i]).value;
}
var fieldarrvalue = encodeURIComponent(JSON.stringify(fieldarrval));
if(Object.size(fieldarrval)>0)
{
$.ajax({
type: "POST",
url: $host_url+"saveeducationaldetails",
data:"fieldarrvalue="+fieldarrvalue,
success:saveeducationaldetailsssuccess
});
}
}
function saveeducationaldetailsssuccess()
{
} */
function saveeducationaldetails()
{
var myobject = {};
fldorder = 'T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,TBA42,T42,T43,T44,T45,T46,T47,T48,T49,T50';
fldorder +=',T51,T52,T53,T54,T55,T56,T57,T58,T59,T60,T61,T62,T63,T64,T65,T66,T67,T68,T69,T70,T71,T72,T73,T74,T75,T76,T77,T78,T79,T80';
mandfields = 'T28';
var fieldarrval = new Object();
fieldarr = fldorder.split(",");
myobject = onsavevalidate.call(myobject, 999);
if (myobject != 999)
{
document.getElementById(myobject).focus();
return false;
}
for(i=0; i<fieldarr.length; i++)
{
fieldarrval[fieldarr[i]] = document.getElementById(fieldarr[i]).value;
}
var fieldarrvalue = encodeURIComponent(JSON.stringify(fieldarrval));
if(Object.size(fieldarrval)>0)
{
$.ajax({
type: "POST",
url: $host_url+"saveeducationaldetails",
data:"fieldarrvalue="+fieldarrvalue,
success:saveeducationaldetailsssuccess
});
}
}
function saveeducationaldetailsssuccess($responce)
{
$responce = eval('(' + $responce + ')');
if($responce.error_code==0)
{
alert($responce.data);
return;
}
else
{
alert($responce.data);
return;
}
}
function saveexperiencedetails()
{
var myobject = {};
fldorder = 'T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44,T45,T46,T47,T48,T49,T50';
fldorder +=',T51,T52,T53,T54,T55,T56,T57,T58,T59,T60,T61,T62,T63,T64,T65,T66,T67,T68,T69,T70,T71,T72,T73,T74,T75,T76,T77,T78,T79,T80';
mandfields = 'T28';
var fieldarrval = new Object();
fieldarr = fldorder.split(",");
myobject = onsavevalidate.call(myobject, 999);
if (myobject != 999)
{
document.getElementById(myobject).focus();
return false;
}
for(i=0; i<fieldarr.length; i++)
{
fieldarrval[fieldarr[i]] = document.getElementById(fieldarr[i]).value;
}
//////////////////////======to read multiple records====///////////
var inputFileds = document.getElementsByTagName('input');
var chkCnt = 0;
var rowCnt = 0;
var foreign_arr = {};
for (var counter=0; counter < inputFileds.length; counter++)
{
if ( inputFileds[counter].type.toUpperCase()=='TEXT' && inputFileds[counter].name == "foreignvisit" )
{
++rowCnt;
if(document.getElementById(rowCnt+'IT7').value != 'T')
{
++chkCnt;
foreign_arr[chkCnt] = new Object();
foreign_arr[chkCnt]['course'] = document.getElementById(rowCnt+'IT1').value;
foreign_arr[chkCnt]['purpose'] = document.getElementById(rowCnt+'IT2').value;
foreign_arr[chkCnt]['from'] = document.getElementById(rowCnt+'IT3').value;
foreign_arr[chkCnt]['to'] = document.getElementById(rowCnt+'IT4').value;
foreign_arr[chkCnt]['total'] = document.getElementById(rowCnt+'IT5').value;
foreign_arr[chkCnt]['period'] = document.getElementById(rowCnt+'IT6').value;
}
}
}
var dataString ="&array="+encodeURIComponent(JSON.stringify(foreign_arr));
$.ajax({
type:"POST",
url:$host_url+"saveDetailsofForeignvisit",
data:dataString,
cache:false,
success:function($responce)
{
$responce = eval('('+$responce+')');
if($responce.error_code == 0)
{
alert($responce.data);
}
else
alert($responce.data);
}
});
alert(Object.size(fieldarrval));
}
function savepublicationdetails()
{
var myobject;
fldorder = 'S1,S2,S3,S4,S6,S8,S12,S9,S10,S11,S12,S13,S14,S15,S16,S17,S18,S19,S20,S21,S22,S23';
mandfields = 'S1,S2,S3,S4,S6,S19,S20,S21,S22,S23';
myobject = onsavevalidate.call(myobject, 999);
if (myobject != 999)
{
document.getElementById(myobject).focus();
return false;
}
//////To get Multiple Records///////
var inputFileds = document.getElementsByTagName('input');
var chkCnt = 0;
var rowCnt = 0;
var foreign_arr = {};
for (var counter=0; counter < inputFileds.length; counter++)
{
if ( inputFileds[counter].type.toUpperCase()=='TEXT' && inputFileds[counter].name == "researchproj" )
{
++rowCnt;
if(document.getElementById(rowCnt+'IT7').value != 'T')
{
++chkCnt;
foreign_arr[chkCnt] = new Object();
foreign_arr[chkCnt]['course'] = document.getElementById(rowCnt+'IT1').value;
foreign_arr[chkCnt]['purpose'] = document.getElementById(rowCnt+'IT2').value;
foreign_arr[chkCnt]['from'] = document.getElementById(rowCnt+'IT3').value;
foreign_arr[chkCnt]['to'] = document.getElementById(rowCnt+'IT4').value;
foreign_arr[chkCnt]['total'] = document.getElementById(rowCnt+'IT5').value;
foreign_arr[chkCnt]['period'] = document.getElementById(rowCnt+'IT6').value;
}
}
}
var dataString ="&array="+encodeURIComponent(JSON.stringify(foreign_arr));
$.ajax({
type:"POST",
url:$host_url+"saveDetailsofForeignvisit",
data:dataString,
cache:false,
success:function($responce)
{
$responce = eval('('+$responce+')');
if($responce.error_code == 0)
{
alert($responce.data);
}
else
alert($responce.data);
}
});
}
function saveforeignvisit()
{
var myobject;
fldorder = 'S1,S2,S3,S4,S6,S8,S12,S9,S10,S11,S12,S13,S14,S15,S16,S17,S18,S19,S20,S21,S22,S23';
mandfields = 'S1,S2,S3,S4,S6,S19,S20,S21,S22,S23';
myobject = onsavevalidate.call(myobject, 999);
if (myobject != 999)
{
document.getElementById(myobject).focus();
return false;
}
}
function savereferences()
{
var myobject;
fldorder = 'S24,S25,S26,S27,S28,S29,S30,S31,S32,S33,S34,S35,S36,S37,S38,S39,S40,S41';
mandfields = 'S24,S27,S30,S33,S36,S39';
var fieldarrval = new Object();
fieldarr = fldorder.split(",");
myobject = onsavevalidate.call(myobject, 999);
if (myobject != 999)
{
document.getElementById(myobject).focus();
return false;
}
for(i=0; i<fieldarr.length; i++)
{
fieldarrval[fieldarr[i]] = document.getElementById(fieldarr[i]).value;
}
var fieldarrvalue = encodeURIComponent(JSON.stringify(fieldarrval));
var inputFileds = document.getElementsByTagName('input');
var chkCnt = 0;
var rowCnt = 0;
var foreign_arr = {};
for (var counter=0; counter < inputFileds.length; counter++)
{
if ( inputFileds[counter].type.toUpperCase()=='TEXT' && inputFileds[counter].name == "foreignvisit" )
{
++rowCnt;
if(document.getElementById(rowCnt+'IT7').value != 'T')
{
++chkCnt;
foreign_arr[chkCnt] = new Object();
foreign_arr[chkCnt]['course'] = document.getElementById(rowCnt+'IT1').value;
foreign_arr[chkCnt]['purpose'] = document.getElementById(rowCnt+'IT2').value;
foreign_arr[chkCnt]['from'] = document.getElementById(rowCnt+'IT3').value;
foreign_arr[chkCnt]['to'] = document.getElementById(rowCnt+'IT4').value;
foreign_arr[chkCnt]['total'] = document.getElementById(rowCnt+'IT5').value;
foreign_arr[chkCnt]['period'] = document.getElementById(rowCnt+'IT6').value;
}
}
}
// var dataString ="&foreign_arr="+encodeURIComponent(JSON.stringify(foreign_arr));
if(Object.size(fieldarrval)>0)
{
$.ajax({
type: "POST",
url: $host_url+"savereferences",
data:"fieldarrvalue="+fieldarrvalue+"&array="+encodeURIComponent(JSON.stringify(foreign_arr)),
success:savereferencessssuccess
});
}
}
function savereferencessssuccess($responce)
{
$responce = eval('(' + $responce + ')');
if($responce.error_code==0)
{
alert($responce.data);
return;
}
else
{
alert($responce.data);
return;
}
}
function DisplayUserSelectedPhoto()
{
var filepath;
var valid_file_extentions = new Array("jpg","jpeg");
var ext=$("#student_photo_upload").val();
filepath=ext;
ext = ext.substring(ext.length-3,ext.length);
ext = ext.toLowerCase();
if(ext != "" && !in_array(ext,valid_file_extentions))
{
alert("Select valid photo file(accepts only jpg or jpeg)");
$("#student_photo_upload").val('')
return false;
}
var lstr_data="filepath="+filepath;
$upload = $host_url+"saveUserSelectedPhoto&"+lstr_data;
//$.blockUI({ message: "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>" });
document.getElementById("form_module_image_upload").setAttribute("action",$upload);
return AIM.submit(document.getElementById("form_module_image_upload"), 'same_tab',{'onComplete' : DiaplayUserSelectedPhotoResponse});
}
function DiaplayUserSelectedPhotoResponse($responce)
{
$responce = eval('(' + $responce + ')');
// $.unblockUI();
$("#student_photo").attr("src","img/default_photo.jpg");
if($responce.error_code==0)
{
$("#student_photo").attr("src", $responce.data);
}
else if($responce.error_code==-1)
$("#student_photo").attr("src", "img/default_photo.jpg");
else if($responce.error_code==-2)
{
alert($responce.data);
$("#student_photo").attr("src", "img/default_photo.jpg");
$("#student_photo_upload").val("");
}
}
function DisplayUserSelectedSign()
{
var filepath;
var valid_file_extentions = new Array("jpg","jpeg");
var ext = $("#student_sign_upload").val();
filepath = ext;
ext = ext.substring(ext.length-3,ext.length);
ext = ext.toLowerCase();
if(ext != "" && !in_array(ext,valid_file_extentions))
{
alert("Select valid sign file(accepts only jpg or jpeg)");
$("#student_sign_upload").val('')
return false;
}
var lstr_data="filepath="+filepath;
$upload = $host_url+"saveUserSelectedSign&"+lstr_data;
//$.blockUI({ message: "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>" });
document.getElementById("form_module_image_upload").setAttribute("action",$upload);
return AIM.submit(document.getElementById("form_module_image_upload"), 'same_tab',{'onComplete' : DiaplayUserSelectedSignResponse});
}
function DiaplayUserSelectedSignResponse($responce)
{
$responce = eval('(' + $responce + ')');
// $.unblockUI();
$("#student_sign").attr("src","img/default_photo.jpg");
if($responce.error_code==0)
{
$("#student_sign").attr("src", $responce.data);
}
else if($responce.error_code==-1)
$("#student_sign").attr("src", "img/signature.png");
else if($responce.error_code==-2)
{
alert($responce.data);
$("#student_sign").attr("src", "img/signature.png");
$("#student_sign_upload").val("");
}
}
function saveDetailsofForeignvisit()
{
var inputFileds = document.getElementsByTagName('input');
var chkCnt = 0;
var rowCnt = 0;
var foreign_arr = {};
for (var counter=0; counter < inputFileds.length; counter++)
{
if ( inputFileds[counter].type.toUpperCase()=='TEXT' && inputFileds[counter].name == "foreignvisit" )
{
++rowCnt;
if(document.getElementById(rowCnt+'IT7').value != 'T')
{
++chkCnt;
foreign_arr[chkCnt] = new Object();
foreign_arr[chkCnt]['country'] = document.getElementById(rowCnt+'IT1').value;
foreign_arr[chkCnt]['purpose'] = document.getElementById(rowCnt+'IT2').value;
foreign_arr[chkCnt]['from'] = document.getElementById(rowCnt+'IT3').value;
foreign_arr[chkCnt]['to'] = document.getElementById(rowCnt+'IT4').value;
foreign_arr[chkCnt]['total'] = document.getElementById(rowCnt+'IT5').value;
foreign_arr[chkCnt]['period'] = document.getElementById(rowCnt+'IT6').value;
}
}
}
var dataString ="&foreign_arr="+encodeURIComponent(JSON.stringify(foreign_arr));
$.ajax({
type:"POST",
url:$host_url+"saveDetailsofForeignvisit",
data:dataString,
cache:false,
success:function($responce)
{
$responce = eval('('+$responce+')');
if($responce.error_code == 0)
{
alert($responce.data);
}
else
alert($responce.data);
}
});
}
function savepostdetails()
{
var myobject;
fldorder = '1S1,1S2';
mandfields = '1S1,1S2';
myobject = onsavevalidate.call(myobject, 999);
if (myobject != 999)
{
document.getElementById(myobject).focus();
return false;
}
//alert( document.getElementById("student_photo").src);
if($("#student_photo").val() == 'default_photo.jpg')
{
alert("Select valid photo file(accepts only jpg or jpeg)");
$("#student_photo_upload").val('')
return false;
}
if($("#student_sign").val() == 'signature.png')
{
alert("Select valid sign file(accepts only jpg or jpeg)");
$("#student_sign_upload").val('')
return false;
}
var inputFileds = document.getElementsByTagName('input');
var chkCnt = 0;
var rowCnt = 0;
var post_arr = {};
for (var counter=0; counter < inputFileds.length; counter++)
{
if ( inputFileds[counter].type.toUpperCase()=='HIDDEN' && inputFileds[counter].name == "postname" )
{
++rowCnt;
if(document.getElementById(rowCnt+'HS3').value != 'T')
{
++chkCnt;
if(trim(document.getElementById(chkCnt+"S1").value) == '')
{
alert("Select Post");
document.getElementById(chkCnt+"S1").focus();
return false;
}
if(trim(document.getElementById(chkCnt+"S2").value) == '')
{
alert("Select Qualifying Exam");
document.getElementById(chkCnt+"S2").focus();
return false;
}
post_arr[chkCnt] = new Object();
post_arr[chkCnt]['post'] = document.getElementById(rowCnt+'S1').value;
post_arr[chkCnt]['course'] = document.getElementById(rowCnt+'S2').value;
}
}
}
var dataString ="&post_arr="+encodeURIComponent(JSON.stringify(post_arr));
$.ajax({
type:"POST",
url:$host_url+"savePostDetails",
data:dataString,
cache:false,
success:function($responce)
{
$responce = eval('('+$responce+')');
if($responce.error_code == 0)
{
alert($responce.data);
document.getElementById("ctab_post").className = "vsuccess";
}
else
alert($responce.data);
}
});
}
function uploadUserDoc(doc_id)
{
var ext = $("#"+doc_id).val();
var filepath = ext;
if(empty(filepath))
{
alert("please select the file!");
return false;
}
var list_data="";
list_data = $host_url+"uploadUserDoc";
list_data += "&filepath="+filepath;
list_data += "&doc_id="+doc_id;
document.getElementById("form_doc_upload").setAttribute("action",list_data);
return AIM.submit(document.getElementById("form_doc_upload"), 'report_display',{'onComplete' :uploadUserDocResponce});
}
function uploadUserDocResponce(responce)
{
responce = eval('(' +responce + ')');
var int_code=responce.data['id'];
var path=responce.data['path'];
var file_name=responce.data['file_name'];
var html='<input type="hidden" id="att_'+int_code+'" value="A" /><a target="_blank" href="'+path+'" style="color:#AB45F9; padding-right:5px;"><img src="images/file-attachment.jpg"/></a>';
$("#attach_td_"+int_code).html(html);
$("#ed_"+int_code).focus();
}
function getDocumentsTable()
{
$.ajax({
type: "POST",
url:$host_url+'getDocumentsTable',
success: function GetCMSAmountValueResponce(responce)
{
try
{
responce = eval('(' + responce + ')');
$("#doc_table").append(responce.data);
}
catch(err)
{
txt= err.message;
}
}
});
}
|