<?php
session_start();
require "../config.php";

if(!isset($_SESSION['login'])){
    header("Location: /login.php");
    exit;
}

if($_SESSION['role'] != 'admin3'){
    header("Location: /login.php");
    exit;
}

$id = intval($_GET['id'] ?? 0);

if($id > 0){

    $cek = $conn->query("
        SELECT *
        FROM rekomtek
        WHERE id='$id'
    ");

    if($cek->num_rows > 0){

        $conn->query("
            DELETE FROM rekomtek
            WHERE id='$id'
        ");

    }
}

header("Location: laporan_diterima.php");
exit;
?>