当前位置: 首页>>代码示例>>PHP>>正文


PHP Classes::getAllClasses方法代码示例

本文整理汇总了PHP中Classes::getAllClasses方法的典型用法代码示例。如果您正苦于以下问题:PHP Classes::getAllClasses方法的具体用法?PHP Classes::getAllClasses怎么用?PHP Classes::getAllClasses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Classes的用法示例。


在下文中一共展示了Classes::getAllClasses方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     //
     $currentPage = "COURSES";
     $mainMenu = "COURSES_MAIN";
     $inputs = Input::all();
     if (isset($inputs['className']) && isset($inputs['franchiseeCourse'])) {
         /* echo '<pre>';
         			print_r($inputs);
         			exit(); */
         $classadd = Classes::addClasses($inputs);
         if ($classadd == "exists") {
             Session::flash('error', "Sorry, Class you are trying to add already exists");
         } elseif (!$classadd) {
             Session::flash('error', "Sorry, Class Could not be added at the moment.");
         } else {
             Session::flash('msg', "Class added successfully.");
         }
     }
     $courseList = CoursesMaster::getCoursesList();
     //$classesMaster = ClassesMaster::getClassesMasterForDropDown();
     $franchiseeCourses = Courses::getFranchiseCoursesList(Session::get('franchiseId'));
     $classes = Classes::getAllClasses(1);
     return View::make('pages.classes.classes', compact('classesMaster', 'classes', 'courseList', 'franchiseeCourses', 'currentPage', 'mainMenu'));
 }
开发者ID:Headrun-php,项目名称:TLG,代码行数:25,代码来源:ClassesController.php

示例2: go

 public function go()
 {
     $this->setViewTemplate('classmembership.tpl');
     $user_id = $_GET['id'];
     $user = User::getUser($user_id);
     if (isset($_POST['submit'])) {
         $class_id = $_POST['class_id'];
         if (ClassMemberships::doesMembershipExist($user_id, $class_id)) {
             $this->addErrorMessage("User is already a member of this class");
         } else {
             ClassMemberships::addMembership($user_id, $class_id);
             $this->addSuccessMessage("User has been added to the class succesfully");
         }
     } elseif (isset($_GET['action']) && $_GET['action'] == "del") {
         $class_id = $_GET['class_id'];
         ClassMemberships::deleteMembership($user_id, $class_id);
         $this->addSuccessMessage("User has been deleted from the class succesfully");
     }
     $class_memberships = ClassMemberships::getMembershipsOfUser($user_id);
     $classes = Classes::getAllClasses();
     $this->addToView('classes', $classes);
     $this->addToView('class_memberships', $class_memberships);
     $this->addToView('user', $user);
     $this->setViewTemplate('classmembership.tpl');
     $this->generateView();
 }
开发者ID:JoffreyO,项目名称:hackademic,代码行数:26,代码来源:class.ClassMembershipsController.php

示例3: go

 public function go()
 {
     $this->setViewTemplate("rankings.tpl");
     if ($this->isLoggedIn()) {
         $username = $this->getLoggedInUser();
         if (Session::isAdmin() || Session::isTeacher()) {
             $classes = Classes::getAllClasses();
         } else {
             $user = User::findByUserName($username);
             $classes = ClassMemberships::getMembershipsOfUserObjects($user->id);
         }
         $this->addToView('classes', $classes);
     }
     if (!isset($_GET["class"]) || $_GET["class"] == "") {
         $rankings = ChallengeAttempts::getUniversalRankings();
     } else {
         $class_id = $_GET["class"];
         $class = Classes::getClass($class_id);
         if (!$class) {
             $this->addErrorMessage("Not a valid class");
             return $this->generateView();
         } else {
             $rankings = ChallengeAttempts::getClasswiseRankings($class_id);
         }
     }
     $final = array();
     $counter = 1;
     $rank = 1;
     $rankcount = 1;
     $prevcount = null;
     foreach ($rankings as $ranking) {
         if ($counter != 1 && $prevcount == $ranking['count']) {
             $rank = $rankcount;
             $rankcount++;
         }
         if ($counter != 1 && $prevcount != $ranking['count']) {
             $rankcount++;
             $rank = $rankcount;
         }
         $prevcount = $ranking['count'];
         $counter++;
         $temp = array('user_id' => $ranking['user_id'], 'time' => $ranking['time'], 'count' => $ranking['count'], 'username' => $ranking['username'], 'rank' => $rank);
         array_push($final, $temp);
     }
     $this->addToView('rankings', $final);
     return $this->generateView();
 }
开发者ID:JoffreyO,项目名称:hackademic,代码行数:47,代码来源:class.RankingsController.php


注:本文中的Classes::getAllClasses方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。