<?php 
session_start();
// ============
include("../../asset/theme/css/myfunc.php");
include("../../php_crud/my_class.php");
$obj=new my_class();
// ============

$branchid = $_SESSION['LOGIN_BRANCH'];

extract($_POST);

if($oper=='insert'){
	$form_data = array(
		'_branch_id'=>$branchid,
		'_class_id'=>$class_id,
		'_section_id'=>$section_id,
		'_std_id'=>$std_id,
		'_scholar_amount'=>$sch_amount,
		'_purpose'=>$purpose,
		'_months'=>$month,
		'_session'=>$session,
		'_status'=>'A',
		'_entry_by'=>$_SESSION['LOGIN_USERID'],
		'_entry_date'=>date("Y:m:d h:i:s")
		);

	 $obj->Insert_Data("_int_scholarship_declare",$form_data);

}





if($oper=='update'){
	$form_data = array(
		'_branch_id'=>$branchid,
		'_class_id'=>$class_id,		
		'_std_id'=>$std_id,
		'_section_id'=>$section_id,
		'_scholar_amount'=>$sch_amount,
		'_purpose'=>$purpose,
		'_months'=>$month,
		'_session'=>$session,
		'_status'=>'A',
		'_update_by'=>$_SESSION['LOGIN_USERID'],
		'_entry_date'=>date("Y:m:d h:i:s")
		);


  $update= $obj->Update_Data("_int_scholarship_declare", $form_data,"WHERE _id='$id'");

  if($update){
				echo "scholarship Updated";
			}
			else{
				echo "Update Faild";
			}

}

?>
<?php

if($oper=='delete'){


 	$delete=$obj->Delete_Data("_int_scholarship_declare","_id='$schlor_id'");
		
        if($delete){
				echo "Failed";
			}
			else{
				echo "scholarship deleted";
			}
	
}
?>