public function index() { $institutions = Institution::all(); $degrees = Degree::all(); self::makeInstitutionsStrings($degrees); $favorites = FavoriteController::getUserFavorites(); View::make('search.html', array('degrees' => $degrees, 'institutions' => $institutions, 'favorites' => $favorites)); }
public static function home() { $degrees = Degree::all(); $degree1 = $degrees['0']; $degree2 = $degrees['1']; $degree3 = $degrees['2']; $degree1->institution = $degree1->institutions['0']; $degree2->institution = $degree2->institutions['0']; $degree3->institution = $degree3->institutions['0']; View::make('home.html', array('degree1' => $degree1, 'degree2' => $degree2, 'degree3' => $degree3)); }
public static function index() { if (self::get_user_admin() == null) { Redirect::to('/home'); } $allInstitutions = Institution::all(); $degrees = Degree::all(); foreach ($degrees as $degree) { $institutions = $degree->institutions; $institutionList = ""; foreach ($institutions as $institution) { $institutionList = $institutionList . $institution->name; $institutionList = $institutionList . "\n"; } $degree->institutions = $institutionList; } View::make('admin/degrees.html', array('degrees' => $degrees)); }