<?php

// DO NOT EDIT THIS FILE.
// This file was generated by searchgen.
// If you need to customize this file, please edit the corresponding
// yaml file in the gencfg directory, and then re-generate this file
// by running searchgen, passing in the table name.
if (isset($command) && $command == 'loadIncomeexpense') {
    header('Content-Type: application/json');
    $db = ConnectionFactory::getConnection();
    $incomeexpenseDAO = new IncomeexpenseDAO($db);
    $id = isset($params['id']) ? (int) trim($params['id']) : 0;
    if ($id <= 0) {
        $rows = array(Incomeexpense::createDefault());
    } else {
        $sql = <<<EOF
select * from incomeexpense pri where pri.id = ?
EOF;
        $ps = new PreparedStatement($sql, 0, 1);
        $ps->setInt($id);
        $rows = $incomeexpenseDAO->findWithPreparedStatement($ps);
    }
    echo json_encode($rows);
    $db->close();
    exit;
}
	}
}
if (returnToSearchMode) {
	parent.setMode(parent.SEARCH_MODE, false);
}
<?php 
            }
            ?>
</script></body></html>
<?php 
            exit;
        case 'deleteIncomeexpense':
            $db = ConnectionFactory::getConnection();
            $db->beginTransaction();
            $committed = false;
            $incomeexpenseDAO = new IncomeexpenseDAO($db);
            $result = createMsgResultObj();
            $id = isset($_POST['id']) ? (int) trim($_POST['id']) : 0;
            if ($incomeexpenseDAO->load($id) === false) {
                $result->errorMsg .= sprintf(_t('crud.idNotFoundRowNotDeleted'), _t('crud.incomeexpense.tableDescription', 'Incomeexpense'), $id) . "\n";
            } else {
                if (function_exists('deleteCheckHook')) {
                    deleteCheckHook();
                }
                if ($result->errorMsg == '' && empty($result->fieldErrors)) {
                    if (function_exists('preDeleteHook')) {
                        preDeleteHook();
                    }
                    try {
                        $success = $incomeexpenseDAO->delete($id);
                    } catch (Exception $ex) {