Ejemplo n.º 1
0
                             if ($object->pending == 0) {
                                 $done = true;
                             }
                         }
                     }
                 }
             }
         }
     }
 }
 if ($notification->itemtype != "message" && $notification->pending == 1 && !$done) {
     $html .= "\t\t<button class='btn btn-primary btnaccept'>Accept<span hidden class='itemid'>" . $notification->itemid . "</span><span hidden class='itemtype'>" . $notification->itemtype . "</span><span hidden class='fromuserid'>" . $notification->fromuserid . "</span><span hidden class='notificationid'>" . $notification->id . "</span></button> ";
     $html .= "\t\t<button class='btn btn-danger btndecline'>Decline<span hidden class='itemid'>" . $notification->itemid . "</span><span hidden class='itemtype'>" . $notification->itemtype . "</span><span hidden class='fromuserid'>" . $notification->fromuserid . "</span><span hidden class='notificationid'>" . $notification->id . "</span></button>";
 } else {
     if ($notification->itemtype == "friend") {
         $object = Friend::get_by_id($notification->itemid);
         if ($object->userid != $session->user_id) {
             $touser = User::get_by_id($object->userid);
         } else {
             if ($object->touserid != $session->user_id) {
                 $touser = User::get_by_id($object->touserid);
             }
         }
         $html .= "Now friends";
     } else {
         if ($notification->itemtype == "schooluser") {
             $object = SchoolUser::get_by_id($notification->itemid);
             $school = School::get_by_id($object->schoolid);
             $html .= "Now a member in School <a href='school.php?id=" . $school->id . "'>" . $school->name . "</a>";
         } else {
             if ($notification->itemtype == "batchuser") {
Ejemplo n.º 2
0
<?php

require_once "../initialize.php";
if (isset($_GET['itemid']) && $_GET['itemid'] != '' && isset($_GET['itemtype']) && $_GET['itemtype'] != '' && isset($_GET['touserid']) && $_GET['touserid'] != '' && isset($_GET['notificationid']) && $_GET['notificationid'] != '') {
    $itemtype = $_GET['itemtype'];
    $itemid = $_GET['itemid'];
    $touserid = $_GET['touserid'];
    $notificationid = $_GET['notificationid'];
    $notification = new Notification();
    if ($itemtype == "friend") {
        $object = Friend::get_by_id($itemid);
        $object->pending = 0;
        $object->update();
        $notification->title = "message";
        $notification->itemid = $itemid;
        $notification->itemtype = "friend";
    } else {
        if ($itemtype == "schooluser") {
            $object = SchoolUser::get_by_id($itemid);
            $object->pending = 0;
            $object->update();
            $notification->title = "message";
            $notification->itemid = $itemid;
            $notification->itemtype = "schooluser";
        } else {
            if ($itemtype == "batchuser") {
                $object = BatchUser::get_by_id($itemid);
                $object->pending = 0;
                $object->update();
                $notification->title = "message";
                $notification->itemid = $itemid;