create identification parts functions

This commit is contained in:
2025-05-09 09:12:08 +02:00
parent 7d0224ac19
commit 7c111b0dba
10 changed files with 407 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
<?php
header('Content-Type: application/json');
include('include/headscript.php');
$dbHandler = DBHandlerSelect::getInstance();
$pdo = $dbHandler->getConnection();
$iddatadb = $_GET['iddatadb'] ?? null;
if (!$iddatadb) {
echo json_encode(['success' => false, 'message' => 'ID TRF mancante']);
exit;
}
try {
$stmt = $pdo->prepare("SELECT id, iddatadb, part_number, part_description FROM identification_parts WHERE iddatadb = :iddatadb ORDER BY part_number ASC");
$stmt->execute([':iddatadb' => $iddatadb]);
$parts = $stmt->fetchAll();
echo json_encode(['success' => true, 'parts' => $parts]);
} catch (PDOException $e) {
echo json_encode(['success' => false, 'message' => 'Errore nel caricamento: ' . $e->getMessage()]);
}