// ===================
/* $("#std_Section_final_trabulation").click(function(){

	var shift_id = $("#shift_id").val();
	var medium_id = $("#medium_id").val();
	var class_id = $("#class_id").val();
	var department_id = $("#department_id").val();
	var student_type_id = $("#student_type_id").val();
	var section_id = $("#section_id").val();
	//var exam_term_id = $("#exam_term_id").val();
	var exam_session = $("#exam_session").val();

	//var operation = 'insert';
	
	
	var datastr_sc = "shift_id="+shift_id+"&medium_id="+medium_id+"&class_id="+class_id+"&department_id="+department_id+"&student_type_id="+student_type_id+"&section_id="+section_id+"&exam_session="+exam_session;
    
//"shift_id="+shift_id+"&medium_id="+medium_id+"&class_id="+class_id+"&department_id="+department_id+"&student_type_id="+student_type_id+"&section_id="+section_id+"&exam_term_id="+exam_term_id+"&exam_session="+exam_session+"&operation="+operation;	
	

	if(shift_id==""){
		alert("Select Shift Name");
		$('#shift_id').focus();
		return false;
	}
	else if(medium_id==""){
		alert("Select Medium Name");
		$('#medium_id').focus();
		return false;
	}
	else if(class_id==""){
		alert("Select Class Name");
		$('#class_id').focus();
		return false;
	}
	else if(department_id==""){
		alert("Select Department Name");
		$('#department_id').focus();
		return false;
	}
	else if(student_type_id==""){
		alert("Select Student Type");
		$('#student_type_id').focus();
		return false;
	}
	else if(section_id==""){
		alert("Select Section Name");
		$('#section_id').focus();
		return false;
	}

	// else if(exam_term_id==""){
	// 	alert("Select Exam Term");
	// 	$('#exam_term_id').focus();
	// 	return false;
	// }
	else if(exam_session==""){
		alert("Select Exam Session");
		$('#exam_session').focus();
		return false;
	}

	else{



		$(".show_Section_final_trabulation").load("module/exam/get_final_trabulation.php",datastr_sc);

		$('#first_part').remove();
		$('#second_part').css("display","block");
				
	}


}); */
// =======================================



// ===================
$("#std_Section_trabulation").click(function(){

	var shift_id = $("#shift_id").val();
	var medium_id = $("#medium_id").val();
	var class_id = $("#class_id").val();
	var department_id = $("#department_id").val();
	var student_type_id = $("#student_type_id").val();
	var section_id = $("#section_id").val();
	var exam_term_id = $("#exam_term_id").val();
	var exam_session = $("#exam_session").val();

	var operation = 'insert';
	
	
	var datastr_sc = "shift_id="+shift_id+"&medium_id="+medium_id+"&class_id="+class_id+"&department_id="+department_id+"&student_type_id="+student_type_id+"&section_id="+section_id+"&exam_term_id="+exam_term_id+"&exam_session="+exam_session+"&operation="+operation;

	
	//var datastr_sc = "department_id="+department_id+"&section_id="+section_id+"&exam_term_id="+exam_term_id+"&exam_session="+exam_session+"&operation="+operation;
	
	/* for pdf */
	var dataStr_term_check = "exam_term_id="+exam_term_id;
	var final_sc = datastr_sc+"&"+dataStr_term_check;
	$('#pdf_gen').val(final_sc);
	/* ======== */
	
	
	//var dataStr_term_check = "exam_term_id="+exam_term_id;

	if(shift_id==""){
		alert("Select Shift Name");
		$('#shift_id').focus();
		return false;
	}
	else if(medium_id==""){
		alert("Select Medium Name");
		$('#medium_id').focus();
		return false;
	}
	else if(class_id==""){
		alert("Select Class Name");
		$('#class_id').focus();
		return false;
	}
	else if(department_id==""){
		alert("Select Department Name");
		$('#department_id').focus();
		return false;
	}
	/* else if(student_type_id==""){
		alert("Select Student Type");
		$('#student_type_id').focus();
		return false;
	} */
	else if(section_id==""){
		alert("Select Section Name");
		$('#section_id').focus();
		return false;
	}

	else if(exam_term_id==""){
		alert("Select Exam Term");
		$('#exam_term_id').focus();
		return false;
	}
	else if(exam_session==""){
		alert("Select Exam Session");
		$('#exam_session').focus();
		return false;
	}

	else{


		$.ajax({
			type:"post",
			url:"module/exam/get_term_type.php",
			data:dataStr_term_check ,
			success:function(term_type){

				//alert(term_type);

				if(term_type=='T'){
					$(".show_Section_trabulation").load("module/exam/subs_excel_download.php",datastr_sc);

					$('#first_part').remove();
					$('#second_part').css("display","block");
				}
				else if(term_type=='F'){

					$(".show_Section_trabulation").load("module/exam/get_trabulation_final_std_list.php",datastr_sc);

					$('#first_part').remove();
					$('#second_part').css("display","block");

				}

			}
		});



		




	}


});
// =======================================

// ================================
function call_medium(id){
	var datastr="shift_id="+id;
	$("#medium_id").load("module/settings/get_medium_list_for_form.php",datastr);
}
function call_class(id){
	var datastr="medium_id="+id;
	$("#class_id").load("module/settings/get_class_list_for_form.php",datastr);
}
function call_department(id){
	var datastr="class_id="+id;
	$("#department_id").load("module/settings/get_department_list_for_form.php",datastr);
}
function call_std_type(id){
		var datastr="department_id="+id;
	$("#student_type_id").load("module/settings/get_student_type_list_for_form.php",datastr);
}
function call_section(id){
		var datastr="student_type_id="+id;
	$("#section_id").load("module/settings/get_section_list_for_form.php",datastr);
}