Sindbad~EG File Manager

Current Path : /home/copmadinaarea/thecopmadinaarea.org/reports/
Upload File :
Current File : /home/copmadinaarea/thecopmadinaarea.org/reports/README.md

# COP Madina Area Reports System

A comprehensive Data Entry and Report Generation platform for The Church of Pentecost - Madina Area.

## Features

### Authentication & Authorization
- Secure login system with email/username support
- Role-based access control (Admin, Data Entry, Viewer)
- Multi-level hierarchy (Superuser, Area, District, Assembly)
- Session management with timeout protection

### User Interface
- Professional, responsive design using Tailwind CSS
- Gradient blue, gray, and white color scheme
- Modern sidebar navigation
- Real-time notifications system
- Vue.js integration for interactive components

### Core Modules
- **Dashboard**: Level-specific dashboards with statistics and quick actions
- **Profile Management**: User profile editing and password changes
- **Data Entry**: Placeholder for custom data entry forms (awaiting requirements)
- **Data Edit**: Placeholder for data modification interfaces (awaiting requirements)
- **Reports**: Placeholder for report generation tools (awaiting requirements)
- **Settings**: System configuration and site management
- **Audit Logs**: Complete activity tracking and change history
- **Maintenance**: Database cleanup and system optimization
- **Notifications**: User notification management system

### Security Features
- Password hashing with PHP's password_hash()
- SQL injection protection with prepared statements
- XSS protection with input sanitization
- Session security with regeneration
- Comprehensive audit logging
- Role-based permission checking

## Installation

### Requirements
- PHP 7.4 or higher
- MySQL 5.7 or higher
- Apache/Nginx web server
- XAMPP (recommended for local development)

### Setup Instructions

1. **Clone/Download** the project to your web server directory:
   ```
   C:/xampp/htdocs/copmadinareports/
   ```

2. **Database Setup**:
   - Create a new MySQL database named `copmadinaarea_copreports`
   - Import the schema from `database/schema.sql`
   - The schema includes sample data and the superuser account

3. **Configuration**:
   - Update database credentials in `config/database.php` if needed
   - Modify settings in `config/config.php` as required
   - The app uses relative paths/URLs internally (no absolute base URL needed)

4. **Default Superuser Account**:
   - **Email**: nabibo2@yahoo.co.uk
   - **Username**: nabibo
   - **Password**: password123

5. **File Permissions**:
   - Ensure the web server has read/write access to the project directory
   - Create an `uploads/` directory for file uploads (if needed)

## Project Structure

```
copmadinareports/
├── config/
│   ├── config.php          # Application configuration
│   └── database.php        # Database connection
├── dashboard/
│   ├── superuser.php       # Superuser dashboard
│   ├── area.php           # Area dashboard
│   ├── district.php       # District dashboard
│   ├── assembly.php       # Assembly dashboard
│   ├── profile.php        # User profile management
│   ├── data-entry.php     # Data entry placeholder
│   ├── data-edit.php      # Data edit placeholder
│   ├── reports.php        # Reports placeholder
│   ├── settings.php       # System settings
│   ├── audit.php          # Audit logs viewer
│   ├── maintenance.php    # System maintenance
│   └── notifications.php  # Notification management
├── database/
│   └── schema.sql         # Database schema and sample data
├── includes/
│   ├── functions.php      # Core PHP functions
│   ├── header.php         # Common header template
│   └── footer.php         # Common footer template
├── index.php              # Main entry point with redirects
├── login.php              # Login page
├── logout.php             # Logout handler
└── README.md              # This file
```

## User Hierarchy & Permissions

### User Levels
1. **Superuser**: Full system access, can manage all areas/districts/assemblies
2. **Area**: Can access district and assembly platforms within their area
3. **District**: Can access assembly platforms within their district
4. **Assembly**: Can only access their specific assembly platform

### User Roles
- **Admin**: Create, view, update, delete permissions
- **Data Entry**: Create, view, update permissions
- **Viewer**: View-only permissions

## Database Schema

### Core Tables
- `users`: User accounts and authentication
- `areas`: Area-level organizational units
- `districts`: District-level units (belong to areas)
- `assemblies`: Assembly-level units (belong to districts)
- `notifications`: User notification system
- `audit_logs`: Complete activity tracking
- `settings`: System configuration
- `user_sessions`: Session management

## Customization

### Adding Data Entry Forms
The system includes placeholder pages for data entry, editing, and reports. To implement specific functionality:

1. **Data Entry**: Modify `dashboard/data-entry.php` to include your specific forms
2. **Data Edit**: Update `dashboard/data-edit.php` with data management interfaces
3. **Reports**: Customize `dashboard/reports.php` with report generation tools

### Styling
- The system uses Tailwind CSS for styling
- Custom colors are defined in the Tailwind configuration
- Modify the color scheme in the `<script>` sections of each page

### Adding New Features
1. Create new PHP files in the `dashboard/` directory
2. Add navigation links in `includes/header.php`
3. Implement proper permission checking using `checkPermission()` and `checkLevel()`
4. Add audit logging for new actions using `logAudit()`

## Security Considerations

- Change the default superuser password immediately
- Use HTTPS in production environments
- Regularly backup the database
- Monitor audit logs for suspicious activity
- Keep PHP and MySQL updated
- Configure proper file permissions

## Support & Development

This system is designed to be extensible and customizable. The placeholder modules (Data Entry, Data Edit, Reports) are ready for implementation based on specific requirements.

For additional features or modifications, the codebase follows standard PHP practices with:
- PDO for database operations
- Prepared statements for security
- Session-based authentication
- Comprehensive error handling
- Audit trail for all actions

## Version Information

- **Version**: 1.0.0
- **PHP Version**: 7.4+
- **Database**: MySQL 5.7+
- **Frontend**: HTML5, Tailwind CSS, Vue.js
- **Backend**: PHP, MySQL

---

**The Church of Pentecost - Madina Area**  
Data Entry & Report Generation Platform

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists