<?php include __DIR__ . '/../includes/header.php';
if (!can_approve_leaves()) { set_flash('danger', 'No tenés permiso para rechazar solicitudes.'); redirect('leaves/index.php'); }
$id = (int)($_GET['id'] ?? 0);
$stmt = db()->prepare("UPDATE leaves_requests SET status='Rechazado' WHERE id=?");
$stmt->execute([$id]);
audit_log('update', 'leaves_requests', $id, 'Solicitud rechazada');
set_flash('success', 'Solicitud rechazada.');
redirect('leaves/index.php');
