function call_info(id,pre,type){

var total_row = $( "#total_row" ).val();
alert(total_row);

}

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

$("#btn_save_promossion").click(function(){

	var total_row = $('input[name="total_row"]').val();
	var pre_sec_id = $('input[name="pre_sec_id"]').val();
	var uniq_id = $('input[name="uniq_id"]').val();

	

	//alert(pre_sec_id);

	var operation = 'promossion';
	
	for (i = 1; i <= total_row; i++) {
		var id = $('input[name="base_info_id_'+i+'"]').val();
		var sec_id = $('select[name="section_'+i+'"] option:selected').val();

		//var dataStr="operation="+operation+"&id="+id+"&sec_id="+sec_id;
		var sec_session = $('select[name="session_'+i+'"] option:selected').val();

		var dataStr="operation="+operation+"&id="+id+"&sec_id="+sec_id+"&session="+sec_session;


		$.ajax({
			type:"post",
			url:"module/exam/update_ajax.php",
			data:dataStr ,
			success:function(s){
				//alert(result);
				var datastr="section_id="+pre_sec_id+"&uniq_id="+uniq_id;
				$(".section_std_list").load("module/exam/student_per.php",datastr);
			
			}
		});
	}
});


// ===========================================
function call_m_info(id,pre,type){
	var m_branch = $( "#m_branch" ).val();
	var m_shift = $( "#m_shift" ).val();
	var m_medium = $( "#m_medium" ).val();
	var m_class = $( "#m_class" ).val();
	var m_dept = $( "#m_dept" ).val();
	var m_std_type = $( "#m_std_type" ).val();
	var m_section = $( "#m_section" ).val();
var m_session = $( "#m_session" ).val();
	//alert(m_branch);
	
	if(type=='br'){
		var datastr="id="+id+"&pre="+pre+"&type="+type;

		$(".branch").load("module/exam/get_won_basic_info.php",datastr);
		$(".m_shift").load("module/exam/get_basic_info.php",datastr);
		$(".shift").load("module/exam/get_basic_info.php",datastr);

		$(".m_medium").load("module/exam/get_null_info.php",datastr);
		$(".medium").load("module/exam/get_null_info.php",datastr);

		$(".m_class").load("module/exam/get_null_info.php",datastr);
		$(".class").load("module/exam/get_null_info.php",datastr);

		$(".m_dept").load("module/exam/get_null_info.php",datastr);
		$(".dept").load("module/exam/get_null_info.php",datastr);

		$(".m_std_type").load("module/exam/get_null_info.php",datastr);
		$(".std_type").load("module/exam/get_null_info.php",datastr);

		$(".m_section").load("module/exam/get_null_info.php",datastr);
		$(".section").load("module/exam/get_null_info.php",datastr);

	}
	else if(type=='sh'){
		var datastr="id="+id+"&pre="+m_branch+"&type="+type;

		$(".shift").load("module/exam/get_won_basic_info.php",datastr);
		$(".m_medium").load("module/exam/get_basic_info.php",datastr);
		$(".medium").load("module/exam/get_basic_info.php",datastr);

		$(".m_class").load("module/exam/get_null_info.php",datastr);
		$(".class").load("module/exam/get_null_info.php",datastr);

		$(".m_dept").load("module/exam/get_null_info.php",datastr);
		$(".dept").load("module/exam/get_null_info.php",datastr);

		$(".m_std_type").load("module/exam/get_null_info.php",datastr);
		$(".std_type").load("module/exam/get_null_info.php",datastr);

		$(".m_section").load("module/exam/get_null_info.php",datastr);
		$(".section").load("module/exam/get_null_info.php",datastr);

	}

	else if(type=='me'){
		var datastr="id="+id+"&pre="+m_shift+"&type="+type;

		$(".medium").load("module/exam/get_won_basic_info.php",datastr);
		$(".m_class").load("module/exam/get_basic_info.php",datastr);
		$(".class").load("module/exam/get_basic_info.php",datastr);

		$(".m_dept").load("module/exam/get_null_info.php",datastr);
		$(".dept").load("module/exam/get_null_info.php",datastr);

		$(".m_std_type").load("module/exam/get_null_info.php",datastr);
		$(".std_type").load("module/exam/get_null_info.php",datastr);

		$(".m_section").load("module/exam/get_null_info.php",datastr);
		$(".section").load("module/exam/get_null_info.php",datastr);

	}

	else if(type=='cl'){
		var datastr="id="+id+"&pre="+m_medium+"&type="+type;

		$(".class").load("module/exam/get_won_basic_info.php",datastr);
		$(".m_dept").load("module/exam/get_basic_info.php",datastr);
		$(".dept").load("module/exam/get_basic_info.php",datastr);

		$(".m_std_type").load("module/exam/get_null_info.php",datastr);
		$(".std_type").load("module/exam/get_null_info.php",datastr);

		$(".m_section").load("module/exam/get_null_info.php",datastr);
		$(".section").load("module/exam/get_null_info.php",datastr);

	}

	else if(type=='dp'){
		var datastr="id="+id+"&pre="+m_class+"&type="+type;

		$(".dept").load("module/exam/get_won_basic_info.php",datastr);
		$(".m_std_type").load("module/exam/get_basic_info.php",datastr);
		$(".std_type").load("module/exam/get_basic_info.php",datastr);

		$(".m_section").load("module/exam/get_null_info.php",datastr);
		$(".section").load("module/exam/get_null_info.php",datastr);

	}

	else if(type=='st'){
		var datastr="id="+id+"&pre="+m_dept+"&type="+type;

		$(".std_type").load("module/exam/get_won_basic_info.php",datastr);
		$(".m_section").load("module/exam/get_basic_info.php",datastr);
		$(".section").load("module/exam/get_basic_info.php",datastr);

	}

	else if(type=='sc'){
		var datastr="id="+id+"&pre="+m_std_type+"&type="+type;

		$(".section").load("module/exam/get_won_basic_info.php",datastr);
	}



else if(type=='se'){
		var datastr="id="+id+"&pre="+m_std_type+"&type="+type+"&session="+m_session;

		$(".session").load("module/exam/get_session_info.php",datastr);
	}
	




}



































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

// ===============
function call_std_list(id){
	var datastr="uniq_id="+id;
	// alert(datastr);
	// exit();
	$(".section_std_list").load("module/exam/student_per.php",datastr);
}




function edit_rutine_data(id){
	var datastr1="routine_id="+id;
	
	$("#model_rutine_value").load("module/settings/class_routine_edit.php",datastr1);
	
}


