function customers_management ()
{
//verifica se o usuário está logado//
if (!$this->tank_auth->is_logged_in()) {
redirect('/auth/login/');
} else {
//verifica se o usuário é o mesmo do db//
$data['user_id'] = $this->tank_auth->get_user_id();
$data['username'] = $this->tank_auth->get_username();
$this->load->view('welcome', $data);
//direciona o acesso do usuário de acordo com os dados do login//
if($this->uri->segment(4) != $this->tank_auth->get_user_id('admin')) {
redirect('examples/customers_management/edit/'.$this->tank_auth->get_user_id());
}
//função que libera o acesso as funções editar do usuário//
$user_id = $this->tank_auth->get_user_id();
//Biblioteca insere Crud//
$crud = new grocery_CRUD();
$crud->set_table('users');
$crud->fields('nome_user','countryID','stateID','cityID','categoriaID','tipoID','estiloID','bio');
//DISPlAY renomeia os campos fields db//
$crud->display_as('email','Email conta');
$crud->display_as('password','Senha da conta');
$crud->display_as('nome_user','Nome de perfil');
$crud->display_as('countryID','PaÃs');
$crud->display_as('stateID','Estado');
$crud->display_as('cityID','Cidade');
$crud->display_as('categoriaID','Categoria musical');
$crud->display_as('tipoID','Qual instrumento você domina?');
$crud->display_as('estiloID','Influências?');
$crud->set_subject('informações');
//DEFININDO RELAÇÕES ENTRE TABELAS//
$crud->set_relation('countryID','country','country_title');
$crud->set_relation('stateID','state','state_title');
$crud->set_relation('cityID','city','city_title');
$crud->set_relation('categoriaID','categoriausers','categoria_user');
$crud->set_relation('estiloID','estilousers','estilo_user');
$crud->set_relation('tipoID','tipousers','tipo_user');
// UNSET - remove funções indesejados //
$crud->unset_print ();
$crud->unset_list();
$crud->unset_back_to_list ();
$crud->unset_add();
//IF YOU HAVE A LARGE AMOUNT OF DATA, ENABLE THE CALLBACKS BELOW - FOR EXAMPLE ONE USER HAD 36000 CITIES AND SLOWERD UP THE LOADING PROCESS. THESE CALLBACKS WILL LOAD EMPTY SELECT FIELDS THEN POPULATE THEM AFTERWARDS
$crud->callback_add_field('stateID', array($this, 'empty_state_dropdown_select'));
$crud->callback_edit_field('stateID', array($this, 'empty_state_dropdown_select'));
$crud->callback_add_field('cityID', array($this, 'empty_city_dropdown_select'));
$crud->callback_edit_field('cityID', array($this, 'empty_city_dropdown_select'));
$output = $crud->render();
//DEPENDENT DROPDOWN SETUP
$dd_data = array(
//GET THE STATE OF THE CURRENT PAGE - E.G LIST | ADD
'dd_state' => $crud->getState(),
//SETUP YOUR DROPDOWNS
//Parent field item always listed first in array, in this case countryID
//Child field items need to follow in order, e.g stateID then cityID
'dd_dropdowns' => array('countryID','stateID','cityID'),
//SETUP URL POST FOR EACH CHILD
//List in order as per above
'dd_url' => array('', site_url().'/examples/get_states/', site_url().'/examples/get_cities/'),
//LOADER THAT GETS DISPLAYED NEXT TO THE PARENT DROPDOWN WHILE THE CHILD LOADS
'dd_ajax_loader' => base_url().'ajax-loader.gif'
);
$output->dropdown_setup = $dd_data;
$this->_example_output($output);
}
But now I need in one user profile page where I can display the information for users...I'm used crud set relation in my database...
How I can make this? I try used tags forech and echo but can't...
Please, help