MediArchive is a comprehensive web-based medical certificate management system that digitizes the process of issuing, managing, and verifying medical certificates. The system connects clinics, patients, and verification entities through a secure platform with QR code validation, real-time chat, appointment scheduling, and multiple API integrations.
Version: 5.0 (Production Ready - Enhanced)
Last Updated: November 12, 2025
Developed For: System Integration Course
- Digitize Medical Certificate Issuance - Replace paper-based certificates with secure digital versions
- Enable Instant Verification - QR code scanning for immediate certificate validation
- Streamline Communication - Real-time chat between patients and clinics
- Appointment Management - Online booking and scheduling system
- API Integration - SOAP, JSON, and XML endpoints for third-party systems
- Clinic Administrators - Doctors and medical staff issuing certificates
- Patients - Individuals receiving and managing their medical certificates
- Web Administrators - System moderators and analytics viewers
- HR/Verification Entities - Organizations validating certificate authenticity
- Multi-Role System: Clinic Admin, Patient, Web Admin
- Secure Authentication: Password hashing (bcrypt), session management
- User Profiles: Customizable profiles with photo upload
- Registration System: Self-registration for patients, admin-created clinic accounts
- Digital Certificate Creation: Generate certificates with unique IDs (MED-YYYYMMDD-XXXXX)
- QR Code Generation: Automatic QR code creation for each certificate
- PDF Download: Download certificates as PDF documents
- Certificate Requests: Patients can request certificates from clinics
- Status Tracking: Active, Expired, Revoked statuses
- Expiry Management: Automatic expiry date tracking
- Bulk Operations: View and manage multiple certificates
- Clinic Profiles: Detailed clinic information with specializations
- Doctor Signatures: Upload and attach digital signatures
- Clinic Seals: Add official clinic seals to certificates
- Availability Toggle: Set clinic availability for chat and appointments
- Operating Hours: Configure available time slots
- Patient Management: View and manage patient records
- My Certificates: View all personal medical certificates
- Certificate Requests: Request new certificates from clinics
- Appointment Booking: Schedule appointments with available clinics
- Find Doctors: Search clinics by specialization
- Medical History: Track all medical interactions
- Profile Management: Update personal information
- Patient-Clinic Messaging: Direct communication channel
- File Attachments: Share documents and images (up to 10MB)
- Read Receipts: Track message read status
- Availability Indicators: See when clinics/patients are available
- Web Admin Moderation: Monitor all conversations
- Unread Message Counts: Never miss important messages
- Integrated Payments: Process payments for certificates and appointments
- Multiple Payment Methods: Cash, Credit/Debit Card, GCash, PayMaya, Bank Transfer
- Transaction Tracking: Unique transaction IDs for all payments
- Payment History: View all payment records and receipts
- Secure Processing: PCI-compliant payment handling
- Automated Notifications: Payment confirmations and receipts
- Online Booking: Schedule appointments with preferred clinics
- Specialization-Based: Filter by medical specialization
- Time Slot Management: Choose from available time slots
- Status Tracking: Pending, Approved, Rescheduled, Completed, Cancelled
- Appointment History: View past and upcoming appointments
- Notifications: Get notified about appointment updates
- Payment Integration: Appointments can require payment before approval
- Payment Processing: Patients can pay for appointments directly from My Appointments page
- Real-Time Alerts: Instant notifications for important events
- Notification Categories: Certificate created, expiry warnings, appointments, messages
- In-App Notifications: Bell icon with unread count
- Notification Preferences: Customize which notifications to receive
- Mark as Read: Manage notification status
- Comprehensive Security: SQL injection, XSS, CSRF protection
- Automated Security Audits: 10-point security assessment system
- Audit Certificates: Export security reports as PDF, JSON, XML
- Audit Logging: Track all system actions (create, view, delete, update)
- Security Event Logging: Monitor security-related activities
- User Activity Tracking: Monitor user actions with timestamps
- IP Address Logging: Record IP addresses for security
- Certificate Verification Logs: Track QR code scans
- System Statistics: Comprehensive analytics dashboard
- Web Admin Dashboard: View system-wide analytics and logs
- Data Privacy: Secure handling of sensitive medical information
- Endpoint:
/api/soap_server.php - WSDL:
/api/soap_server.php?wsdl - Function:
validateCertificate($cert_id) - Purpose: Enterprise integration for HR systems
- Response: Certificate details and validation status
- Endpoint:
/api/json.php?cert_id=MED-XXXXXXXX - Method: GET
- Purpose: Mobile app integration
- Response: JSON formatted certificate data
- Use Case: Mobile applications, web services
- Endpoint:
/api/xml.php?cert_id=MED-XXXXXXXX - Method: GET
- Purpose: Government/HR system integration
- Response: XML formatted certificate data
- Use Case: Legacy system integration
- Endpoint:
/api/validate.php?cert_id=MED-XXXXXXXX - Method: GET
- Purpose: Instant certificate verification
- Response: HTML page with certificate details
- Use Case: Mobile QR scanning
- Dashboard Statistics: Certificate counts, appointment stats
- User Analytics: Active users, registration trends
- Certificate Analytics: Issued, active, expired counts
- Appointment Analytics: Booking trends, completion rates
- Verification Logs: QR scan statistics
- Audit Reports: Comprehensive activity logs
- PHP 7.4+: Server-side logic and processing
- MySQL 5.7+: Relational database management
- PDO: Database abstraction layer with prepared statements
- SOAP Extension: Web service implementation
- cURL: External API calls and QR generation
- HTML5: Semantic markup
- CSS3: Modern styling with animations
- Bootstrap 5: Responsive UI framework
- JavaScript (ES6): Client-side interactivity
- AJAX: Asynchronous data loading
- Bootstrap Icons: Icon library
- DomPDF: PDF generation for certificates
- Google Charts API: QR code generation
- PHPMailer: Email notifications (optional)
- Session Management: Secure user sessions
- File Upload Handling: Image and document uploads
- MVC Pattern: Separation of concerns
- OOP Utilities: Database, FileProcessor, JsonHelper, XmlHandler
- RESTful APIs: Standard HTTP methods
- SOAP Web Services: Enterprise integration
- Responsive Design: Mobile-first approach
SYSTEMINTEG/
βββ api/ # API Endpoints
β βββ availability.php # Clinic availability toggle
β βββ chat_create.php # Create chat conversation
β βββ chat_send.php # Send chat message
β βββ delete_certificate.php # Delete certificate
β βββ download.php # Download certificate
β βββ json.php # JSON API endpoint
β βββ notifications.php # Notification management
β βββ patient_availability.php # Patient availability toggle
β βββ process_payment.php # Payment processing API
β βββ soap_server.php # SOAP web service
β βββ validate.php # QR validation page
β βββ xml.php # XML export endpoint
β
βββ cron/ # Scheduled Tasks
β βββ expiry_check.php # Check certificate expiry
β
βββ includes/ # Core Classes & Utilities
β βββ dompdf/ # PDF generation library
β βββ AuditLogger.php # Audit logging utility
β βββ Database.php # PDO database wrapper
β βββ EmailNotifier.php # Email notification handler
β βββ FileProcessor.php # File upload handler
β βββ HttpClient.php # cURL wrapper
β βββ JsonHelper.php # JSON encode/decode
β βββ NotificationManager.php # Notification system
β βββ SoapFacade.php # SOAP service wrapper
β βββ XmlHandler.php # XML builder/parser
β
βββ migrations/ # Database Migrations
β βββ 001_add_columns.sql # Initial columns
β βββ 002_feature_enhancements.sql
β βββ 003_new_features.sql
β βββ 004_appointments.sql
β βββ 005_appointments_v2.sql
β βββ 006_add_spec_answers_to_requests.sql
β βββ 007_chat_system.sql
β βββ 008_chat_enhancements.sql
β βββ 009_patient_availability.sql
β
βββ qrcodes/ # Generated QR Codes
β βββ MED-*.png # QR code images
β
βββ temp/ # Temporary Files
β βββ *.pdf # Temporary PDFs
β
βββ tests/ # Test Suite
β βββ run_tests.php # CLI test runner
β
βββ uploads/ # User Uploads
β βββ *.* # Profile photos, attachments
β
βββ views/ # View Files (Pages)
β βββ includes/ # Shared Components
β β βββ role_styles.php # Role-based CSS
β β βββ sidebar.php # Navigation sidebar
β β
β βββ all_appointments.php # All appointments (admin)
β βββ all_certificates.php # All certificates (admin)
β βββ analytics.php # Analytics dashboard
β βββ appointments.php # Appointment management
β βββ audit_logs.php # Audit log viewer
β βββ certificates.php # Certificate list
β βββ chat.php # Chat interface
β βββ clinic_appointments.php # Clinic appointment management
β βββ clinic_transactions.php # Clinic payment transactions
β βββ create_certificate.php # Create new certificate
β βββ dashboard.php # Main dashboard
β βββ doctor_profile.php # Doctor profile (public)
β βββ edit_profile.php # Edit user profile
β βββ find_doctors.php # Find doctors/clinics (logged in)
β βββ find_doctors_public.php # Find doctors (public)
β βββ login.php # Login page
β βββ logout.php # Logout handler
β βββ my_appointments.php # Patient appointments
β βββ my_certificates.php # Patient certificates
β βββ my_transactions.php # Patient payment transactions
β βββ notification_settings.php # Notification preferences
β βββ patient_history.php # Medical history
β βββ patients.php # Patient list (admin)
β βββ profile.php # User profile
β βββ register.php # Registration page
β βββ request_appointment.php # Request appointment
β βββ request_certificate.php # Request certificate
β βββ view_certificate.php # View certificate details
β
βββ config.php # Database configuration
βββ database.sql # Complete database schema
βββ index.php # Landing/login page
βββ package-lock.json # NPM dependencies (if any)
βββ README.md # This file
βββ SETUP_GUIDE.md # Installation instructions
- Web Server: Apache 2.4+ (XAMPP recommended)
- PHP Version: 7.4 or higher
- MySQL Version: 5.7 or higher
- Disk Space: 500MB minimum
- RAM: 512MB minimum
pdo_mysql- Database connectivitygd- Image processingcurl- External API callssoap- SOAP web servicesmbstring- String handlingzip- File compressionxml- XML processing
- Chrome: 90+
- Firefox: 88+
- Safari: 14+
- Edge: 90+
- Mobile: iOS Safari 14+, Chrome Mobile 90+
See SETUP_GUIDE.md for detailed installation instructions.
-
Import Database
# Start XAMPP (Apache + MySQL) # Open phpMyAdmin: http://localhost/phpmyadmin # Import: database.sql
-
Configure
// config.php (usually no changes needed) define('DB_HOST', 'localhost'); define('DB_USER', 'root'); define('DB_PASS', ''); define('DB_NAME', 'mediarchive');
-
Access System
http://localhost/SYSTEMINTEG/
- Username:
admin - Password:
password - Access: Create certificates, manage patients, view appointments
- Username:
patient1 - Password:
password - Access: View certificates, request certificates, book appointments
- Username:
webadmin - Password:
password - Access: System-wide analytics, audit logs, chat moderation
- Upload: Profile photos, signatures, seals, chat attachments
- Download: PDF certificates, certificate files
- File Types: Images (JPG, PNG, GIF), Documents (PDF)
- Storage: Organized in
uploads/andqrcodes/directories
- Database: MySQL with 15+ tables
- Connections: PDO with prepared statements
- Transactions: Atomic operations for data integrity
- Relationships: Foreign keys, cascading deletes
- Indexes: Optimized queries with proper indexing
- SOAP Server: Native PHP SOAP implementation
- WSDL: Auto-generated WSDL definition
- Function:
validateCertificate($cert_id) - Response: Structured certificate data
- Use Case: Enterprise HR system integration
- Export: Certificate data as XML
- Format: Well-formed XML with proper structure
- Encoding: UTF-8 character encoding
- Use Case: Government system integration
- REST API: JSON endpoint for certificate data
- Encoding: PHP
json_encode()with error handling - Decoding: PHP
json_decode()for API requests - Use Case: Mobile app integration
- QR Generation: Google Charts API via cURL
- HTTP Requests: External API calls
- Error Handling: Proper exception handling
- Use Case: QR code image generation
- Framework: Bootstrap 5 responsive framework
- Design: Modern, clean, professional interface with gradient effects
- Modal Authentication: Floating login/register overlays on home page
- Responsiveness: Mobile-first, tablet, desktop
- Accessibility: Semantic HTML, ARIA labels
- UX: Intuitive navigation, clear feedback, smooth animations
- Role-Based Themes: Distinct color schemes for patients, clinics, and admins
- Modern Aesthetics: Matching home page design with cards, shadows, and transitions
- Password Hashing: bcrypt (PHP
password_hash()) - Session Management: Secure session handling
- Login Protection: Brute force prevention
- Role-Based Access: Granular permission system
- SQL Injection Prevention: Prepared statements (PDO)
- XSS Protection: Input sanitization, output escaping
- CSRF Protection: Token-based form validation
- File Upload Validation: Type and size restrictions
- Activity Logging: All actions tracked in audit_logs
- IP Tracking: Record IP addresses for security
- User Agent Logging: Track browser/device information
- Verification Logs: QR scan tracking
- OWASP ZAP Integration: Automated security scanning with Python scripts
- Python Security Audit: Custom XSS and SQL injection testing tools
- Manual Testing: Comprehensive security probe suite
- Audit Reports: Downloadable security certificates (HTML/JSON)
- ZAP Reports: Accessible via web interface at
/views/zap.html - Compliance: Meets academic and OWASP security standards
The system includes Python-based security testing tools in the security_audit/ directory:
- test_security_manual.py: XSS and SQL injection probes
- zap.py: OWASP ZAP automated scanning integration
- requirements.txt: Python dependencies (requests>=2.31.0, python-owasp-zap-v2.4>=0.0.24)
# Install Python dependencies
pip install -r security_audit/requirements.txt
# Run manual security tests
python security_audit/test_security_manual.py --target http://localhost/SYSTEMINTEG
# Run OWASP ZAP scan (requires ZAP running on localhost:8080)
python security_audit/zap.py --target http://localhost/SYSTEMINTEG --apikey YOUR_API_KEY
# View ZAP reports
# - HTML: security_audit/zap_report.html
# - JSON: security_audit/zap_report.json
# - Web: http://localhost/SYSTEMINTEG/views/zap.html- Concurrent Users: 100+ simultaneous users
- Database: Handles 10,000+ certificates
- Response Time: <500ms average page load
- File Storage: Unlimited (disk-dependent)
- Horizontal Scaling: Load balancer ready
- Database Replication: Master-slave support
- Caching: Session-based caching
- CDN Ready: Static asset optimization
- Email Notifications: Not fully implemented (EmailNotifier class exists)
- SMS Notifications: Not implemented
- Multi-Language: English only
- Payment Gateway Integration: Demo mode (ready for Stripe/PayMaya/GCash integration)
- Mobile App: Web-based only (responsive design)
- Offline Mode: Requires internet connection
- Bulk Upload: Single file upload only
- Advanced Search: Basic search functionality
- Two-Factor Authentication: Not implemented
- Real-time Notifications: Polling-based (not WebSocket)
- PDF generation requires DomPDF library (included)
- QR code generation requires internet (Google Charts API)
- Large file uploads may timeout (adjust php.ini if needed)
- Payment system in demo mode (integrate real gateway for production)
- IE11 not supported
- JavaScript required
- Cookies must be enabled
- Pop-up blocker may affect downloads
- Email notification system
- SMS alerts for appointments
- Multi-language support (Filipino, Spanish)
- Payment gateway integration
- Native mobile apps (iOS, Android)
- Offline mode with sync
- Bulk certificate generation
- Advanced analytics dashboard
- Two-factor authentication
- Telemedicine integration
- E-prescription system
- Insurance claim integration
# From project root
php tests/run_tests.php- Database connectivity
- JSON encoding/decoding
- File operations
- HTTP client (cURL)
- SOAP service (requires web server)
- Certificate Workflow: Create β View β Download β Verify
- Chat System: Send message β Receive β Attach file
- Appointments: Book β Approve β Complete
- API Endpoints: Test SOAP, JSON, XML responses
- QR Validation: Scan QR code β Verify certificate
- Ensure XAMPP is running (Apache + MySQL)
- Database is imported (
database.sql) - Test all login credentials
- Prepare sample certificates for demo
- Have QR code ready for scanning
- Database Error: Check MySQL is running, verify credentials
- SOAP Error: Enable SOAP extension in
php.ini - QR Not Generating: Check internet connection
- Permission Denied: Set folder permissions (uploads/, qrcodes/)
- PDF Error: Ensure DomPDF library is in
includes/dompdf/
- Login as Clinic Admin (15s)
- Create Certificate (30s)
- Login as Patient (15s)
- View & Download Certificate (20s)
- Scan QR Code (20s)
- Show API Endpoint (20s)
This project is developed for educational purposes as part of the System Integration course. All rights reserved.
Developed By: Kurt Zildjian C. Santos Course: Systems Integration & CBS 401 Institution: Technological Institute of The Philippines Academic Year: 2024-2025
- β Modal-based authentication - Login/Register overlays on home page
- β Payment system - Integrated payment processing for certificates and appointments
- β Payment gates - Appointments require payment before approval
- β Transaction history - My Transactions pages for patients and doctors
- β Public find doctors - Standalone public page for finding doctors without login
- β Doctor profile viewing - Public access to doctor profiles
- β Enhanced medical history - Combined view of certificates and appointments
- β Web Admin analytics - Comprehensive system-wide analytics dashboard
- β Modern UI overhaul - Matching home page aesthetic across all pages
- β Improved sidebar - Better organization and reduced crowding
- β Increased file upload - Chat attachments up to 10MB
- β Enhanced security - Account lockout, rate limiting, security events tracking
- β Improved analytics - Charts, trends, and detailed reporting
- β Certificate attestation - Medical professional attestation with payment and signature verification
- β Complete chat system with file attachments
- β Patient availability feature
- β Web admin moderation
- β Comprehensive audit logging
- β All migrations consolidated
- β Production-ready database schema
- Added appointment system
- Enhanced notification system
- Audit logging implementation
- Web admin role
- Chat system implementation
- Certificate requests feature
- Profile management
- Analytics dashboard
- Initial release
- Basic certificate management
- QR code validation
- SOAP/JSON/XML APIs
β
Digital Transformation: Paper certificates β Digital system
β
Instant Verification: QR code scanning
β
Real-Time Communication: Chat system
β
Appointment Management: Online booking
β
API Integration: SOAP, JSON, XML
β
Security: Audit logs, authentication
β
User Experience: Modern, responsive UI
β
Scalability: Modular architecture
Thank you
For questions or issues, please refer to the SETUP_GUIDE.md