0xV3NOMx
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.129.71.13


Current Path : /proc/thread-self/root/var/www/html/ssa/js_16042016/
Upload File :
Current File : //proc/thread-self/root/var/www/html/ssa/js_16042016/uploadStudentPhotos.js

function CalluploadStudentPhotos()
{ 
	$("#page_main_div").load('html_modules/upload_studentphoto.html',function()
	{	
 
	document.getElementById('display_module_name').innerHTML = 'Upload Photo';
	document.getElementById('module_name_for_save').value = 'Upload Photo';	 	
	clearCalluploadStudentPhotos();
	getDefaultHeadFooterLinks("Upload Photo");
	var userType = getCookie("user_type");
	userType =userType.toLowerCase();
	if(userType == 'lsys')
		$("#photo_download").show();
	else
		$("#photo_download").hide();
	}
	);
  // $('#module_details_div').hide();	


}

function clearCalluploadStudentPhotos()
{
	$("#degree_code").val('');
	$("#degree_code").focus();
}

function viewUploadStudentPhoto()
{
	if(trim($('#degree_code').val()) == '')
	{
		alert("Enter Degree Code ");		
		$("#degree_code").focus();
		return;
	}
	if(trim($('#uploadPhoto_regno_start_from').val()) =='')
	{
		alert("Enter Register / Roll Number ");		
		$("#uploadPhoto_regno_start_from").focus();
		return;
	}
	$.blockUI({ message: "<h1 class='h1' style='font-size:12px'><img src='images/ajax-loader.gif' border='0'></h1>" });
	var dataString="degreeCode="+$('#degree_code').val() +"&regStart="+$('#uploadPhoto_regno_start_from').val()+"&regEnd="+$('#uploadPhoto_regno_end_to').val();
	$.ajax({
	       type: "POST",
	       data:dataString,
	       url: $host_url+"viewStudInfoToupload",
 	       success: viewStudInfoTouploadResponse
	    });
}

function viewStudInfoTouploadResponse($responce)
{

	$responce = eval('('+$responce+')');
	$.unblockUI();
	if($responce.error_code==-1)
	{
		alert($responce.data);
	}
	else
	{
	$("#uploadPh_studlist").show();
	$("#uploadPh_studlist").html($responce.data['html']);
	}

}	

var regnumb;
function UserSelectedPhotoDisplay(file,index)
{	
		var valid_file_extentions = new Array("jpeg","jpg",'png','gif');
		var filepath=$("#"+file.id).val();
		var regno=$("#hd_regno_"+index).val();
		var ext = filepath.substring(filepath.length-3,filepath.length);
		ext = ext.toLowerCase();  
		if(ext != "" && !in_array(ext,valid_file_extentions))
	    {	      
			alert("Please Select the Valid Photo!");
			$("#stud_uploadfile_"+index).val('')
		 return false;
		}
		//readURL(file,index);
		var lstr_data="&filepath="+filepath+"&index="+index+"&regno="+regno;		
		$upload = $host_url+"UserSelectedPhotoDisplay&"+lstr_data;	
	    document.getElementById("form_module_image_upload").setAttribute("action",$upload);		
		return AIM.submit(document.getElementById("form_module_image_upload"), 'report_display',{'onComplete' : UserSelectedPhotoDisplayResponse});		 
 
}

function UserSelectedPhotoDisplayResponse($responce)
{

		$responce = eval('(' + $responce + ')'); 
	var row_index=$responce.data['index'];
	if($responce.error_code === 0)
	{	
		$("#student_entry_photo_"+row_index).attr("src", $responce.data['path']);
	}
	else if($responce.error_code === -1)
	{	
		alert($responce.data);
		$("#stud_uploadfile_"+row_index).val("");
	}
	else if($responce.error_code === -2)	
	{
		alert($responce.data);
		$("#student_entry_photo_"+row_index).attr("src", "images/default_photo.jpg");
		$("#stud_uploadfile_"+row_index).val("");
	}
}
	
function UserSelectedPhotoUpload(index)
{
		var valid_file_extentions = new Array("jpeg","jpg",'png','gif');
		var filepath=$("#stud_uploadfile_"+index).val();
		var regno=$("#hd_regno_"+index).val();
		var ext = filepath.substring(filepath.length-3,filepath.length);
		ext = ext.toLowerCase();  
		
		if(ext == "" || !in_array(ext,valid_file_extentions ) || ext =='default_photo.jpg')
		{	      
			alert("Select the Photo!");
			
		}
		else
		{
			$lstr_data="filepath="+filepath+"&index="+index+"&regno="+regno;
			$upload = $host_url+"saveUserSelectedPhotoUpload&"+$lstr_data;
			document.getElementById("form_module_image_upload").setAttribute("action",$upload);		
			return AIM.submit(document.getElementById("form_module_image_upload"), 'report_display',{'onComplete' : UserSelectedPhotoUploadResponse});		 
		}

}

function UserSelectedPhotoUploadResponse($responce)
{

	$responce = eval('(' + $responce + ')'); 
	alert($responce.data);
	
}

function downloadAllStudentPhotos()
{	
	if(trim($('#degree_code').val()) == '')
	{
		alert("Enter Degree Code ");		
		$("#degree_code").focus();
		return;
	}
	if(trim($('#uploadPhoto_regno_start_from').val()) =='')
	{
		alert("Enter Register / Roll Number ");		
		$("#uploadPhoto_regno_start_from").focus();
		return;
	}

		
		 window.location.href = $host_url+"downloadAllStudentPhotos.demo&degreeCode="+$('#degree_code').val() +"&regStart="+$('#uploadPhoto_regno_start_from').val()+"&regEnd="+$('#uploadPhoto_regno_end_to').val(); 

}