diff --git a/public/userarea/apilogic/process_import.php b/public/userarea/apilogic/process_import.php
index 9725991..03c6c0f 100644
--- a/public/userarea/apilogic/process_import.php
+++ b/public/userarea/apilogic/process_import.php
@@ -415,4 +415,6 @@ function markForIntervention($id, $pdo)
$query = "UPDATE temp_json_queue SET processed = 2 WHERE id = :id";
$stmt = $pdo->prepare($query);
$stmt->execute(['id' => $id]);
+
+ $query = "INSERT INTO notifications (`title`,`description`) VALUES ('Intervention Required', 'Intervention required for JSON entry with ID $id')";
}
diff --git a/public/userarea/importify/interventionlist.php b/public/userarea/importify/interventionlist.php
index 775b8fe..f7fc458 100644
--- a/public/userarea/importify/interventionlist.php
+++ b/public/userarea/importify/interventionlist.php
@@ -130,7 +130,8 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/userarea/notifications/notifications.php b/public/userarea/notifications/notifications.php
new file mode 100644
index 0000000..62d8ea5
--- /dev/null
+++ b/public/userarea/notifications/notifications.php
@@ -0,0 +1,205 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | ID |
+ Title |
+ Description |
+ Actions |
+
+
+
+ connect_error) {
+ die("Connection failed: " . $conn->connect_error);
+ }
+
+ // Query for rows with processed = 2
+ $sql = "SELECT * FROM notifications";
+ $result = $conn->query($sql);
+
+ $all_notifications = [];
+ if ($result->num_rows > 0) {
+ while ($row = $result->fetch_assoc()) {
+ $all_notifications[] = $row;
+ }
+ }
+
+ $user_id = $_SESSION['iduserlogin'];
+ $all_notification_ids = array_column($all_notifications, 'id');
+ $all_notification_ids_str = implode(',', $all_notification_ids);
+
+ $sql = "SELECT notification_id
+ FROM seen_notifications
+ WHERE notification_id IN ($all_notification_ids_str)
+ AND user_id = $user_id";
+ $result = $conn->query($sql);
+ $seen_notification_ids = [];
+ if ($result->num_rows > 0) {
+ while ($row = $result->fetch_assoc()) {
+ $seen_notification_ids[] = $row['notification_id'];
+ }
+ }
+
+ $seen_notifications = [];
+ foreach($all_notifications as $notification){
+ if(in_array($notification['id'], $seen_notification_ids)){
+ $seen_notifications[] = $notification;
+ }
+ }
+
+ $unseen_notifications = array_udiff($all_notifications, $seen_notifications, function ($a, $b) {
+ return $a['id'] <=> $b['id'];
+ });
+
+
+ // unseen notifications with mark as seen button and different color , seen without that
+ if(!empty($all_notifications)){
+ foreach($all_notifications as $notification){
+ if(in_array($notification, $unseen_notifications)){
+ echo "";
+ }else{
+ echo "
";
+ }
+ echo "| " . $notification['id'] . " | ";
+ echo "" . $notification['title'] . " | ";
+ echo "" . $notification['description'] . " | ";
+ if(in_array($notification, $unseen_notifications)){
+ echo "
+
+ | ";
+ }else{
+ echo " | ";
+ }
+ echo "
";
+ }
+ }
+
+ $conn->close();
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file