<?php
session_start();
require 'config/db.php';
if (!isset($_SESSION['admin_id'])) {
    header("Location: login.php");
    exit;
}

if (!isset($_GET['id'])) die('Manager ID missing');

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

// Optional: delete login logs first
$pdo->prepare("DELETE FROM manager_login_logs WHERE manager_id=?")->execute([$id]);

// Delete manager
$pdo->prepare("DELETE FROM managers WHERE id=?")->execute([$id]);

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