Viewing file: salescard.php (1.92 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php include 'connect.php';
// Total students $total_sql = "SELECT COUNT(*) AS total FROM admission"; $total_result = mysqli_query($link, $total_sql); $total_row = mysqli_fetch_assoc($total_result); $total_students = $total_row['total'];
// Students with certificate $generated_sql = "SELECT COUNT(*) AS generated FROM admission WHERE enrollment IN (SELECT enrollment FROM certificate)"; $generated_result = mysqli_query($link, $generated_sql); $generated_row = mysqli_fetch_assoc($generated_result); $generated_students = $generated_row['generated'];
// Remaining students $remaining_students = $total_students - $generated_students;
mysqli_close($link); ?>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Student Certificate Report</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <style> .card { border-radius: 15px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); } .card h3 { font-size: 2rem; font-weight: bold; } </style> </head> <body class="bg-light">
<div class="container py-5"> <h2 class="text-center mb-4">📊 Certificate Status Report</h2>
<div class="row g-4"> <!-- Total Students --> <div class="col-md-4"> <div class="card text-center p-4 bg-primary text-white"> <h5>Total Students</h5> <h3><?php echo $total_students; ?></h3> </div> </div>
<!-- Generated Certificates --> <div class="col-md-4"> <div class="card text-center p-4 bg-success text-white"> <h5>Certificates Generated</h5> <h3><?php echo $generated_students; ?></h3> </div> </div>
<!-- Remaining Students --> <div class="col-md-4"> <div class="card text-center p-4 bg-warning text-dark"> <h5>Certificates Remaining</h5> <h3><?php echo $remaining_students; ?></h3> </div> </div> </div> </div>
</body> </html>
|