Sindbad~EG File Manager

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

# Church Attendance Management System

A comprehensive, professional attendance management system designed specifically for churches. This system allows churches to manage attendance across multiple programs, locations, and user roles with a modern, mobile-optimized interface.

## Features

### 🎯 Core Features
- **Landing Page**: Welcome page with program selection
- **Attendance Forms**: Dynamic, customizable attendance forms
- **Multi-User System**: Role-based access (Superuser, Admin, User)
- **Location Management**: District and Assembly hierarchy
- **Program Management**: Create and manage church programs
- **Real-time Analytics**: Dashboard with charts and statistics

### 👥 User Management
- **Superuser**: Full system access and administration
- **Admin Users**: Location-restricted access to their areas
- **Profile Management**: User profiles with customizable settings
- **Secure Authentication**: Password hashing, CSRF protection, session management

### 📊 Reporting & Analytics
- **Export Options**: PDF, CSV, Excel formats
- **Analytics Dashboard**: Charts, trends, and insights
- **Custom Reports**: Filter by date, program, location
- **Real-time Statistics**: Live attendance tracking

### 🎨 Design & UX
- **Modern UI**: Gradient blue, yellow, grey, and white theme
- **Mobile Optimized**: Responsive design for all devices
- **Professional Interface**: Clean, elegant, and intuitive
- **Accessibility**: WCAG compliant design

### 🔧 Technical Features
- **Form Builder**: Dynamic form creation and editing
- **Audit System**: Complete activity logging
- **Notification System**: Real-time notifications
- **Backup & Restore**: Data protection features
- **Settings Module**: Comprehensive configuration options

## Technology Stack

- **Backend**: PHP 7.4+
- **Database**: MySQL 5.7+
- **Frontend**: HTML5, Tailwind CSS, JavaScript
- **Charts**: Chart.js
- **Icons**: Font Awesome 6
- **Server**: Apache/Nginx

## Installation

### Prerequisites
- XAMPP/WAMP/LAMP stack
- PHP 7.4 or higher
- MySQL 5.7 or higher
- Web server (Apache/Nginx)

### Step 1: Download and Setup
1. Clone or download the project to your web server directory
2. Place files in `htdocs/copattendance/` (for XAMPP)

### Step 2: Database Setup
1. Start your MySQL server
2. Open phpMyAdmin or MySQL command line
3. Run the SQL script located at `database/schema.sql`
4. This will create the database and all necessary tables

### Step 3: Configuration
1. Update database credentials in `config/database.php` if needed:
   ```php
   private $host = 'localhost';
   private $db_name = 'church_attendance';
   private $username = 'root';
   private $password = '';
   ```

### Step 4: Access the System
1. Open your web browser
2. Navigate to `http://localhost/copattendance/`
3. You should see the landing page

## Default Login Credentials

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

**Important**: Change the default password immediately after first login!

## File Structure

```
copattendance/
├── admin/                  # Admin panel files
│   ├── includes/          # Shared admin components
│   ├── dashboard.php      # Main admin dashboard
│   ├── login.php         # Admin login page
│   ├── programs.php      # Program management
│   ├── attendance.php    # Attendance records
│   ├── reports.php       # Reports and analytics
│   └── locations.php     # Location management
├── assets/               # Static assets
│   ├── css/             # Stylesheets
│   ├── js/              # JavaScript files
│   └── images/          # Images and logos
├── attendance/          # Public attendance forms
│   └── form.php        # Attendance form page
├── config/             # Configuration files
│   ├── config.php     # Main configuration
│   └── database.php   # Database connection
├── database/          # Database files
│   └── schema.sql    # Database schema
├── index.php         # Landing page
└── README.md        # This file
```

## Usage Guide

### For Church Members (Public)
1. Visit the website homepage
2. Select the program you're attending
3. Fill out the attendance form
4. Submit and receive confirmation

### For Administrators
1. Go to `/admin/login.php`
2. Login with your credentials
3. Access the admin dashboard
4. Manage programs, view reports, and configure settings

### Creating Programs
1. Login as admin/superuser
2. Go to "Programs" in the admin panel
3. Click "Create Program"
4. Fill in program details and save

### Viewing Reports
1. Navigate to "Reports" in admin panel
2. Select report type and filters
3. Export data in desired format (CSV, Excel, PDF)

## Security Features

- **Password Hashing**: Secure password storage using PHP's password_hash()
- **CSRF Protection**: Cross-Site Request Forgery prevention
- **SQL Injection Prevention**: Prepared statements throughout
- **XSS Protection**: Input sanitization and output encoding
- **Session Security**: Secure session management
- **Role-Based Access**: Granular permission system
- **Activity Logging**: Complete audit trail

## Customization

### Theme Colors
Update the gradient colors in the CSS files:
```css
.gradient-bg {
    background: linear-gradient(135deg, #3B82F6 0%, #F59E0B 50%, #6B7280 100%);
}
```

### Site Settings
Modify site settings through the admin panel:
- Site title and logo
- Footer text
- Theme colors
- Notification settings

### Form Fields
Customize attendance form fields through the Form Management section in the admin panel.

## Troubleshooting

### Common Issues

**Database Connection Error**
- Check database credentials in `config/database.php`
- Ensure MySQL server is running
- Verify database exists

**Login Issues**
- Clear browser cache and cookies
- Check if user account is active
- Verify password (default: password123)

**Permission Errors**
- Ensure proper file permissions (755 for directories, 644 for files)
- Check web server user has access to files

**Form Submission Issues**
- Check if JavaScript is enabled
- Verify CSRF tokens are working
- Check browser console for errors

## Support and Maintenance

### Regular Maintenance
- Backup database regularly
- Update passwords periodically
- Monitor audit logs for security
- Clean up old attendance records as needed

### Performance Optimization
- Enable PHP OPcache
- Optimize MySQL queries
- Use CDN for static assets
- Enable gzip compression

## Contributing

This system is designed to be easily extensible. Key areas for enhancement:
- Additional report types
- Email/SMS notifications
- Mobile app integration
- Advanced analytics
- Multi-language support

## License

This project is developed for church use. Please ensure compliance with your organization's policies and local regulations regarding data collection and storage.

## Contact

For technical support or questions about this system, please contact your system administrator.

---

**Version**: 1.0  
**Last Updated**: 2024  
**Developed for**: Church Attendance Management

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