<?php 
include '../koneksi.php';
$id = $_GET['id'];

// hapus file lama
$lama = mysqli_query($koneksi,"select * from undangan where kode_surat='$id'");
$l = mysqli_fetch_assoc($lama);
$nama_file_lama = $l['file_surat'];
unlink("../arsipmonev/".$nama_file_lama);

mysqli_query($koneksi, "delete from undangan where kode_surat='$id'");
header("location:undangan.php");
