In case you've missed it, you are looking at an older version of the website. Checkout our latest version, we promise you will love it 😍

Customers example

function customers_management()
{
    $crud = new grocery_CRUD();
 
    $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->required_fields('customerName','contactLastName');
    $crud->set_subject('Customer');
    $crud->set_relation('salesRepEmployeeNumber','employees','lastName');
 
    $output = $crud->render();
 
    $this->_example_output($output);
}    
Note: The below example is an iframe so it might appeared with a scroll bar. If you like you can view the example on a new tab