<?php

require 'koneksi.php';

$con = open_connection();

$id = $_GET['id'];

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

mysqli_query($con, "DELETE FROM perkembangan WHERE id_murid='$id'");
mysqli_query($con, "DELETE FROM murid WHERE id_murid='$id'");

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

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

?>