<?php
require_once '../db.php';
require_once '../includes/auth.php';
requirePermission('products', 'edit');

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

$conn->query("
    UPDATE products
    SET status = IF(status = 1, 0, 1)
    WHERE id = $id
");

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