private function make_crud()
 {
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // initialize groceryCRUD
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $crud = $this->new_crud();
     // this is just for code completion
     if (FALSE) {
         $crud = new Extended_Grocery_CRUD();
     }
     // check state & get primary_key
     $state = $crud->getState();
     $state_info = $crud->getStateInfo();
     $primary_key = isset($state_info->primary_key) ? $state_info->primary_key : NULL;
     switch ($state) {
         case 'unknown':
             break;
         case 'list':
             break;
         case 'add':
             break;
         case 'edit':
             break;
         case 'delete':
             break;
         case 'insert':
             break;
         case 'update':
             break;
         case 'ajax_list':
             break;
         case 'ajax_list_info':
             break;
         case 'insert_validation':
             break;
         case 'update_validation':
             break;
         case 'upload_file':
             break;
         case 'delete_file':
             break;
         case 'ajax_relation':
             break;
         case 'ajax_relation_n_n':
             break;
         case 'success':
             break;
         case 'export':
             break;
         case 'print':
             break;
     }
     // unset things
     $crud->unset_jquery();
     $crud->unset_read();
     // $crud->unset_add();
     // $crud->unset_edit();
     // $crud->unset_delete();
     // $crud->unset_list();
     // $crud->unset_back_to_list();
     // $crud->unset_print();
     // $crud->unset_export();
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Create custom search form (if needed)
     // usage:
     //     $crud->unset_default_search();
     //     // Your custom form
     //     $html =  '<div class="row container col-md-12" style="margin-bottom:10px;">';
     //     $html .= '</div>';
     //     $html .= '<input name="keyword" placeholder="Keyword" value="'.$keyword.'" /> &nbsp;';
     //     $html .= '<input type="button" value="Search" class="crud_search btn btn-primary form-control" id="crud_search" />';
     //     $crud->set_search_form_components($html);
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // set custom grocery crud model, uncomment to use.
     /*
     $this->load->model('grocery_crud_model');
     $this->load->model('grocery_crud_generic_model');
     $this->load->model('grocery_crud_automatic_model');
     $crud->set_model($this->cms_module_path().'/Grocerycrud_tourism_model');
     */
     // adjust groceryCRUD's language to No-CMS's language
     $crud->set_language($this->cms_language());
     // table name
     $crud->set_table($this->cms_complete_table_name('tourism'));
     // primary key
     $crud->set_primary_key('tourism_id');
     // set subject
     $crud->set_subject('Tourism');
     // displayed columns on list
     $crud->columns('name');
     // displayed columns on edit operation
     $crud->edit_fields('name');
     // displayed columns on add operation
     $crud->add_fields('name');
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put Tabs (if needed)
     // usage:
     //     $crud->set_outside_tab($how_many_field_outside_tab);
     //     $crud->set_tabs(array(
     //        'First Tab Caption'  => $how_many_field_on_first_tab,
     //        'Second Tab Caption' => $how_many_field_on_second_tab,
     //     ));
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // caption of each columns
     $crud->display_as('name', 'Name');
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put required field validation codes here
     // (documentation: http://www.grocerycrud.com/documentation/options_functions/required_fields)
     // eg:
     //      $crud->required_fields( $field1, $field2, $field3, ... );
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $crud->required_fields('name');
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put required field validation codes here
     // (documentation: http://www.grocerycrud.com/documentation/options_functions/unique_fields)
     // eg:
     //      $crud->unique_fields( $field1, $field2, $field3, ... );
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $crud->unique_fields('name');
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put field validation codes here
     // (documentation: http://www.grocerycrud.com/documentation/options_functions/set_rules)
     // eg:
     //      $crud->set_rules( $field_name , $caption, $filter );
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put set relation (lookup) codes here
     // (documentation: http://www.grocerycrud.com/documentation/options_functions/set_relation)
     // eg:
     //      $crud->set_relation( $field_name , $related_table, $related_title_field , $where , $order_by );
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put set relation_n_n (detail many to many) codes here
     // (documentation: http://www.grocerycrud.com/documentation/options_functions/set_relation_n_n)
     // eg:
     //      $crud->set_relation_n_n( $field_name, $relation_table, $selection_table, $primary_key_alias_to_this_table,
     //          $primary_key_alias_to_selection_table , $title_field_selection_table, $priority_field_relation );
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put custom field type here
     // (documentation: http://www.grocerycrud.com/documentation/options_functions/field_type)
     // eg:
     //      $crud->field_type( $field_name , $field_type, $value  );
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put callback here
     // (documentation: httm://www.grocerycrud.com/documentation/options_functions)
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $crud->callback_before_insert(array($this, '_before_insert'));
     $crud->callback_before_update(array($this, '_before_update'));
     $crud->callback_before_delete(array($this, '_before_delete'));
     $crud->callback_after_insert(array($this, '_after_insert'));
     $crud->callback_after_update(array($this, '_after_update'));
     $crud->callback_after_delete(array($this, '_after_delete'));
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put custom error message here
     // (documentation: httm://www.grocerycrud.com/documentation/set_lang_string)
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // $crud->set_lang_string('delete_error_message', 'Cannot delete the record');
     // $crud->set_lang_string('update_error',         'Cannot edit the record'  );
     // $crud->set_lang_string('insert_error',         'Cannot add the record'   );
     $this->crud = $crud;
     return $crud;
 }