die("Redirecting to index.php"); } else { if (!empty($_GET['diagnosis']) && isset($_GET['submitButton'])) { $query = "\n SELECT *\n FROM appointment\n WHERE\n id = :id\n "; $query_params = array(':id' => $_GET['id']); try { $stmt = $db->prepare($query); $stmt->execute($query_params); } catch (PDOException $ex) { die("Failed to run query: " . $ex->getMessage()); } $row = $stmt->fetch(); // Only update the tables without sending email $d = new Diagnosis($_SESSION['user']['id'], $row['doctor_name'], $row['patient_name'], $_SESSION["user"]["email"], htmlspecialchars($_GET['diagnosis']), htmlspecialchars($_GET['observations']), $row['date'], $row['time'], $db, htmlspecialchars($_GET['medication'])); $d->initiate($_SESSION, $_GET['id']); $d->updateAppointment($_GET['id']); } } ?> <!doctype html> <html lang="en"> <head> <style>.error {color: #FF0000;}</style> <style>.success {color: #00FF00;</style> <meta charset="utf-8"> <title>Hospital Management</title> <meta name="description" content="Hospital management system for Intro to Software Engineering"> <meta name="author" content="WAL Consulting"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>