```php getConnection(); // Handle verification actions if ($_SERVER['REQUEST_METHOD'] == 'POST') { $verificationID = $_POST['verificationID']; $result = $_POST['result']; $notes = $_POST['notes'] ?? ''; $adminId = $_SESSION['admin_id']; try { $connection->beginTransaction(); // Update verification $updateQuery = "UPDATE verifications SET result = :result, notes = :notes, adminId = :adminId, vDate = NOW() WHERE verificationID = :verificationID"; $updateStmt = $connection->prepare($updateQuery); $updateStmt->bindParam(':result', $result); $updateStmt->bindParam(':notes', $notes); $updateStmt->bindParam(':adminId', $adminId); $updateStmt->bindParam(':verificationID', $verificationID); $updateStmt->execute(); // Get verification details for notifications $detailsQuery = "SELECT v.reportID, v.itemID, r.userId, i.description FROM verifications v JOIN reports r ON v.reportID = r.reportID JOIN items i ON v.itemID = i.itemID WHERE v.verificationID = :verificationID"; $detailsStmt = $connection->prepare($detailsQuery); $detailsStmt->bindParam(':verificationID', $verificationID); $detailsStmt->execute(); $details = $detailsStmt->fetch(PDO::FETCH_ASSOC); // Update report status $reportStatus = $result == 'approved' ? 'verified' : 'rejected'; $reportQuery = "UPDATE reports SET status = :status WHERE reportID = :reportID"; $reportStmt = $connection->prepare($reportQuery); $reportStmt->bindParam(':status', $reportStatus); $reportStmt->bindParam(':reportID', $details['reportID']); $reportStmt->execute(); // Update item status $itemStatus = $result == 'approved' ? 'available' : 'lost'; $itemQuery = "UPDATE items SET status = :status WHERE itemID = :itemID"; $itemStmt = $connection->prepare($itemQuery); $itemStmt->bindParam(':status', $itemStatus); $itemStmt->bindParam(':itemID', $details['itemID']); $itemStmt->execute(); // Create notification $message = $result == 'approved' ? "Your report #{$details['reportID']} for '{$details['description']}' has been approved. The item is now available for claiming." : "Your report #{$details['reportID']} for '{$details['description']}' has been rejected. Reason: $notes"; $notificationQuery = "INSERT INTO notifications (userId, message) VALUES (:userId, :message)"; $notificationStmt = $connection->prepare($notificationQuery); $notificationStmt->bindParam(':userId', $details['userId']); $notificationStmt->bindParam(':message', $message); $notificationStmt->execute(); $connection->commit(); $success = "Verification updated successfully!"; } catch (Exception $e) { $connection->rollBack(); $error = "Error updating verification: " . $e->getMessage(); } } // Get pending verifications $verificationsQuery = " SELECT v.*, r.locationFound, r.notes as reportNotes, i.description, i.category, i.imagePath, u.name as finderName, u.email as finderEmail FROM verifications v JOIN reports r ON v.reportID = r.reportID JOIN items i ON v.itemID = i.itemID JOIN users u ON r.userId = u.userId WHERE v.result = 'pending' ORDER BY v.vDate ASC "; $verificationsStmt = $connection->prepare($verificationsQuery); $verificationsStmt->execute(); $pendingVerifications = $verificationsStmt->fetchAll(PDO::FETCH_ASSOC); // Get pending claims $claimsQuery = " SELECT c.*, i.description, i.category, i.imagePath, u.name as ownerName, u.email as ownerEmail FROM claims c JOIN items i ON c.itemID = i.itemID JOIN users u ON c.ownerUserId = u.userId WHERE c.status = 'pending' ORDER BY c.createdAt ASC "; $claimsStmt = $connection->prepare($claimsQuery); $claimsStmt->execute(); $pendingClaims = $claimsStmt->fetchAll(PDO::FETCH_ASSOC); ?> Verifications - Lost & Found

Verification Queue

Review and approve/reject pending verifications and claims

Pending Report Verifications ()

No pending verifications.

<?php echo $verification['description']; ?>
No Image

Description:

Found Location:

Reported by: ()

Report Notes:

Pending Claims ()

No pending claims.

<?php echo $claim['description']; ?>
No Image

Description:

Claimed by: ()

Proof Provided: View Proof

Claim Date:

```