add stats, and add history import details

This commit is contained in:
2024-10-17 13:52:03 +02:00
parent 01fffcb0ac
commit 4f0ad202c9
11 changed files with 630 additions and 7 deletions
@@ -0,0 +1,25 @@
<?php
include('../include/headscript.php');
include("../class/company.php");
$conn = new mysqli($servername, $username, $password, $database);
$analysisId = $_POST['analysis_id'] ?? null;
$compoundId = $_POST['compound_id'] ?? null;
if ($analysisId && $compoundId) {
$sql = "INSERT INTO analysis_compounds (idanalysisvocabulary, idcompoundsvocabulary) VALUES (?, ?)";
$stmt = $conn->prepare($sql);
$stmt->bind_param("ii", $analysisId, $compoundId);
if ($stmt->execute()) {
echo json_encode(['success' => true]);
} else {
echo json_encode(['success' => false, 'error' => 'Error adding compound association.']);
}
$stmt->close();
} else {
echo json_encode(['success' => false, 'error' => 'Invalid input data.']);
}
$conn->close();