|
@@ -691,6 +691,7 @@ class ThreeYearPlanController extends \BaseController
|
691
|
691
|
|
692
|
692
|
public function printPlan($program_id, $typ)
|
693
|
693
|
{
|
|
694
|
+ $view=0;
|
694
|
695
|
|
695
|
696
|
$program = DB::table('programs')->where('id', $program_id)->first();
|
696
|
697
|
$three_year_plan = DB::table('three_year_plan')->where('id', $typ)->first();
|
|
@@ -733,7 +734,54 @@ class ThreeYearPlanController extends \BaseController
|
733
|
734
|
//Log::info($typ_semester_outcome);
|
734
|
735
|
|
735
|
736
|
|
736
|
|
- return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome'));
|
|
737
|
+ return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome', 'view'));
|
|
738
|
+ }
|
|
739
|
+
|
|
740
|
+ public function viewPlan($program_id, $typ)
|
|
741
|
+ {
|
|
742
|
+ $view=1;
|
|
743
|
+ $program = DB::table('programs')->where('id', $program_id)->first();
|
|
744
|
+ $three_year_plan = DB::table('three_year_plan')->where('id', $typ)->first();
|
|
745
|
+
|
|
746
|
+ $typ_program_id = DB::table('typ_program')->where('three_year_plan_id', $three_year_plan->id)
|
|
747
|
+ ->where('program_id', $program->id)
|
|
748
|
+ ->first()->id;
|
|
749
|
+
|
|
750
|
+ $typ_semesters = DB::table('semesters')
|
|
751
|
+ ->join('typ_semesters', 'semesters.id', '=', 'typ_semesters.semester_id')
|
|
752
|
+ ->where('typ_id', $three_year_plan->id)
|
|
753
|
+ ->orderBy('semester_id')
|
|
754
|
+ ->get();
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+ foreach ($typ_semesters as $semester) {
|
|
758
|
+ $typ_semester_outcome[$semester->semester_id] = DB::table('typ_semester_outcome')
|
|
759
|
+ ->join('outcomes', 'outcomes.id', '=', 'typ_semester_outcome.outcome_id')
|
|
760
|
+ ->where('typ_program_id', $typ_program_id)
|
|
761
|
+ ->where('semester_id', $semester->semester_id)
|
|
762
|
+ ->select('typ_semester_outcome.id as typ_id')
|
|
763
|
+ ->addSelect('outcomes.id as outcome_id', 'outcomes.name')
|
|
764
|
+ ->get();
|
|
765
|
+
|
|
766
|
+ foreach ($typ_semester_outcome[$semester->semester_id] as $outcome) {
|
|
767
|
+ $outcome->objectives = DB::table('typ_semester_objectives')
|
|
768
|
+ ->join('objectives', 'objectives.id', '=', 'typ_semester_objectives.objective_id')
|
|
769
|
+ ->where('typ_semester_outcome_id', $outcome->typ_id)
|
|
770
|
+ ->select('typ_semester_objectives.id as typ_obj_id')
|
|
771
|
+ ->addSelect('objectives.text', 'objectives.id as objective_id')
|
|
772
|
+ ->get();
|
|
773
|
+ foreach ($outcome->objectives as $objective) {
|
|
774
|
+ $objective->courses = DB::table('typ_semester_courses')
|
|
775
|
+ ->join('courses', 'courses.id', '=', 'typ_semester_courses.course_id')
|
|
776
|
+ ->where('typ_semester_objective_id', $objective->typ_obj_id)
|
|
777
|
+ ->get();
|
|
778
|
+ }
|
|
779
|
+ }
|
|
780
|
+ }
|
|
781
|
+ Log::info($typ_semester_outcome);
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+ return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome', 'view'));
|
737
|
785
|
}
|
738
|
786
|
|
739
|
787
|
public function showPDFs($program_id)
|