Ejemplo n.º 1
0
<?php

require_once "../initialize.php";
$input = $_GET['input'];
$html = "";
$filterby = $_GET['filterby'];
$thestudent = User::get_by_id($_GET['studentid']);
if ($filterby == "schoolmates") {
    $orgbyuser = SchoolUser::getSchoolsImIn($thestudent->id);
    $ids = array();
    foreach ($orgbyuser as $item) {
        array_push($ids, $item->schoolid);
    }
    $mates = SchoolUser::getUsersInMultipleSchoolsSearch($ids, $_GET['input']);
} else {
    if ($filterby == "batchmates") {
        $orgbyuser = BatchUser::getBatchsImIn($thestudent->id);
        $ids = array();
        foreach ($orgbyuser as $item) {
            array_push($ids, $item->batchid);
        }
        $mates = BatchUser::getUsersInMultipleBatchsSearch($ids, $_GET['input']);
    } else {
        if ($filterby == "sectionmates") {
            $orgbyuser = SectionUser::getSectionsImIn($thestudent->id);
            $ids = array();
            foreach ($orgbyuser as $item) {
                array_push($ids, $item->sectionid);
            }
            $mates = SectionUser::getUsersInMultipleSectionsSearch($ids, $_GET['input']);
        } else {
Ejemplo n.º 2
0
         <button class="btn-mini btn-link pull-right btnaddfriend"> 
           Add Friend<span hidden>' . $user->id . '</span>
         </button>
         ';
         }
     }
 }
 echo '
       <div class="btn-group pull-right">
         <a id="btninvite" class="btn-mini dropdown-toggle" data-toggle="dropdown" href="#">
           <i class="icon-large icon-circle-arrow-down"></i> Invite <i class="icon-caret-down"></i>
           <span class="caret"></span>
         </a>
         <ul class="dropdown-menu">
     ';
 $schoolsImIn = SchoolUser::getSchoolsImIn($session->user_id);
 $bathsImIn = BatchUser::getBatchsImIn($session->user_id);
 $sectionsImIn = SectionUser::getSectionsImIn($session->user_id);
 if ($loggeduser->is_super_admin()) {
     if (count($schoolsImIn) > 0) {
         echo '<li class="divider"> schools</li>';
         foreach ($schoolsImIn as $theuser) {
             $school = School::get_by_id($theuser->schoolid);
             if (!$school) {
                 $theuser->delete();
             }
             echo '<li><a href="#" onclick="invite(\'schoolid\', ' . $school->id . '); return false;">' . $school->name . '</a></li>';
         }
     }
 }
 if (count($bathsImIn) > 0) {