|
@@ -1,7 +1,7 @@
|
1
|
1
|
<?php
|
2
|
2
|
|
3
|
3
|
class AdministratorsController extends \BaseController
|
4
|
|
-{
|
|
4
|
+{
|
5
|
5
|
private function outcomes_semesters($selected_semesters, $level)
|
6
|
6
|
{
|
7
|
7
|
$min_start="9000-01-01 00:00:00";
|
|
@@ -42,14 +42,14 @@ class AdministratorsController extends \BaseController
|
42
|
42
|
->orWhere("level",3);
|
43
|
43
|
})
|
44
|
44
|
->count();
|
45
|
|
-
|
|
45
|
+
|
46
|
46
|
foreach($outcomes as $outcome)
|
47
|
47
|
{
|
48
|
|
-
|
|
48
|
+
|
49
|
49
|
// var_dump($outcome->id);
|
50
|
50
|
// print "<br>";
|
51
|
51
|
$outcomes_attempted[$outcome->id]=$outcome->attempted($selected_semesters, $level);
|
52
|
|
- $outcomes_achieved[$outcome->id]=$outcome->achieved($selected_semesters, $level);
|
|
52
|
+ $outcomes_achieved[$outcome->id]=$outcome->achieved($selected_semesters, $level);
|
53
|
53
|
}
|
54
|
54
|
|
55
|
55
|
$uhs_school_id = School::where('name', 'LIKE', '%UHS%')->first()->id;
|
|
@@ -91,34 +91,34 @@ class AdministratorsController extends \BaseController
|
91
|
91
|
}
|
92
|
92
|
}
|
93
|
93
|
}
|
94
|
|
-
|
|
94
|
+
|
95
|
95
|
return array('outcomes'=>$outcomes,'outcomes_attempted'=>$outcomes_attempted, 'outcomes_achieved'=>$outcomes_achieved, 'attemptedProgramsPerOutcome'=>$attemptedProgramsPerOutcome, 'achievedProgramsPerOutcome'=>$achievedProgramsPerOutcome,'participating_programs'=>$participating_programs);
|
96
|
|
-
|
97
|
|
-
|
98
|
|
-
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
99
|
99
|
}
|
100
|
100
|
public function overview()
|
101
|
101
|
{
|
102
|
|
-
|
|
102
|
+
|
103
|
103
|
$selected_semesters = Semester::find(Session::get('semesters_ids'));
|
104
|
|
-
|
|
104
|
+
|
105
|
105
|
$subgraduado=$this->outcomes_semesters($selected_semesters,0);
|
106
|
106
|
$outcomes_subgrad=$subgraduado['outcomes'];
|
107
|
|
- $undergrad_outcomes_achieved=$subgraduado['outcomes_achieved'];
|
108
|
|
- $undergrad_outcomes_attempted=$subgraduado['outcomes_attempted'];
|
109
|
|
- $attemptedUndergradProgramsPerOutcome=$subgraduado['attemptedProgramsPerOutcome'];
|
110
|
|
- $achievedUndergradProgramsPerOutcome=$subgraduado['achievedProgramsPerOutcome'];
|
111
|
|
- $participating_undergrad_programs=$subgraduado['participating_programs'];
|
112
|
|
-
|
113
|
|
-
|
|
107
|
+ $undergrad_outcomes_achieved=$subgraduado['outcomes_achieved'];
|
|
108
|
+ $undergrad_outcomes_attempted=$subgraduado['outcomes_attempted'];
|
|
109
|
+ $attemptedUndergradProgramsPerOutcome=$subgraduado['attemptedProgramsPerOutcome'];
|
|
110
|
+ $achievedUndergradProgramsPerOutcome=$subgraduado['achievedProgramsPerOutcome'];
|
|
111
|
+ $participating_undergrad_programs=$subgraduado['participating_programs'];
|
|
112
|
+
|
|
113
|
+
|
114
|
114
|
$graduado=$this->outcomes_semesters($selected_semesters,1);
|
115
|
115
|
$outcomes_grad=$graduado['outcomes'];
|
116
|
|
- $grad_outcomes_achieved=$graduado['outcomes_achieved'];
|
117
|
|
- $grad_outcomes_attempted=$graduado['outcomes_attempted'];
|
118
|
|
- $attemptedGradProgramsPerOutcome=$graduado['attemptedProgramsPerOutcome'];
|
119
|
|
- $achievedGradProgramsPerOutcome=$graduado['achievedProgramsPerOutcome'];
|
120
|
|
- $participating_grad_programs=$graduado['participating_programs'];
|
121
|
|
-
|
|
116
|
+ $grad_outcomes_achieved=$graduado['outcomes_achieved'];
|
|
117
|
+ $grad_outcomes_attempted=$graduado['outcomes_attempted'];
|
|
118
|
+ $attemptedGradProgramsPerOutcome=$graduado['attemptedProgramsPerOutcome'];
|
|
119
|
+ $achievedGradProgramsPerOutcome=$graduado['achievedProgramsPerOutcome'];
|
|
120
|
+ $participating_grad_programs=$graduado['participating_programs'];
|
|
121
|
+
|
122
|
122
|
//Total amount of learning outcomes
|
123
|
123
|
// $outcomeCount = Outcome::withTrashed()->count();
|
124
|
124
|
// $selected_semester = Semester::find(Session::get('semesters_ids')[0]);
|
|
@@ -147,7 +147,7 @@ class AdministratorsController extends \BaseController
|
147
|
147
|
// ->orWhere("level",3);
|
148
|
148
|
// })
|
149
|
149
|
// ->count();
|
150
|
|
-//
|
|
150
|
+//
|
151
|
151
|
// $outcomes_grad = Outcome::where(function($query) use ($selected_semester){$query->where('deactivation_date', '>=', $selected_semester->start)->orWhere('deactivation_date', null);})->where(function($query2){$query2->where("level",2)->orWhere("level",3);})->orderBy('name', 'ASC')->get();
|
152
|
152
|
// $outcomeCount_grad = Outcome::where(function($query) use ($selected_semester){$query->where('deactivation_date', '>=', $selected_semester->start)->orWhere('deactivation_date', null);})->where(function($query2){$query2->where("level",2)->orWhere("level",3);})->count();
|
153
|
153
|
|
|
@@ -159,21 +159,21 @@ class AdministratorsController extends \BaseController
|
159
|
159
|
|
160
|
160
|
$schools = School::where('id', '!=', $uhs_school_id)->orderBy('name', 'asc')->get();
|
161
|
161
|
$title = 'Campus Overview';
|
162
|
|
-
|
163
|
|
-
|
|
162
|
+
|
|
163
|
+
|
164
|
164
|
/**
|
165
|
165
|
* Calculate campus wide outcome performance by counting the number of students
|
166
|
|
- $undergrad_outcomes_attempted will have the number of criteria that was assessed in undergradute courses during the selected semester
|
167
|
|
- $undergrad_outcomes_achieved will have the number of criteria that was assessed in undergradute courses during the selected semester
|
|
166
|
+ $undergrad_outcomes_attempted will have the number of criteria that was assessed in undergradute courses during the selected semester
|
|
167
|
+ $undergrad_outcomes_achieved will have the number of criteria that was assessed in undergradute courses during the selected semester
|
168
|
168
|
where the percentage of students that obtained a better or equal score than the expected_student_score established in the
|
169
|
169
|
activity_criterion table is greater or equal than the expected_percentage_students_achieving also established in the
|
170
|
|
- activity_criterion table
|
|
170
|
+ activity_criterion table
|
171
|
171
|
*/
|
172
|
172
|
|
173
|
173
|
// foreach($outcomes_subgrad as $outcome)
|
174
|
174
|
// {
|
175
|
175
|
// $undergrad_outcomes_attempted[$outcome->id]=$outcome->attempted($selected_semester->id,0);
|
176
|
|
-// $undergrad_outcomes_achieved[$outcome->id]=$outcome->achieved($selected_semester->id,0);
|
|
176
|
+// $undergrad_outcomes_achieved[$outcome->id]=$outcome->achieved($selected_semester->id,0);
|
177
|
177
|
// }
|
178
|
178
|
// var_dump($undergrad_outcomes_attempted);
|
179
|
179
|
// print"<br>";
|
|
@@ -182,7 +182,7 @@ class AdministratorsController extends \BaseController
|
182
|
182
|
// foreach($outcomes_grad as $outcome)
|
183
|
183
|
// {
|
184
|
184
|
// $grad_outcomes_attempted[$outcome->id]=$outcome->attempted($selected_semester->id,1);
|
185
|
|
-// $grad_outcomes_achieved[$outcome->id]=$outcome->achieved($selected_semester->id,1);
|
|
185
|
+// $grad_outcomes_achieved[$outcome->id]=$outcome->achieved($selected_semester->id,1);
|
186
|
186
|
// }
|
187
|
187
|
|
188
|
188
|
/**
|
|
@@ -221,7 +221,7 @@ class AdministratorsController extends \BaseController
|
221
|
221
|
// }))->where('is_graduate', 0)->where('school_id', '!=', $uhs_school_id)->orderBy('name', 'asc')->get() as $program)
|
222
|
222
|
// {
|
223
|
223
|
// $participating_undergrad_programs[$program->id]=(object)array('id'=>$program->id, 'name'=>$program->name, 'is_graduate'=> $program->is_graduate, 'school_id'=>$program->school_id,'semestre_id',$selected_semester);
|
224
|
|
-//
|
|
224
|
+//
|
225
|
225
|
// // SELECT ac.id activity_criterion_id, ac.activity_id, ac.expected_student_score, ac.expected_percentage_students_achieving, co.program_id FROM activity_criterion ac, new_criteria c, activities a, objectives o, courses co where co.id=a.course_id and co.semester_id=13 and a.id=ac.activity_id and c.id = ac.criterion_id and o.id=c.objective_id and o.outcome_id = 2 order by program_id
|
226
|
226
|
// $program_attempted_outcome=$program->attempted_outcome($outcome->id, $selected_semester->id);
|
227
|
227
|
// $attempted_outcomes_per_undergrad_program[$outcome->id]+=$program_attempted_outcome;
|
|
@@ -250,11 +250,11 @@ class AdministratorsController extends \BaseController
|
250
|
250
|
// exit();
|
251
|
251
|
/**
|
252
|
252
|
* Calculate how many grad programs achieved and attempted each outcome
|
253
|
|
- $grad_outcomes_attempted will have the number of criteria that was assessed in gradute courses during the selected semester
|
254
|
|
- $grad_outcomes_achieved will have the number of criteria that was assessed in gradute courses during the selected semester
|
|
253
|
+ $grad_outcomes_attempted will have the number of criteria that was assessed in gradute courses during the selected semester
|
|
254
|
+ $grad_outcomes_achieved will have the number of criteria that was assessed in gradute courses during the selected semester
|
255
|
255
|
where the percentage of students that obtained a better or equal score than the expected_student_score established in the
|
256
|
256
|
activity_criterion table is greater or equal than the expected_percentage_students_achieving also established in the
|
257
|
|
- activity_criterion table
|
|
257
|
+ activity_criterion table
|
258
|
258
|
*/
|
259
|
259
|
|
260
|
260
|
|
|
@@ -303,4 +303,319 @@ class AdministratorsController extends \BaseController
|
303
|
303
|
// exit();
|
304
|
304
|
return View::make('local.managers.admins.overview', compact('title', 'schools', 'outcomes_subgrad', 'outcomes_grad', 'undergrad_outcomes_achieved', 'undergrad_outcomes_attempted', 'grad_outcomes_achieved', 'grad_outcomes_attempted', 'attemptedUndergradProgramsPerOutcome', 'participating_undergrad_programs', 'achievedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'participating_grad_programs', 'achievedGradProgramsPerOutcome'));
|
305
|
305
|
}
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+ public function overview2()
|
|
309
|
+ {
|
|
310
|
+ // '''
|
|
311
|
+ //stucture of outcomes array:
|
|
312
|
+ //
|
|
313
|
+ // $outcome->id
|
|
314
|
+ // $outcome->name
|
|
315
|
+ // $outcome->semesters
|
|
316
|
+ //
|
|
317
|
+ // $outcome->semesters[i]->id
|
|
318
|
+ // $outcome->semesters[i]->code
|
|
319
|
+ // $outcome->semesters[i]->name
|
|
320
|
+ // $outcome->semesters[i]->tested
|
|
321
|
+ // $outcome->semesters[i]->achievers
|
|
322
|
+ // '''
|
|
323
|
+ $selected_semesters = Semester::find(Session::get('semesters_ids'));
|
|
324
|
+ $title = 'Overview2';
|
|
325
|
+
|
|
326
|
+ $semesters = DB::table('overview')
|
|
327
|
+ ->join('semesters','semesters.id','=','overview.semester_id')
|
|
328
|
+ ->select('semesters.name', 'semesters.code')
|
|
329
|
+ ->orderBy('semesters.code', 'asc')
|
|
330
|
+ ->groupBy('semesters.id')
|
|
331
|
+ ->get();
|
|
332
|
+ $outcomes = DB::table('overview')
|
|
333
|
+ ->join('outcomes','outcomes.id','=','overview.outcome_id')
|
|
334
|
+ ->selectRaw('outcomes.name, overview.outcome_id as id, sum(overview.total_evaluated) as total_evaluated, sum(overview.total_achieved) as total_achieved')
|
|
335
|
+ ->orderBy('outcomes.name', 'asc')
|
|
336
|
+ ->groupBy('overview.outcome_id')
|
|
337
|
+ ->get();
|
|
338
|
+ foreach ($outcomes as $outcome) {
|
|
339
|
+ $outcome->semesters = DB::table('overview')
|
|
340
|
+ ->join('semesters','semesters.id','=','overview.semester_id')
|
|
341
|
+ ->where('overview.outcome_id', $outcome->id)
|
|
342
|
+ ->selectRaw('semesters.id, semesters.name, semesters.code, sum(overview.total_evaluated) as total_evaluated, sum(overview.total_achieved) as total_achieved')
|
|
343
|
+ ->orderBy('semesters.code', 'asc')
|
|
344
|
+ ->groupBy('overview.outcome_id')
|
|
345
|
+ ->groupBy('overview.semester_id')
|
|
346
|
+ ->get();
|
|
347
|
+ }
|
|
348
|
+
|
|
349
|
+ $filters = array();
|
|
350
|
+ $filters['school'] = DB::table('overview')
|
|
351
|
+ ->join('programs','programs.id','=','overview.program_id')
|
|
352
|
+ ->join('schools','schools.id','=','programs.school_id')
|
|
353
|
+ ->select('schools.id','schools.name')
|
|
354
|
+ ->orderBy('schools.name', 'asc')
|
|
355
|
+ ->groupBy('schools.id')
|
|
356
|
+ ->get();
|
|
357
|
+
|
|
358
|
+ $filters['program'] = DB::table('overview')
|
|
359
|
+ ->join('programs','programs.id','=','overview.program_id')
|
|
360
|
+ ->select('programs.id','programs.name')
|
|
361
|
+ ->orderBy('programs.name', 'asc')
|
|
362
|
+ ->groupBy('overview.program_id')
|
|
363
|
+ ->get();
|
|
364
|
+
|
|
365
|
+ $filters['semester'] = DB::table('overview')
|
|
366
|
+ ->join('semesters','semesters.id','=','overview.semester_id')
|
|
367
|
+ ->select('semesters.id','semesters.name','semesters.code')
|
|
368
|
+ ->orderBy('semesters.code', 'asc')
|
|
369
|
+ ->groupBy('overview.semester_id')
|
|
370
|
+ ->get();
|
|
371
|
+
|
|
372
|
+ $filters['year'] = DB::table('overview')//
|
|
373
|
+ ->join('semesters','semesters.id','=','overview.semester_id')
|
|
374
|
+ ->select('semesters.id','semesters.start')
|
|
375
|
+ ->orderBy('semesters.code', 'asc')
|
|
376
|
+ ->groupBy('overview.semester_id')
|
|
377
|
+ ->get();
|
|
378
|
+
|
|
379
|
+ $filters['outcome'] = DB::table('overview')
|
|
380
|
+ ->join('outcomes','outcomes.id','=','overview.outcome_id')
|
|
381
|
+ ->select('outcomes.id','outcomes.name')
|
|
382
|
+ ->orderBy('outcomes.name', 'asc')
|
|
383
|
+ ->groupBy('overview.outcome_id')
|
|
384
|
+ ->get();
|
|
385
|
+
|
|
386
|
+ $target = 0.70;
|
|
387
|
+
|
|
388
|
+ return View::make('local.managers.admins.overview2', compact('title','selected_semesters','outcomes','semesters','filters','target'));
|
|
389
|
+ }
|
|
390
|
+
|
|
391
|
+ // this is called when filters are changed
|
|
392
|
+ public function overview2_filter_results()
|
|
393
|
+ {
|
|
394
|
+
|
|
395
|
+ // selected filter data
|
|
396
|
+ $schools = Input::get('schools');
|
|
397
|
+ $programs = Input::get('programs');
|
|
398
|
+ $semesters = Input::get('semesters');
|
|
399
|
+ $years = Input::get('years');
|
|
400
|
+ $outcomes = Input::get('outcomes');
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+ // make an array id's of schools selected. if All, use All available id's
|
|
404
|
+ if ($schools == array("0")){
|
|
405
|
+ $result = DB::table('overview')
|
|
406
|
+ ->join('programs','programs.id','=','overview.program_id')
|
|
407
|
+ ->join('schools','schools.id','=','programs.school_id')
|
|
408
|
+ ->select('schools.id')
|
|
409
|
+ ->orderBy('schools.name', 'asc')
|
|
410
|
+ ->groupBy('schools.id')
|
|
411
|
+ ->get();
|
|
412
|
+ $schools_id = array();
|
|
413
|
+ foreach ($result as $school) {
|
|
414
|
+ array_push($schools_id,$school->id);
|
|
415
|
+ }
|
|
416
|
+ }else {
|
|
417
|
+ $schools_id = array();
|
|
418
|
+ foreach ($schools as $school_id) {
|
|
419
|
+ array_push($schools_id,intval($school_id));
|
|
420
|
+ }
|
|
421
|
+ }
|
|
422
|
+ // make an array id's of programs selected. if All, use All available id's
|
|
423
|
+ if ($programs == array("0")){
|
|
424
|
+ $result = DB::table('overview')
|
|
425
|
+ ->join('programs','programs.id','=','overview.program_id')
|
|
426
|
+ ->select('programs.id')
|
|
427
|
+ ->orderBy('programs.name', 'asc')
|
|
428
|
+ ->groupBy('overview.program_id')
|
|
429
|
+ ->get();
|
|
430
|
+ $programs_id = array();
|
|
431
|
+ foreach ($result as $program) {
|
|
432
|
+ array_push($programs_id,$program->id);
|
|
433
|
+ }
|
|
434
|
+ }else {
|
|
435
|
+ $programs_id = array();
|
|
436
|
+ foreach ($programs as $program_id) {
|
|
437
|
+ array_push($programs_id,intval($program_id));
|
|
438
|
+ }
|
|
439
|
+ }
|
|
440
|
+ // make an array id's of semesters selected. if All, use All available id's
|
|
441
|
+ if ($semesters == array("0")){
|
|
442
|
+ $result = DB::table('overview')
|
|
443
|
+ ->join('semesters','semesters.id','=','overview.semester_id')
|
|
444
|
+ ->select('semesters.id')
|
|
445
|
+ ->orderBy('semesters.code', 'asc')
|
|
446
|
+ ->groupBy('overview.semester_id')
|
|
447
|
+ ->get();
|
|
448
|
+ $semesters_id = array();
|
|
449
|
+ foreach ($result as $semester) {
|
|
450
|
+ array_push($semesters_id,$semester->id);
|
|
451
|
+ }
|
|
452
|
+ }else {
|
|
453
|
+ $semesters_id = array();
|
|
454
|
+ foreach ($semesters as $semester_id) {
|
|
455
|
+ array_push($semesters_id,intval($semester_id));
|
|
456
|
+ }
|
|
457
|
+ }
|
|
458
|
+ // make an array id's of years selected. if All, use All available id's
|
|
459
|
+ if ($years == array("0")){
|
|
460
|
+ $result = DB::table('overview')//
|
|
461
|
+ ->join('semesters','semesters.id','=','overview.semester_id')
|
|
462
|
+ ->select('semesters.id')
|
|
463
|
+ ->orderBy('semesters.code', 'asc')
|
|
464
|
+ ->groupBy('overview.semester_id')
|
|
465
|
+ ->get();
|
|
466
|
+ $years_id = array();
|
|
467
|
+ foreach ($result as $year) {
|
|
468
|
+ array_push($years_id,$year->id);
|
|
469
|
+ }
|
|
470
|
+ }else {
|
|
471
|
+ $years_id = array();
|
|
472
|
+ foreach ($years as $year_id) {
|
|
473
|
+ array_push($years_id,intval($year_id));
|
|
474
|
+ }
|
|
475
|
+ }
|
|
476
|
+ // make an array id's of outcomes selected. if All, use All available id's
|
|
477
|
+ if ($outcomes == array("0")){
|
|
478
|
+ $result = DB::table('overview')
|
|
479
|
+ ->join('outcomes','outcomes.id','=','overview.outcome_id')
|
|
480
|
+ ->select('outcomes.id')
|
|
481
|
+ ->orderBy('outcomes.name', 'asc')
|
|
482
|
+ ->groupBy('overview.outcome_id')
|
|
483
|
+ ->get();
|
|
484
|
+ $outcomes_id = array();
|
|
485
|
+ foreach ($result as $outcome) {
|
|
486
|
+ array_push($outcomes_id,$outcome->id);
|
|
487
|
+ }
|
|
488
|
+ }else {
|
|
489
|
+ $outcomes_id = array();
|
|
490
|
+ foreach ($outcomes as $outcome_id) {
|
|
491
|
+ array_push($outcomes_id,intval($outcome_id));
|
|
492
|
+ }
|
|
493
|
+ }
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+ // get data for graph
|
|
497
|
+ $semesters = DB::table('overview')
|
|
498
|
+ ->join('programs','programs.id','=','overview.program_id')
|
|
499
|
+ ->join('schools','schools.id','=','programs.school_id')
|
|
500
|
+ ->join('semesters','semesters.id','=','overview.semester_id')
|
|
501
|
+ ->join('outcomes','outcomes.id','=','overview.outcome_id')
|
|
502
|
+ ->whereIn('schools.id',$schools_id)
|
|
503
|
+ ->whereIn('programs.id',$programs_id)
|
|
504
|
+ ->whereIn('semesters.id',$semesters_id)
|
|
505
|
+ // ->whereIn('years.id',$years_id)
|
|
506
|
+ ->whereIn('outcomes.id',$outcomes_id)
|
|
507
|
+ ->select('semesters.name', 'semesters.code')
|
|
508
|
+ ->orderBy('semesters.code', 'asc')
|
|
509
|
+ ->groupBy('semesters.id')
|
|
510
|
+ ->get();
|
|
511
|
+ $outcomes = DB::table('overview')
|
|
512
|
+ ->join('programs','programs.id','=','overview.program_id')
|
|
513
|
+ ->join('schools','schools.id','=','programs.school_id')
|
|
514
|
+ ->join('semesters','semesters.id','=','overview.semester_id')
|
|
515
|
+ ->join('outcomes','outcomes.id','=','overview.outcome_id')
|
|
516
|
+ ->whereIn('schools.id',$schools_id)
|
|
517
|
+ ->whereIn('programs.id',$programs_id)
|
|
518
|
+ ->whereIn('semesters.id',$semesters_id)
|
|
519
|
+ // ->whereIn('years.id',$years_id)
|
|
520
|
+ ->whereIn('outcomes.id',$outcomes_id)
|
|
521
|
+ ->selectRaw('outcomes.name, overview.outcome_id as id, sum(overview.total_evaluated) as total_evaluated, sum(overview.total_achieved) as total_achieved')
|
|
522
|
+ ->orderBy('outcomes.name', 'asc')
|
|
523
|
+ ->groupBy('overview.outcome_id')
|
|
524
|
+ ->get();
|
|
525
|
+ foreach ($outcomes as $outcome) {
|
|
526
|
+ $outcome->semesters = DB::table('overview')
|
|
527
|
+ ->join('programs','programs.id','=','overview.program_id')
|
|
528
|
+ ->join('schools','schools.id','=','programs.school_id')
|
|
529
|
+ ->join('semesters','semesters.id','=','overview.semester_id')
|
|
530
|
+ ->join('outcomes','outcomes.id','=','overview.outcome_id')
|
|
531
|
+ ->whereIn('schools.id',$schools_id)
|
|
532
|
+ ->whereIn('programs.id',$programs_id)
|
|
533
|
+ ->whereIn('semesters.id',$semesters_id)
|
|
534
|
+ // ->whereIn('years.id',$years_id)
|
|
535
|
+ ->whereIn('outcomes.id',$outcomes_id)
|
|
536
|
+ ->where('overview.outcome_id', $outcome->id)
|
|
537
|
+ ->selectRaw('semesters.id, semesters.name, semesters.code, sum(overview.total_evaluated) as total_evaluated, sum(overview.total_achieved) as total_achieved')
|
|
538
|
+ ->orderBy('semesters.code', 'asc')
|
|
539
|
+ ->groupBy('overview.outcome_id')
|
|
540
|
+ ->groupBy('overview.semester_id')
|
|
541
|
+ ->get();
|
|
542
|
+ }
|
|
543
|
+
|
|
544
|
+ // get data for filters
|
|
545
|
+ $filters = array();
|
|
546
|
+ $filters['school'] = DB::table('overview')
|
|
547
|
+ ->join('programs','programs.id','=','overview.program_id')
|
|
548
|
+ ->join('schools','schools.id','=','programs.school_id')
|
|
549
|
+ ->join('semesters','semesters.id','=','overview.semester_id')
|
|
550
|
+ ->join('outcomes','outcomes.id','=','overview.outcome_id')
|
|
551
|
+ ->whereIn('schools.id',$schools_id)
|
|
552
|
+ ->whereIn('programs.id',$programs_id)
|
|
553
|
+ ->whereIn('semesters.id',$semesters_id)
|
|
554
|
+ // ->whereIn('years.id',$years_id)
|
|
555
|
+ ->whereIn('outcomes.id',$outcomes_id)
|
|
556
|
+ ->select('schools.id','schools.name')
|
|
557
|
+ ->orderBy('schools.name', 'asc')
|
|
558
|
+ ->groupBy('schools.id')
|
|
559
|
+ ->get();
|
|
560
|
+ $filters['program'] = DB::table('overview')
|
|
561
|
+ ->join('programs','programs.id','=','overview.program_id')
|
|
562
|
+ ->join('schools','schools.id','=','programs.school_id')
|
|
563
|
+ ->join('semesters','semesters.id','=','overview.semester_id')
|
|
564
|
+ ->join('outcomes','outcomes.id','=','overview.outcome_id')
|
|
565
|
+ ->whereIn('schools.id',$schools_id)
|
|
566
|
+ // ->whereIn('programs.id',$programs_id)
|
|
567
|
+ ->whereIn('semesters.id',$semesters_id)
|
|
568
|
+ // ->whereIn('years.id',$years_id)
|
|
569
|
+ ->whereIn('outcomes.id',$outcomes_id)
|
|
570
|
+ ->select('programs.id','programs.name')
|
|
571
|
+ ->orderBy('programs.name', 'asc')
|
|
572
|
+ ->groupBy('overview.program_id')
|
|
573
|
+ ->get();
|
|
574
|
+ $filters['semester'] = DB::table('overview')
|
|
575
|
+ ->join('programs','programs.id','=','overview.program_id')
|
|
576
|
+ ->join('schools','schools.id','=','programs.school_id')
|
|
577
|
+ ->join('semesters','semesters.id','=','overview.semester_id')
|
|
578
|
+ ->join('outcomes','outcomes.id','=','overview.outcome_id')
|
|
579
|
+ ->whereIn('schools.id',$schools_id)
|
|
580
|
+ ->whereIn('programs.id',$programs_id)
|
|
581
|
+ // ->whereIn('semesters.id',$semesters_id)
|
|
582
|
+ // ->whereIn('years.id',$years_id)
|
|
583
|
+ ->whereIn('outcomes.id',$outcomes_id)
|
|
584
|
+ ->select('semesters.id','semesters.name','semesters.code')
|
|
585
|
+ ->orderBy('semesters.code', 'asc')
|
|
586
|
+ ->groupBy('overview.semester_id')
|
|
587
|
+ ->get();
|
|
588
|
+ $filters['year'] = DB::table('overview')////////////////////////////////////////////
|
|
589
|
+ ->join('programs','programs.id','=','overview.program_id')
|
|
590
|
+ ->join('schools','schools.id','=','programs.school_id')
|
|
591
|
+ ->join('semesters','semesters.id','=','overview.semester_id')
|
|
592
|
+ ->join('outcomes','outcomes.id','=','overview.outcome_id')
|
|
593
|
+ ->whereIn('schools.id',$schools_id)
|
|
594
|
+ ->whereIn('programs.id',$programs_id)
|
|
595
|
+ ->whereIn('semesters.id',$semesters_id)
|
|
596
|
+ // ->whereIn('years.id',$years_id)
|
|
597
|
+ ->whereIn('outcomes.id',$outcomes_id)
|
|
598
|
+
|
|
599
|
+ ->get();
|
|
600
|
+ $filters['outcome'] = DB::table('overview')
|
|
601
|
+ ->join('programs','programs.id','=','overview.program_id')
|
|
602
|
+ ->join('schools','schools.id','=','programs.school_id')
|
|
603
|
+ ->join('semesters','semesters.id','=','overview.semester_id')
|
|
604
|
+ ->join('outcomes','outcomes.id','=','overview.outcome_id')
|
|
605
|
+ ->whereIn('schools.id',$schools_id)
|
|
606
|
+ ->whereIn('programs.id',$programs_id)
|
|
607
|
+ ->whereIn('semesters.id',$semesters_id)
|
|
608
|
+ // ->whereIn('years.id',$years_id)
|
|
609
|
+ // ->whereIn('outcomes.id',$outcomes_id)
|
|
610
|
+ ->select('outcomes.id','outcomes.name')
|
|
611
|
+ ->orderBy('outcomes.name', 'asc')
|
|
612
|
+ ->groupBy('overview.outcome_id')
|
|
613
|
+ ->get();
|
|
614
|
+
|
|
615
|
+ return array(
|
|
616
|
+ "semesters" => $semesters,
|
|
617
|
+ "outcomes_info" => $outcomes,
|
|
618
|
+ "filters" => $filters,
|
|
619
|
+ );
|
|
620
|
+ }
|
306
|
621
|
}
|