// ===================
$("#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 publish_date = encodeURIComponent($("#date").val());
	var atd_from = encodeURIComponent($("#atd_from").val());
	var atd_to = encodeURIComponent($("#atd_to").val());
	var mod_id = $("#mod_id").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+"&publish_date="+publish_date+"&atd_from="+atd_from+"&atd_to="+atd_to+"&operation="+operation+"&mod_id="+mod_id;
	//alert(datastr_sc);
	
	//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 if(publish_date==""){
		alert("Select Publish Date");
		$('#date').focus();
		return false;
	}
	else if(atd_from==""){
		alert("Select Attendance Start Date");
		$('#atd_from').focus();
		return false;
	}
	else if(atd_to==""){
		alert("Select Attendance End Date");
		$('#atd_to').focus();
		return false;
	}

	else{
		//$(".show_Section_trabulation").load("module/exam/result_publish.php",datastr_sc);

		$.ajax({
			type:"get",
			url:"module/exam/result_publish.php",
			data:datastr_sc ,
			success:function(result){
				alert(result);
			}
		});

	}


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

// ================================
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);
}