<?php declare(strict_types=1);
if (session_status() === PHP_SESSION_NONE) session_start();

/* ---------- DB (optional; safe if not used) ---------- */
const DB_HOST = 'localhost';
const DB_USER = 'edencamp_eden';
const DB_PASS = 'D#uVBrdpAppH^d,6';
const DB_NAME = 'edencamp_edencampus';
const DB_PORT = 3306;

/* ---------- Timezone ---------- */
date_default_timezone_set('Asia/Colombo');

/* ---------- BASE_URL (auto-detects /admin.edencampus.lk/elms) ---------- */
if (!defined('BASE_URL')) {
  // Example result: /admin.edencampus.lk/elms
  $autoBase = rtrim(str_replace('\\','/', dirname($_SERVER['SCRIPT_NAME'] ?? '')), '/');
  define('BASE_URL', $autoBase ?: '');
}

/* ---------- Demo accounts (fallback if no users table) ---------- */
$DEMO_ACCOUNTS = [
  ['u'=>'admin', 'p'=>'admin123', 'role'=>'super_admin',  'name'=>'Super Admin'],
  ['u'=>'coord', 'p'=>'coord123', 'role'=>'coordinator',  'name'=>'Course Coordinator'],
  ['u'=>'lect',  'p'=>'lect123',  'role'=>'lecturer',     'name'=>'Lecturer'],
  ['u'=>'stud',  'p'=>'stud123',  'role'=>'student',      'name'=>'Test Student'],
];
