<LINK href="images/index.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
    function refreshAndClose() {
        window.opener.location.reload(true);
        window.close();
    }
</script>
<body onbeforeunload="refreshAndClose();">
<?php
include("../index.cma.db.php");
$uid1 = $_GET["uid"];
$table1 = $_GET["table"];

// Create connection
$conn = new mysqli($server, $username, $password, $database);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
// sql to delete a record
$sql = "DELETE FROM $table1 WHERE tu_noagenda = $uid1";
if ($conn->query($sql) === TRUE) {
    echo "BERHASIL MENGHAPUS  TUTUP JENDELA INI";
} else {
    echo "Error deleting record: " . $conn->error;
}
$conn->close();
?> 