|
@@ -614,6 +614,7 @@ class ThreeYearPlanController extends \BaseController
|
614
|
614
|
|
615
|
615
|
public function printPlan($program_id, $typ)
|
616
|
616
|
{
|
|
617
|
+ $view=0;
|
617
|
618
|
|
618
|
619
|
$program = DB::table('programs')->where('id', $program_id)->first();
|
619
|
620
|
$three_year_plan = DB::table('three_year_plan')->where('id', $typ)->first();
|
|
@@ -656,6 +657,53 @@ class ThreeYearPlanController extends \BaseController
|
656
|
657
|
Log::info($typ_semester_outcome);
|
657
|
658
|
|
658
|
659
|
|
659
|
|
- return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome'));
|
|
660
|
+ return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome', 'view'));
|
|
661
|
+ }
|
|
662
|
+
|
|
663
|
+ public function viewPlan($program_id, $typ)
|
|
664
|
+ {
|
|
665
|
+ $view=1;
|
|
666
|
+ $program = DB::table('programs')->where('id', $program_id)->first();
|
|
667
|
+ $three_year_plan = DB::table('three_year_plan')->where('id', $typ)->first();
|
|
668
|
+
|
|
669
|
+ $typ_program_id = DB::table('typ_program')->where('three_year_plan_id', $three_year_plan->id)
|
|
670
|
+ ->where('program_id', $program->id)
|
|
671
|
+ ->first()->id;
|
|
672
|
+
|
|
673
|
+ $typ_semesters = DB::table('semesters')
|
|
674
|
+ ->join('typ_semesters', 'semesters.id', '=', 'typ_semesters.semester_id')
|
|
675
|
+ ->where('typ_id', $three_year_plan->id)
|
|
676
|
+ ->orderBy('semester_id')
|
|
677
|
+ ->get();
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+ foreach ($typ_semesters as $semester) {
|
|
681
|
+ $typ_semester_outcome[$semester->semester_id] = DB::table('typ_semester_outcome')
|
|
682
|
+ ->join('outcomes', 'outcomes.id', '=', 'typ_semester_outcome.outcome_id')
|
|
683
|
+ ->where('typ_program_id', $typ_program_id)
|
|
684
|
+ ->where('semester_id', $semester->semester_id)
|
|
685
|
+ ->select('typ_semester_outcome.id as typ_id')
|
|
686
|
+ ->addSelect('outcomes.id as outcome_id', 'outcomes.name')
|
|
687
|
+ ->get();
|
|
688
|
+
|
|
689
|
+ foreach ($typ_semester_outcome[$semester->semester_id] as $outcome) {
|
|
690
|
+ $outcome->objectives = DB::table('typ_semester_objectives')
|
|
691
|
+ ->join('objectives', 'objectives.id', '=', 'typ_semester_objectives.objective_id')
|
|
692
|
+ ->where('typ_semester_outcome_id', $outcome->typ_id)
|
|
693
|
+ ->select('typ_semester_objectives.id as typ_obj_id')
|
|
694
|
+ ->addSelect('objectives.text', 'objectives.id as objective_id')
|
|
695
|
+ ->get();
|
|
696
|
+ foreach ($outcome->objectives as $objective) {
|
|
697
|
+ $objective->courses = DB::table('typ_semester_courses')
|
|
698
|
+ ->join('courses', 'courses.id', '=', 'typ_semester_courses.course_id')
|
|
699
|
+ ->where('typ_semester_objective_id', $objective->typ_obj_id)
|
|
700
|
+ ->get();
|
|
701
|
+ }
|
|
702
|
+ }
|
|
703
|
+ }
|
|
704
|
+ Log::info($typ_semester_outcome);
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+ return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome', 'view'));
|
660
|
708
|
}
|
661
|
709
|
}
|