View file hashtag.io-2629a1a4ea078149b002e45e2e12bb946062c2b8/ajaxify/ajax_requests/notifications_requests.php

File size: 685B
<?php
  session_start();
  if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == "xmlhttprequest") {

    include_once '../../config/class/needy_class.php';
    // include '../../config/class/notifications.class.php';
    include '../../config/classesGetter.php';
    $noti = new notifications;

    if (isset($_GET['getUnread'])) {
      $unread = $noti->unreadCount();
      $array = array("unread" => $unread);
      echo json_encode($array);
    }

    if (isset($_GET['clearAll'])) {
      $noti->clearNotifications();
    }

    if (isset($_GET['notiFeeds'])) {
      $noti->getNotifications("ajax", $_GET['notiFeeds']);
    }

  }
?>