<?php
session_start();
include("../../php_crud/my_class.php");
$obj=new my_class();
extract($_POST);

if($form_type=='student_fee_info'){
	//echo "hello: student_fee_info";
	//print_r($fh);
	foreach($fh AS $index=>$value){
	//echo $value['tbl_id'];
//	echo "<br/>";
		if($value['ac_fee_type']=="Month" || $value['ac_fee_type']=="Monthly"){
            $value['ac_fee_type']="M";
		}else{
            $value['ac_fee_type']="O";
		}
		$condition="_std_id='$p_id' and _fee_head_id='".$value['ac_feehead_name']."'";
		if($value['tbl_id']!=0){
			$form_data=array(
						'_fee_head_id'=>$value['ac_feehead_name'],
						'_fee_amount'=>$value['ac_fee_amount'],
						'_update_date'=>date("Y:m:d h:i:s"),
						'_update_by'=>$_SESSION['LOGIN_USERID']
						);	
			$entry10=$obj->Update_Data('_pf_student_fee_assign', $form_data, "_id=".$value['tbl_id']);
		}
		else{
			$form_data=array(
						'_std_id'=>$p_id,
						'_dept_id'=>$dept_id,
						'_fee_type'=>$value['ac_fee_type'],
						'_fee_head_id'=>$value['ac_feehead_name'],
						'_fee_amount'=>$value['ac_fee_amount'],
						'_entry_by'=>$_SESSION['LOGIN_USERID'],
						'_entry_date'=>date("Y:m:d h:i:s"),
						'_status'=>'A',
						'_year'=>$fee_year
						);
			$entry10=$obj->Insert_Data_By_Cond('_pf_student_fee_assign', $form_data,$condition);
		}
	}
	echo 1;
}
if($form_type=='delete'){
	$delete=$obj->Delete_Data($table_name,"_id='".$tbl_id."'");
}
?>