diff --git a/public/userarea/delete_part.php b/public/userarea/delete_part.php new file mode 100644 index 0000000..fc5309a --- /dev/null +++ b/public/userarea/delete_part.php @@ -0,0 +1,29 @@ +getConnection(); + +$data = json_decode(file_get_contents('php://input'), true); + +$partId = $data['part_id'] ?? null; + +if (!$partId) { + echo json_encode(['success' => false, 'message' => 'ID parte mancante']); + exit; +} + +try { + $stmt = $pdo->prepare("DELETE FROM identification_parts WHERE id = :part_id"); + $stmt->execute([':part_id' => $partId]); + $rowCount = $stmt->rowCount(); + if ($rowCount > 0) { + echo json_encode(['success' => true, 'message' => 'Parte eliminata con successo']); + } else { + echo json_encode(['success' => false, 'message' => 'Nessuna parte trovata con ID ' . $partId]); + } +} catch (PDOException $e) { + echo json_encode(['success' => false, 'message' => 'Errore nell\'eliminazione: ' . $e->getMessage()]); +} diff --git a/public/userarea/import_edit.php b/public/userarea/import_edit.php index 24fc5cb..5c4560a 100644 --- a/public/userarea/import_edit.php +++ b/public/userarea/import_edit.php @@ -152,6 +152,7 @@ foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $row) { + + Edit Imported Data - <?= htmlspecialchars($titlewebsite, ENT_QUOTES, 'UTF-8'); ?> @@ -473,6 +499,7 @@ foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $row) {
+
fetchAll(PDO::FETCH_ASSOC) as $row) {
Save
Photos
+
Parts
fetchAll(PDO::FETCH_ASSOC) as $row) {
+
+ +
$value) { @@ -625,7 +656,7 @@ foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $row) {
- +
+
@@ -649,6 +681,7 @@ foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $row) { +