• 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:
    Signal Gift Stores
    Name:
    Signal Gift Stores
    Last Name:
    King
    Last Name:
    King
    ContactFirstName:
    Jean
    ContactFirstName:
    Jean
    Phone:
    7025551838
    Phone:
    7025551838
    AddressLine1:
    8489 Strong St.
    AddressLine1:
    8489 Strong St.
    AddressLine2:
     
    AddressLine2:
     
    City:
    Las Vegas
    City:
    Las Vegas
    State:
    NV
    State:
    NV
    PostalCode:
    83030
    PostalCode:
    83030
    Country:
    USA
    Country:
    USA
    from Employeer:
    Thompson
    from Employeer:
    Thompson
    CreditLimit:
    71800
    CreditLimit:
    71800