$app = new Application($_GET['app_id']); if (!$app->ok()) { redirect('tickets.php'); } if (isset($_POST['btnNew'])) { if ($Error->ok()) { $m = new Milestone(); $m->app_id = $app->id; $m->title = trim($_POST['title']); $m->description = $_POST['description']; $m->status = 'open'; $m->dt_due = dater($_POST['due']); if (strlen($m->title) == 0) { $m->title = 'Untitled Milestone'; } $m->insert(); redirect('tickets-milestones.php?app_id=' . $app->id); } else { $title = $_POST['title']; $description = $_POST['description']; $due = $_POST['due']; } } else { $title = ''; $description = ''; $due = ''; } include 'inc/header.inc.php'; ?> <div id="bd">