diff --git a/inbound.php b/inbound.php index db16ae0..d056af8 100644 --- a/inbound.php +++ b/inbound.php @@ -13,13 +13,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) { $id = $_POST['id'] ?? 0; $ref_no = $_POST['ref_no'] ?? ''; $date_registered = $_POST['date_registered'] ?? date('Y-m-d'); - $due_date = $_POST['due_date'] ?? null; + $due_date = !empty($_POST['due_date']) ? $_POST['due_date'] : null; $sender = $_POST['sender'] ?? ''; $recipient = $_POST['recipient'] ?? ''; $subject = $_POST['subject'] ?? ''; $description = $_POST['description'] ?? ''; - $status_id = $_POST['status_id'] ?? null; - $assigned_to = $_POST['assigned_to'] ?? null; + $status_id = !empty($_POST['status_id']) ? $_POST['status_id'] : null; + $assigned_to = !empty($_POST['assigned_to']) ? $_POST['assigned_to'] : null; if ($action === 'add' || $action === 'edit') { try { diff --git a/internal_outbox.php b/internal_outbox.php index 6a75d7b..3ae13ce 100644 --- a/internal_outbox.php +++ b/internal_outbox.php @@ -15,7 +15,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST[' if (!canAdd('internal')) { $error = 'عذراً، ليس لديك الصلاحية لإرسال رسائل'; } else { - $recipient_id = $_POST['recipient_id'] ?? null; + $recipient_id = !empty($_POST['recipient_id']) ? $_POST['recipient_id'] : null; $subject = $_POST['subject'] ?? ''; $description = $_POST['description'] ?? ''; $type = 'internal'; diff --git a/outbound.php b/outbound.php index e0a67b6..1b4fbcd 100644 --- a/outbound.php +++ b/outbound.php @@ -13,13 +13,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) { $id = $_POST['id'] ?? 0; $ref_no = $_POST['ref_no'] ?? ''; $date_registered = $_POST['date_registered'] ?? date('Y-m-d'); - $due_date = $_POST['due_date'] ?? null; + $due_date = !empty($_POST['due_date']) ? $_POST['due_date'] : null; $sender = $_POST['sender'] ?? ''; $recipient = $_POST['recipient'] ?? ''; $subject = $_POST['subject'] ?? ''; $description = $_POST['description'] ?? ''; - $status_id = $_POST['status_id'] ?? null; - $assigned_to = $_POST['assigned_to'] ?? null; + $status_id = !empty($_POST['status_id']) ? $_POST['status_id'] : null; + $assigned_to = !empty($_POST['assigned_to']) ? $_POST['assigned_to'] : null; if ($action === 'add' || $action === 'edit') { try { @@ -311,6 +311,10 @@ if (isset($_GET['id'])) { +
+ + +
-
+