function report_edit_form_submit($data)
{
    $error = report_validate($data);
    if (!empty($error)) {
        return FALSE;
    } else {
        $report = new Report();
        $update = $report->update($data);
        if ($update['code'] == 200) {
            return report_list($data['id']);
        }
    }
}
示例#2
0
/*
 * Sending calls to the view
 * Call functions on {yourmodule}.controller.php
 */
switch ($_GET['fn']) {
    case 'report_list':
        echo report_list($_GET['row_id']);
        break;
    case 'report_list_pager':
        print report_list(NULL, $_GET['search'], $_GET['sort'], $_GET['page']);
        break;
    case 'report_list_sort':
        print report_list(NULL, $_GET['search'], $_GET['sort'], 1);
        break;
    case 'report_list_search':
        print report_list(NULL, $_GET['search']);
        break;
    case 'report_create_form':
        print report_create_form();
        break;
    case 'report_create_form_submit':
        print report_create_form_submit($_GET);
        break;
    case 'report_edit_form':
        print report_edit_form($_GET);
        break;
    case 'report_edit_form_submit':
        print report_edit_form_submit($_GET);
        break;
    case 'report_delete_form':
        print report_delete_form($_GET);