I am calling a callback_insert but it never goes into that function. i tried var_dump. but i can never see the result. it just loads, saves file and then stops but no record is added to the database. please help.
Here is the controller code:
public function new_user_education()
{
$userid = $_SESSION['logged_in']["user_profile_id"];
$now = date("Y-m-d H:i:s");
$this->load->library('grocery_CRUD');
$crud = new grocery_CRUD();
echo "<h1>Education Details</h1>";
$crud->set_theme('datatables');
$crud->set_subject('Education Details');
$crud->set_table('user_education_details');
$crud->set_relation('user_profile_id','user_profile','id');
$crud->where('user_profile_id',$userid);
// $crud->callback_before_insert(array($this,'user_callback'));
$crud->required_fields('degree','status','college','address1','address2','city','zip','country');
$crud->set_relation('country','country','country_name');
$crud->columns(array('degree','specialization','status','college','address1','address2','city','state','zip','country'));
$crud->add_fields(array('degree','specialization','status','college','address1','address2','city','state','zip','country'));
$crud->edit_fields(array('degree','specialization','status','college','address1','address2','city','state','zip','country'));
$crud->field_type('degree','dropdown',array('1' => 'Bachelors', '2' => 'Diploma','3' => 'Doctorate' , '4' => 'Masters'));
$crud->field_type('status','dropdown',array('1' => 'Completed', '2' => 'In Progress'));
$crud->unset_export();
$crud->unset_print();
$crud->callback_insert(array($this,'insert_education'));
$output = $crud->render();
$this->_example_output($output);
}
function insert_education($post_array,$primary_key) {
$user_education_insert = array(
"id" => $primary_key,
"user_profile_id" => $_SESSION['logged_in']["user_profile_id"],
"degree" => $_SESSION['logged_in']["degree"],
"specialization" => $_SESSION['logged_in']["specialization"],
'college' => $_SESSION['logged_in']["college"],
'address1' => $_SESSION['logged_in']["address1"],
'address2' => $_SESSION['logged_in']["address2"],
'city' => $_SESSION['logged_in']["city"],
'state' => $_SESSION['logged_in']["state"],
'zip' => $_SESSION['logged_in']["zip"],
'country' => $_SESSION['logged_in']["country"],
"added_on" => date('Y-m-d H:i:s'),
"added_by" => 'Web Registration',
"updated_by" => 'Web Registration'
);
var_dump($user_education_insert);
exit();
return $this->db->insert('user_education_details',$user_education_insert);
}