<?php
declare(strict_types=1);

require __DIR__ . '/../auth.php';
requireLogin();

$storeId = isset($_POST['store_id']) ? (int)$_POST['store_id'] : 0;

if ($storeId > 0) {
    $stmt = $pdo->prepare('DELETE FROM stores WHERE id = :id');
    $stmt->execute([':id' => $storeId]);
}

header('Location: ../start.php');
exit;
