<?php
include '../config/koneksi.php';
include '../helpers/functions.php';

if (!isLogin() || !isAdmin()) redirect('../auth/login.php');

$id = (int) $_GET['id'];
mysqli_query($conn, "UPDATE withdrawals SET status='rejected', confirmed_at=NOW(), catatan_admin='Penarikan ditolak admin' WHERE id=$id");

setFlash('warning', 'Penarikan ditolak');
redirect('withdrawals.php');
?>