grocery-crud
grocery-crud copied to clipboard
Boot Strap Theme search not working for filtering column and global search
public function add_students() { $crud = new grocery_CRUD(); $crud->set_theme('bootstrap');
$crud->set_table('studentdb');
$crud->columns('LRN','year_section','yearLevel','section_list','studentLastName','studentFirstName','studentMiddleName','phone','address','guardian','contactNo');
$crud->display_as('studentLastName','Last Name')
->display_as('studentFirstName','First Name')
->display_as('studentMiddleName','Middle Name')
->display_as('phone',"Tel. No. / Phone No.")
->display_as('LRN',"Learner's Reference Number")
->display_as('guardian',"Parent / Guardian")
->display_as('contactNo',"Contact No. In Case of Emergency");
$crud->set_subject('List of Students');
**$crud->set_relation('year_section','section_list','{yearLevel} {year_section}');**
//$crud->set_table('film');
//$crud->set_relation_n_n('actors', 'film_actor', 'actor', 'film_id', 'actor_id', 'fullname','priority'); //$crud->set_relation_n_n('category', 'film_category', 'category', 'film_id', 'category_id', 'name');
//$crud->field_type('LRN','readonly');
//$crud->field_type('studentLastName','readonly');
//$crud->field_type('studentFirstName','readonly');
//$crud->field_type('studentMiddleName','readonly');
$crud->field_type('lowest_rating','invisible');
$crud->field_type('percentage_value','invisible');
$crud->field_type('percentage_standard','invisible');
$crud->field_type('written_works','invisible');
$crud->field_type('performance_task','invisible');
$crud->field_type('quarter_exam','invisible');
//$crud->field_type('average','readonly');
//$crud->field_type('final_average','readonly');
$crud->callback_before_insert(array($this,'get_average'));
$crud->callback_before_update(array($this,'get_average'));
$output = $crud->render();
$this->_studentroll_output($output);
}
function get_average($post_array) {
$post_array['quarter_exam'] = 20; $post_array['performance_task'] = 60; $post_array['written_works'] = 20; $post_array['lowest_rating'] = 60; $post_array['percentage_standard'] = 100; $post_array['percentage_value'] = ($post_array['percentage_standard'] - $post_array['lowest_rating']);
//$post_array['mean_written'] = ($post_array['total_score'] / $post_array['total_item']) * $post_array['lowest_rating'] + //$post_array['percentage_value']; //$post_array['average'] = $post_array['mean_written'] + $post_array['mean_performance'] + $post_array['mean_quarter'];
//$post_array['mean_written'] = (($post_array['written_total_score'] / $post_array['written_total_item']) * ($post_array['percentage_value'] + $post_array['lowest_rating']) * ($post_array['written_works'] / 100));
//$post_array['mean_performance'] = (($post_array['performance_total_score'] / $post_array['performance_total_item']) * ($post_array['percentage_value'] + $post_array['lowest_rating']) * ($post_array['performance_task'] / 100));
//$post_array['mean_quarter'] = (($post_array['quarter_total_score'] / $post_array['quarter_total_item']) * ($post_array['percentage_value'] + $post_array['lowest_rating']) * ($post_array['quarter_exam'] / 100));
//$post_array['average'] = $post_array['mean_written']+$post_array['mean_performance']+$post_array['mean_quarter'];
//$post_array['final_average'] = $post_array['mean_written']+$post_array['mean_performance']+$post_array['mean_quarter'];
return $post_array; }
I am using using $crud->set_relation('year_section','section_list','{yearLevel} {year_section}'); in here the rest are working, when i switch my theme in "flexigrid" the "search all" is not working as well. But in "datatables" theme all is working fine.
Please help Thanks! God Bless.!