<?php
require_once("../php/db_connect.php");
session_start();

if (!isset($_GET["id"])) {
    die("Invalid request");
}

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

$stmt = $conn->prepare("UPDATE services SET status = 'archived' WHERE id = ?");
$stmt->bind_param("i", $id);

if ($stmt->execute()) {
    header("Location: admin.php?page=services&message=archived");
    exit;
} else {
    die("Failed to archive service.");
}