<?php
declare(strict_types=1);
session_start();
if (empty($_SESSION['miter'])) {
header('Location: ../../index.php');
exit;
}
if (isset($_GET['d'])) {
$tenon_name = basename((string)$_GET['d']);
$txt_file = "../../tenons/{$tenon_name}.txt";
if (file_exists($txt_file) && is_file($txt_file)) {
unlink($txt_file);
}
// log
include '../admin/otc.php';
$log_data = ($o_date . " -- Deleted Tenon: " . $tenon_name . "\n");
$log_file = '../admin/log.txt';
file_put_contents($log_file, $log_data, FILE_APPEND | LOCK_EX);
header('location:../../index.php?l=');
exit;
}
?>