added laboratory creation with API secret and key

This commit is contained in:
2024-10-17 17:25:43 +02:00
parent 4f0ad202c9
commit 837bfbaded
8 changed files with 641 additions and 25 deletions
+19
View File
@@ -0,0 +1,19 @@
<?php
include('../include/headscript.php');
include('../class/company.php');
$conn = new mysqli($servername, $username, $password, $database);
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$idlab = $_POST['idlab'];
$stmt = $conn->prepare("DELETE FROM laboratories WHERE idlab = ?");
$stmt->bind_param("i", $idlab);
if ($stmt->execute()) {
echo json_encode(["status" => "success", "message" => "Laboratory deleted successfully."]);
} else {
echo json_encode(["status" => "error", "message" => "Failed to delete laboratory."]);
}
$stmt->close();
}
$conn->close();