<?php
include "../config/koneksi.php";
include "../middleware/auth.php";
include "../config/komplain_workflow.php";

sikompro_require_role('pelaksana');

$id = (int)$_POST['id'];
$hasil = isset($_POST['admin_keterangan']) ? komplain_escape($conn, $_POST['admin_keterangan']) : '';

mysqli_query($conn,"
    UPDATE komplain 
    SET status='menunggu_admin',
        hasil_pelaksana='$hasil',
        admin_keterangan='$hasil',
        tanggal_update=NOW()
    WHERE id='$id'
");

header("Location: dashboard.php?pesan=terkirim_admin");
