$login = new login(true);
if (isset($_GET['edit_id'])) {
    $holdingId = intval($_GET['edit_id']);
} else {
    if (isset($_GET['abandon_id'])) {
        $holdingId = intval($_GET['abandon_id']);
        $message = isset($_GET['message']) ? $_GET['message'] : "";
        holdings::AbandonAtClose($holdingId, $message, COMMS_MANUAL_ABANDON_AT_CLOSE);
        header('Location: admin.editallholdings.php');
    } else {
        if (isset($_POST['holding_id'])) {
            $holdingId = intval($_POST['holding_id']);
        } else {
            if (isset($_GET['history_id'])) {
                $holdingId = intval($_GET['history_id']);
                holdings::ADMIN_MarkAbandoned($holdingId);
                header('Location: admin.editallholdings.php');
            } else {
                header('Location: admin.editallholdings.php');
            }
        }
    }
}
// load holding data
$holdingItem = new holdings();
$holdingItem->set_variable('holdings_id', $holdingId);
if ($holdingItem->load()) {
    $abandonDate = strtotime($holdingItem->get_variable('holdings_abandon_date'));
    $tickerId = $holdingItem->get_variable('holdings_ticker_id');
    $ticker = new ticker();
    $ticker->set_variable('ticker_id', $tickerId);