} else { if ($notification->itemtype == "sectionuser") { $object = SectionUser::get_by_id($notification->itemid); $section = Section::get_by_id($object->sectionid); $batch = Batch::get_by_id($object->batchid); $school = School::get_by_id($object->schoolid); $html .= "Now a member in Section <a href='section.php?id=" . $section->id . "'>" . $section->name . "</a> of Batch <a href='batch.php?id=" . $batch->id . "'>" . $batch->get_batchyear() . "</a> of School <a href='school.php?id=" . $school->id . "'>" . $school->name . "</a>"; } else { if ($notification->itemtype == "clubuser") { $object = ClubUser::get_by_id($notification->itemid); $club = Club::get_by_id($object->clubid); $school = School::get_by_id($object->schoolid); $html .= "Now a member in Club <a href='club.php?id=" . $club->id . "'>" . $club->name . "</a> of School <a href='school.php?id=" . $school->id . "'>" . $school->name . "</a>"; } else { if ($notification->itemtype == "groupuser") { $object = GroupUser::get_by_id($notification->itemid); $group = Group::get_by_id($object->groupid); $school = School::get_by_id($object->schoolid); $html .= "Now a member in Group <a href='group.php?id=" . $group->id . "'>" . $group->name . "</a> of School <a href='school.php?id=" . $school->id . "'>" . $school->name . "</a>"; } } } } } } $html .= "\t\t<button class='btn btn-mini btndelete pull-right'>x<span hidden class='notificationid'>" . $notification->id . "</span></button>"; } $html .= "\t\t<p>" . $notification->date . "</p>"; $html .= "\t\t</div>"; $html .= " </td>"; $html .= "</tr>";
$object->pending = 0; $object->update(); $notification->title = "message"; $notification->itemid = $itemid; $notification->itemtype = "sectionuser"; } else { if ($itemtype == "clubuser") { $object = ClubUser::get_by_id($itemid); $object->pending = 0; $object->update(); $notification->title = "message"; $notification->itemid = $itemid; $notification->itemtype = "clubuser"; } else { if ($itemtype == "groupuser") { $object = GroupUser::get_by_id($itemid); $object->pending = 0; $object->update(); $notification->title = "message"; $notification->itemid = $itemid; $notification->itemtype = "groupuser"; } } } } } } $notification->fromuserid = $session->user_id; $notification->touserid = $touserid; $notification->create(); $lastnotification = Notification::get_by_id($notificationid);