0 ? 'WHERE ' . implode(' AND ', $where) : ''; // Fetch receipts $receipts = $con->query("SELECT fc.*, s.name, s.enrollment_no, s.father, s.mobile, c.course_name, ce.institute_name, ce.center_number, fct.category_name FROM fee_collections fc LEFT JOIN students s ON fc.student_id = s.id LEFT JOIN courses c ON s.course_id = c.id LEFT JOIN centers ce ON s.center_id = ce.id LEFT JOIN fee_categories fct ON fc.category_id = fct.id $where_clause ORDER BY fc.id DESC"); // Summary $summary = $con->query("SELECT COUNT(*) as total_receipts, SUM(fc.paid_amount) as total_amount, COUNT(DISTINCT fc.student_id) as total_students, SUM(CASE WHEN fc.status='Paid' THEN 1 ELSE 0 END) as fully_paid FROM fee_collections fc LEFT JOIN students s ON fc.student_id = s.id $where_clause")->fetch_assoc(); // Centers & filters $centers = $con->query("SELECT * FROM centers ORDER BY institute_name ASC"); ?>
Total Receipts
Total Amount
Students
Fully Paid

Filter Receipts

Generate Receipt
Reset

All Receipts

Total: num_rows ?> receipts
num_rows > 0): ?> fetch_assoc()): $grand += $r['paid_amount']; ?> num_rows > 0): ?>
Receipt No. Date Student Name Enroll. No. Course Center Category Amount Due Mode Txn No. Status Action
GSOS/
No receipts found
Total