prepare($sql_ngo); $stmt_ngo->bindParam(':ngo_id', $ngo_id, PDO::PARAM_INT); $stmt_ngo->execute(); $ngo = $stmt_ngo->fetch(PDO::FETCH_ASSOC); // Fetch listings claimed by this NGO $sql_listings = "SELECT l.id, l.name, l.quantity, l.status, l.pickup_by, v.name as volunteer_name FROM food_listings as l LEFT JOIN volunteer_assignments as va ON l.id = va.listing_id LEFT JOIN volunteers as v ON va.volunteer_id = v.id WHERE l.ngo_id = :ngo_id ORDER BY l.pickup_by DESC"; $stmt_listings = $pdo->prepare($sql_listings); $stmt_listings->bindParam(':ngo_id', $ngo_id, PDO::PARAM_INT); $stmt_listings->execute(); $listings = $stmt_listings->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { $ngo = false; $listings = []; // error_log($e->getMessage()); } function getStatusBadge($status) { switch ($status) { case 'claimed': return 'Awaiting Volunteer'; case 'assigned': return 'Volunteer Assigned'; case 'collected': return 'Collected'; default: return 'Unknown'; } } ?> NGO Dashboard - Food Rescue

Dashboard:

You have not claimed any donations yet. Visit the public listings to find available food.

Food Item Quantity Pickup By Status Volunteer
View All Available Donations