================================================================================
INVESTOR DATABASE SYSTEM - QUICK SETUP GUIDE
================================================================================

STEP 1: DATABASE SETUP
----------------------
1. Open phpMyAdmin or MySQL command line
2. Import the database schema:
   - In phpMyAdmin: Import > Choose file > database/schema.sql > Go
   - In MySQL command: mysql -u root -p < database/schema.sql

This creates the 'investor_db' database with 3 tables:
   - staff (bank employees)
   - clients (investor records)
   - contact_records (interaction history)

STEP 2: CONFIGURE DATABASE CONNECTION
--------------------------------------
1. Open: includes/config.php
2. Update these settings with your database credentials:

   define('DB_HOST', 'localhost');      // Your database host
   define('DB_USER', 'root');           // Your database username
   define('DB_PASS', '');               // Your database password
   define('DB_NAME', 'investor_db');    // Database name (keep as is)

STEP 3: START THE APPLICATION
------------------------------
Option A - PHP Built-in Server (Quick Test):
   1. Open terminal/command prompt
   2. Navigate to investor-database folder
   3. Run: php -S localhost:8000
   4. Open browser: http://localhost:8000

Option B - XAMPP/WAMP/MAMP:
   1. Copy investor-database folder to htdocs (XAMPP) or www (WAMP)
   2. Start Apache and MySQL
   3. Open browser: http://localhost/investor-database

Option C - Production Server:
   1. Upload files to your web server
   2. Ensure PHP 7.4+ and MariaDB/MySQL are installed
   3. Set proper file permissions (chmod 755)
   4. Access via your domain

STEP 4: VERIFY INSTALLATION
----------------------------
1. You should see the Dashboard with statistics
2. The system includes 5 sample staff members
3. Try these features:
   - Add a test client (Add Client menu)
   - Search for clients (Search Clients menu)
   - Add a contact record (Contact Records menu)

TROUBLESHOOTING
---------------
Error: "Connection failed"
   → Check database credentials in includes/config.php
   → Ensure MySQL/MariaDB is running
   → Verify database 'investor_db' exists

Error: "Access denied"
   → Update DB_USER and DB_PASS in config.php
   → Grant proper permissions to database user

Blank page with no errors:
   → Enable error reporting (already set in config.php)
   → Check PHP error logs
   → Verify PHP version is 7.4 or higher

Cannot find pages:
   → Ensure you're accessing index.php
   → Check file paths are correct
   → Verify web server is running

SYSTEM FEATURES
---------------
✓ Client Management - Complete investor profiles with KYC
✓ Advanced Search - Filter by multiple criteria
✓ Contact Tracking - Record all client interactions
✓ Staff Management - Manage bank employees
✓ Dashboard - Real-time statistics and recent activity

DEFAULT LOGIN (if you add authentication later):
Username: admin
Password: [You need to implement authentication]

SECURITY NOTES FOR PRODUCTION
------------------------------
1. Change database credentials from defaults
2. Disable error display (set display_errors = 0 in config.php)
3. Implement user authentication system
4. Use HTTPS (SSL/TLS certificate)
5. Regular database backups
6. Update PHP to latest version
7. Use prepared statements (enhance db.php)

NEXT STEPS
----------
1. Add your bank's staff members via Staff Management
2. Start adding client records
3. Begin tracking client interactions
4. Customize the system to your needs

For questions or customization requests, refer to README.md

================================================================================
Version 1.0 - © 2025 Investor Database System
================================================================================
