<?php

$id = $_GET['idhapus'];

$datagambar = $koneksi->query("SELECT  artikel_foto From tbl_artikel WHERE artikel_id = '$id'")->fetch_assoc();
$gambar = $datagambar['artikel_foto'];

unlink("dist/img/imgartikel/" . $gambar);
$koneksi->query("DELETE FROM tbl_artikel WHERE artikel_id='$id'");

echo "<script>
       alert('Data Berhasil Di Hapus');
       window.location='?page=pages/artikel/view'
       </script>";
