PLATFORM IMPROVEMENTS — 2026-08-21 ================================== All changes implemented across Admin, Trader, and Investor portals. ────────────────────────────────────────────────────────────────────── 1. FORGOT-PASSWORD LINKS ────────────────────────────────────────────────────────────────────── - trader/login.php → "Forgot password?" link added below the password field - investor/login.php → "Forgot password?" link added below the password field (The reset API already worked for all roles; links were just missing from the UI) ────────────────────────────────────────────────────────────────────── 2. ACCOUNT SETTINGS PAGES (self-service name / language / password) ────────────────────────────────────────────────────────────────────── New pages: trader/account.php — trader changes name or password investor/account.php — investor changes name, preferred language, or password New JS: assets/js/trader/account.js assets/js/investor/account.js Admin password change: admin/settings.php — new "Account" tab (change name / password without DB access) New API endpoints: PUT /api/trader/account — trader self-service update PUT /api/investor/account — investor self-service update PUT /api/account — admin self-service update New controller: api/controllers/AccountController.php "Account" nav link added to all sidebar pages in all three portals. ────────────────────────────────────────────────────────────────────── 3. INVESTOR UNFOLLOW TRADER ────────────────────────────────────────────────────────────────────── - investor/index.php → "Unfollow" button added next to "Change Trader" - assets/js/investor/dashboard.js → handleUnfollowTrader() wired up New API endpoint: DELETE /api/investor/assigned-trader ────────────────────────────────────────────────────────────────────── 4. RISK WARNING BEFORE FOLLOWING A TRADER ────────────────────────────────────────────────────────────────────── - assets/js/investor/traders.js → confirmation dialog before follow / switch - assets/js/investor/dashboard.js → same dialog on dashboard trader-selection ────────────────────────────────────────────────────────────────────── 5. MOBILE RESPONSIVE SIDEBAR (hamburger menu) ────────────────────────────────────────────────────────────────────── New file: assets/js/sidebar-mobile.js — injects hamburger button; handles slide-in/out overlay CSS added to: assets/css/app.css — sidebar fixed-position + transform at < 768px Script injected into all 21 portal pages: admin/index.php, copy-trading-api.php, email-logs.php, investor-traders.php, investors.php, logs-explorer.php, order-logs.php, sahme-api-brokers.php, sahme-api-wt5.php, settings.php trader/account.php, followers.php, index.php, portfolio.php, profile.php, trademarket.php investor/account.php, index.php, portfolio.php, trader-profile.php, traders.php ────────────────────────────────────────────────────────────────────── 6. CSV EXPORT ────────────────────────────────────────────────────────────────────── "Export CSV" button added to: admin/investors.php → downloads investors list as CSV admin/investor-traders.php → downloads traders list as CSV admin/order-logs.php → downloads order logs as CSV Export support added to controllers: api/controllers/UserController.php → GET /api/users?export=csv api/controllers/OrderLogsController.php → GET /api/order-logs?export=csv ────────────────────────────────────────────────────────────────────── 7. ADMIN COPY-TRADE ORDERS PAGE ────────────────────────────────────────────────────────────────────── New page: admin/copy-trade-orders.php — lists all copy-trade batches (trader, symbol, side, amount, follower count, success count, date) New JS: assets/js/admin/copy-trade-orders.js New controller: api/controllers/CopyTradeOrdersController.php New API endpoint: GET /api/copy-trade-orders — paginated list GET /api/copy-trade-orders?export=csv — full CSV download "Copy Trade Orders" nav link added to all admin sidebar pages. ────────────────────────────────────────────────────────────────────── 8. API HEALTH ENDPOINT ────────────────────────────────────────────────────────────────────── New controller: api/controllers/HealthController.php New endpoint: GET /api/health (no auth required) Returns: { status: "ok"|"degraded", db: "ok"|"error", timestamp } HTTP 200 when healthy, 503 when DB unreachable. ────────────────────────────────────────────────────────────────────── 9. ADMIN SIDEBAR i18n FIX ────────────────────────────────────────────────────────────────────── Hardcoded English section labels ("Main Menu", "System", "Logs", "API") now carry data-i18n attributes in: admin/index.php admin/investor-traders.php (The translation keys portal.main_menu / portal.system / portal.logs / portal.api already existed in all three lang files.) ────────────────────────────────────────────────────────────────────── 10. i18n KEYS — new strings in all three languages (en / ar / es) ────────────────────────────────────────────────────────────────────── assets/lang/en.json / ar.json / es.json — new keys added: account.* — Account Settings page labels traders.follow_warning — risk disclosure before following traders.switch_warning — risk disclosure before switching traders.unfollowed investor_dash.unfollow_trader / unfollow_confirm / unfollowed export.csv copy_trade_orders.* api/lang/en.php / ar.php / es.php — new server-side keys: validation.current_password_required validation.current_password_wrong validation.invalid_language traders.unfollowed ────────────────────────────────────────────────────────────────────── 11. CRON SCRIPT ────────────────────────────────────────────────────────────────────── New file: cron/email-retry.php Purpose: Re-sends failed emails (up to 3 retries, min 5-min gap). Schedule: */5 * * * * php /path/to/invest/cron/email-retry.php ────────────────────────────────────────────────────────────────────── FILES CHANGED (modified) ────────────────────────────────────────────────────────────────────── admin/copy-trading-api.php admin/email-logs.php admin/index.php admin/investor-traders.php admin/investors.php admin/logs-explorer.php admin/order-logs.php admin/sahme-api-brokers.php admin/sahme-api-wt5.php admin/settings.php api/controllers/InvestorController.php (added unfollowTrader) api/controllers/OrderLogsController.php (added CSV export) api/controllers/UserController.php (added CSV export) api/index.php (registered new routes) api/lang/ar.php api/lang/en.php api/lang/es.php assets/css/app.css (mobile sidebar CSS) assets/js/admin/investor-traders.js (export button) assets/js/admin/investors.js (export button) assets/js/admin/order-logs.js (export button) assets/js/admin/settings.js (admin account tab) assets/js/investor/dashboard.js (unfollow + risk warning) assets/js/investor/traders.js (risk warning) assets/lang/ar.json assets/lang/en.json assets/lang/es.json investor/index.php (unfollow button + account nav) investor/login.php (forgot-password link) investor/portfolio.php (account nav) investor/trader-profile.php (account nav) investor/traders.php (account nav) trader/followers.php (account nav) trader/login.php (forgot-password link) trader/portfolio.php (account nav) trader/profile.php (account nav) trader/trademarket.php (account nav) trader/index.php (account nav) FILES ADDED (new) ────────────────────────────────────────────────────────────────────── admin/copy-trade-orders.php api/controllers/AccountController.php api/controllers/CopyTradeOrdersController.php api/controllers/HealthController.php assets/js/admin/copy-trade-orders.js assets/js/investor/account.js assets/js/sidebar-mobile.js assets/js/trader/account.js cron/email-retry.php investor/account.php trader/account.php