<?php
/**
 * Admin Marka Silme (Pasife Alma) İşlemi
 * Konum: /magaza/admin/urunler/marka_sil.php
 */

require_once '../../includes/db.php';
require_once '../../includes/functions.php';

adminCheck();

if (isset($_GET['id']) && is_numeric($_GET['id'])) {
    $id = (int)$_GET['id'];

    try {
        $stmt = $db->prepare("UPDATE brands SET status = 0 WHERE id = ?");
        $stmt->execute([$id]);

        header("Location: markalar.php");
        exit;
    } catch (Exception $e) {
        die("Marka silinirken hata oluştu: " . $e->getMessage());
    }
} else {
    header("Location: markalar.php");
    exit;
}
?>