<thead> <tr> <th>#ID</th> <th>Name</th> <th>Related Tutorial</th> <th>Subject</th> <th>Grade</th> <th>Submitted To</th> <th>Submission Date</th> <th>Score out of 100</th> <th>Submitted By</th> </tr> </thead> <tbody> <?php $assessments = Assessments::all(); foreach ($assessments as $assessment) { $tutorialid = $assessment->tutorialid; $teacherid = $assessment->teacherid; $teacher = User::find($teacherid); $admin = Sentry::getUser()->inGroup(Sentry::findGroupByName('admin')); if (Sentry::getUser()->id == $teacherid || $admin) { $tutorial = DB::select(DB::raw('SELECT * FROM `tutorials` WHERE `id` = ' . $tutorialid)); $tutorial = array_dot(objectToArray($tutorial)); $tutorial = Tutorials::find((int) $assessment->tutorialid); $studentid = $assessment->studentid; $student = User::find($studentid); $subject = Subject::find($assessment->subjectid); echo "<tr>"; echo "<td>"; echo $assessment->id;
$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> <span class="notification blue">{{ $todaystudentcount }}</span> </a>