<?php
session_start();
require_once '../config/database.php';
require_once '../config/helpers.php';

if (!can('agents','edit')) die('Access Denied');

$id = (int)$_GET['id'];

$pdo->prepare("
    UPDATE agents
    SET status='active', updated_at=NOW()
    WHERE agent_id=?
")->execute([$id]);

header("Location: agents.php");
exit;
