first commit

This commit is contained in:
claus75a
2024-06-10 10:07:23 +02:00
parent e43b9b4b28
commit c76565c1a3
226 changed files with 24944 additions and 531 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
include('../include/headscript.php');
include("../class/company.php");
if (isset($_POST['filename']) && isset($_POST['idstandards'])) {
$filename = $_POST['filename'];
$idstandards = $_POST['idstandards'];
$filePath = "../pdfstandards/" . $filename;
// Cancella il file dal server
if (file_exists($filePath)) {
unlink($filePath);
}
// Cancella il record dal database
$conn = new mysqli($servername, $username, $password, $database);
$delete = $conn->prepare("DELETE FROM pdfstandards WHERE idstandards = ? AND pdffilename = ?");
$delete->bind_param("is", $idstandards, $filename);
if ($delete->execute()) {
echo json_encode(array("status" => "success", "message" => "File cancellato."));
} else {
echo json_encode(array("status" => "error", "message" => "Errore durante la cancellazione dal database."));
}
$delete->close();
} else {
echo json_encode(array("status" => "error", "message" => "Parametri mancanti."));
}