<?php
include "../../../../inc/conn.php";

$id         = $_POST['id'];
$unit         = $_POST['unit'];

$sql = "select * from tb_materi where id_materi=".$id;
$result = mysqli_query($connect,$sql);

$response = "<div style='align:center;'>";
while( $row = mysqli_fetch_array($result) ){
?>
    <form action="hapusfile" method="POST">
        
        <input type="hidden" name="id_materi" value="<?php echo $id;?>">
        <input type="hidden" name="id_unit" value="<?php echo $unit;?>">
        
        <table align="center">
            <tr><td align="center">
            <i style="font-size:50px;" class="fas fa-trash"></i>
            <br><br>
            Anda yakin akan menghapus artikel ini ?
            </td></tr>

            <tr><td align="center">
                <br>
                <button type="submit" class="btn btn-primary">Hapus</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">Batal</button>
            </td></tr>
        </table>

    </form>
<?php
}
$response .= "</div";
echo $response;
exit;