$("#subject_atd_create").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 operation="subject_atd_create";
	
	var dataStr="operation="+operation+"&class_id="+class_id+"&department_id="+department_id+"&section_id="+section_id;
	var dataStr1="class_id="+class_id+"&section_id="+section_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{
		$.ajax({
			type:"post",
			url:"module/attendance/daily_attendance_subject_status.php",
			data:dataStr ,
			success:function(st){
				//alert(st);
				$(".data_to_show_atd_sub").load("module/attendance/daily_attendance_subject_status_view.php",dataStr1);

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

// ============================================

function Attendanch_Sheet_subject(sub_id,section_id,atd_status_id){
	var datastr_sc="section_id="+section_id+"&sub_id="+sub_id+"&atd_status_id="+atd_status_id;
	$(".data_to_show_atd_sub").load("module/attendance/get_attendance_sheet_subject.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);
}