include_once '../classes/class.goals.crud.php'; $crud = new crud($conn); if (isset($_POST['btn-update'])) { $uid = $_GET['edit_id']; $timeframe = $_POST['timeframe']; $goal = nl2br2($_POST['goal']); $actions = nl2br2($_POST['actions']); if ($crud->update($uid, $timeframe, $goal, $actions)) { $msg = "<div class='alert alert-info'>\n\t\t\t\t<strong>WOW!</strong> Record was updated successfully <a href='index.php'>HOME</a>!\n\t\t\t\t</div>"; } else { $msg = "<div class='alert alert-warning'>\n\t\t\t\t<strong>SORRY!</strong> ERROR while updating record !\n\t\t\t\t</div>"; } } if (isset($_GET['edit_id'])) { $id = $_GET['edit_id']; extract($crud->getID($id)); } ?> </head> <body > <!---- Include Header -----> <?php include '../includes/menubars.inc.php'; ?> <!-- Main body ================== -->