<?php
require 'koneksi.php';
$con = open_connection();

$id = $_GET['id'];

$data = mysqli_fetch_assoc(mysqli_query($con, "SELECT nama FROM guru WHERE id_guru='$id'"));
$nama = $data ? $data['nama'] : 'ID ' . $id;

mysqli_query($con,
"DELETE FROM guru WHERE id_guru='$id'");

catat_log($con, "Data guru dihapus: " . $nama, "guru");

header("Location:guru.php");
?>