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'); }
public function showStudents() { $students = Student::all(); if (Auth::Admin()->check()) { return Response::json($students); } else { return Redirect::intended('/'); } }
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'; }
public function teststudents() { return Student::all(); }
/** * Display a listing of students * * @return Response */ public function index() { $students = Student::all(); return View::make('students.index', compact('students')); }
<?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>
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>";