Skip to content

Latest commit

Β 

History

58 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Lost & Found Management System

A comprehensive web-based platform that connects people who have lost items with those who have found them. The system streamlines the process of reporting lost/found items, searching databases, managing claims, and uses intelligent matching algorithms to automatically detect potential matches.

Overview

Lost & Found is a community-driven platform designed to help reunite people with their belongings. Users can:

  • Report Lost Items β€” Post details about items they've lost with descriptions
  • Report Found Items β€” Help reunite found items with their owners
  • Smart Matching β€” Automatic detection of potential matches between lost and found items
  • Search Database β€” Browse and filter through lost and found reports
  • Manage Claims β€” Submit, track, and manage claims on found items
  • Contact Owners β€” Direct contact information for lost item reporters
  • Admin Dashboard β€” Administrative staff can approve/reject claims and manage reports

Features

User Features

  • User Authentication β€” Secure registration and login with encrypted phone storage
  • Report Items β€” Report lost or found items with detailed descriptions
  • Intelligent Matching β€” System automatically finds potential matches (5-10 point scoring based on category, location, date, and name similarity)
  • Real-time Notifications β€” Bell icon notifications for potential matches and claim updates
  • Search & Filter β€” Find items by category, status, date, location, and type
  • Claims Management β€” Submit and track claims on found items with approval workflow
    • View button for approved claims to access owner contact info
    • Track claim status (pending/approved/rejected) with visual indicators
  • Contact Information Sharing β€” Smart contact info visibility:
    • Lost items: Contact info always visible to help return items
    • Found items: Contact info revealed only after claim approval
    • Approved claimers can view owner contact details
    • Found item owners can view claimer contact details after approval
  • Profile Management β€” View and update user profile information with encrypted phone numbers
  • Enhanced Dashboard β€” Personal dashboard with stats, notifications, and quick actions
  • Step-by-Step Guidance β€” Context-aware guidance for claiming found items or contacting lost item reporters
  • Status Management β€” Mark lost items as found or found items as returned
  • Responsive Design β€” Modern gradient-based UI that works seamlessly on all devices

Admin Features

  • Claim Approval/Rejection β€” Review and approve/reject user claims with admin notes
    • Full item details displayed in claim review interface
    • Contact information sharing automatically triggered upon approval
  • Report Management β€” View and manage all lost and found reports with complete item details
  • User Management β€” View and manage user accounts
  • Staff Management β€” Create and manage staff accounts
  • Dashboard Analytics β€” View system-wide statistics and activity

Staff Features

  • Report Verification β€” Verify and manage item reports with full item details
  • Claim Processing β€” Assist with claim verification and approval
    • Complete item information displayed during claim review
  • User Support β€” Help users with claims and inquiries

Technology Stack

  • Backend: PHP 7+/8+ with PDO
  • Database: MySQL 5.7+
  • Frontend: HTML5, CSS3, Bootstrap 5.3.3
  • Icons: Bootstrap Icons 1.11.3
  • Additional: JavaScript (Bootstrap Bundle)
  • Encryption: AES-256-CBC for phone numbers

Project Structure

Lost-Found/
β”œβ”€β”€ index.php                          # Root entry point (redirects to login)
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ login.php                      # User login page
β”‚   β”œβ”€β”€ register.php                   # User registration
β”‚   β”œβ”€β”€ logout.php                     # Logout handler
β”‚   β”œβ”€β”€ admin_login.php                # Admin login
β”‚   β”œβ”€β”€ staff_login.php                # Staff login
β”‚   β”œβ”€β”€ user/
β”‚   β”‚   β”œβ”€β”€ userdash.php               # User dashboard with notifications
β”‚   β”‚   β”œβ”€β”€ userprofile.php            # User profile management
β”‚   β”‚   β”œβ”€β”€ lost.php                   # Report lost item
β”‚   β”‚   β”œβ”€β”€ found.php                  # Report found item
β”‚   β”‚   β”œβ”€β”€ search.php                 # Search items
β”‚   β”‚   β”œβ”€β”€ claim.php                  # Manage claims & reports
β”‚   β”‚   β”œβ”€β”€ match_results.php          # View potential matches
β”‚   β”‚   β”œβ”€β”€ item_detail.php            # Item detail view with guidance
β”‚   β”‚   β”œβ”€β”€ edit_profile.php           # Edit user profile
β”‚   β”‚   β”œβ”€β”€ changeuserpassword.php     # Change password
β”‚   β”‚   └── includes/
β”‚   β”‚       └── header.php             # User header component
β”‚   β”œβ”€β”€ admin/
β”‚   β”‚   β”œβ”€β”€ admin_dashboard.php        # Admin dashboard
β”‚   β”‚   β”œβ”€β”€ admin_staff.php            # Manage staff
β”‚   β”‚   β”œβ”€β”€ admin_users.php            # Manage users
β”‚   β”‚   β”œβ”€β”€ admin_claim.php            # Manage claims
β”‚   β”‚   β”œβ”€β”€ admin_report.php           # Manage reports
β”‚   β”‚   └── includes/
β”‚   β”‚       └── header.php             # Admin header component
β”‚   └── staff/
β”‚       β”œβ”€β”€ staff_dashboard.php        # Staff dashboard
β”‚       β”œβ”€β”€ staff_claim.php            # Manage claims
β”‚       β”œβ”€β”€ staff_report.php           # Manage reports
β”‚       └── includes/
β”‚           └── header.php             # Staff header component
β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ userconfig.php                 # User database config
β”‚   β”œβ”€β”€ adminconfig.php                # Admin configuration
β”‚   └── staffconfig.php                # Staff configuration
β”œβ”€β”€ includes/
β”‚   └── functions.php                  # Helper functions (encrypt/decrypt phone, sanitization)
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ style.css                      # Global styles
β”‚   └── admin-style.css                # Admin styles
β”œβ”€β”€ sql/
β”‚   β”œβ”€β”€ schema.sql                     # Database schema
β”‚   β”œβ”€β”€ config.sql                     # Database configuration
β”‚   β”œβ”€β”€ scripts.sql                    # Stored procedures & triggers
β”‚   β”œβ”€β”€ privileges.sql                 # Database user privileges
β”‚   β”œβ”€β”€ syntheticrecords.sql           # Sample data for testing
β”‚   └── add_matching_feature.sql       # Matching algorithm setup
└── README.md                          # This file

Database Schema

Main Tables

  • User β€” User accounts (username, email, encrypted phone, password, etc.)
  • LostItem β€” Lost item reports (item_name, description, status, etc.)
  • FoundItem β€” Found item reports (item_name, description, status, etc.)
  • ClaimRequest β€” Claims linking users to found items (status: pending/approved/rejected) with separate nullable approver foreign keys: admin_approver_id and staff_approver_id (replaces prior polymorphic approver_id + approver_type design)
  • Admin β€” Admin accounts
  • Staff β€” Staff accounts

Status Values

  • LostItem.status: pending, claimed
  • FoundItem.status: available, returned
  • ClaimRequest.status: pending, approved, rejected

Stored Procedures

  • GetUserById() β€” Retrieve user information
  • ReportFoundItem() β€” Insert found item report
  • ReportLostItem() β€” Insert lost item report
  • SubmitClaim() β€” Submit a claim request
  • ViewPendingClaimsWithFoundDetails() β€” Get pending claims with associated found item
  • ViewProcessedClaimsWithDetails() β€” Approved / rejected claims incl. approver (admin/staff)
  • ViewStaffProcessedClaims() β€” Processed claims approved by a specific staff member
  • ApproveClaim() β€” Branching logic writes to admin_approver_id or staff_approver_id
  • RejectClaim() β€” Branching logic writes to admin_approver_id or staff_approver_id
  • GetUserLostItems() β€” Get user's lost items
  • GetUserFoundItems() β€” Get user's found items
  • GetUserLostItemsCount() β€” Count user's lost items
  • GetUserFoundItemsCount() β€” Count user's found items
  • GetUserClaims() β€” Get user's claim requests with item details
  • GetUserClaimsCount() β€” Count user's total claims
  • FindPotentialMatches() β€” Intelligent matching algorithm for lost/found items
  • GetUserMatchCount() β€” Count potential matches for user
  • GetUserClaimNotifications() β€” Recent approved/rejected claim decisions for user
  • GetFoundItemClaimNotifications() β€” Notifications for owners whose found items were claimed
  • SearchItems() β€” Search items with filters
  • UpdateUserProfile() β€” Update user profile information

Installation

Prerequisites

  • PHP 7.4+ or PHP 8+
  • MySQL 5.7+
  • A web server (Apache, Nginx, etc.)
  • MAMP/LAMP/LEMP stack or similar

Setup Steps

  1. Clone/Extract the project to your web server root:

    git clone https://github.com/SupaOhm/Lost-and-Found-Management-System.git
    cd Lost-Found
  2. Create Database:

    mysql -u root -p < sql/schema.sql
    mysql -u root -p lost_found_db < sql/config.sql
    mysql -u root -p lost_found_db < sql/scripts.sql
    mysql -u root -p lost_found_db < sql/privileges.sql
    mysql -u root -p lost_found_db < sql/syntheticrecords.sql  # Optional: sample data
  3. Configure Database Connections: Edit config/userconfig.php, config/adminconfig.php, and config/staffconfig.php:

    $host = 'localhost';
    $port = '8889';  // Adjust for your setup (default MySQL: 3306)
    $dbname = 'lost_found_db';
    $user = 'user_user';  // or admin_user, staff_user
    $password = 'user_password';  // Set in privileges.sql
  4. Set Encryption Key (Optional): Phone numbers are encrypted using AES-256-CBC. Set the environment variable:

    export LF_ENCRYPT_KEY="your_32_character_encryption_key"

    If not set, a default key is used (not recommended for production).

  5. Access the Application:

    • User Login: http://localhost/Lost-Found/
    • Admin Login: http://localhost/Lost-Found/pages/admin_login.php
    • Staff Login: http://localhost/Lost-Found/pages/staff_login.php

Database Users & Privileges

The system uses three separate database users with different privilege levels:

  • user_user β€” Limited privileges for regular users (SELECT, INSERT, DELETE on items/claims, UPDATE on User/LostItem/FoundItem)
  • staff_user β€” Extended privileges for staff (full access to items and claims)
  • admin_user β€” Full privileges for administrators

Passwords are set in sql/privileges.sql.

Default Credentials (Development)

Check sql/syntheticrecords.sql for test users created during database initialization.

Key Features in Detail

User Dashboard

  • View stats on lost items, found items, potential matches, and active claims
  • Real-time notification bell icon with count badge
  • Quick access to report new items, search database, and view matches
  • Recent activity feed

Claims & Reports Management

  • Left Panel: View all your reported items (lost/found) with filters and pagination
    • Filter by Type (Lost/Found) and Status (Open/Closed)
    • Delete reports
    • Mark items as found/returned
    • View item details with one-click access
  • Right Panel: View your claims on other users' found items with pagination
    • Track claim status (pending/approved/rejected)
    • Delete claims
    • View admin notes
    • View Button: For approved claims, directly access item detail page to see owner contact info
  • Profile Stats: View counts of your lost items, found items, and claims

Search & Discovery

  • Intelligent Matching β€” Automatic potential match detection based on:
    • Category match (2 points)
    • Location match (2 points)
    • Date proximity within 30 days (2 points)
    • Similar item names (4 points)
    • Minimum 2 points required for match notification
  • Search through all lost and found items in the database
  • Filter by category, location, date range, type, and status
  • View item details with step-by-step guidance:
    • For Lost Items: Contact info visible, guidance on reaching out to owner
    • For Found Items: Submit claim with proof of ownership
  • Submit claims directly from item detail page

Item Detail Page

  • Context-Aware Guidance:
    • Lost Items: "How to Contact" guidance with 3 steps (verify info β†’ contact owner β†’ share/return)
    • Found Items: "How to Claim" guidance with 3 steps (verify details β†’ submit claim β†’ prove ownership)
  • Smart Contact Information Display:
    • Lost items: Reporter's email and phone always visible (decrypted for display) to facilitate returns
    • Found items (non-owner view): Contact info protected until claim approval
    • Found items (approved claimer): Owner contact info becomes visible with approval notification
    • Found items (owner view): Claimer contact info displayed after approving their claim
  • Seamless Claim Workflow:
    • Claim submission integrated into item detail page
    • Automatic notification when viewing own items
    • Direct access to approved claim details via view button
  • Modern UI: Gradient backgrounds, rounded cards, icon badges, status-aware displays

Admin Panel

  • Notification System β€” Real-time bell icon notifications for:
    • New potential matches detected
    • Claim status updates (approved/rejected within 7 days)
    • Notification count badge
  • Dashboard with system-wide statistics
  • View all reports and claims in the system
  • Approve or reject claims with admin notes
  • Manage user accounts and staff members

Usage

For Users

  1. Register β€” Create an account on the registration page (provide name, email, phone, password)
  2. Report Lost Item β€” Navigate to "Report Lost Item" and fill in details (name, category, location, date, description)
  3. Report Found Item β€” Navigate to "Report Found Item" and describe the item
  4. View Matches β€” Check notification bell for potential matches between your lost items and found reports
  5. Search β€” Use the search feature to find items matching your needs
  6. Claim β€” Submit a claim on a found item if you believe it's yours
  7. Track Claim Status β€” Monitor your claim from the "Claims & Reports" page
  8. Access Owner Info β€” Once your claim is approved, click the view button to see owner contact details
  9. Contact β€” For lost items, directly contact the reporter using provided email/phone; for approved found item claims, contact info becomes visible
  10. Manage β€” Track your claims and reports from the dashboard, mark items as found/returned, and view claimer contact info after approving claims

For Admins

  1. Login β€” Use admin credentials to access the admin panel
  2. Review Claims β€” Review pending claims and approve/reject them with notes
  3. Manage Reports β€” Monitor and manage all system reports
  4. Manage Users β€” View and manage user accounts
  5. Manage Staff β€” Create and manage staff accounts

Security Features

  • Password Hashing β€” All passwords hashed using PHP's password_hash (bcrypt)
  • Phone Number Encryption β€” Phone numbers encrypted using AES-256-CBC with automatic decryption for display. Current implementation derives a static IV from the key; recommended enhancement: store a random 16‑byte IV prefixed to the ciphertext (e.g. base64(iv + encrypted)), then extract for decryption.
  • Prepared Statements β€” PDO prepared statements prevent SQL injection
  • Session Management β€” Secure session-based authentication
  • Input Validation β€” Server-side validation and sanitization
  • Ownership Checks β€” Users can only modify their own reports/claims
  • Privacy-First Contact Sharing β€” Contact information only revealed when appropriate (claim approval)
  • Database Privilege Separation β€” Different DB users with minimal required privileges

UI/UX Features

  • Responsive Design β€” Optimized for all screen sizes
  • Modern Gradient UI β€” Gradient backgrounds, rounded corners, shadow effects
  • Bootstrap 5.3.3 β€” Clean, professional interface with Bootstrap Icons
  • Intuitive Navigation β€” Easy-to-use menu structure
  • Visual Feedback β€” Color-coded status badges, hover effects, confirmation dialogs
  • Aesthetic Components β€” Gradient buttons, circular badges, smooth transitions
  • Contextual Guidance β€” Step-by-step instructions based on item type
  • Notification System β€” Bell icon with badge counter for real-time updates
  • Pagination β€” Clean pagination for large lists of items
  • Accessibility β€” Semantic HTML, ARIA labels, keyboard navigation

Known Limitations & Future Improvements

  • Photo upload feature for items (currently text-only descriptions)
  • Email notifications not yet implemented
  • SMS notifications could be added using encrypted phone numbers
  • Random IV adoption for phone encryption (improves cryptographic robustness)
  • Two-factor authentication for enhanced security
  • Advanced analytics dashboard with charts and trends
  • Mobile app version under consideration
  • Integration with campus security/police departments
  • Geolocation-based proximity matching

Contributing

This project is in active development. Contributions are welcome!

License

This project is licensed under the MIT License.

Support & Contact

For issues, feature requests, or support:

Project Status

πŸ”„ In Active Development β€” Features and improvements are being added regularly.

Recent Updates (Changelog Snapshot)

Schema: Introduced separate admin_approver_id and staff_approver_id columns in ClaimRequest replacing polymorphic approver pattern; added trigger BeforeFoundItemDelete to automatically remove related ClaimRequest rows before a FoundItem delete.

Triggers:

  • BeforeUserDelete β€” Cleans up related claims, found items, lost items.
  • BeforeFoundItemDelete β€” Cleans up claims for the specific found item.

Procedures Added / Revised:

  • ViewProcessedClaimsWithDetails, ViewStaffProcessedClaims reflect new approver column structure.
  • GetUserClaimNotifications, GetFoundItemClaimNotifications power dashboard bell notifications.
  • ApproveClaim / RejectClaim now route approver IDs into the correct dedicated column.

Report Filtering: Admin and Staff report pages now support item type (lost/found) and status (pending/available vs claimed/returned) filters with active filter display and clear button.

Deletion Logic: Application layer simplifiedβ€”claim cleanup for found item deletion now handled by trigger instead of manual PHP deletion cascade.

Security Note: Encryption section documents recommendation to migrate to per‑record random IV for phone number storage.

Consistency: All view item and claim operations use prepared statements, reducing SQL injection surface.

Keep this section updated as further changes land.

About

A comprehensive web-based platform that connects people who have lost items with those who have found them. The system streamlines the process of reporting lost/found items, searching databases, managing claims, and uses intelligent matching algorithms to automatically detect potential matches.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages