<?php
// Get the name/code from the URL and clean it
$code = isset($_GET['code']) ? strtolower(trim($_GET['code'])) : '';

if (empty($code)) {
    die("No identification name provided.");
}

/**
 * MAPPING LOGIC
 * We check the specific name and include the correct design file.
 */

switch ($code) {
    // ELDER CARE DEMO
    case 'saraswathi-r':
        include('elder-care.php');
        break;

    // STUDENT DEMO
    case 'krishika-kowtham':
    case 'krishnakowtham': // Adding a variation just in case
        include('smartstudent.php');
        break;

    // PET DEMO
    case 'arjun':
        include('petsmart.php');
        break;

    // BIKE / VEHICLE DEMO
    case 'kowthamkr':
        include('bike.php');
        break;

    // OTHER DEMOS
    case 'womensafety':
        include('womensafety.php');
        break;
        
    case 'apartment':
        include('aprtsmart.php');
        break;

    // DEFAULT ERROR
    default:
        header("HTTP/1.0 404 Not Found");
        echo "<div style='text-align:center; margin-top:50px; font-family:sans-serif;'>";
        echo "<h1>Tag Not Found</h1>";
        echo "<p>The OneQRScan profile for <b>" . htmlspecialchars($code) . "</b> has not been activated yet.</p>";
        echo "<a href='/'>Go to Home</a>";
        echo "</div>";
        break;
}
exit;