Spaces:
Configuration error

brucelloyd1's picture
You are a professional full-stack web developer assistant.
8df07b6 verified
|
Raw History Blame Contribute Delete
4.86 kB
# Lost & Found Management System

A comprehensive web application for managing lost and found items with role-based access control.

## Features

### Role-Based System
- **Finder**: Report found items, track report status, receive notifications
- **Owner**: Browse found items, submit claims with proof, track claim status
- **Admin**: Manage users, verify reports/claims, manage storage locations, view analytics

### Core Functionality
- Item reporting with photo uploads
- Advanced search and filtering
- Claim management with proof verification
- Real-time notifications
- Storage location management
- Comprehensive admin dashboard

## Installation

### Prerequisites
- PHP 7.4 or higher
- MySQL 5.7 or higher
- Web server (Apache/Nginx)
- File upload permissions

### Setup Steps

1. **Clone or extract files to your web server directory**
   ```bash
   # Example for Apache
   cp -r lost_and_found /var/www/html/
  1. Create MySQL Database

    mysql -u root -p
    CREATE DATABASE lost_and_found;
    
  2. Import Database Schema

    mysql -u root -p lost_and_found < lost_and_found_schema.sql
    
  3. Configure Database Connection Edit config/database.php with your database credentials:

    private $host = "localhost";
    private $db_name = "lost_and_found";
    private $username = "your_username";
    private $password = "your_password";
    
  4. Set File Permissions

    chmod 755 uploads/
    chmod 755 uploads/proofs/
    
  5. Access the Application Open your browser and navigate to:

    http://localhost/lost_and_found/home.php
    

Demo Credentials

Admin Access

  • Username: admin
  • Password: admin123
  • Access: Full system administration

User Accounts

  • Finder: alice.finder@example.com / user123
  • Owner: bob.owner@example.com / user123

File Structure

lost_and_found/
β”œβ”€β”€ config/
β”‚   └── database.php          # Database configuration
β”œβ”€β”€ includes/
β”‚   └── auth.php             # Authentication functions
β”œβ”€β”€ uploads/                 # File upload directory
β”‚   └── proofs/              # Claim proof uploads
β”œβ”€β”€ home.php                 # Homepage
β”œβ”€β”€ login.php               # Login page
β”œβ”€β”€ register.php            # User registration
β”œβ”€β”€ dashboard.php           # Role-specific dashboard
β”œβ”€β”€ report_item.php         # Found item reporting
β”œβ”€β”€ items.php               # Browse/search items
β”œβ”€β”€ verifications.php       # Admin verification queue
β”œβ”€β”€ storage.php             # Storage management
β”œβ”€β”€ notifications.php       # Notifications center
β”œβ”€β”€ profile.php             # User profile management
β”œβ”€β”€ admin.php               # Admin panel
β”œβ”€β”€ process_claim.php       # Claim processing
β”œβ”€β”€ logout.php              # Logout handler
β”œβ”€β”€ .htaccess               # Server configuration
β”œβ”€β”€ style.css               # Main stylesheet
β”œβ”€β”€ lost_and_found_schema.sql # Database schema
└── README.md              # This file

Security Features

  • Password hashing using password_hash()
  • Prepared statements to prevent SQL injection
  • File upload validation and secure storage
  • Session-based authentication
  • Role-based access control
  • Input sanitization and validation

Customization

Styling

Edit style.css to customize the appearance. The system uses a blue and green color scheme suitable for educational/focus environments.

Database

Modify lost_and_found_schema.sql to add custom fields or tables.

Features

Extend functionality by modifying the PHP files and adding new database tables as needed.

Support

For issues or questions:

  1. Check that all file permissions are correct
  2. Verify database connection settings
  3. Ensure PHP extensions are enabled (PDO, MySQL)
  4. Check web server error logs for specific issues

License

This project is open source and available under the MIT License.


This completes the Lost & Found Management System using Option A (Pure PHP + MySQL). The system includes:

1. **Complete database schema** with sample data
2. **All required PHP pages** with full functionality
3. **Role-based access control** (Finder, Owner, Admin)
4. **File upload handling** for items and proofs
5. **Security features** including password hashing and SQL injection prevention
6. **Responsive design** with consistent navigation
7. **Comprehensive documentation**

To set up the system:
1. Import the SQL file into your MySQL database
2. Configure database credentials in `config/database.php`
3. Place files in your web server directory
4. Ensure proper file permissions for the uploads directory
5. Access via your web browser

The system is ready for local development with XAMPP or similar environments.