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

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

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

setFlash('warning', 'Setoran ditolak');
redirect('transaksi.php');
?>