I have a column like this:
$crud->columns('student_no','last_name','first_name','middle_name','faculty_name','subject_desc','first_qtr','second_qtr','final_grade');
$crud->display_as('final_grade','Final Grade');
//My Callback column
$crud->callback_column('final_grade',array($this,'callback_fg'));
//my callback function
public function callback_fg($value, $row)
{
$first_qtr = $row->first_qtr;
$second_qtr = $row->second_qtr;
$final_grade = round(($first_qtr + $second_qtr)/2);
if($second_qtr == 0)
{
return "input 2nd_qtr";
}
else {
return $final_grade;
}
}