function mvno_edit_form_submit($data) { $error = mvno_validate($data); if (!empty($error)) { return FALSE; } else { $mvno = new Mvno(); $update = $mvno->update($data); if ($update['code'] == 200) { return mvno_list($data['id']); } } }
/* * Sending calls to the view * Call functions on {yourmodule}.controller.php */ switch ($_GET['fn']) { case 'mvno_list': echo mvno_list($_GET['row_id']); break; case 'mvno_list_pager': print mvno_list(NULL, $_GET['search'], $_GET['sort'], $_GET['page']); break; case 'mvno_list_sort': print mvno_list(NULL, $_GET['search'], $_GET['sort'], 1); break; case 'mvno_list_search': print mvno_list(NULL, $_GET['search']); break; case 'mvno_create_form': print mvno_create_form(); break; case 'mvno_create_form_submit': print mvno_create_form_submit($_GET); break; case 'mvno_edit_form': print mvno_edit_form($_GET); break; case 'mvno_edit_form_submit': print mvno_edit_form_submit($_GET); break; case 'mvno_delete_form': print mvno_delete_form($_GET);