<?php
session_start();
require_once __DIR__."/config/config.php";

if($_SESSION['role']!='admin') die("Akses ditolak");

$id = (int)$_GET['id'];
$aksi = $_GET['aksi'];

if($aksi=='setujui'){
    mysqli_query($conn,"
        UPDATE upload_laporan SET
            status_verifikasi='ditolak'
        WHERE id_laporan=$id
    ");
}

if($aksi=='batal'){
    mysqli_query($conn,"
        UPDATE upload_laporan SET
            status_verifikasi='disetujui',
            alasan_buka_kunci=NULL
        WHERE id_laporan=$id
    ");
}

header("Location: list_laporan.php");
exit;
