Ejemplo n.º 1
0
 if (isset($_GET['ajax']) && $_GET['ajax'] == 'msgQueueTable') {
     isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'uint') ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE);
     if (isset($_GET['sort']) && eF_checkParameter($_GET['sort'], 'text')) {
         $sort = $_GET['sort'];
         // @TODO fix
         if ($sort == "timestamp") {
             $order = "desc";
         } else {
             isset($_GET['order']) && $_GET['order'] == 'desc' ? $order = 'desc' : ($order = 'asc');
         }
     } else {
         $sort = 'timestamp';
         $order = 'asc';
     }
     $constraints = createConstraintsFromSortedTable();
     list($where, $limit, $orderby) = EfrontNotification::convertNotificationConstraintsToSqlParameters($constraints);
     // ** Get queue messages **
     $sending_queue_msgs = eF_getTableData("notifications as n", "*", implode(" and ", $where), $orderby, false, $limit);
     $sending_queue_size = eF_countTableData("notifications as n", "n.id", implode(" and ", $where));
     //$sending_queue_msgs = eF_getTableData("notifications", "*", "active = 1", "timestamp ASC");
     // Create the corresponding info per message
     foreach ($sending_queue_msgs as $key => $sending_queue_msg) {
         // recipients
         if ($sending_queue_msg['send_conditions'] == "N;") {
             $sending_queue_msgs[$key]['recipients'] = _ALLUSERS;
         } else {
             $sending_queue_msg['send_conditions'] = unserialize($sending_queue_msg['send_conditions']);
             if (is_array($sending_queue_msg['send_conditions'])) {
                 if (isset($sending_queue_msg['send_conditions']['lessons_ID'])) {
                     if ($sending_queue_msg['send_conditions']['lessons_ID'] != 0) {
                         $lesson = new EfrontLesson($sending_queue_msg['send_conditions']['lessons_ID']);