<?php
/**
 * =====================================================
 * SIMPAS v1.0
 * Modul : Jadwal Absensi
 * File   : hapus.php
 * =====================================================
 */

include "../../config/koneksi.php";
include "../../config/session.php";

if(!isset($_GET['id'])){

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

}

$id = intval($_GET['id']);

$hapus=mysqli_query($conn,"
DELETE FROM jadwal_absensi
WHERE id_jadwal='$id'
");

if($hapus){

    echo "
    <script>
        alert('Jadwal berhasil dihapus.');
        window.location='index.php';
    </script>
    ";

}else{

    echo "
    <script>
        alert('Jadwal gagal dihapus.');
        window.location='index.php';
    </script>
    ";

}
?>