<?php
/**
 * Force login script for demo purposes
 * This sets the session variables to simulate a logged-in admin user
 */

session_start();

// Clear any existing session
session_destroy();
session_start();

// Set admin session variables
$_SESSION['user_id'] = 1;  // Assuming admin user ID is 1
$_SESSION['username'] = 'admin';
$_SESSION['user_role'] = 'admin';
$_SESSION['role'] = 'admin'; // For backward compatibility
$_SESSION['user_name'] = 'Administrator';

echo "<h2>Force Login Success</h2>";
echo "<p>Session variables have been set to simulate admin login.</p>";
echo "<h3>Current Session Data:</h3>";
echo "<ul>";
echo "<li>user_id: " . $_SESSION['user_id'] . "</li>";
echo "<li>username: " . $_SESSION['username'] . "</li>";
echo "<li>user_role: " . $_SESSION['user_role'] . "</li>";
echo "<li>role: " . $_SESSION['role'] . "</li>";
echo "</ul>";

echo "<h3>Now you can access transport pages:</h3>";
echo "<ul>";
echo "<li><a href='admin/transport/buses.php'>🚌 Buses Management</a></li>";
echo "<li><a href='admin/transport/bus_routes.php'>🛤️ Bus Routes Management</a></li>";
echo "<li><a href='admin/transport/bus_subscriptions.php'>🎫 Student Subscriptions</a></li>";
echo "<li><a href='admin/transport/bus_attendance.php'>📋 Bus Attendance</a></li>";
echo "</ul>";

echo "<p><a href='index.php'>🏠 Go to Home Page</a> | <a href='login.php'>🔐 Normal Login Page</a></p>";

?>