Exemple #1
0
    $portfolio = new Portfolio();
    $message = $portfolio->buildFromPost();
    if ($message == "") {
        $message = "Successfully aded portfolio!";
        include 'html/green_messagebox.php';
        $portfolio->persist();
    } else {
        include 'html/red_messagebox.php';
    }
}
if ($_REQUEST['do'] == 'closeTrade') {
    $trade_id = $_POST['trade_id'];
    $trade = new Trade($trade_id);
    $message = $trade->closeTrade();
    if ($message == "") {
        $trade->persist();
        $message = "Successfully closed trade.";
        include 'html/green_messagebox.php';
    } else {
        include 'html/red_messagebox.php';
    }
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Portfolios - Kyle Stock Tracker</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="images/ktrader.css" type="text/css" />
<script type="text/javascript" src="ajax.js"></script>
</head>
<body>