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


PHP Student::all方法代码示例

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


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

示例1: changeCase

 public function changeCase()
 {
     ini_set('max_execution_time', 300);
     $students = Student::all();
     foreach ($students as $student) {
         $name = ucwords(strtolower($student->name));
         $birthplace = ucwords(strtolower($student->birthplace));
         $religion = ucwords(strtolower($student->religion));
         $address = ucwords(strtolower($student->address));
         $father_name = ucwords(strtolower($student->father_name));
         $father_occupation = ucwords(strtolower($student->father_occupation));
         $father_address = ucwords(strtolower($student->father_address));
         $mother_name = ucwords(strtolower($student->mother_name));
         $mother_occupation = ucwords(strtolower($student->mother_occupation));
         $mother_address = ucwords(strtolower($student->mother_address));
         $student->name = $name;
         $student->birthplace = $birthplace;
         $student->religion = $religion;
         $student->address = $address;
         $student->father_name = $father_name;
         $student->father_occupation = $father_occupation;
         $student->father_address = $father_address;
         $student->mother_name = $mother_name;
         $student->mother_occupation = $mother_occupation;
         $student->mother_address = $mother_address;
         $student->save();
     }
     Session::flash('message', 'Sukses mengimport Data Siswa');
 }
开发者ID:emanmks,项目名称:oneschool,代码行数:29,代码来源:DashboardController.php

示例2: showStudents

 public function showStudents()
 {
     $students = Student::all();
     if (Auth::Admin()->check()) {
         return Response::json($students);
     } else {
         return Redirect::intended('/');
     }
 }
开发者ID:andelus,项目名称:echooly,代码行数:9,代码来源:AdministrationController.php

示例3: listStudentContacts

 public function listStudentContacts($id = 1)
 {
     $studentList = Student::all($start, $records);
     if (isset($_POST['studentID'])) {
         $id = $_POST['studentID'];
     }
     $studentContacts = StudentContact::findByStudentId($id)->getValues();
     $temp = [];
     foreach ($studentContacts['relationships'] as $i) {
         $temp[] = array('id' => $i['id'], 'identityID' => $i['identityID'], 'relationshipID' => $i['relationshipID'], 'type' => $i['type'], 'identity' => Identity::findById($i['identityID'])->getValues());
     }
     $studentContacts = array();
     require_once 'views/student/listContacts.php';
 }
开发者ID:MatthewAry,项目名称:php-cs313,代码行数:14,代码来源:student_controller.php

示例4: teststudents

 public function teststudents()
 {
     return Student::all();
 }
开发者ID:nu1ww,项目名称:ls-rewamp,代码行数:4,代码来源:StudentsController.php

示例5: index

 /**
  * Display a listing of students
  *
  * @return Response
  */
 public function index()
 {
     $students = Student::all();
     return View::make('students.index', compact('students'));
 }
开发者ID:blestab,项目名称:laravel-school-erp,代码行数:10,代码来源:StudentsController.php

示例6: COUNT

<?php

$studentquery = DB::select(DB::raw('SELECT COUNT(`dob`) FROM `students` WHERE `created_at` >= CURDATE() - INTERVAL 1 DAY'));
$userquery = DB::select(DB::raw('SELECT COUNT(`email`) FROM `users` WHERE `created_at` >= CURDATE() - INTERVAL 1 DAY'));
$tutorialquery = DB::select(DB::raw('SELECT COUNT(`id`) FROM `tutorials` WHERE `created_at` >= CURDATE() - INTERVAL 1 DAY'));
$assessmentquery = DB::select(DB::raw('SELECT COUNT(`id`) FROM `assessments` WHERE `created_at` >= CURDATE() - INTERVAL 1 DAY'));
$stresult = objectToArray($studentquery);
$usresult = objectToArray($userquery);
$turesult = objectToArray($tutorialquery);
$asresult = objectToArray($assessmentquery);
$todayusercount = $usresult[0]['COUNT(`email`)'];
$usercountall = User::all()->count();
$todaystudentcount = $stresult[0]['COUNT(`dob`)'];
$studentcountall = Student::all()->count();
$todaytutorialcount = $turesult[0]['COUNT(`id`)'];
$tutorialcountall = Tutorials::all()->count();
$todayassessmentcount = $asresult[0]['COUNT(`id`)'];
$assessmentcountall = Assessments::all()->count();
?>
<div class="sortable row-fluid">
                <a data-rel="tooltip" title="{{ $todayusercount }} new members." class="well span3 top-block" href="#">
                    <span class="icon32 icon-red icon-user"></span>
                    <div>Total Members</div>
                    <div>{{ $usercountall }}</div>
                    <span class="notification">{{ $todayusercount }}</span>
                </a>

                <a data-rel="tooltip" title="{{ $todaystudentcount }} new students." class="well span3 top-block" href="#">
                    <span class="icon32 icon-blue icon-user"></span>
                    <div>Total Students</div>
                    <div>{{ $studentcountall }} </div>
开发者ID:eufelipemartins,项目名称:edlara,代码行数:31,代码来源:statusbox.blade.php

示例7: defined

defined('ROOT') || die('Restricted Access');
?>
             <table id="datatable" class="table table-striped table-bordered bootstrap-datatable datatable">
                <thead>
                    <tr>
                        <th>#ID</th>
                        <th>First Name</th>
                        <th>Last Name</th>
                        <th>Date of Birth</th>
                        <th>Status</th>
                        <th>Actions</th>
                    </tr>
                </thead>
                <tbody>
            <?php 
$students = Student::all();
foreach ($students as $student) {
    $user = Sentry::findUserByLogin($student->email);
    echo "<tr>";
    echo "<td>";
    echo $student->user_id;
    echo "</td>";
    echo "<td>";
    echo $user->first_name;
    echo "</td>";
    echo "<td>";
    echo $user->last_name;
    echo "</td>";
    echo "<td>";
    echo $student->dob;
    echo "</td>";
开发者ID:eufelipemartins,项目名称:edlara,代码行数:31,代码来源:students.blade.php


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