Jump to content


Add/Edit/Delete using where as a variable

Where Variable

  • Please log in to reply
1 reply to this topic

#1 Linkark07

Linkark07

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 25 August 2014 - 12:49 PM

Good morning.

 

Thanks for making this great library. It has really helped me with my project.

 

My question, and problem, is this: how to use add/edit/delete and all the other options using where as a variable? Right now I'm doing an attendance list, and for it to work the user must select a group from a dropdown. This is when the problem comes in; the list with the selected group appears but the user can't use any of the options.

 

Here is the code:

$this->form_validation->set_rules('group', 'Grupo', 'trim|xss_clean');
                if($this->form_validation->run() == FALSE)
                {
                    $this->seleccionar_grupo();
                }else{
                $grupo = $this->input->get('grupo', TRUE);
                 $this->grocery_crud->where('id_grupo', $grupo); //Here is when I use a variable for get the group_id.
                     $this->grocery_crud->display_as('id_participante', 'C├ędula');
                      $this->grocery_crud->display_as('id_grupo', 'Grupo');
        $this->grocery_crud->set_subject('Participante');
        $this->grocery_crud->set_relation('id_participante', 'participante', 'numero_identificacion');
              $this->grocery_crud->set_table('asistencia');
    $this->grocery_crud->edit_fields('clase', 'observaciones');
       $this->grocery_crud->unset_delete();
                $this->grocery_crud->unset_add();
                $this->grocery_crud->unset_export();
                $this->grocery_crud->unset_print();
            $output = $this->grocery_crud->render();
 
        $this->ver_lista($output);
 


#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 04 September 2014 - 04:33 AM

what exactly you trying to achieve ..  can u explain - then i might be able to help you on the same.







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users