<?php
include 'includes/auth.php';
include 'db.php';

if(!isset($_GET['id']) || !is_numeric($_GET['id'])){
    die("Invalid request ID.");
}

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

// Update status to Approved
$stmt = $conn->prepare("UPDATE maintenance_requests SET status='Approved' WHERE id=?");
$stmt->bind_param("i", $request_id);
$stmt->execute();
$stmt->close();

header("Location: maintenance_requests.php");
exit;
?>