diff --git a/assignTaskForm.php b/assignTaskForm.php index b2fb740..191b4bd 100644 --- a/assignTaskForm.php +++ b/assignTaskForm.php @@ -98,6 +98,17 @@ $adminInstructions = mysqli_real_escape_string($conn, $_POST['admin_instruction']); $handover_to = mysqli_real_escape_string($conn, $_POST['handover_to']); + + //check for duplicate task + $checkTask = "SELECT * FROM assign_task WHERE order_no_fk = '$workorder_no'"; + $resultCheck = mysqli_query($conn, $checkTask); + if ($resultCheck->num_rows > 0) { + // If task already exists, redirect to assignTaskForm.php with error message + $_SESSION['error_message'] = "Task already assigned!"; + header("Location: assignTaskForm.php?id=$workorder_no"); + exit; + } + // Insert data into box table $sql = "INSERT INTO assign_task (order_no_fk, assign_to, location, bank_instruction, admin_instruction, box, items, is_read, handover_to) VALUES ('$workorder_no', '$assign_to', '$location', '$bankInstructions', '$adminInstructions', '$barcode', '$json_items', '0', '$handover_to')"; diff --git a/image/messages_3.jpg b/image/messages_3.jpg new file mode 100644 index 0000000..390712b Binary files /dev/null and b/image/messages_3.jpg differ diff --git a/order.php b/order.php index 9da7e30..1de41ec 100644 --- a/order.php +++ b/order.php @@ -532,6 +532,7 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+ +Box | +Items | +Location | +Hand over to | '; + echo '
---|---|---|---|
';
+ $barcodes = explode(',', $row['barcode']); // Split comma-separated values into an array
+ echo '
| ';
+
+ echo '';
+ $item_barcodes = explode(',', $row['item_barcode']); // Split comma-separated values into an array
+ echo '
| ';
+
+
+ echo ''; // End unordered list
+ echo '';
+
+ echo '' . + "L4-B-02-C-01" . + ' | '; + + + echo '' . + $handover_to . + ' | '; + } + echo '
No items found.
'; + } + + ?> +L4-B-02-C-01
Courier
+