?> "> <?php echo $count . ". " . $record['name']; ?> </a> </td> <td style="text-align: center;"><?php echo $record['score']; ?> </td> <td><?php echo $date . " " . $time; ?> </td> <td style="text-align: center;"><a href="process_test.php?del=<?php echo numEncrypt($record['test_id']); ?> " class="glyphicon glyphicon-trash" title ="delete" onclick="return msgAlert('delete')"></a></td> </tr> <?php } ?> <?php } ?> <?php } ?>
echo $output; } } elseif (isset($_POST['search2'])) { if (!empty($_POST['search2'])) { $output = ""; $searchq = $_POST['search2']; $searchq = escape($searchq); $sql = "SELECT * FROM departments WHERE name LIKE '{$searchq}%'"; $result = mysql_query($sql); $count = mysql_num_rows($result); if ($count == 0) { $output = "<span style='margin-left:20px'>Nothing found</span>"; } else { while ($row = mysql_fetch_array($result)) { $name = $row['name']; $output .= '<a href="department.php?collegeid=' . numEncrypt($row['college_id']) . '"style="font-size:14px; color:white; margin-bottom: -20px;">' . $name . '</a>'; } } echo $output; } } elseif (isset($_POST['save'])) { if (isset($_SESSION['active_test_id'])) { $testId = $_SESSION['active_test_id']; $feedback = ''; //$feedback['testid'] = $_SESSION['active_test_id']; list($numCorrect, $numQuestions, $percent) = markTest($testId); $score = "You scored " . $numCorrect . " out of " . $numQuestions . " representing " . $percent . "%"; // save score and related information $courseId = $_SESSION['courseId']; $userId = $_SESSION['user_id']; $query = select("SELECT * FROM test_info WHERE test_id ='{$testId}'")[0];