• codeSample Codes

    public function customers_management()
    {

    $this->config->load('grocery_crud');
    $this->config->set_item('grocery_crud_dialog_forms',true);
    $this->config->set_item('grocery_crud_dialog_color','green darken-4');
    $this->config->set_item('grocery_crud_dialog_text_color','white');

    $crud = new grocery_CRUD();
    $crud->set_theme('materializecss'); // magic code
    $crud->set_table('customers');
    $crud->columns('customerName','contactLastName','phone','city','country','salesRepEmployeeNumber','creditLimit');
    $crud->display_as('salesRepEmployeeNumber','from Employeer')
    ->display_as('customerName','Name')
    ->display_as('contactLastName','Last Name');
    $crud->set_subject('Customer');
    $crud->set_relation('salesRepEmployeeNumber','employees','lastName');

    $output = $crud->render();

    $this->_example_output($output);
    }
  • editView Customer
    Name:
    Blauer See Auto, Co.
    Name:
    Blauer See Auto, Co.
    Last Name:
    Keitel
    Last Name:
    Keitel
    ContactFirstName:
    Roland
    ContactFirstName:
    Roland
    Phone:
    +49 69 66 90 2555
    Phone:
    +49 69 66 90 2555
    AddressLine1:
    Lyonerstr. 34
    AddressLine1:
    Lyonerstr. 34
    AddressLine2:
     
    AddressLine2:
     
    City:
    Frankfurt
    City:
    Frankfurt
    State:
     
    State:
     
    PostalCode:
    60528
    PostalCode:
    60528
    Country:
    Germany
    Country:
    Germany
    from Employeer:
    Jones
    from Employeer:
    Jones
    CreditLimit:
    59700
    CreditLimit:
    59700