Viewing file: exam_results.php (2.78 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<!DOCTYPE html> <html lang="en">
<?php include 'head.php';?> <style> table { border-collapse: collapse; width: 100%; margin-top: 20px; }
table, th, td { border: 1px solid #ddd; }
th, td { padding: 8px; text-align: left; }
th { background-color: #f2f2f2; font-weight: bold; } .custom-image { width: 100px; height: 100px; } </style> <body>
<!-- ======= Header ======= --> <?php include 'menubar.php';?>
<?php include 'sidebar.php';?>
<main id="main" class="main">
<?php include 'connect.php';
// Fetch all results from answersheet $sql = "SELECT ID, date, totlaquestion, correctanswer, name, batch_no, roll_no FROM answersheet ORDER BY date DESC"; $result = $conn->query($sql);
if (!$result) { die("❌ SQL Error: " . $conn->error); } ?> <!DOCTYPE html> <html> <head> <title>Answer Sheet Results</title> <style> body { font-family: Arial, sans-serif; background: #f9f9f9; } h2 { text-align: center; margin: 20px; } table { border-collapse: collapse; width: 95%; margin: auto; background: #fff; box-shadow: 0px 0px 6px rgba(0,0,0,0.2); } th, td { border: 1px solid #ddd; padding: 10px; text-align: center; } th { background: #007BFF; color: white; } tr:nth-child(even) { background: #f2f2f2; } a.btn { padding: 6px 10px; text-decoration: none; border-radius: 4px; margin: 2px; } .edit { background: #28a745; color: white; } .delete { background: #dc3545; color: white; } .print { background: #17a2b8; color: white; } </style> </head> <body>
<h2>Answer Sheet Results</h2>
<table> <tr> <th>ID</th> <th>Date</th> <th>Roll No</th> <th>Name</th> <th>Batch No</th> <th>Total Questions</th> <th>Correct Answers</th> <th>Actions</th> </tr> <?php while($row = $result->fetch_assoc()): ?> <tr> <td><?= $row['ID'] ?></td> <td><?= $row['date'] ?></td> <td><?= $row['roll_no'] ?></td> <td><?= $row['name'] ?></td> <td><?= $row['batch_no'] ?></td> <td><?= $row['totlaquestion'] ?></td> <td><b><?= $row['correctanswer'] ?></b></td> <td> <a class="btn edit" href="edit_answersheet.php?id=<?= $row['ID'] ?>">Edit</a> <a class="btn delete" href="delete_answersheet.php?id=<?= $row['ID'] ?>" onclick="return confirm('Delete this record?')">Delete</a> <a class="btn print" href="print_answersheet.php?id=<?= $row['ID'] ?>" target="_blank">Print</a> </td> </tr> <?php endwhile; ?> </table>
</body> </html>
</main><!-- End #main -->
<?php include 'footer.php';?>
</body>
</html>
|