upgrade matrice with files

This commit is contained in:
2026-03-19 16:16:41 +01:00
parent 245750f057
commit f043b43791
28 changed files with 4028 additions and 358 deletions
+24
View File
@@ -0,0 +1,24 @@
<?php
include('include/headscript.php');
header('Content-Type: application/json');
$category = trim($_POST['category'] ?? '');
$item_name = trim($_POST['item_name'] ?? '');
$item_code = trim($_POST['item_code'] ?? '');
$allowed = ['PACKAGING_TYPE', 'BOX', 'PALLET', 'OTHER'];
if (!in_array($category, $allowed, true) || $item_name === '' || $item_code === '') {
echo json_encode(['success' => false, 'message' => 'Invalid input']);
exit;
}
$db = DBHandlerSelect::getInstance();
$pdo = $db->getConnection();
try {
$stmt = $pdo->prepare("INSERT INTO packaging_items (category, item_name, item_code) VALUES (?,?,?)");
$stmt->execute([$category, $item_name, $item_code]);
echo json_encode(['success' => true]);
} catch (PDOException $e) {
echo json_encode(['success' => false, 'message' => $e->getMessage()]);
}