• 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:
    Mini Gifts Distributors Ltd.
    Name:
    Mini Gifts Distributors Ltd.
    Last Name:
    Nelson
    Last Name:
    Nelson
    ContactFirstName:
    Susan
    ContactFirstName:
    Susan
    Phone:
    4155551450
    Phone:
    4155551450
    AddressLine1:
    5677 Strong St.
    AddressLine1:
    5677 Strong St.
    AddressLine2:
     
    AddressLine2:
     
    City:
    San Rafael
    City:
    San Rafael
    State:
    CA
    State:
    CA
    PostalCode:
    97562
    PostalCode:
    97562
    Country:
    USA
    Country:
    USA
    from Employeer:
    Jennings
    from Employeer:
    Jennings
    CreditLimit:
    210500
    CreditLimit:
    210500