<?php
session_start();
require_once __DIR__ . '/../src/db.php';

$workspaceId = $_GET['id'] ?? 1;

// Get company data
$pdo = getPDO();
$stmt = $pdo->prepare("SELECT * FROM companies WHERE id = ?");
$stmt->execute([$workspaceId]);
$company = $stmt->fetch();

if ($company) {
    $_SESSION['workspace'] = $company;
}

// Redirect to main page
header("Location: index.php");
?>
