Преглед изворни кода

seteando everview2 como landing page de administradores

Carlos J Corrada Bravo пре 3 година
родитељ
комит
7a785a05ad

+ 192
- 74
app/controllers/AdministratorsController.php Прегледај датотеку

@@ -306,47 +306,71 @@ class AdministratorsController extends \BaseController
306 306
 		// $outcome->semesters[i]->tested
307 307
 		// $outcome->semesters[i]->achievers
308 308
 		// '''
309
+		$is_graduate=0;
310
+		$levels=array(1,3);
309 311
 		$selected_semesters = Semester::find(Session::get('semesters_ids'));
310
-		$title = 'Overview2';
312
+		$title = 'Overview';
311 313
 
312 314
 		$semesters = DB::table('overview')
313 315
 			->join('semesters', 'semesters.id', '=', 'overview.semester_id')
314
-			->select('semesters.name', 'semesters.code')
316
+			->select('semesters.id', 'semesters.name', 'semesters.code')
315 317
 			->orderBy('semesters.code', 'asc')
316 318
 			->groupBy('semesters.id')
317 319
 			->get();
320
+
321
+
318 322
 		$outcomes = DB::table('overview')
319
-			->join('outcomes', 'outcomes.id', '=', 'overview.outcome_id')
320
-			->selectRaw('outcomes.name, overview.outcome_id as id, sum(overview.total_evaluated) as total_evaluated, sum(overview.total_achieved) as total_achieved')
323
+			->rightJoin('outcomes', 'outcomes.id', '=', 'overview.outcome_id')
324
+			->whereIn('outcomes.level',$levels)
325
+			->selectRaw('outcomes.name, coalesce(outcomes.new_outcome_id,outcomes.id) as id, sum(overview.total_evaluated) as total_evaluated, sum(overview.total_achieved) as total_achieved')
321 326
 			->orderBy('outcomes.name', 'asc')
322
-			->groupBy('overview.outcome_id')
327
+			->groupBy(DB::raw('coalesce(outcomes.new_outcome_id,outcomes.id)'))
323 328
 			->get();
329
+//outcomes activos 
330
+// 		$outcomes = DB::table('outcomes')
331
+// 			->whereNull('deactivation_date')
332
+// 			
333
+// 			->get();
334
+			
335
+// DB::enableQueryLog();
324 336
 		foreach ($outcomes as $outcome) {
337
+// 		select semester_id, program_id, sum(`total_evaluated`) eval, sum(`total_achieved`) ach from overview where outcome_id in (select id from outcomes where coalesce(`new_outcome_id`,id) = 12) group by semester_id, program_id
325 338
 			$outcome->semesters = DB::table('overview')
326 339
 				->join('semesters', 'semesters.id', '=', 'overview.semester_id')
327
-				->where('overview.outcome_id', $outcome->id)
340
+				->whereIn('overview.outcome_id',function ($query) use ($outcome)
341
+				{
342
+					$query->select('outcomes.id')
343
+						  ->from('outcomes')
344
+						  ->whereRaw('coalesce(outcomes.new_outcome_id,outcomes.id)=?',[$outcome->id]);
345
+				})
328 346
 				->selectRaw('semesters.id, semesters.name, semesters.code, sum(overview.total_evaluated) as total_evaluated, sum(overview.total_achieved) as total_achieved')
329 347
 				->orderBy('semesters.code', 'asc')
330
-				->groupBy('overview.outcome_id')
331 348
 				->groupBy('overview.semester_id')
332 349
 				->get();
333 350
 		}
351
+// var_dump($outcomes);
352
+// 		exit();
353
+// dd(DB::getQueryLog());
334 354
 
335 355
 		$filters = array();
336 356
 		$filters['school'] = DB::table('overview')
337 357
 			->join('programs', 'programs.id', '=', 'overview.program_id')
338 358
 			->join('schools', 'schools.id', '=', 'programs.school_id')
359
+			->where('programs.is_graduate',$is_graduate)
339 360
 			->select('schools.id', 'schools.name')
340 361
 			->orderBy('schools.name', 'asc')
341 362
 			->groupBy('schools.id')
342 363
 			->get();
343 364
 
365
+// DB::enableQueryLog();
344 366
 		$filters['program'] = DB::table('overview')
345 367
 			->join('programs', 'programs.id', '=', 'overview.program_id')
368
+			->where('programs.is_graduate',$is_graduate)
346 369
 			->select('programs.id', 'programs.name')
347 370
 			->orderBy('programs.name', 'asc')
348 371
 			->groupBy('overview.program_id')
349 372
 			->get();
373
+// dd(DB::getQueryLog());
350 374
 
351 375
 		$filters['semester'] = DB::table('overview')
352 376
 			->join('semesters', 'semesters.id', '=', 'overview.semester_id')
@@ -361,14 +385,23 @@ class AdministratorsController extends \BaseController
361 385
 			->orderBy('semesters.code', 'asc')
362 386
 			->groupBy('overview.semester_id')
363 387
 			->get();
388
+// DB::enableQueryLog();
389
+//select `outcomes`.`id`, `outcomes`.`name` from outcomes where deactivation_date is null and `outcomes`.`id` in (select outcome_id from overview)
364 390
 
365
-		$filters['outcome'] = DB::table('overview')
366
-			->join('outcomes', 'outcomes.id', '=', 'overview.outcome_id')
391
+		$filters['outcome'] = DB::table('outcomes')
367 392
 			->select('outcomes.id', 'outcomes.name')
393
+			->whereNull('deactivation_date')
394
+			->whereIn('outcomes.id',function($query)
395
+			{
396
+				$query->select('outcome_id')
397
+				 ->from('overview');
398
+			}
399
+			
400
+			)
368 401
 			->orderBy('outcomes.name', 'asc')
369
-			->groupBy('overview.outcome_id')
370 402
 			->get();
371
-
403
+// dd(DB::getQueryLog());
404
+// exit();
372 405
 		$target = 0.70;
373 406
 
374 407
 		return View::make('local.managers.admins.overview2', compact('title', 'selected_semesters', 'outcomes', 'semesters', 'filters', 'target'));
@@ -384,13 +417,17 @@ class AdministratorsController extends \BaseController
384 417
 		$semesters = Input::get('semesters');
385 418
 		$years = Input::get('years');
386 419
 		$outcomes = Input::get('outcomes');
387
-
420
+		$is_graduate=Input::get('is_graduate');
421
+// 		$is_graduate=0;
422
+		if($is_graduate)$levels=array(2,3);
423
+		else $levels=array(1,3);
388 424
 
389 425
 		// make an array id's of schools selected. if All, use All available id's
390 426
 		if ($schools == array("0")) {
391 427
 			$result = DB::table('overview')
392 428
 				->join('programs', 'programs.id', '=', 'overview.program_id')
393 429
 				->join('schools', 'schools.id', '=', 'programs.school_id')
430
+				->where('programs.is_graduate',$is_graduate)
394 431
 				->select('schools.id')
395 432
 				->orderBy('schools.name', 'asc')
396 433
 				->groupBy('schools.id')
@@ -409,6 +446,7 @@ class AdministratorsController extends \BaseController
409 446
 		if ($programs == array("0")) {
410 447
 			$result = DB::table('overview')
411 448
 				->join('programs', 'programs.id', '=', 'overview.program_id')
449
+				->where('programs.is_graduate',$is_graduate)
412 450
 				->select('programs.id')
413 451
 				->orderBy('programs.name', 'asc')
414 452
 				->groupBy('overview.program_id')
@@ -442,31 +480,52 @@ class AdministratorsController extends \BaseController
442 480
 			}
443 481
 		}
444 482
 		// make an array id's of years selected. if All, use All available id's
445
-		if ($years == array("0")) {
446
-			$result = DB::table('overview') //
447
-				->join('semesters', 'semesters.id', '=', 'overview.semester_id')
448
-				->select('semesters.id')
449
-				->orderBy('semesters.code', 'asc')
450
-				->groupBy('overview.semester_id')
451
-				->get();
452
-			$years_id = array();
453
-			foreach ($result as $year) {
454
-				array_push($years_id, $year->id);
455
-			}
456
-		} else {
457
-			$years_id = array();
458
-			foreach ($years as $year_id) {
459
-				array_push($years_id, intval($year_id));
460
-			}
461
-		}
483
+// 		if ($years == array("0")) {
484
+// 			$result = DB::table('overview') //
485
+// 				->join('semesters', 'semesters.id', '=', 'overview.semester_id')
486
+// 				->select('semesters.id')
487
+// 				->orderBy('semesters.code', 'asc')
488
+// 				->groupBy('overview.semester_id')
489
+// 				->get();
490
+// 			$years_id = array();
491
+// 			foreach ($result as $year) {
492
+// 				array_push($years_id, $year->id);
493
+// 			}
494
+// 		} else {
495
+// 			$years_id = array();
496
+// 			foreach ($years as $year_id) {
497
+// 				array_push($years_id, intval($year_id));
498
+// 			}
499
+// 		}
462 500
 		// make an array id's of outcomes selected. if All, use All available id's
463 501
 		if ($outcomes == array("0")) {
464
-			$result = DB::table('overview')
465
-				->join('outcomes', 'outcomes.id', '=', 'overview.outcome_id')
466
-				->select('outcomes.id')
467
-				->orderBy('outcomes.name', 'asc')
468
-				->groupBy('overview.outcome_id')
469
-				->get();
502
+
503
+		$result = DB::table('overview')
504
+			->rightJoin('outcomes', 'outcomes.id', '=', 'overview.outcome_id')
505
+			->whereIn('outcomes.level',$levels)
506
+			->selectRaw('coalesce(outcomes.new_outcome_id,outcomes.id) as id')
507
+			->orderBy('outcomes.name', 'asc')
508
+			->groupBy(DB::raw('coalesce(outcomes.new_outcome_id,outcomes.id)'))
509
+			->get();
510
+// 		$result = DB::table('outcomes')
511
+// 			->select('outcomes.id')
512
+// 			->whereIn('outcomes.level',$levels)
513
+// 			->whereNull('deactivation_date')
514
+// // 			->whereIn('outcomes.id',function($query)
515
+// // 				{
516
+// // 					$query->select('outcome_id')
517
+// // 					 ->from('overview');
518
+// // 				}
519
+// // 			)
520
+// 			->orderBy('outcomes.name', 'asc')
521
+// 			->get();
522
+// 
523
+// 			$result = DB::table('overview')
524
+// 				->join('outcomes', 'outcomes.id', '=', 'overview.outcome_id')
525
+// 				->select('outcomes.id')
526
+// 				->orderBy('outcomes.name', 'asc')
527
+// 				->groupBy('overview.outcome_id')
528
+// 				->get();
470 529
 			$outcomes_id = array();
471 530
 			foreach ($result as $outcome) {
472 531
 				array_push($outcomes_id, $outcome->id);
@@ -485,6 +544,7 @@ class AdministratorsController extends \BaseController
485 544
 			->join('schools', 'schools.id', '=', 'programs.school_id')
486 545
 			->join('semesters', 'semesters.id', '=', 'overview.semester_id')
487 546
 			->join('outcomes', 'outcomes.id', '=', 'overview.outcome_id')
547
+// 			->where('programs.is_graduate',$is_graduate)
488 548
 			->whereIn('schools.id', $schools_id)
489 549
 			->whereIn('programs.id', $programs_id)
490 550
 			->whereIn('semesters.id', $semesters_id)
@@ -494,35 +554,78 @@ class AdministratorsController extends \BaseController
494 554
 			->orderBy('semesters.code', 'asc')
495 555
 			->groupBy('semesters.id')
496 556
 			->get();
497
-		$outcomes = 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)
557
+
558
+// 		$outcomes = DB::table('overview')
559
+// 			->rightJoin('outcomes', 'outcomes.id', '=', 'overview.outcome_id')
560
+// 			->join('programs', 'programs.id', '=', 'overview.program_id')
561
+// 			->join('schools', 'schools.id', '=', 'programs.school_id')
562
+// 			->join('semesters', 'semesters.id', '=', 'overview.semester_id')
563
+// 			->whereIn('schools.id', $schools_id)
564
+// 			->whereIn('programs.id', $programs_id)
565
+// 			->whereIn('semesters.id', $semesters_id)
566
+// 			->whereIn('outcomes.id', $outcomes_id)
567
+// 			->selectRaw('outcomes.name, coalesce(outcomes.new_outcome_id,outcomes.id) as id, sum(overview.total_evaluated) as total_evaluated, sum(overview.total_achieved) as total_achieved')
568
+// 			->orderBy('outcomes.name', 'asc')
569
+// 			->groupBy(DB::raw('coalesce(outcomes.new_outcome_id,outcomes.id)'))
570
+// 			->get();
571
+			
572
+// 			$sql=DB::table('overview')
573
+// 				->join('programs', 'programs.id', '=', 'overview.program_id')
574
+// 				->join('schools', 'schools.id', '=', 'programs.school_id')
575
+// 				->join('semesters', 'semesters.id', '=', 'overview.semester_id')
576
+// 				->select('overview.id','program_id','outcome_id','semester_id','total_evaluated','total_achieved')
577
+// 				->whereIn('schools.id', $schools_id)
578
+// 				->whereIn('programs.id', $programs_id)
579
+// 				->whereIn('semesters.id', $semesters_id);
580
+
581
+			$schools_text=implode(",", $schools_id);
582
+			$programs_text=implode(",", $programs_id);
583
+			$semesters_text=implode(",", $semesters_id);
584
+
585
+			$sql="select overview.* from `overview` inner join `programs` on `programs`.`id` = `overview`.`program_id` inner join `schools` on `schools`.`id` = `programs`.`school_id` inner join `semesters` on `semesters`.`id` = `overview`.`semester_id` where `schools`.`id` in ($schools_text) and `programs`.`id` in ($programs_text) and `semesters`.`id` in ($semesters_text)";
586
+			
587
+			$outcomes = DB::table('outcomes')
588
+			->leftJoin(DB::raw("({$sql}) as overview2"),'outcomes.id', '=', 'overview2.outcome_id')
506 589
 			->whereIn('outcomes.id', $outcomes_id)
507
-			->selectRaw('outcomes.name, overview.outcome_id as id, sum(overview.total_evaluated) as total_evaluated, sum(overview.total_achieved) as total_achieved')
590
+			->selectRaw('outcomes.name, coalesce(outcomes.new_outcome_id,outcomes.id) as id, sum(overview2.total_evaluated) as total_evaluated, sum(overview2.total_achieved) as total_achieved')
508 591
 			->orderBy('outcomes.name', 'asc')
509
-			->groupBy('overview.outcome_id')
592
+			->groupBy(DB::raw('coalesce(outcomes.new_outcome_id,outcomes.id)'))
593
+// 			->mergeBindings($sql->getQuery())
510 594
 			->get();
595
+			
511 596
 		foreach ($outcomes as $outcome) {
597
+// 			$outcome->semesters = DB::table('overview')
598
+// 				->join('programs', 'programs.id', '=', 'overview.program_id')
599
+// 				->join('schools', 'schools.id', '=', 'programs.school_id')
600
+// 				->join('semesters', 'semesters.id', '=', 'overview.semester_id')
601
+// 				->join('outcomes', 'outcomes.id', '=', 'overview.outcome_id')
602
+// 				->whereIn('schools.id', $schools_id)
603
+// 				->whereIn('programs.id', $programs_id)
604
+// 				->whereIn('semesters.id', $semesters_id)
605
+// 				// ->whereIn('years.id',$years_id)
606
+// 				->whereIn('outcomes.id', $outcomes_id)
607
+// 				->where('overview.outcome_id', $outcome->id)
608
+// 				->selectRaw('semesters.id, semesters.name, semesters.code, sum(overview.total_evaluated) as total_evaluated, sum(overview.total_achieved) as total_achieved')
609
+// 				->orderBy('semesters.code', 'asc')
610
+// 				->groupBy('overview.outcome_id')
611
+// 				->groupBy('overview.semester_id')
612
+// 				->get();
613
+
512 614
 			$outcome->semesters = DB::table('overview')
513 615
 				->join('programs', 'programs.id', '=', 'overview.program_id')
514 616
 				->join('schools', 'schools.id', '=', 'programs.school_id')
515 617
 				->join('semesters', 'semesters.id', '=', 'overview.semester_id')
516
-				->join('outcomes', 'outcomes.id', '=', 'overview.outcome_id')
517 618
 				->whereIn('schools.id', $schools_id)
518 619
 				->whereIn('programs.id', $programs_id)
519 620
 				->whereIn('semesters.id', $semesters_id)
520
-				// ->whereIn('years.id',$years_id)
521
-				->whereIn('outcomes.id', $outcomes_id)
522
-				->where('overview.outcome_id', $outcome->id)
621
+				->whereIn('overview.outcome_id',function ($query) use ($outcome)
622
+				{
623
+					$query->select('outcomes.id')
624
+						  ->from('outcomes')
625
+						  ->whereRaw('coalesce(outcomes.new_outcome_id,outcomes.id)=?',[$outcome->id]);
626
+				})
523 627
 				->selectRaw('semesters.id, semesters.name, semesters.code, sum(overview.total_evaluated) as total_evaluated, sum(overview.total_achieved) as total_achieved')
524 628
 				->orderBy('semesters.code', 'asc')
525
-				->groupBy('overview.outcome_id')
526 629
 				->groupBy('overview.semester_id')
527 630
 				->get();
528 631
 		}
@@ -539,10 +642,12 @@ class AdministratorsController extends \BaseController
539 642
 			->whereIn('semesters.id', $semesters_id)
540 643
 			// ->whereIn('years.id',$years_id)
541 644
 			->whereIn('outcomes.id', $outcomes_id)
645
+			->where('programs.is_graduate',$is_graduate)
542 646
 			->select('schools.id', 'schools.name')
543 647
 			->orderBy('schools.name', 'asc')
544 648
 			->groupBy('schools.id')
545 649
 			->get();
650
+			
546 651
 		$filters['program'] = DB::table('overview')
547 652
 			->join('programs', 'programs.id', '=', 'overview.program_id')
548 653
 			->join('schools', 'schools.id', '=', 'programs.school_id')
@@ -553,6 +658,7 @@ class AdministratorsController extends \BaseController
553 658
 			->whereIn('semesters.id', $semesters_id)
554 659
 			// ->whereIn('years.id',$years_id)
555 660
 			->whereIn('outcomes.id', $outcomes_id)
661
+			->where('programs.is_graduate',$is_graduate)
556 662
 			->select('programs.id', 'programs.name')
557 663
 			->orderBy('programs.name', 'asc')
558 664
 			->groupBy('overview.program_id')
@@ -567,37 +673,49 @@ class AdministratorsController extends \BaseController
567 673
 			// ->whereIn('semesters.id',$semesters_id)
568 674
 			// ->whereIn('years.id',$years_id)
569 675
 			->whereIn('outcomes.id', $outcomes_id)
676
+			->where('programs.is_graduate',$is_graduate)
570 677
 			->select('semesters.id', 'semesters.name', 'semesters.code')
571 678
 			->orderBy('semesters.code', 'asc')
572 679
 			->groupBy('overview.semester_id')
573 680
 			->get();
574
-		$filters['year'] = 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
-
585
-			->get();
586
-		$filters['outcome'] = DB::table('overview')
587
-			->join('programs', 'programs.id', '=', 'overview.program_id')
588
-			->join('schools', 'schools.id', '=', 'programs.school_id')
589
-			->join('semesters', 'semesters.id', '=', 'overview.semester_id')
590
-			->join('outcomes', 'outcomes.id', '=', 'overview.outcome_id')
591
-			->whereIn('schools.id', $schools_id)
592
-			->whereIn('programs.id', $programs_id)
593
-			->whereIn('semesters.id', $semesters_id)
594
-			// ->whereIn('years.id',$years_id)
595
-			// ->whereIn('outcomes.id',$outcomes_id)
681
+// 		$filters['year'] = DB::table('overview') ////////////////////////////////////////////
682
+// 			->join('programs', 'programs.id', '=', 'overview.program_id')
683
+// 			->join('schools', 'schools.id', '=', 'programs.school_id')
684
+// 			->join('semesters', 'semesters.id', '=', 'overview.semester_id')
685
+// 			->join('outcomes', 'outcomes.id', '=', 'overview.outcome_id')
686
+// 			->whereIn('schools.id', $schools_id)
687
+// 			->whereIn('programs.id', $programs_id)
688
+// 			->whereIn('semesters.id', $semesters_id)
689
+// 			// ->whereIn('years.id',$years_id)
690
+// 			->whereIn('outcomes.id', $outcomes_id)
691
+// 
692
+// 			->get();
693
+			$sql="select overview.* from `overview` inner join `programs` on `programs`.`id` = `overview`.`program_id` inner join `schools` on `schools`.`id` = `programs`.`school_id` inner join `semesters` on `semesters`.`id` = `overview`.`semester_id` where `schools`.`id` in ($schools_text) and `programs`.`id` in ($programs_text) and `semesters`.`id` in ($semesters_text) and programs.is_graduate=$is_graduate";
694
+			
695
+			$filters['outcome']  = DB::table('outcomes')
696
+			->leftJoin(DB::raw("({$sql}) as overview2"),'outcomes.id', '=', 'overview2.outcome_id')
596 697
 			->select('outcomes.id', 'outcomes.name')
597 698
 			->orderBy('outcomes.name', 'asc')
598
-			->groupBy('overview.outcome_id')
699
+			->groupBy(DB::raw('coalesce(outcomes.new_outcome_id,outcomes.id)'))
700
+// 			->mergeBindings($sql->getQuery())
599 701
 			->get();
600 702
 
703
+// 		$filters['outcome'] = DB::table('overview')
704
+// 			->join('programs', 'programs.id', '=', 'overview.program_id')
705
+// 			->join('schools', 'schools.id', '=', 'programs.school_id')
706
+// 			->join('semesters', 'semesters.id', '=', 'overview.semester_id')
707
+// 			->join('outcomes', 'outcomes.id', '=', 'overview.outcome_id')
708
+// 			->whereIn('schools.id', $schools_id)
709
+// 			->whereIn('programs.id', $programs_id)
710
+// 			->whereIn('semesters.id', $semesters_id)
711
+// 			// ->whereIn('years.id',$years_id)
712
+// 			// ->whereIn('outcomes.id',$outcomes_id)
713
+// 			->where('programs.is_graduate',$is_graduate)
714
+// 			->select('outcomes.id', 'outcomes.name')
715
+// 			->orderBy('outcomes.name', 'asc')
716
+// 			->groupBy('overview.outcome_id')
717
+// 			->get();
718
+
601 719
 		return array(
602 720
 			"semesters" => $semesters,
603 721
 			"outcomes_info" => $outcomes,

+ 2
- 2
app/routes.php Прегледај датотеку

@@ -268,8 +268,8 @@ Route::group(array('before' => 'auth|has_access'), function () {
268 268
      * Administrator Routes
269 269
      */
270 270
     Route::group(array('before' => 'admin'), function () {
271
-        Route::get('/administrator', 'AdministratorsController@overview');
272
-        Route::get('/administrator2', 'AdministratorsController@overview2');
271
+        Route::get('/administrator', 'AdministratorsController@overview2');
272
+        Route::get('/administrator2', 'AdministratorsController@overview');
273 273
         Route::post('/administrator2/filter', 'AdministratorsController@overview2_filter_results');
274 274
         Route::post('administrator/rubrics', array(
275 275
             'as' => 'rubrics',

+ 18
- 1
app/views/local/managers/admins/overview2.blade.php Прегледај датотеку

@@ -60,12 +60,14 @@
60 60
 
61 61
       //
62 62
       outcomes_data.push(hidden_values);
63
+// 		console.log(semesters)
63 64
 
64 65
       $.each(outcomes_info, function(index, outcome){
65 66
         var temp_outcome_grouping_info = Array();
66 67
         temp_outcome_grouping_info.push({v:(index+1),f:"Students acheiving Learning Outcomes"});
67 68
         temp_outcome_grouping_info.push(target_line);
68
-
69
+		
70
+// 		console.log(outcome.semesters)
69 71
         var i = 0;
70 72
         $.each(outcome.semesters, function(index, semester){
71 73
 
@@ -158,6 +160,7 @@
158 160
     var outcomes_info = <?= json_encode($outcomes, JSON_HEX_TAG); ?>;
159 161
     var semesters = <?= json_encode($semesters, JSON_HEX_TAG); ?>;
160 162
 
163
+// 	console.log(outcomes_info);
161 164
     make_chart(outcomes_info,semesters);
162 165
 
163 166
     </script>
@@ -166,6 +169,17 @@
166 169
       <div class="filters">
167 170
         <div class="row" style="display: flex;">
168 171
           <div class="category" >
172
+            <label for="is_graduate">Level</label>
173
+            <div class="select">
174
+              <select class="selectpicker" name="is_graduate" id="is_graduate">
175
+                <option value="0" selected="selected">Undergradute</option>
176
+                <option value="1">Graduate</option>
177
+              </select>
178
+            </div>
179
+          </div>
180
+        </div>
181
+        <div class="row" style="display: flex;">
182
+          <div class="category" >
169 183
             <label for="school">School</label>
170 184
             <div class="select">
171 185
               <select multiple class="selectpicker" name="school" id="school">
@@ -302,6 +316,8 @@ $(document).ready(function()
302 316
     var semesters = $("#semester").val();
303 317
     var years = $("#year").val();
304 318
     var outcomes = $("#outcome").val();
319
+    var outcomes = $("#outcome").val();
320
+    var is_graduate = $("#is_graduate").val();
305 321
 
306 322
     // query the values and get new data for chart
307 323
     $.post(
@@ -312,6 +328,7 @@ $(document).ready(function()
312 328
         semesters: (semesters),
313 329
         years: (years),
314 330
         outcomes: (outcomes),
331
+        is_graduate: (is_graduate),
315 332
       },
316 333
       function(data)
317 334
       {