<body> <form action="<?php echo $_SERVER['PHP_SELF']; ?> " method="post" name="theform" id="theform"> <?php $disabled = ''; $note_details = array('note_id' => 0, 'note' => ''); $student_details = UserUtils::get_user_details($userID, $mysqli); if (isset($_GET['paperID'])) { echo "<input type=\"hidden\" name=\"paperID\" value=\"" . $_GET['paperID'] . "\" />\n"; $note_details = StudentNotes::get_note($_GET['paperID'], $userID, $mysqli); echo '<strong>' . $student_details['title'] . ' ' . $student_details['surname'] . ', ' . $student_details['initials'] . '</strong><br />'; } else { $student_modules = UserUtils::load_student_modules($userID, $mysqli); $current_year = date_utils::get_current_academic_year(); $module_IDs = array(); if (isset($student_modules[$current_year])) { foreach ($student_modules[$current_year] as $moduleID => $module_code) { $module_IDs[] = $moduleID; } } echo $string['papername'] . " <select name=\"paperID\" id=\"paperID\" required>\n<option value=\"\"></option>\n"; if (count($module_IDs) > 0) { // Look up summative papers that have been live in the last 28 days. $result = $mysqli->prepare("SELECT DISTINCT properties.property_id, paper_title FROM properties, properties_modules WHERE properties.property_id = properties_modules.property_id AND idMod IN (" . implode(',', $module_IDs) . ") AND paper_type = '2' AND end_date > DATE_SUB(NOW(), INTERVAL 28 DAY) AND deleted IS NULL ORDER BY paper_title"); $result->execute(); $result->bind_result($property_id, $paper_title); while ($result->fetch()) { echo "<option value=\"{$property_id}\">{$paper_title}</option>\n";