本文整理汇总了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');
}
示例2: showStudents
public function showStudents()
{
$students = Student::all();
if (Auth::Admin()->check()) {
return Response::json($students);
} else {
return Redirect::intended('/');
}
}
示例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';
}
示例4: teststudents
public function teststudents()
{
return Student::all();
}
示例5: index
/**
* Display a listing of students
*
* @return Response
*/
public function index()
{
$students = Student::all();
return View::make('students.index', compact('students'));
}
示例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>
示例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>";