$eve->RedirectUrl('track.php');
}
$pos_id = $eve->VarCleanFromInput('i');
if (!$pos_id) {
    $eve->SessionSetVar('errormsg', 'Need an ID!');
    $eve->RedirectUrl('index.php');
}
$pos = $posmgmt->GetTowerInfo($pos_id);
$arrposize = array(1 => 'Small', 2 => 'Medium', 3 => 'Large');
$arrporace = array(1 => 'Amarr CT', 2 => 'Caldari CT', 3 => 'Gallente CT', 4 => 'Minmatar CT', 5 => 'Angel CT', 6 => 'Blood CT', 7 => 'Dark Blood CT', 8 => 'Domination CT', 9 => 'Dread Guristas CT', 10 => 'Guristas CT', 11 => 'Sansha CT', 12 => 'Serpentis CT', 13 => 'Shadow CT', 14 => 'True Sansha CT');
$pos['pos_type_name'] = $arrporace[$pos['pos_race']];
$pos['pos_size_name'] = $arrposize[$pos['pos_size']];
//echo '<pre>';print_r($pos); echo '</pre>';exit;
if (!$pos) {
    $eve->SessionSetVar('errormsg', 'That POS apparently does not exist!');
    $eve->RedirectUrl('track.php');
}
$action = $eve->VarCleanFromInput('action');
if ($action == 'deletepos') {
    if (in_array('5', $access) || in_array('6', $access) || in_array('83', $access) && ($pos['owner_id'] == $userinfo['eve_id'] || $pos['secondary_owner_id'] == $userinfo['eve_id'])) {
        if ($posmgmt->DeletePOS($pos_id)) {
            $eve->SessionSetVar('statusmsg', 'POS deleted!');
            $eve->RedirectUrl('track.php');
        }
    } else {
        $eve->SessionSetVar('statusmsg', 'ERROR - You are not allowed to delete this POS');
        $eve->RedirectUrl('track.php');
    }
}
$eveRender->Assign($pos);
$eveRender->Display('deletepos.tpl');