$committed = false;
 $accttypeDAO = new AccttypeDAO($db);
 $result = createMsgResultObj();
 $id = isset($_POST['id']) ? (int) trim($_POST['id']) : 0;
 if ($accttypeDAO->load($id) === false) {
     $result->errorMsg .= sprintf(_t('crud.idNotFoundRowNotDeleted'), _t('crud.accttype.tableDescription', 'Accttype'), $id) . "\n";
 } else {
     if (function_exists('deleteCheckHook')) {
         deleteCheckHook();
     }
     if ($result->errorMsg == '' && empty($result->fieldErrors)) {
         if (function_exists('preDeleteHook')) {
             preDeleteHook();
         }
         try {
             $success = $accttypeDAO->delete($id);
         } catch (Exception $ex) {
             $success = false;
         }
         if ($success) {
             if (function_exists('postDeleteHook')) {
                 postDeleteHook();
             }
             $db->commitTransaction();
             $committed = true;
             $result->successMsg .= sprintf(_t('crud.rowDeleted'), _t('crud.accttype.tableDescription', 'Accttype'), $id) . "\n";
         } else {
             $result->errorMsg .= sprintf(_t('crud.rowCouldNotBeDeleted'), _t('crud.accttype.tableDescription', 'Accttype')) . "\n";
         }
     }
 }