public static function destroyUnit($id) { $unit = new unit(array('id' => $id)); $unit->delete($id); Redirect::to('/waybill', array('message' => 'Tuotteen poisto onnistui.')); }
} } } break; case 'delete_entry': // Check for dependencies $administration_unit = new unit($_POST['units_id']); if ($administration_unit->has_dependencies()) { $error_level = 2; // Related tariff(s) exist $_POST['action'] = ''; } break; case 'delete_entry_confirmed': $administration_unit = new unit($_POST['units_id']); $administration_unit->delete(); unset($_POST['units_id']); $_POST['action'] = ''; break; } // Create a new unit object with id == 0 (default) $_SESSION['unit'] = new unit(); // header // require DIR_WS_INCLUDES . 'header.php'; ?> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>