$_SESSION['error'] = "Your partially entered randomisation data has been deleted. Please note the new trial ID when you go to re-enter."; } $trial->user->unlinkRecord(); // Unlink user from any records } $trial->addRecord(); } $include = $trial->checkPageLogin($page); // Generate correct include file, assuming user has correct privilege if ($include == 'logout') { $loggedIn = $include = false; $_SESSION['message'] = "You have been successfully logged out."; header('Location:index.php'); exit; } $trial->writeHead($page); echo "<body>"; echo "<div id=\"wrap\""; if (is_null($page) || $page == 'logout') { echo " class=\"background\""; } echo ">"; $trial->writeNavBar(); echo "<div class=\"container\">"; if (isset($_SESSION['error']) && $_SESSION['error']) { echo "<div class=\"alert alert-error\">"; echo "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>"; echo "{$_SESSION['error']}"; echo "</div>"; unset($_SESSION['error']); }
} } else { $_SESSION['error'] = "Log in expired due to inactivity"; header("Location:index.php?expire=1"); exit; } $link_id = $trial->addRecord(); $include = $trial->checkPageLogin($page); // Generate correct include file, assuming user has correct privilege if (!$link_id || !isset($include) || $include != $page) { // If include isn't set or doen't equal page then go back to index as user not validated $_SESSION['error'] = "An error has occurred please try again"; header('Location:index.php'); exit; } $trial->writeHead(); echo "<body>"; echo "<div id=\"wrap\">"; $trial->writeNavBar(); echo '<div class="container well">'; if (isset($_SESSION['error']) && $_SESSION['error']) { echo "<div class=\"alert alert-error\">"; echo "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>"; echo "{$_SESSION['error']}"; echo "</div>"; unset($_SESSION['error']); } $trial->writeCore(); $trial->writeDataNav(); echo "<div class=\"tab-content\">"; echo "<div class=\"tab-pane active\">";