╔════════════════════════════════════════════════════════════════╗
║                                                                ║
║         SUB2ME BOREHOLE TECH - MANAGEMENT SYSTEM              ║
║              QUICK INSTALLATION GUIDE                          ║
║                                                                ║
╚════════════════════════════════════════════════════════════════╝

📦 INSTALLATION - 5 SIMPLE STEPS
════════════════════════════════════════════════════════════════

STEP 1: UPLOAD FILES
--------------------
✓ Upload all files to your server
  (Example: public_html/borehole or /var/www/html/borehole)


STEP 2: CREATE DATABASE  
-----------------------
✓ Log in to cPanel or phpMyAdmin
✓ Create new database: "borehole_tech"
✓ Import the "install.sql" file
  
  In phpMyAdmin:
  → Select database
  → Click "Import" tab
  → Choose "install.sql"
  → Click "Go"


STEP 3: CONFIGURE DATABASE
--------------------------
✓ Edit "config.php" file
✓ Update these lines:

  define('DB_HOST', 'localhost');
  define('DB_USERNAME', 'your_username');     ← Change this
  define('DB_PASSWORD', 'your_password');     ← Change this
  define('DB_NAME', 'borehole_tech');
  define('SITE_URL', 'https://yourdomain.com/borehole_system'); ← Change this

✓ Save the file


STEP 4: SET PERMISSIONS (Linux servers only)
---------------------------------------------
chmod 755 /path/to/borehole_system
chmod 644 /path/to/borehole_system/*.php


STEP 5: LOGIN
-------------
✓ Open: https://yourdomain.com/borehole_system/
✓ Login with:
  
  Username: admin
  Password: admin123

⚠️  IMPORTANT: CHANGE PASSWORD IMMEDIATELY!


════════════════════════════════════════════════════════════════
🎯 QUICK START
════════════════════════════════════════════════════════════════

1️⃣  ADD AGENTS
   → Go to "Agents" menu
   → Click "+ Add New Agent"
   → Enter agent details

2️⃣  CREATE PROJECT
   → Click "+ New Project"
   → Select agent
   → Enter location and depth
   → Choose payment terms:
      * Standard 70/30 split, OR
      * Custom amount
   → Save

3️⃣  RECORD PAYMENT
   → Open project details
   → Click "Record Initial Payment"
   → Enter payment info
   → Save

4️⃣  UPDATE STATUS
   → Click "Update Status"
   → Change from "Pending" → "Approved" → "In Progress" → "Completed"
   → Enter depth achieved
   → Save

5️⃣  VIEW REPORTS
   → Go to "Reports" menu
   → Select month
   → See profit/loss breakdown


════════════════════════════════════════════════════════════════
💡 FEATURES
════════════════════════════════════════════════════════════════

✓ Flexible payment terms (percentage or custom amounts)
✓ Agent performance tracking
✓ Outstanding balance monitoring
✓ Automatic profit calculations
✓ Monthly financial reports
✓ Complete activity logs
✓ WhatsApp integration with agents


════════════════════════════════════════════════════════════════
⚙️  DEFAULT SETTINGS
════════════════════════════════════════════════════════════════

Rate per meter:       ₦12,500
Initial payment:      70%
Diesel price:         ₦990/liter
GM commission:        ₦500/meter
CEO commission:       ₦1,500/meter
Staff feeding:        ₦2,500/day
Monthly target:       20 boreholes


════════════════════════════════════════════════════════════════
🛠️  TROUBLESHOOTING
════════════════════════════════════════════════════════════════

❌ "Database Connection Failed"
   → Check config.php has correct credentials
   → Verify database exists
   → Ensure database user has privileges

❌ Blank page after login
   → Check install.sql imported successfully
   → Check PHP error logs
   → Verify all files uploaded

❌ Session errors
   → Enable PHP sessions on server
   → Check folder permissions


════════════════════════════════════════════════════════════════
📚 FILES INCLUDED
════════════════════════════════════════════════════════════════

config.php              - Database configuration ✏️ EDIT THIS
install.sql             - Database installation 📦 IMPORT THIS
login.php               - Login page
index.php               - Dashboard
add_project.php         - Create projects
projects.php            - View all projects
project_details.php     - Project details
payments.php            - Payment tracking
agents.php              - Agent management
reports.php             - Financial reports
README.txt              - Full documentation
INSTALL.txt             - This file


════════════════════════════════════════════════════════════════
🔐 SECURITY REMINDERS
════════════════════════════════════════════════════════════════

⚠️  Change default admin password immediately
⚠️  Backup database weekly
⚠️  Use HTTPS (SSL certificate)
⚠️  Keep system updated
⚠️  Don't share login credentials


════════════════════════════════════════════════════════════════
📞 NEED HELP?
════════════════════════════════════════════════════════════════

Read the full README.txt for detailed documentation


════════════════════════════════════════════════════════════════

Version: 1.0
Created: January 2026
For: Sub2me Borehole Tech

════════════════════════════════════════════════════════════════
