Browse Source

reportes y annualplans

parent
commit
903dec58c7

+ 76
- 24
app/controllers/AnnualPlansController.php View File

129
   }*/
129
   }*/
130
   public function adminIndex()
130
   public function adminIndex()
131
   {
131
   {
132
-  	Log::info("Entre".json_encode($this));
132
+    Log::info("Entre" . json_encode($this));
133
 
133
 
134
     $title = "Annual Plans";
134
     $title = "Annual Plans";
135
     $programs = Program::get();
135
     $programs = Program::get();
322
 
322
 
323
       $typ_info['courses'][$objective->id] = DB::select("select c.id, c.number, c.name, c.code, typ.id typ_course_id from courses c, typ_semester_courses typ, (select course_id, id  from typ_semester_courses where typ_semester_objective_id in (select id from typ_semester_objectives where objective_id ={$objective->id} and typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id =? and semester_id ={$semester->id} and typ_program_id in(select id from typ_program where program_id ={$program_id})))) rel where typ.course_id =c.id and rel.course_id = c.id and typ.id = rel.id ", array(Input::get('id')));
323
       $typ_info['courses'][$objective->id] = DB::select("select c.id, c.number, c.name, c.code, typ.id typ_course_id from courses c, typ_semester_courses typ, (select course_id, id  from typ_semester_courses where typ_semester_objective_id in (select id from typ_semester_objectives where objective_id ={$objective->id} and typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id =? and semester_id ={$semester->id} and typ_program_id in(select id from typ_program where program_id ={$program_id})))) rel where typ.course_id =c.id and rel.course_id = c.id and typ.id = rel.id ", array(Input::get('id')));
324
 
324
 
325
-      $typ_info['criteria'][$objective->id] = DB::select("select * from criteria where deleted_at IS NULL and id in (select criterion_id from criterion_objective_outcome join program_criterion_objective_outcome on program_criterion_objective_outcome.cri_obj_out_id = criterion_objective_outcome.id where outcome_id = ? and program_id {$program_id} and objective_id = {$objective->id})", array(Input::get('id')));
325
+      $typ_info['criteria'][$objective->id] = DB::select("select * from criteria where deleted_at IS NULL and id in (select criterion_id from criterion_objective_outcome join program_criterion_objective_outcome on program_criterion_objective_outcome.cri_obj_out_id = criterion_objective_outcome.id where outcome_id = ? and program_id  = {$program_id} and objective_id = {$objective->id})", array(Input::get('id')));
326
       Log::info($typ_info['criteria'][$objective->id]);
326
       Log::info($typ_info['criteria'][$objective->id]);
327
       $typ_info['typ_objective_id'][$objective->id] = DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id =? and semester_id ={$semester->id} and typ_program_id in (select id from typ_program where program_id ={$program_id}))", array(Input::get('id')));
327
       $typ_info['typ_objective_id'][$objective->id] = DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id =? and semester_id ={$semester->id} and typ_program_id in (select id from typ_program where program_id ={$program_id}))", array(Input::get('id')));
328
       Log::info($typ_info['typ_objective_id'][$objective->id]);
328
       Log::info($typ_info['typ_objective_id'][$objective->id]);
963
   }
963
   }
964
 
964
 
965
   //Print annual report
965
   //Print annual report
966
-  public function printAnnualReport($annual_id = null)
966
+  public function printAnnualReport($annual_id = null, $submit = null)
967
   {
967
   {
968
 
968
 
969
 
969
 
981
     $pdf->save(app_path() . '/storage/annual_pdfs/' . date('d-m-Y') . '-for-' . $annualPlan->program->id . '.pdf');
981
     $pdf->save(app_path() . '/storage/annual_pdfs/' . date('d-m-Y') . '-for-' . $annualPlan->program->id . '.pdf');
982
     return $pdf->download(date('d-m-Y') . '-for-' . $annualPlan->program->id . '.pdf');
982
     return $pdf->download(date('d-m-Y') . '-for-' . $annualPlan->program->id . '.pdf');
983
     */ //pdf = $pdf->setOrientation("landscape");
983
     */ //pdf = $pdf->setOrientation("landscape");
984
-    return View::make('local.managers.shared.print_annual_report', compact('annualPlan'));
984
+    Log::info("submit");
985
+    Log::info($submit);
986
+    return View::make('local.managers.shared.print_annual_report', compact('annualPlan', 'submit'));
985
   }
987
   }
986
 
988
 
987
   public function postAnnualReport($annual_id)
989
   public function postAnnualReport($annual_id)
989
 
991
 
990
     $annualPlan = AnnualPlan::findOrFail($annual_id);
992
     $annualPlan = AnnualPlan::findOrFail($annual_id);
991
     $user_id = Auth::user()->id;
993
     $user_id = Auth::user()->id;
992
-    $pdf = new PDF(app('config'), app("Filesystem"), app('view'), '/storage/plan_pdf');
993
-    $pdf = $pdf->loadView('local.managers.shared.print_annual_report', compact('annualPlan'))
994
-      ->setOrientation("landscape")
995
 
994
 
996
-      ->setPaper('legal', 'landscape');
997
-    $path = app_path() . '/storage/annual_pdfs/' . date('d-m-Y') . '-for-' . $annualPlan->program->id . '-by-' . $user_id . '.pdf';
998
-    $pdf->save($path);
999
-    $name = date('d-m-Y') . '-for-' . $annualPlan->program->id . '.pdf';
1000
-    $pdf->download($name);
995
+    //$pdf = new PDF(app('config'), app("Filesystem"), app('view'), '/storage/plan_pdf');
996
+    //$pdf = $pdf->loadView('local.managers.shared.print_annual_report', compact('annualPlan'))
997
+    //  ->setOrientation("landscape")
998
+
999
+    //  ->setPaper('legal', 'landscape');
1000
+    $path = app_path() . '/views/annual_htmls/report-on-' . date('d-m-Y') . '-for-' . $annualPlan->program->id . '-by-' . $user_id . '.blade.php';
1001
+    //$pdf->save($path);
1002
+    //$name = date('d-m-Y') . '-for-' . $annualPlan->program->id . '.pdf';
1003
+    //$pdf->download($name);
1001
 
1004
 
1002
     //is a path already there
1005
     //is a path already there
1003
 
1006
 
1072
     return View::make('local.managers.shared.new_view_annual_plans', compact('paths_with_users', 'title', 'report', 'last', 'annual_report_or_plan', 'program_id'));
1075
     return View::make('local.managers.shared.new_view_annual_plans', compact('paths_with_users', 'title', 'report', 'last', 'annual_report_or_plan', 'program_id'));
1073
   }
1076
   }
1074
 
1077
 
1078
+  public function findHTML($type_of_annual, $path_id)
1079
+  {
1080
+    $path = DB::table('paths_for_annual_plans')->where('id', $path_id)->first();
1081
+
1082
+    if (isset($path)) {
1083
+      Log::info($path->path_to_pdf);
1084
+      Log::info(app_path()); //. "/views/annual_htmls/");
1085
+
1086
+
1087
+      //FALTA COMO HACER PAl REPORT.
1088
+      // Este problema esta bien algarete. So si le doy str_replace(app_path() . '/views/annual_htmls/'),
1089
+      // si yo añado '/' al substring "htmls/" , me borra '/pla'. For no reason. 
1090
+      // so el plan, no se. 
1091
+      // 
1092
+      //
1093
+
1094
+      //$path = str_replace(app_path() . '/views/annual_htmls/', '', $path->path_to_pdf);
1095
+      //$path = trim($path->path_to_pdf, app_path() . '/views/annual_');
1096
+      //$path = trim($path, "htmls");
1097
+      //$path = trim($path, '/'); //. "/views/annual_htmls/");
1098
+      //Log::info($path);
1099
+
1100
+      //aqui tambien pasa una loquera
1101
+      $path = str_replace(app_path() . '/views/annual_htmls/', '', $path->path_to_pdf);
1102
+
1103
+
1104
+
1105
+
1106
+
1107
+      $path = trim($path, ".blade.php");
1108
+      $dir =  '';
1109
+
1110
+      if ($type_of_annual == "plan") {
1111
+        $dir = 'annual_htmls.pla';
1112
+      } else {
1113
+        $dir = "annual_htmls.";
1114
+      }
1115
+      return View::make($dir . $path);
1116
+    }
1117
+    Session::flash('status', 'warning');
1118
+    Session::flash('message', 'Error loading Annual Plan. Please try again later.');
1119
+    return Redirect::back();
1120
+  }
1121
+
1075
   public function adminReportIndex()
1122
   public function adminReportIndex()
1076
   {
1123
   {
1077
   }
1124
   }
1145
     */
1192
     */
1146
     $error_array = [];
1193
     $error_array = [];
1147
 
1194
 
1195
+    Log::info("Esto devuelve?");
1196
+
1197
+    Log::info($annual_plan->courses);
1198
+
1148
     foreach ($annual_plan->courses as $index => $course) {
1199
     foreach ($annual_plan->courses as $index => $course) {
1200
+
1149
       Log::info('paired Criteria');
1201
       Log::info('paired Criteria');
1150
       Log::info($course->paired_criteria);
1202
       Log::info($course->paired_criteria);
1151
       if (count($course->paired_criteria) <= 0) {
1203
       if (count($course->paired_criteria) <= 0) {
1238
   }
1290
   }
1239
 
1291
 
1240
 
1292
 
1241
-  function printAnnualPlan($annual_id)
1293
+  public function printAnnualPlan($annual_id, $submit = null)
1242
   {
1294
   {
1243
     $alphabet = range("A", "Z");
1295
     $alphabet = range("A", "Z");
1244
     $annualPlan = AnnualPlan::findOrFail($annual_id);
1296
     $annualPlan = AnnualPlan::findOrFail($annual_id);
1245
     $small_alphabet = range('a', 'z');
1297
     $small_alphabet = range('a', 'z');
1246
-    return View::make('local.managers.shared.print_annual_plan', compact('annualPlan', 'alphabet', 'small_alphabet'));
1298
+    return View::make('local.managers.shared.print_annual_plan', compact('annualPlan', 'alphabet', 'small_alphabet', 'submit'));
1247
   }
1299
   }
1248
 
1300
 
1249
-  function submitAnnualPlan($annual_id)
1301
+  public function submitAnnualPlan($annual_id)
1250
   {
1302
   {
1251
     $alphabet = range("A", "Z");
1303
     $alphabet = range("A", "Z");
1252
     $small_alphabet = range('a', 'z');
1304
     $small_alphabet = range('a', 'z');
1253
     $annualPlan = AnnualPlan::findOrFail($annual_id);
1305
     $annualPlan = AnnualPlan::findOrFail($annual_id);
1254
     $user_id = Auth::user()->id;
1306
     $user_id = Auth::user()->id;
1255
-    $pdf = new PDF(app('config'), app("Filesystem"), app('view'), '/storage/plan_pdf');
1256
-    $pdf = $pdf->loadView('local.managers.shared.print_annual_plan', compact('annualPlan', 'alphabet', 'small_alphabet'))
1257
-      ->setOrientation("landscape")
1307
+    //$pdf = new PDF(app('config'), app("Filesystem"), app('view'), '/storage/plan_pdf');
1308
+    //$pdf = $pdf->loadView('local.managers.shared.print_annual_plan', compact('annualPlan', 'alphabet', 'small_alphabet'))
1309
+    //  ->setOrientation("landscape")
1258
 
1310
 
1259
-      ->setPaper('legal', 'landscape');
1260
-    $path = app_path() . '/storage/annual_pdfs/plan-on-' . date('d-m-Y') . '-for-' . $annualPlan->program->id . '-by-' . $user_id . '.pdf';
1261
-    $pdf->save($path);
1262
-    $name = "plan-on-" . date('d-m-Y') . '-for-' . $annualPlan->program->id . '.pdf';
1263
-    $pdf->download($name);
1311
+    //  ->setPaper('legal', 'landscape');
1312
+    $path = app_path() . '/views/annual_htmls/plan-on-' . date('d-m-Y') . '-for-' . $annualPlan->program->id . '-by-' . $user_id . '.blade.php';
1313
+    //$pdf->save($path);
1314
+    $name = "plan-on-" . date('d-m-Y') . '-for-' . $annualPlan->program->id . '.blade.php';
1315
+    //$pdf->download($name);
1264
 
1316
 
1265
     //is a path already there
1317
     //is a path already there
1266
-
1318
+    $submit = 1;
1267
     $it_exists = DB::table("paths_for_annual_plans")
1319
     $it_exists = DB::table("paths_for_annual_plans")
1268
       ->where('path_to_pdf', $path)
1320
       ->where('path_to_pdf', $path)
1269
       ->first();
1321
       ->first();

+ 67
- 23
app/controllers/ThreeYearPlanController.php View File

2
 
2
 
3
 use Illuminate\Database\Eloquent\Collection;
3
 use Illuminate\Database\Eloquent\Collection;
4
 use Barryvdh\DomPDF\PDF as PDF;
4
 use Barryvdh\DomPDF\PDF as PDF;
5
+use Illuminate\Support\Facades\View;
5
 
6
 
6
 class ThreeYearPlanController extends \BaseController
7
 class ThreeYearPlanController extends \BaseController
7
 {
8
 {
41
       return Redirect::to("three-years-plan/{$program_id}");
42
       return Redirect::to("three-years-plan/{$program_id}");
42
     }
43
     }
43
   }
44
   }
44
-    public function adminIndex()
45
+  public function adminIndex()
45
   {
46
   {
46
-  	Log::info("Entre".json_encode($this));
47
+    Log::info("Entre" . json_encode($this));
47
 
48
 
48
     $title = "Three Years Plans";
49
     $title = "Three Years Plans";
49
     $programs = Program::get();
50
     $programs = Program::get();
51
     return View::make('local.managers.admins.show-typ-program', compact('title', 'programs'));
52
     return View::make('local.managers.admins.show-typ-program', compact('title', 'programs'));
52
   }
53
   }
53
 
54
 
54
-    public function manageSemesterCycle()
55
+  public function manageSemesterCycle()
55
   {
56
   {
56
-//   	Log::info("Entre".json_encode($this));
57
+    //   	Log::info("Entre".json_encode($this));
57
 
58
 
58
     $title = "Semesters Cycles";
59
     $title = "Semesters Cycles";
59
-//     $programs = Program::get();
60
+    //     $programs = Program::get();
60
 
61
 
61
-		return $this->adminIndex();
62
-//     return View::make('local.managers.admins.show-typ-program', compact('title', 'programs'));
62
+    return $this->adminIndex();
63
+    //     return View::make('local.managers.admins.show-typ-program', compact('title', 'programs'));
63
   }
64
   }
64
 
65
 
66
+  //busca los links de public y los loadea
67
+  public function findHTML($path_id)
68
+  {
69
+
70
+    $path = DB::table('paths_for_three_year_plans')->where('id', $path_id)->first();
65
 
71
 
72
+    if (isset($path)) {
73
+
74
+      $path = trim($path->path_to_pdf, app_path() . "/views/three_year_plan_htmls/");
75
+      $path = trim($path, ".blade.php");
76
+      return View::make("three_year_plan_htmls." . $path);
77
+    }
78
+    Session::flash('status', 'warning');
79
+    Session::flash('message', 'Error loading typ. Please try again later.');
80
+    return Redirect::back();
81
+  }
66
   // load the Three year Plan page
82
   // load the Three year Plan page
67
   public function threeYearsReport($program_id)
83
   public function threeYearsReport($program_id)
68
   {
84
   {
601
     $count = 0;
617
     $count = 0;
602
     $yearStartPlusOne = $current_typ->year_start + 1;
618
     $yearStartPlusOne = $current_typ->year_start + 1;
603
     $yearStart = $current_typ->year_start;
619
     $yearStart = $current_typ->year_start;
604
-    Log::info($yearStart);
605
-    Log::info($yearStartPlusOne);
620
+    //Log::info($yearStart);
621
+    //Log::info($yearStartPlusOne);
606
     while ($count < 3) {
622
     while ($count < 3) {
607
 
623
 
608
 
624
 
635
 
651
 
636
   public function  createThreeYearPlanPdf($program_id, $typ)
652
   public function  createThreeYearPlanPdf($program_id, $typ)
637
   {
653
   {
654
+
638
     $program = DB::table('programs')->where('id', $program_id)->first();
655
     $program = DB::table('programs')->where('id', $program_id)->first();
639
     $three_year_plan = DB::table('three_year_plan')->where('id', $typ)->first();
656
     $three_year_plan = DB::table('three_year_plan')->where('id', $typ)->first();
640
 
657
 
642
       ->where('program_id', $program->id)
659
       ->where('program_id', $program->id)
643
       ->first()->id;
660
       ->first()->id;
644
 
661
 
662
+
645
     $typ_semesters = DB::table('semesters')
663
     $typ_semesters = DB::table('semesters')
646
       ->join('typ_semesters', 'semesters.id', '=', 'typ_semesters.semester_id')
664
       ->join('typ_semesters', 'semesters.id', '=', 'typ_semesters.semester_id')
647
       ->where('typ_id', $three_year_plan->id)
665
       ->where('typ_id', $three_year_plan->id)
648
       ->orderBy('semester_id')
666
       ->orderBy('semester_id')
649
       ->get();
667
       ->get();
650
 
668
 
669
+    //Log::info("Stop 2");
670
+
651
 
671
 
652
     foreach ($typ_semesters as $semester) {
672
     foreach ($typ_semesters as $semester) {
653
       $typ_semester_outcome[$semester->semester_id] = DB::table('typ_semester_outcome')
673
       $typ_semester_outcome[$semester->semester_id] = DB::table('typ_semester_outcome')
674
       }
694
       }
675
     }
695
     }
676
 
696
 
677
-    $pdf = new PDF(app('config'), app("Filesystem"), app('view'), '/storage/three_year_plan_pdfs');
678
-    $pdf = $pdf->loadView('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome'))
679
-      ->setOrientation("landscape")
697
+    //html para salvar
698
+
699
+    $submit = 1;
700
+    $view = 0;
701
+
702
+
703
+    //$pdf = new PDF(app('config'), app("Filesystem"), app('view'), '/storage/three_year_plan_pdfs');
680
 
704
 
681
-      ->setPaper('legal', 'landscape');
682
-    $path = app_path() . '/storage/three_year_plan_pdfs/' . date('d-m-Y') . '-for-' . $program->id . '-by-' . Auth::user()->id . '.pdf';
683
-    $pdf->save($path);
684
-    $name = date('d-m-Y') . '-for-' . $program->id . '.pdf';
685
-    $pdf->download($name);
686
 
705
 
687
-    //is a path already there
706
+    //$pdf = $pdf->loadView('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome'))
707
+    //  ->setOrientation("landscape")
708
+
709
+    // ->setPaper('legal', 'landscape');
710
+
711
+
712
+    $path = app_path() . '/views/three_year_plan_htmls/' . date('d-m-Y') . '-for-' . $program->id . '-by-' . Auth::user()->id . '.blade.php';
713
+
714
+
715
+
716
+    $name = date('d-m-Y') . '-for-' . $program->id . '-by-' . Auth::user()->id . '.blade.php';
717
+
718
+
719
+
720
+    //is a path already there, if it is, leave the same path
688
 
721
 
689
     $it_exists = DB::table("paths_for_three_year_plans")
722
     $it_exists = DB::table("paths_for_three_year_plans")
690
       ->where('path_to_pdf', $path)
723
       ->where('path_to_pdf', $path)
691
       ->first();
724
       ->first();
725
+    //Log::info("pero aqui?");
692
 
726
 
693
     if (isset($it_exists)) {
727
     if (isset($it_exists)) {
694
-      return '200';
728
+      return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome', 'view', 'app_path', 'submit'));
695
     }
729
     }
696
-    //$user_id = Auth::user()->id;
730
+
731
+    //else save the new path and update time
732
+
733
+
697
     DB::table("paths_for_three_year_plans")
734
     DB::table("paths_for_three_year_plans")
698
       ->where('typ_program_id', $typ_program_id)
735
       ->where('typ_program_id', $typ_program_id)
699
       ->where('user_id', Auth::user()->id)
736
       ->where('user_id', Auth::user()->id)
702
         'last' => 0
739
         'last' => 0
703
       ));
740
       ));
704
 
741
 
742
+
705
     DB::table('paths_for_three_year_plans')->insert(array(
743
     DB::table('paths_for_three_year_plans')->insert(array(
706
       "path_to_pdf" => $path,
744
       "path_to_pdf" => $path,
707
       'typ_program_id' => $typ_program_id,
745
       'typ_program_id' => $typ_program_id,
709
       'user_id' => Auth::user()->id,
747
       'user_id' => Auth::user()->id,
710
       'date_posted' => date('Y-m-d')
748
       'date_posted' => date('Y-m-d')
711
     ));
749
     ));
750
+    return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome', 'view', 'app_path', 'submit'));
712
   }
751
   }
713
 
752
 
714
-  public function printPlan($program_id, $typ)
753
+  public function printPlan($program_id, $typ, $submit = NULL)
715
   {
754
   {
716
     $view = 0;
755
     $view = 0;
717
 
756
 
756
     //Log::info($typ_semester_outcome);
795
     //Log::info($typ_semester_outcome);
757
 
796
 
758
 
797
 
759
-    return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome', 'view'));
798
+    //TEMP
799
+
800
+    //$app_path = app_path() . '/jsPDF-master/src/jspdf.js';
801
+    //$submit = 1;
802
+    return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome', 'view', 'app_path', 'submit'));
760
   }
803
   }
761
 
804
 
762
   public function viewPlan($program_id, $typ)
805
   public function viewPlan($program_id, $typ)
841
     return View::make('local.managers.shared.new_view_three_year_plans', compact('paths_with_users', 'title', 'last', 'program_id'));
884
     return View::make('local.managers.shared.new_view_three_year_plans', compact('paths_with_users', 'title', 'last', 'program_id'));
842
   }
885
   }
843
 
886
 
844
-  public function downloadPDF($download, $path_id)
887
+  /*public function downloadPDF($download, $path_id)
845
   {
888
   {
846
     $pdf = new PDF(app('config'), app("Filesystem"), app('view'), '/storage/three_year_plan_pdfs');
889
     $pdf = new PDF(app('config'), app("Filesystem"), app('view'), '/storage/three_year_plan_pdfs');
847
 
890
 
907
     else
950
     else
908
       return $pdf->stream(basename($queryToPath->path_to_pdf));
951
       return $pdf->stream(basename($queryToPath->path_to_pdf));
909
   }
952
   }
953
+  */
910
 }
954
 }

+ 12
- 6
app/models/AnnualPlan.php View File

23
 
23
 
24
 	public function getCoursesAttribute()
24
 	public function getCoursesAttribute()
25
 	{
25
 	{
26
-
26
+		/*
27
 		$sql = Course::join('typ_semester_courses', 'typ_semester_courses.course_id', '=', 'courses.id')
27
 		$sql = Course::join('typ_semester_courses', 'typ_semester_courses.course_id', '=', 'courses.id')
28
 			->join('typ_semester_objectives', 'typ_semester_courses.typ_semester_objective_id', '=', 'typ_semester_objectives.id')
28
 			->join('typ_semester_objectives', 'typ_semester_courses.typ_semester_objective_id', '=', 'typ_semester_objectives.id')
29
 			->join("typ_semester_outcome", 'typ_semester_outcome.id', '=', 'typ_semester_objectives.typ_semester_outcome_id')
29
 			->join("typ_semester_outcome", 'typ_semester_outcome.id', '=', 'typ_semester_objectives.typ_semester_outcome_id')
32
 					->orOn('typ_semester_outcome.semester_id', '=', 'annual_cycle.semester_end');
32
 					->orOn('typ_semester_outcome.semester_id', '=', 'annual_cycle.semester_end');
33
 			})
33
 			})
34
 			->join('annual_plans', 'annual_plans.annual_cycle_id', '=', 'annual_cycle.id')
34
 			->join('annual_plans', 'annual_plans.annual_cycle_id', '=', 'annual_cycle.id')
35
-			->join('typ_program', 'typ_program.program_id','=','annual_plans.program_id')
36
-			->where('typ_program.id','=','typ_semester_outcome.typ_program_id')
35
+			->join('typ_program', 'typ_program.program_id', '=', 'annual_plans.program_id')
36
+			->where('typ_program.id', '=', 'typ_semester_outcome.typ_program_id')
37
 			->where('annual_plans.program_id', $this->program_id)
37
 			->where('annual_plans.program_id', $this->program_id)
38
 			->where('annual_plans.id', $this->id)
38
 			->where('annual_plans.id', $this->id)
39
 			->select('courses.*', 'typ_semester_courses.id as typ_semester_course_id', 'annual_plans.program_id', 'typ_semester_outcome.semester_id as semester_id')
39
 			->select('courses.*', 'typ_semester_courses.id as typ_semester_course_id', 'annual_plans.program_id', 'typ_semester_outcome.semester_id as semester_id')
40
 			->toSql();
40
 			->toSql();
41
 		Log::info($sql);
41
 		Log::info($sql);
42
 		Log::info("Aqui sql");
42
 		Log::info("Aqui sql");
43
+
44
+		*/
43
 		return Course::join('typ_semester_courses', 'typ_semester_courses.course_id', '=', 'courses.id')
45
 		return Course::join('typ_semester_courses', 'typ_semester_courses.course_id', '=', 'courses.id')
44
 			->join('typ_semester_objectives', 'typ_semester_courses.typ_semester_objective_id', '=', 'typ_semester_objectives.id')
46
 			->join('typ_semester_objectives', 'typ_semester_courses.typ_semester_objective_id', '=', 'typ_semester_objectives.id')
45
 			->join("typ_semester_outcome", 'typ_semester_outcome.id', '=', 'typ_semester_objectives.typ_semester_outcome_id')
47
 			->join("typ_semester_outcome", 'typ_semester_outcome.id', '=', 'typ_semester_objectives.typ_semester_outcome_id')
48
 					->orOn('typ_semester_outcome.semester_id', '=', 'annual_cycle.semester_end');
50
 					->orOn('typ_semester_outcome.semester_id', '=', 'annual_cycle.semester_end');
49
 			})
51
 			})
50
 			->join('annual_plans', 'annual_plans.annual_cycle_id', '=', 'annual_cycle.id')
52
 			->join('annual_plans', 'annual_plans.annual_cycle_id', '=', 'annual_cycle.id')
51
-			->join('typ_program', 'typ_program.program_id','=','annual_plans.program_id')
52
-			->where('typ_program.id','=','typ_semester_outcome.typ_program_id')
53
+			->join('typ_program', function ($join) {
54
+
55
+				$join->on('typ_program.program_id', '=', 'annual_plans.program_id')
56
+					->on('typ_program.id', '=', 'typ_semester_outcome.typ_program_id');
57
+			})
58
+
53
 			->where('annual_plans.program_id', $this->program_id)
59
 			->where('annual_plans.program_id', $this->program_id)
54
 			->where('annual_plans.id', $this->id)
60
 			->where('annual_plans.id', $this->id)
55
 			->select('courses.*', 'typ_semester_courses.id as typ_semester_course_id', 'annual_plans.program_id', 'typ_semester_outcome.semester_id as semester_id')
61
 			->select('courses.*', 'typ_semester_courses.id as typ_semester_course_id', 'annual_plans.program_id', 'typ_semester_outcome.semester_id as semester_id')
105
 			->join('typ_semester_objectives', 'typ_semester_objectives.typ_semester_outcome_id', '=', 'typ_semester_outcome.id')
111
 			->join('typ_semester_objectives', 'typ_semester_objectives.typ_semester_outcome_id', '=', 'typ_semester_outcome.id')
106
 			->join('typ_semester_courses', 'typ_semester_courses.typ_semester_objective_id', '=', 'typ_semester_objectives.id')
112
 			->join('typ_semester_courses', 'typ_semester_courses.typ_semester_objective_id', '=', 'typ_semester_objectives.id')
107
 			->where('annual_plans.id', $this->id)
113
 			->where('annual_plans.id', $this->id)
108
-			->groupBy('outcomes.id')
114
+			->groupBy('outcomes.id', 'semester_id')
109
 			->orderBy('typ_semester_outcome.semester_id')
115
 			->orderBy('typ_semester_outcome.semester_id')
110
 			->select(
116
 			->select(
111
 				'outcomes.*',
117
 				'outcomes.*',

+ 3
- 3
app/models/Outcome.php View File

19
 				->where('program_id', $this->program_id)
19
 				->where('program_id', $this->program_id)
20
 				->where('semester_id', $this->semester_id)
20
 				->where('semester_id', $this->semester_id)
21
 				->first();
21
 				->first();
22
-			Log::info("PApi que hayy chabau");
23
-			Log::info(array($expected_target));
22
+			//Log::info("PApi que hayy chabau");
23
+			//Log::info(array($expected_target));
24
 			if ($expected_target != null) {
24
 			if ($expected_target != null) {
25
-				Log::info("PApi no chabau");
25
+				//Log::info("PApi no chabau");
26
 				return $expected_target->expected_target;
26
 				return $expected_target->expected_target;
27
 			} else return "Go to Annual Plan and define a target for learning outcome";
27
 			} else return "Go to Annual Plan and define a target for learning outcome";
28
 		}
28
 		}

+ 9
- 8
app/routes.php View File

183
 
183
 
184
 
184
 
185
     Route::post('postAnnualReport/{annual_id?}', 'AnnualPlansController@postAnnualReport');
185
     Route::post('postAnnualReport/{annual_id?}', 'AnnualPlansController@postAnnualReport');
186
-    Route::get('printAnnualPlan/{annual_plan?}', 'AnnualPlansController@printAnnualPlan');
186
+    Route::get('printAnnualPlan/{annual_plan?}/{submit?}', 'AnnualPlansController@printAnnualPlan');
187
     Route::post('checkIfPlanReady', 'AnnualPlansController@checkIfPlanReady');
187
     Route::post('checkIfPlanReady', 'AnnualPlansController@checkIfPlanReady');
188
 
188
 
189
     Route::post('submitAnnualPlan/{annual_id?}', 'AnnualPlansController@submitAnnualPlan');
189
     Route::post('submitAnnualPlan/{annual_id?}', 'AnnualPlansController@submitAnnualPlan');
191
 
191
 
192
     Route::post("checkIfReady", 'AnnualPlansController@checkIfReady');
192
     Route::post("checkIfReady", 'AnnualPlansController@checkIfReady');
193
 
193
 
194
-    Route::get("printAnnualReport/{annual_plan?}", 'AnnualPlansController@printAnnualReport');
194
+    Route::get("printAnnualReport/{annual_plan?}/{submit?}", 'AnnualPlansController@printAnnualReport');
195
     Route::post('fetchObjectiveInfo', array(
195
     Route::post('fetchObjectiveInfo', array(
196
         'as' => 'fetchObjectiveInfo',
196
         'as' => 'fetchObjectiveInfo',
197
         'uses' => 'AnnualPlansController@fetchObjectiveInfo'
197
         'uses' => 'AnnualPlansController@fetchObjectiveInfo'
232
     //View Three year plan
232
     //View Three year plan
233
 
233
 
234
     Route::get('three-year-plan/show/{program_id}', "ThreeYearPlanController@showPDFs");
234
     Route::get('three-year-plan/show/{program_id}', "ThreeYearPlanController@showPDFs");
235
-    Route::get("downloadThreeYearPlanPDF/{download}/{path_id}", "ThreeYearPlanController@downloadPDF");
235
+    Route::get("downloadThreeYearPlanPDF/{path_id}", "ThreeYearPlanController@showHTML");
236
+    Route::get("findHTMLlinksTYP/{path_id}", 'ThreeYearPlanController@findHTML');
236
 
237
 
237
     //View annual plans and report
238
     //View annual plans and report
238
 
239
 
239
     Route::get('{annual_report_or_plan}/show/{program_id}', "AnnualPlansController@annualPlansShow");
240
     Route::get('{annual_report_or_plan}/show/{program_id}', "AnnualPlansController@annualPlansShow");
240
-    Route::get("downloadAnnualPDF/{download}/{path_id}", "AnnualPlansController@downloadPDF");
241
+    Route::get("findHTMLlinksAP/{type_of_annual}/{path_id}", "AnnualPlansController@findHTML");
241
 
242
 
242
     //Route::post('submitAnnualPlan', array('uses' => 'AnnualPlansController@submitAnnualPlan'));
243
     //Route::post('submitAnnualPlan', array('uses' => 'AnnualPlansController@submitAnnualPlan'));
243
 
244
 
260
         'as' => 'createThreeYearCycle',
261
         'as' => 'createThreeYearCycle',
261
         'uses' => 'ThreeYearPlanController@create'
262
         'uses' => 'ThreeYearPlanController@create'
262
     ));
263
     ));
263
-    Route::get('printThreeYear/{program_id}/{typ}', array(
264
-        'as' => 'printThreeYear/{program_id}/{typ}',
264
+    Route::get('printThreeYear/{program_id}/{typ}/{submit?}', array(
265
+        'as' => 'printThreeYear/{program_id}/{typ}/{submit?}',
265
         'uses' => 'ThreeYearPlanController@printPlan'
266
         'uses' => 'ThreeYearPlanController@printPlan'
266
     ));
267
     ));
267
     Route::get('viewThreeYear/{program_id}/{typ}', array(
268
     Route::get('viewThreeYear/{program_id}/{typ}', array(
355
         array('only' => array('create'))
356
         array('only' => array('create'))
356
     );
357
     );
357
 
358
 
358
- 	Route::get('agreement', 'AgreementController@index');
359
+    Route::get('agreement', 'AgreementController@index');
359
     Route::post('agreement/agree', array('before' => 'csrf', 'uses' => 'AgreementController@agree'));
360
     Route::post('agreement/agree', array('before' => 'csrf', 'uses' => 'AgreementController@agree'));
360
 
361
 
361
-   // Show users all learning outcomes and criteria
362
+    // Show users all learning outcomes and criteria
362
     Route::get('learning-outcomes-criteria', 'CriteriaController@index');
363
     Route::get('learning-outcomes-criteria', 'CriteriaController@index');
363
     Route::post('fetchOutcome', array('before' => 'csrf', 'uses' => 'OutcomesController@fetchOutcome'));
364
     Route::post('fetchOutcome', array('before' => 'csrf', 'uses' => 'OutcomesController@fetchOutcome'));
364
     // Show users all objectives and criteria
365
     // Show users all objectives and criteria

+ 506
- 0
app/storage/three_year_plan_pdfs/03-10-2022-for-999-by-5478.html View File

1
+<html><head></head><body id="theDocument"><style type="text/css">
2
+    body
3
+    {
4
+        font-family: "Arial", sans-serif;
5
+        width:90%;
6
+        margin: 0 auto;
7
+    }
8
+    .header-text
9
+    {
10
+        text-align:center;
11
+        font-weight: bold;
12
+        margin:0;
13
+    }
14
+
15
+    h1.header-text
16
+    {
17
+      margin: 15px auto;
18
+      width:75%;
19
+      font-size: 25px;
20
+    }
21
+
22
+    table
23
+    {
24
+        border-collapse: collapse;
25
+        border: 1px solid black;
26
+        width: 100%;
27
+        margin: 30px auto;
28
+        font-size:1.5vw;
29
+    }
30
+    td, th
31
+    {
32
+        border: 1px solid black;
33
+        padding: 5px;
34
+    }
35
+
36
+    .activity-name-row
37
+    {
38
+      background:black;
39
+      color:white;
40
+    }
41
+
42
+    .activity-headers-row
43
+    {
44
+      background:lightgrey;
45
+      font-weight:bold;
46
+    }
47
+
48
+    .report-info
49
+    {
50
+      margin:5px 0;
51
+      font-size: 16px;
52
+    }
53
+
54
+    .criterion-field
55
+    {
56
+      text-align:left;
57
+    }
58
+
59
+    .score-field, .total, .percentage
60
+    {
61
+      text-align:center;
62
+    }
63
+
64
+    .header
65
+    {
66
+      margin: 30px 0;
67
+    }
68
+
69
+    .content
70
+    {
71
+      font-size: 12px;
72
+    }
73
+
74
+    .logo
75
+    {
76
+      position:absolute;
77
+      right:0;
78
+      top: 30px;
79
+      width: 100px;
80
+    }
81
+
82
+    ol{
83
+      list-style-type:none;
84
+    }
85
+
86
+    @media print{@page {size: landscape}}
87
+</style><style type="text/css" media="print">
88
+	  @page { size: landscape; }
89
+	</style><img class="logo" src="http://localhost:8000/images/logo_uprrp_bw.png" alt="UPRRP Logo">
90
+
91
+<div class="header">
92
+    <p class="header-text">University of Puerto Rico, Río Piedras Campus</p>
93
+    <p class="header-text">Online Learning Assessment System</p>
94
+
95
+    <h1 class="header-text">Three Year Plan for Unassigned from 2019 to
96
+        2022</h1>
97
+</div>
98
+
99
+
100
+
101
+    <br>
102
+    <br>
103
+    <h2 class='header-text'>First Semester 2019-2020</h2>
104
+    <br>
105
+                  <span>
106
+            <h3>Content Knowledge, Skills or Dispositions in the academic program learning outcomes</h3>
107
+        </span>
108
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
109
+            <thead>
110
+                <tr>
111
+
112
+                    <th>Objectives</th>
113
+                    <th>Courses</th>
114
+
115
+                </tr>
116
+            </thead>
117
+            <tbody>
118
+
119
+                                    <tr>
120
+
121
+                        <td>
122
+                            1. Redactar enunciados aplicando teorías del aprendizaje
123
+                        </td>
124
+                        <td>
125
+                            <ol>
126
+                                                                    <li>[ADMI6590] FUNDAMENTOS EMPRENDERISMO </li>
127
+                                                            </ol>
128
+                        </td>
129
+
130
+                    </tr>
131
+                
132
+            </tbody>
133
+        </table>
134
+        <br>
135
+        <br>
136
+                                  <br>
137
+    <br>
138
+    <h2 class='header-text'>Second Semester 2019-2020</h2>
139
+    <br>
140
+                  <span>
141
+            <h3>Content Knowledge, Skills or Dispositions in the academic program learning outcomes</h3>
142
+        </span>
143
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
144
+            <thead>
145
+                <tr>
146
+
147
+                    <th>Objectives</th>
148
+                    <th>Courses</th>
149
+
150
+                </tr>
151
+            </thead>
152
+            <tbody>
153
+
154
+                                    <tr>
155
+
156
+                        <td>
157
+                            1. Redactar enunciados aplicando teorías del aprendizaje
158
+                        </td>
159
+                        <td>
160
+                            <ol>
161
+                                                                    <li>[ADPU6195] FUENTES EXTERNAS DE FINANC</li>
162
+                                                            </ol>
163
+                        </td>
164
+
165
+                    </tr>
166
+                
167
+            </tbody>
168
+        </table>
169
+        <br>
170
+        <br>
171
+                              <span>
172
+            <h3>Information Literacy</h3>
173
+        </span>
174
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
175
+            <thead>
176
+                <tr>
177
+
178
+                    <th>Objectives</th>
179
+                    <th>Courses</th>
180
+
181
+                </tr>
182
+            </thead>
183
+            <tbody>
184
+
185
+                                    <tr>
186
+
187
+                        <td>
188
+                            1. Vamos a ver que pasaahora
189
+                        </td>
190
+                        <td>
191
+                            <ol>
192
+                                                                    <li>[INCO4102] COM DE CRISIS </li>
193
+                                                            </ol>
194
+                        </td>
195
+
196
+                    </tr>
197
+                
198
+            </tbody>
199
+        </table>
200
+        <br>
201
+        <br>
202
+                                  <br>
203
+    <br>
204
+    <h2 class='header-text'>First Semester 2020-2021</h2>
205
+    <br>
206
+                  <span>
207
+            <h3>Critical Thinking</h3>
208
+        </span>
209
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
210
+            <thead>
211
+                <tr>
212
+
213
+                    <th>Objectives</th>
214
+                    <th>Courses</th>
215
+
216
+                </tr>
217
+            </thead>
218
+            <tbody>
219
+
220
+                                    <tr>
221
+
222
+                        <td>
223
+                            1. Esto es un objetivo 1 para prueba 1
224
+                        </td>
225
+                        <td>
226
+                            <ol>
227
+                                                                    <li>[ANAT8528] NEUROFISIOLOGIA</li>
228
+                                                                    <li>[EDUC6140] EXPER PUERTO BILIN,BICUL </li>
229
+                                                            </ol>
230
+                        </td>
231
+
232
+                    </tr>
233
+                
234
+            </tbody>
235
+        </table>
236
+        <br>
237
+        <br>
238
+                              <span>
239
+            <h3>Effective Communication Skills</h3>
240
+        </span>
241
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
242
+            <thead>
243
+                <tr>
244
+
245
+                    <th>Objectives</th>
246
+                    <th>Courses</th>
247
+
248
+                </tr>
249
+            </thead>
250
+            <tbody>
251
+
252
+                                    <tr>
253
+
254
+                        <td>
255
+                            1. La habilidad de comunicar lo que desarrolló e investigó.
256
+                        </td>
257
+                        <td>
258
+                            <ol>
259
+                                                                    <li>[COMU3046] LAB PRINC DE TELEVISION   </li>
260
+                                                                    <li>[INSI3001] COMUNIC BASICA EN INGL I  </li>
261
+                                                            </ol>
262
+                        </td>
263
+
264
+                    </tr>
265
+                
266
+            </tbody>
267
+        </table>
268
+        <br>
269
+        <br>
270
+                                  <br>
271
+    <br>
272
+    <h2 class='header-text'>Second Semester 2020-2021</h2>
273
+    <br>
274
+                  <span>
275
+            <h3>Information Literacy</h3>
276
+        </span>
277
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
278
+            <thead>
279
+                <tr>
280
+
281
+                    <th>Objectives</th>
282
+                    <th>Courses</th>
283
+
284
+                </tr>
285
+            </thead>
286
+            <tbody>
287
+
288
+                                    <tr>
289
+
290
+                        <td>
291
+                            1. Vamos a ver que pasaahora
292
+                        </td>
293
+                        <td>
294
+                            <ol>
295
+                                                                    <li>[ESSI3121] LENG ESPA SEG IDIO:BASI I </li>
296
+                                                            </ol>
297
+                        </td>
298
+
299
+                    </tr>
300
+                
301
+            </tbody>
302
+        </table>
303
+        <br>
304
+        <br>
305
+                              <span>
306
+            <h3>Effective Communication Skills</h3>
307
+        </span>
308
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
309
+            <thead>
310
+                <tr>
311
+
312
+                    <th>Objectives</th>
313
+                    <th>Courses</th>
314
+
315
+                </tr>
316
+            </thead>
317
+            <tbody>
318
+
319
+                                    <tr>
320
+
321
+                        <td>
322
+                            1. Vamos a ver que pasaahora
323
+                        </td>
324
+                        <td>
325
+                            <ol>
326
+                                                                    <li>[COMU3046] LAB PRINC DE TELEVISION   </li>
327
+                                                            </ol>
328
+                        </td>
329
+
330
+                    </tr>
331
+                
332
+            </tbody>
333
+        </table>
334
+        <br>
335
+        <br>
336
+                    <br>
337
+    <br>
338
+    <h2 class='header-text'>First Semester 2021-2022</h2>
339
+    <br>
340
+                  <span>
341
+            <h3>Logical-mathematical reasoning </h3>
342
+        </span>
343
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
344
+            <thead>
345
+                <tr>
346
+
347
+                    <th>Objectives</th>
348
+                    <th>Courses</th>
349
+
350
+                </tr>
351
+            </thead>
352
+            <tbody>
353
+
354
+                                    <tr>
355
+
356
+                        <td>
357
+                            1. La habilidad de comunicar lo que desarrolló e investigó.
358
+                        </td>
359
+                        <td>
360
+                            <ol>
361
+                                                                    <li>[CIFI4074] CIENC MAT EN ARTE </li>
362
+                                                                    <li>[CIFI3074] LABORATORIO </li>
363
+                                                            </ol>
364
+                        </td>
365
+
366
+                    </tr>
367
+                
368
+            </tbody>
369
+        </table>
370
+        <br>
371
+        <br>
372
+                              <span>
373
+            <h3>Research and Creation</h3>
374
+        </span>
375
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
376
+            <thead>
377
+                <tr>
378
+
379
+                    <th>Objectives</th>
380
+                    <th>Courses</th>
381
+
382
+                </tr>
383
+            </thead>
384
+            <tbody>
385
+
386
+                                    <tr>
387
+
388
+                        <td>
389
+                            1. Vamos a ver que pasaahora
390
+                        </td>
391
+                        <td>
392
+                            <ol>
393
+                                                                    <li>[CIFI3074] MAT EN ARTE Y CONSERVACION</li>
394
+                                                                    <li>[EDUC6140] EXPER PUERTO BILIN,BICUL </li>
395
+                                                            </ol>
396
+                        </td>
397
+
398
+                    </tr>
399
+                
400
+            </tbody>
401
+        </table>
402
+        <br>
403
+        <br>
404
+                              <span>
405
+            <h3>Critical Thinking</h3>
406
+        </span>
407
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
408
+            <thead>
409
+                <tr>
410
+
411
+                    <th>Objectives</th>
412
+                    <th>Courses</th>
413
+
414
+                </tr>
415
+            </thead>
416
+            <tbody>
417
+
418
+                                    <tr>
419
+
420
+                        <td>
421
+                            1. Esto es un objetivo 1 para prueba 1
422
+                        </td>
423
+                        <td>
424
+                            <ol>
425
+                                                                    <li>[COMU3043] PRINCIPIOS DE TELEVISION  </li>
426
+                                                                    <li>[INSI3001] COMUNIC BASICA EN INGL I  </li>
427
+                                                            </ol>
428
+                        </td>
429
+
430
+                    </tr>
431
+                
432
+            </tbody>
433
+        </table>
434
+        <br>
435
+        <br>
436
+                    <br>
437
+    <br>
438
+    <h2 class='header-text'>Second Semester 2021-2022</h2>
439
+    <br>
440
+                  <span>
441
+            <h3>Research and Creation</h3>
442
+        </span>
443
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
444
+            <thead>
445
+                <tr>
446
+
447
+                    <th>Objectives</th>
448
+                    <th>Courses</th>
449
+
450
+                </tr>
451
+            </thead>
452
+            <tbody>
453
+
454
+                                    <tr>
455
+
456
+                        <td>
457
+                            1. Vamos a ver que pasaahora
458
+                        </td>
459
+                        <td>
460
+                            <ol>
461
+                                                                    <li>[EDUC6140] EXPER PUERTO BILIN,BICUL </li>
462
+                                                            </ol>
463
+                        </td>
464
+
465
+                    </tr>
466
+                
467
+            </tbody>
468
+        </table>
469
+        <br>
470
+        <br>
471
+                                            <span>
472
+            <h3>Logical-mathematical reasoning </h3>
473
+        </span>
474
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
475
+            <thead>
476
+                <tr>
477
+
478
+                    <th>Objectives</th>
479
+                    <th>Courses</th>
480
+
481
+                </tr>
482
+            </thead>
483
+            <tbody>
484
+
485
+                                    <tr>
486
+
487
+                        <td>
488
+                            1. La habilidad de comunicar lo que desarrolló e investigó.
489
+                        </td>
490
+                        <td>
491
+                            <ol>
492
+                                                                    <li>[INSI3001] COMUNIC BASICA EN INGL I  </li>
493
+                                                            </ol>
494
+                        </td>
495
+
496
+                    </tr>
497
+                
498
+            </tbody>
499
+        </table>
500
+        <br>
501
+        <br>
502
+                
503
+
504
+</body></html>
505
+
506
+

BIN
app/storage/three_year_plan_pdfs/03-10-2022-for-999-by-5478.pdf View File


BIN
app/storage/three_year_plan_pdfs/20-09-2022-for-999-by-5478.pdf View File


+ 442
- 0
app/views/annual_htmls/plan-on-04-10-2022-for-999-by-5478.blade.php View File

1
+<html><body><style type="text/css">
2
+    body
3
+    {
4
+        font-family: "Arial", sans-serif;
5
+        width:90%;
6
+        margin: 0 auto;
7
+    }
8
+    .header-text
9
+    {
10
+        text-align:center;
11
+        font-weight: bold;
12
+        margin:0;
13
+    }
14
+    .outcome-text
15
+    {
16
+        text-align:left;
17
+        font-weight: bold;
18
+        margin:0;
19
+    }
20
+    h1.header-text
21
+    {
22
+      margin: 15px auto;
23
+      width:75%;
24
+      font-size: 25px;
25
+    }
26
+
27
+    table
28
+    {
29
+        border-collapse: collapse;
30
+        border: 1px solid black;
31
+        width: 100%;
32
+        margin: 30px auto;
33
+        font-size:1.5vw;
34
+    }
35
+    td, th
36
+    {
37
+        border: 1px solid black;
38
+        padding: 5px;
39
+    }
40
+
41
+    .activity-name-row
42
+    {
43
+      background:black;
44
+      color:white;
45
+    }
46
+
47
+    .activity-headers-row
48
+    {
49
+      background:lightgrey;
50
+      font-weight:bold;
51
+    }
52
+
53
+    .report-info
54
+    {
55
+      margin:5px 0;
56
+      font-size: 16px;
57
+    }
58
+
59
+    .criterion-field
60
+    {
61
+      text-align:left;
62
+    }
63
+
64
+    .score-field, .total, .percentage
65
+    {
66
+      text-align:center;
67
+    }
68
+
69
+    .header
70
+    {
71
+      margin: 30px 0;
72
+    }
73
+
74
+    .content
75
+    {
76
+      font-size: 12px;
77
+    }
78
+
79
+    .logo
80
+    {
81
+      position:absolute;
82
+      right:0;
83
+      top: 30px;
84
+      width: 100px;
85
+    }
86
+
87
+    ul{
88
+      list-style-type:none;
89
+    }
90
+
91
+    @media print{@page {size: landscape}}
92
+
93
+    .outcome-header{
94
+        text-align:left
95
+    }
96
+    hr{
97
+        border-block-color: black
98
+    }
99
+
100
+    .course-title {
101
+      text-align:center;
102
+      font-weight:bold;
103
+    }
104
+</style><style type="text/css" media="print">
105
+  @page { size: landscape; }
106
+</style><img class="logo" src="http://localhost:8000/images/logo_uprrp_bw.png" alt="UPRRP Logo">
107
+
108
+<div class="header">
109
+    <p class="header-text">University of Puerto Rico, Río Piedras Campus</p>
110
+    <p class="header-text">Online Learning Assessment System</p>
111
+    <p class="header-text">Unassigned Program Report</p>
112
+
113
+    <h1 class="header-text">Academic Year 2019-2020 </h1>
114
+</div>
115
+
116
+    <h1 class="outcome-header">Content Knowledge, Skills or Dispositions in the academic program learning outcomes <sub>(Semester
117
+            B91)</sub></h1>
118
+    <hr>
119
+    <p class="outcome-text">Target to achieve the learning outcome: 66.66 or more of
120
+        the
121
+        attempts</p>
122
+    <p class="outcome-text">Expected percent of students achieving the target by learning outcome:
123
+        70.00%
124
+
125
+        <hr>
126
+    <table class="table table-striped table-condensed">
127
+        <thead>
128
+            <tr>
129
+                <th>
130
+                    Objectives for Courses
131
+                </th>
132
+
133
+                <th>
134
+                    Courses and Criteria
135
+                </th>
136
+                <th>
137
+                    Transformative Actions to be Implemented
138
+                </th>
139
+            </tr>
140
+        </thead>
141
+        <tbody>
142
+                            <tr>
143
+                    <td>
144
+                        
145
+                        A. Redactar enunciados aplicando teorías del aprendizaje
146
+                    </td>
147
+                    <td>
148
+                        <ol type="1">
149
+
150
+
151
+                                                            <li>
152
+                                    <p>ADMI-6590</p>
153
+
154
+                                    <ol type="a">
155
+                                                                                    <li>
156
+                                                Identificación de la información más importante
157
+                                            </li>
158
+                                                                            </ol>
159
+
160
+                                    
161
+
162
+                                </li>
163
+                                                    </ol>
164
+                    </td>
165
+                    <td>
166
+                        <ol type="1">
167
+                                                                                                                </ol>
168
+
169
+
170
+                    </td>
171
+
172
+
173
+                </tr>
174
+            
175
+        </tbody>
176
+
177
+    </table>
178
+
179
+        
180
+            <h2>Program Transformative Actions</h2>
181
+            <hr>
182
+
183
+            <table class="table table-striped table-condensed">
184
+                <thead>
185
+                    <tr>
186
+                        <th></th>
187
+                        <th>Transformative Action</th>
188
+                        <th>Category</th>
189
+
190
+
191
+                    </tr>
192
+                </thead>
193
+                <tbody>
194
+                                            <tr>
195
+                            <td>1.</td>
196
+                            <td>
197
+                                <strong>Si pa: </strong>Si le metemos entonces full
198
+
199
+
200
+                            </td>
201
+                            <td>
202
+                                Cosa guapa
203
+                            </td>
204
+
205
+
206
+
207
+
208
+                        </tr>
209
+                                            <tr>
210
+                            <td>2.</td>
211
+                            <td>
212
+                                <strong>[09g][ugv: </strong>pi;hyv[ougbo[b[biujb[kjb
213
+
214
+
215
+
216
+                            </td>
217
+                            <td>
218
+                                Cosa guapa
219
+                            </td>
220
+
221
+
222
+
223
+
224
+                        </tr>
225
+                    
226
+                </tbody>
227
+            </table>
228
+            <hr>
229
+        
230
+        <h1 class="outcome-header">Content Knowledge, Skills or Dispositions in the academic program learning outcomes <sub>(Semester
231
+            B92)</sub></h1>
232
+    <hr>
233
+    <p class="outcome-text">Target to achieve the learning outcome: 66.66 or more of
234
+        the
235
+        attempts</p>
236
+    <p class="outcome-text">Expected percent of students achieving the target by learning outcome:
237
+        70.00%
238
+
239
+        <hr>
240
+    <table class="table table-striped table-condensed">
241
+        <thead>
242
+            <tr>
243
+                <th>
244
+                    Objectives for Courses
245
+                </th>
246
+
247
+                <th>
248
+                    Courses and Criteria
249
+                </th>
250
+                <th>
251
+                    Transformative Actions to be Implemented
252
+                </th>
253
+            </tr>
254
+        </thead>
255
+        <tbody>
256
+                            <tr>
257
+                    <td>
258
+                        
259
+                        A. Redactar enunciados aplicando teorías del aprendizaje
260
+                    </td>
261
+                    <td>
262
+                        <ol type="1">
263
+
264
+
265
+                                                            <li>
266
+                                    <p>ADPU-6195</p>
267
+
268
+                                    <ol type="a">
269
+                                                                                    <li>
270
+                                                Organización de la información
271
+                                            </li>
272
+                                                                                    <li>
273
+                                                Identificación de la información más importante
274
+                                            </li>
275
+                                                                            </ol>
276
+
277
+                                    
278
+
279
+                                </li>
280
+                                                    </ol>
281
+                    </td>
282
+                    <td>
283
+                        <ol type="1">
284
+                                                                                                                </ol>
285
+
286
+
287
+                    </td>
288
+
289
+
290
+                </tr>
291
+            
292
+        </tbody>
293
+
294
+    </table>
295
+
296
+        
297
+            <h2>Program Transformative Actions</h2>
298
+            <hr>
299
+
300
+            <table class="table table-striped table-condensed">
301
+                <thead>
302
+                    <tr>
303
+                        <th></th>
304
+                        <th>Transformative Action</th>
305
+                        <th>Category</th>
306
+
307
+
308
+                    </tr>
309
+                </thead>
310
+                <tbody>
311
+                                            <tr>
312
+                            <td>1.</td>
313
+                            <td>
314
+                                <strong>gabriel: </strong>sukdfhsdf
315
+
316
+
317
+                            </td>
318
+                            <td>
319
+                                Acción transformadora para Debugging
320
+                            </td>
321
+
322
+
323
+
324
+
325
+                        </tr>
326
+                    
327
+                </tbody>
328
+            </table>
329
+            <hr>
330
+        
331
+        <h1 class="outcome-header">Information Literacy <sub>(Semester
332
+            B92)</sub></h1>
333
+    <hr>
334
+    <p class="outcome-text">Target to achieve the learning outcome: 66.66 or more of
335
+        the
336
+        attempts</p>
337
+    <p class="outcome-text">Expected percent of students achieving the target by learning outcome:
338
+        70.00%
339
+
340
+        <hr>
341
+    <table class="table table-striped table-condensed">
342
+        <thead>
343
+            <tr>
344
+                <th>
345
+                    Objectives for Courses
346
+                </th>
347
+
348
+                <th>
349
+                    Courses and Criteria
350
+                </th>
351
+                <th>
352
+                    Transformative Actions to be Implemented
353
+                </th>
354
+            </tr>
355
+        </thead>
356
+        <tbody>
357
+                            <tr>
358
+                    <td>
359
+                        
360
+                        A. Vamos a ver que pasaahora
361
+                    </td>
362
+                    <td>
363
+                        <ol type="1">
364
+
365
+
366
+                                                            <li>
367
+                                    <p>INCO-4102</p>
368
+
369
+                                    <ol type="a">
370
+                                                                                    <li>
371
+                                                Contenido (relación con el tema de investigación)
372
+                                            </li>
373
+                                                                                    <li>
374
+                                                Organización
375
+                                            </li>
376
+                                                                                    <li>
377
+                                                Organización de la información
378
+                                            </li>
379
+                                                                            </ol>
380
+
381
+                                    
382
+
383
+                                </li>
384
+                                                    </ol>
385
+                    </td>
386
+                    <td>
387
+                        <ol type="1">
388
+                                                                                                                </ol>
389
+
390
+
391
+                    </td>
392
+
393
+
394
+                </tr>
395
+            
396
+        </tbody>
397
+
398
+    </table>
399
+
400
+        
401
+            <h2>Program Transformative Actions</h2>
402
+            <hr>
403
+
404
+            <table class="table table-striped table-condensed">
405
+                <thead>
406
+                    <tr>
407
+                        <th></th>
408
+                        <th>Transformative Action</th>
409
+                        <th>Category</th>
410
+
411
+
412
+                    </tr>
413
+                </thead>
414
+                <tbody>
415
+                                            <tr>
416
+                            <td>1.</td>
417
+                            <td>
418
+                                <strong>anda pal carajo: </strong>qo9uhwouwhfoushddf
419
+
420
+
421
+
422
+                            </td>
423
+                            <td>
424
+                                Unas cabras nuevas de maya??
425
+                            </td>
426
+
427
+
428
+
429
+
430
+                        </tr>
431
+                    
432
+                </tbody>
433
+            </table>
434
+            <hr>
435
+        
436
+    
437
+
438
+</body></html>
439
+<script type="text/javascript">
440
+
441
+
442
+</script>

+ 47
- 12
app/views/global/print_three_year_plan.blade.php View File

1
+
2
+
1
 <?php
3
 <?php
2
 
4
 
5
+
6
+if(isset($submit)){
7
+  ob_start();
8
+}
3
 echo '<html>';
9
 echo '<html>';
4
-echo '<body>';
10
+echo '<head>';
11
+
12
+echo '</head>';
13
+echo '<body id="theDocument">';
5
 
14
 
6
 //Inline styles (only for printing)
15
 //Inline styles (only for printing)
7
 echo '<style type="text/css">
16
 echo '<style type="text/css">
85
       width: 100px;
94
       width: 100px;
86
     }
95
     }
87
 
96
 
88
-    ul{
97
+    ol{
89
       list-style-type:none;
98
       list-style-type:none;
90
     }
99
     }
91
 
100
 
115
     <h2 class='header-text'>{{ $semester->name }}</h2>
124
     <h2 class='header-text'>{{ $semester->name }}</h2>
116
     <br>
125
     <br>
117
     @foreach ($typ_semester_outcome[$semester->semester_id] as $outcome)
126
     @foreach ($typ_semester_outcome[$semester->semester_id] as $outcome)
127
+      @if(count($outcome->objectives))
118
         <span>
128
         <span>
119
             <h3>{{ $outcome->name }}</h3>
129
             <h3>{{ $outcome->name }}</h3>
120
         </span>
130
         </span>
141
                                     <li>[{{ $course->code }}{{ $course->number }}] {{ $course->name }}</li>
151
                                     <li>[{{ $course->code }}{{ $course->number }}] {{ $course->name }}</li>
142
                                 @endforeach
152
                                 @endforeach
143
                             </ol>
153
                             </ol>
154
+                        </td>
144
 
155
 
145
                     </tr>
156
                     </tr>
146
                 @endforeach
157
                 @endforeach
149
         </table>
160
         </table>
150
         <br>
161
         <br>
151
         <br>
162
         <br>
152
-    @endforeach
153
-@endforeach
163
+        @endif
164
+        @endforeach
165
+@endforeach 
154
 
166
 
155
-<?php
156
 
167
 
157
-echo '</body>';
158
-echo '</html>';
168
+</body></html>
159
 
169
 
160
-?>
161
 
170
 
162
-<script type="text/javascript">
171
+<script>
172
+
173
+  @if($view==0 && !isset($submit))
163
     window.print();
174
     window.print();
164
-</script>
165
-<?php
166
 
175
 
167
-?>
176
+  @elseif(isset($submit))
177
+
178
+    window.close();
179
+  @endif
180
+
181
+
182
+
183
+  </script>
184
+
185
+
186
+@if(isset($submit))
187
+<?php 
188
+
189
+  $path = app_path() . '/views/three_year_plan_htmls/' . date('d-m-Y') . '-for-' . $program->id . '-by-' . Auth::user()->id . '.blade.php';
190
+  $ob = ob_get_contents();
191
+  $ob = str_replace("window.close();", '', $ob);
192
+  file_put_contents($path, $ob);
193
+  ob_end_flush();
194
+
195
+  //return Redirect::action('AnnualPlansController@showPlan', array($program->id));
196
+
197
+  ?>
198
+
199
+  @endif
200
+
201
+
202
+

+ 6
- 3
app/views/global/view-three-year-plan.blade.php View File

404
             // --------------------------------------------------------------------------
404
             // --------------------------------------------------------------------------
405
 
405
 
406
             $('.go-to-temp').on('click', function() {
406
             $('.go-to-temp').on('click', function() {
407
+                typ_id =$('#table-cycles').data('typ-id');
407
                 $.post(
408
                 $.post(
408
                     "{{ URL::action('ThreeYearPlanController@createAnnualPlan', [$program_id]) }}", {
409
                     "{{ URL::action('ThreeYearPlanController@createAnnualPlan', [$program_id]) }}", {
409
-                        typ_id: $('#table-cycles').data('typ-id')
410
+                        typ_id: typ_id
410
                     },
411
                     },
411
                     function() {
412
                     function() {
412
-                        window.location.href =
413
-                            "{{ URL::action('AnnualPlansController@showPlan', [$program_id]) }}";
413
+                        
414
+                        window.open("{{ URL::action('ThreeYearPlanController@printPlan', [$program_id]) }}"+"/"+typ_id+"/1", '_blank');
415
+                        window.location.href = "{{ URL::action('AnnualPlansController@showPlan', [$program_id]) }}";
416
+                            
414
 
417
 
415
                     });
418
                     });
416
             });
419
             });

+ 4
- 0
app/views/local/managers/shared/annual-plans.blade.php View File

1544
                             '<strong>The Annual Plan was submitted. You can check it out in View Annual Plans or Print Plan </strong>'
1544
                             '<strong>The Annual Plan was submitted. You can check it out in View Annual Plans or Print Plan </strong>'
1545
                         )
1545
                         )
1546
                         alert.appendTo($("#alert-for-save"));
1546
                         alert.appendTo($("#alert-for-save"));
1547
+
1548
+                        //open new window to save html
1549
+
1550
+                        window.open("{{URL::action('AnnualPlansController@printAnnualPlan')}}/"+annual_id+'/1', "_blank");
1547
                     }
1551
                     }
1548
 
1552
 
1549
 
1553
 

+ 2
- 0
app/views/local/managers/shared/annual_report.blade.php View File

1807
                         alert.appendTo($("#alert-for-save"));
1807
                         alert.appendTo($("#alert-for-save"));
1808
                     }
1808
                     }
1809
 
1809
 
1810
+                    window.open("{{URL::action('AnnualPlansController@printAnnualReport')}}/"+annual_id+'/1', "_blank");
1811
+
1810
 
1812
 
1811
 
1813
 
1812
                 });
1814
                 });

+ 4
- 10
app/views/local/managers/shared/new_view_annual_plans.blade.php View File

33
                             <th>User who submitted</th>
33
                             <th>User who submitted</th>
34
                             <th>Date Submitted </th>
34
                             <th>Date Submitted </th>
35
                             <th>New Version</th>
35
                             <th>New Version</th>
36
-                            <th>Download</th>
36
+                          
37
 
37
 
38
                         </tr>
38
                         </tr>
39
                     </thead>
39
                     </thead>
42
                             <tr>
42
                             <tr>
43
                                 <td> {{ $info->academic_year }}</td>
43
                                 <td> {{ $info->academic_year }}</td>
44
                                 <td> <a
44
                                 <td> <a
45
-                                        href="{{ URL::action('AnnualPlansController@downloadPDF', ['print', $info->path_id]) }}">
46
-                                        {{ basename($info->path_to_pdf) }}
45
+                                        href="{{ URL::action('AnnualPlansController@findHTML', [ $annual_report_or_plan,$info->path_id]) }}">
46
+                                        {{ str_replace('.blade.php','',basename($info->path_to_pdf))}}
47
                                         <span class="glyphicon glyphicon-eye-open"></span>
47
                                         <span class="glyphicon glyphicon-eye-open"></span>
48
 
48
 
49
                                 </td>
49
                                 </td>
56
                                         <span class="glyphicon glyphicon-ok"></span>
56
                                         <span class="glyphicon glyphicon-ok"></span>
57
                                     @endif
57
                                     @endif
58
                                 </td>
58
                                 </td>
59
-                                <td>
60
-                                    <a type="button" class="btn btn-primary"
61
-                                        href="{{ URL::action('AnnualPlansController@downloadPDF', ['download', $info->path_id]) }}">
62
-                                        Download
63
-                                        <span class="glyphicon glyphicon-download-alt"></span>
64
-                                    </a>
65
-                                </td>
59
+
66
 
60
 
67
                             </tr>
61
                             </tr>
68
                         @endforeach
62
                         @endforeach

+ 4
- 10
app/views/local/managers/shared/new_view_three_year_plans.blade.php View File

33
                             <th>User who submitted</th>
33
                             <th>User who submitted</th>
34
                             <th>Date Submitted </th>
34
                             <th>Date Submitted </th>
35
                             <th>New Version</th>
35
                             <th>New Version</th>
36
-                            <th>Download</th>
36
+                           
37
 
37
 
38
                         </tr>
38
                         </tr>
39
                     </thead>
39
                     </thead>
42
                             <tr>
42
                             <tr>
43
                                 <td> {{ $info->year_start }} - {{ $info->year_end }}</td>
43
                                 <td> {{ $info->year_start }} - {{ $info->year_end }}</td>
44
                                 <td> <a
44
                                 <td> <a
45
-                                        href="{{ URL::action('ThreeYearPlanController@downloadPDF', ['print', $info->path_id]) }}">
46
-                                        {{ basename($info->path_to_pdf) }}
45
+                                        href="{{ URL::action('ThreeYearPlanController@findHTML', [$info->path_id]) }}">
46
+                                        {{ str_replace(".blade.php","",basename($info->path_to_pdf)) }}
47
                                         <span class="glyphicon glyphicon-eye-open"></span>
47
                                         <span class="glyphicon glyphicon-eye-open"></span>
48
 
48
 
49
                                 </td>
49
                                 </td>
56
                                         <span class="glyphicon glyphicon-ok"></span>
56
                                         <span class="glyphicon glyphicon-ok"></span>
57
                                     @endif
57
                                     @endif
58
                                 </td>
58
                                 </td>
59
-                                <td>
60
-                                    <a type="button" class="btn btn-primary"
61
-                                        href="{{ URL::action('ThreeYearPlanController@downloadPDF', ['download', $info->path_id]) }}">
62
-                                        Download
63
-                                        <span class="glyphicon glyphicon-download-alt"></span>
64
-                                    </a>
65
-                                </td>
59
+
66
 
60
 
67
                             </tr>
61
                             </tr>
68
                         @endforeach
62
                         @endforeach

+ 21
- 3
app/views/local/managers/shared/print_annual_plan.blade.php View File

154
             @foreach ($outcome->annual_objectives as $index => $objective)
154
             @foreach ($outcome->annual_objectives as $index => $objective)
155
                 <tr>
155
                 <tr>
156
                     <td>
156
                     <td>
157
+                        
157
                         {{ $alphabet[$index] }}. {{ $objective->text }}
158
                         {{ $alphabet[$index] }}. {{ $objective->text }}
158
                     </td>
159
                     </td>
159
-
160
                     <td>
160
                     <td>
161
                         <ol type="1">
161
                         <ol type="1">
162
 
162
 
219
     </table>
219
     </table>
220
 
220
 
221
     @if (count($outcome->program_transformative_actions) > 0)
221
     @if (count($outcome->program_transformative_actions) > 0)
222
-        <li>
222
+    
223
             <h2>Program Transformative Actions</h2>
223
             <h2>Program Transformative Actions</h2>
224
             <hr>
224
             <hr>
225
 
225
 
255
                 </tbody>
255
                 </tbody>
256
             </table>
256
             </table>
257
             <hr>
257
             <hr>
258
-        </li>
258
+        
259
     @endif
259
     @endif
260
 @endforeach
260
 @endforeach
261
 
261
 
290
 ?>
290
 ?>
291
 
291
 
292
 <script type="text/javascript">
292
 <script type="text/javascript">
293
+
294
+@if(!isset($submit))
295
+
293
     window.print();
296
     window.print();
294
 </script>
297
 </script>
298
+@else
299
+window.close();
300
+</script>
301
+<?php 
302
+
303
+  $path = app_path() . '/views/annual_htmls/plan-on-' . date('d-m-Y') . '-for-' . $annualPlan->program->id . '-by-' . Auth::user()->id . '.blade.php';
304
+  $ob = ob_get_contents();
305
+  $ob = str_replace("window.close();", '', $ob);
306
+  file_put_contents($path, $ob);
307
+  ob_end_flush();
308
+
309
+  
310
+  ?>
311
+@endif
312
+

+ 18
- 0
app/views/local/managers/shared/print_annual_report.blade.php View File

483
 ?>
483
 ?>
484
 
484
 
485
 <script type="text/javascript">
485
 <script type="text/javascript">
486
+
487
+
488
+@if(!isset($submit))
489
+
486
     window.print();
490
     window.print();
487
 </script>
491
 </script>
492
+@else
493
+window.close();
494
+</script>
495
+<?php 
496
+
497
+  $path = app_path() . '/views/annual_htmls/report-on-' . date('d-m-Y') . '-for-' . $annualPlan->program->id . '-by-' . Auth::user()->id . '.blade.php';
498
+  $ob = ob_get_contents();
499
+  $ob = str_replace("window.close();", '', $ob);
500
+  file_put_contents($path, $ob);
501
+  ob_end_flush();
502
+
503
+  
504
+  ?>
505
+@endif

+ 517
- 0
app/views/three_year_plan_htmls/04-10-2022-for-999-by-5478.blade.php View File

1
+<html><head></head><body id="theDocument"><style type="text/css">
2
+    body
3
+    {
4
+        font-family: "Arial", sans-serif;
5
+        width:90%;
6
+        margin: 0 auto;
7
+    }
8
+    .header-text
9
+    {
10
+        text-align:center;
11
+        font-weight: bold;
12
+        margin:0;
13
+    }
14
+
15
+    h1.header-text
16
+    {
17
+      margin: 15px auto;
18
+      width:75%;
19
+      font-size: 25px;
20
+    }
21
+
22
+    table
23
+    {
24
+        border-collapse: collapse;
25
+        border: 1px solid black;
26
+        width: 100%;
27
+        margin: 30px auto;
28
+        font-size:1.5vw;
29
+    }
30
+    td, th
31
+    {
32
+        border: 1px solid black;
33
+        padding: 5px;
34
+    }
35
+
36
+    .activity-name-row
37
+    {
38
+      background:black;
39
+      color:white;
40
+    }
41
+
42
+    .activity-headers-row
43
+    {
44
+      background:lightgrey;
45
+      font-weight:bold;
46
+    }
47
+
48
+    .report-info
49
+    {
50
+      margin:5px 0;
51
+      font-size: 16px;
52
+    }
53
+
54
+    .criterion-field
55
+    {
56
+      text-align:left;
57
+    }
58
+
59
+    .score-field, .total, .percentage
60
+    {
61
+      text-align:center;
62
+    }
63
+
64
+    .header
65
+    {
66
+      margin: 30px 0;
67
+    }
68
+
69
+    .content
70
+    {
71
+      font-size: 12px;
72
+    }
73
+
74
+    .logo
75
+    {
76
+      position:absolute;
77
+      right:0;
78
+      top: 30px;
79
+      width: 100px;
80
+    }
81
+
82
+    ol{
83
+      list-style-type:none;
84
+    }
85
+
86
+    @media print{@page {size: landscape}}
87
+</style><style type="text/css" media="print">
88
+	  @page { size: landscape; }
89
+	</style><img class="logo" src="http://localhost:8000/images/logo_uprrp_bw.png" alt="UPRRP Logo">
90
+
91
+<div class="header">
92
+    <p class="header-text">University of Puerto Rico, Río Piedras Campus</p>
93
+    <p class="header-text">Online Learning Assessment System</p>
94
+
95
+    <h1 class="header-text">Three Year Plan for Unassigned from 2019 to
96
+        2022</h1>
97
+</div>
98
+
99
+
100
+
101
+    <br>
102
+    <br>
103
+    <h2 class='header-text'>First Semester 2019-2020</h2>
104
+    <br>
105
+                  <span>
106
+            <h3>Content Knowledge, Skills or Dispositions in the academic program learning outcomes</h3>
107
+        </span>
108
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
109
+            <thead>
110
+                <tr>
111
+
112
+                    <th>Objectives</th>
113
+                    <th>Courses</th>
114
+
115
+                </tr>
116
+            </thead>
117
+            <tbody>
118
+
119
+                                    <tr>
120
+
121
+                        <td>
122
+                            1. Redactar enunciados aplicando teorías del aprendizaje
123
+                        </td>
124
+                        <td>
125
+                            <ol>
126
+                                                                    <li>[ADMI6590] FUNDAMENTOS EMPRENDERISMO </li>
127
+                                                            </ol>
128
+                        </td>
129
+
130
+                    </tr>
131
+                
132
+            </tbody>
133
+        </table>
134
+        <br>
135
+        <br>
136
+                                  <br>
137
+    <br>
138
+    <h2 class='header-text'>Second Semester 2019-2020</h2>
139
+    <br>
140
+                  <span>
141
+            <h3>Content Knowledge, Skills or Dispositions in the academic program learning outcomes</h3>
142
+        </span>
143
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
144
+            <thead>
145
+                <tr>
146
+
147
+                    <th>Objectives</th>
148
+                    <th>Courses</th>
149
+
150
+                </tr>
151
+            </thead>
152
+            <tbody>
153
+
154
+                                    <tr>
155
+
156
+                        <td>
157
+                            1. Redactar enunciados aplicando teorías del aprendizaje
158
+                        </td>
159
+                        <td>
160
+                            <ol>
161
+                                                                    <li>[ADPU6195] FUENTES EXTERNAS DE FINANC</li>
162
+                                                            </ol>
163
+                        </td>
164
+
165
+                    </tr>
166
+                
167
+            </tbody>
168
+        </table>
169
+        <br>
170
+        <br>
171
+                              <span>
172
+            <h3>Information Literacy</h3>
173
+        </span>
174
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
175
+            <thead>
176
+                <tr>
177
+
178
+                    <th>Objectives</th>
179
+                    <th>Courses</th>
180
+
181
+                </tr>
182
+            </thead>
183
+            <tbody>
184
+
185
+                                    <tr>
186
+
187
+                        <td>
188
+                            1. Vamos a ver que pasaahora
189
+                        </td>
190
+                        <td>
191
+                            <ol>
192
+                                                                    <li>[INCO4102] COM DE CRISIS </li>
193
+                                                            </ol>
194
+                        </td>
195
+
196
+                    </tr>
197
+                
198
+            </tbody>
199
+        </table>
200
+        <br>
201
+        <br>
202
+                                  <br>
203
+    <br>
204
+    <h2 class='header-text'>First Semester 2020-2021</h2>
205
+    <br>
206
+                  <span>
207
+            <h3>Critical Thinking</h3>
208
+        </span>
209
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
210
+            <thead>
211
+                <tr>
212
+
213
+                    <th>Objectives</th>
214
+                    <th>Courses</th>
215
+
216
+                </tr>
217
+            </thead>
218
+            <tbody>
219
+
220
+                                    <tr>
221
+
222
+                        <td>
223
+                            1. Esto es un objetivo 1 para prueba 1
224
+                        </td>
225
+                        <td>
226
+                            <ol>
227
+                                                                    <li>[ANAT8528] NEUROFISIOLOGIA</li>
228
+                                                                    <li>[EDUC6140] EXPER PUERTO BILIN,BICUL </li>
229
+                                                            </ol>
230
+                        </td>
231
+
232
+                    </tr>
233
+                
234
+            </tbody>
235
+        </table>
236
+        <br>
237
+        <br>
238
+                              <span>
239
+            <h3>Effective Communication Skills</h3>
240
+        </span>
241
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
242
+            <thead>
243
+                <tr>
244
+
245
+                    <th>Objectives</th>
246
+                    <th>Courses</th>
247
+
248
+                </tr>
249
+            </thead>
250
+            <tbody>
251
+
252
+                                    <tr>
253
+
254
+                        <td>
255
+                            1. La habilidad de comunicar lo que desarrolló e investigó.
256
+                        </td>
257
+                        <td>
258
+                            <ol>
259
+                                                                    <li>[COMU3046] LAB PRINC DE TELEVISION   </li>
260
+                                                                    <li>[INSI3001] COMUNIC BASICA EN INGL I  </li>
261
+                                                            </ol>
262
+                        </td>
263
+
264
+                    </tr>
265
+                
266
+            </tbody>
267
+        </table>
268
+        <br>
269
+        <br>
270
+                                  <br>
271
+    <br>
272
+    <h2 class='header-text'>Second Semester 2020-2021</h2>
273
+    <br>
274
+                  <span>
275
+            <h3>Information Literacy</h3>
276
+        </span>
277
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
278
+            <thead>
279
+                <tr>
280
+
281
+                    <th>Objectives</th>
282
+                    <th>Courses</th>
283
+
284
+                </tr>
285
+            </thead>
286
+            <tbody>
287
+
288
+                                    <tr>
289
+
290
+                        <td>
291
+                            1. Vamos a ver que pasaahora
292
+                        </td>
293
+                        <td>
294
+                            <ol>
295
+                                                                    <li>[ESSI3121] LENG ESPA SEG IDIO:BASI I </li>
296
+                                                            </ol>
297
+                        </td>
298
+
299
+                    </tr>
300
+                
301
+            </tbody>
302
+        </table>
303
+        <br>
304
+        <br>
305
+                              <span>
306
+            <h3>Effective Communication Skills</h3>
307
+        </span>
308
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
309
+            <thead>
310
+                <tr>
311
+
312
+                    <th>Objectives</th>
313
+                    <th>Courses</th>
314
+
315
+                </tr>
316
+            </thead>
317
+            <tbody>
318
+
319
+                                    <tr>
320
+
321
+                        <td>
322
+                            1. Vamos a ver que pasaahora
323
+                        </td>
324
+                        <td>
325
+                            <ol>
326
+                                                                    <li>[COMU3046] LAB PRINC DE TELEVISION   </li>
327
+                                                            </ol>
328
+                        </td>
329
+
330
+                    </tr>
331
+                
332
+            </tbody>
333
+        </table>
334
+        <br>
335
+        <br>
336
+                    <br>
337
+    <br>
338
+    <h2 class='header-text'>First Semester 2021-2022</h2>
339
+    <br>
340
+                  <span>
341
+            <h3>Logical-mathematical reasoning </h3>
342
+        </span>
343
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
344
+            <thead>
345
+                <tr>
346
+
347
+                    <th>Objectives</th>
348
+                    <th>Courses</th>
349
+
350
+                </tr>
351
+            </thead>
352
+            <tbody>
353
+
354
+                                    <tr>
355
+
356
+                        <td>
357
+                            1. La habilidad de comunicar lo que desarrolló e investigó.
358
+                        </td>
359
+                        <td>
360
+                            <ol>
361
+                                                                    <li>[CIFI4074] CIENC MAT EN ARTE </li>
362
+                                                                    <li>[CIFI3074] LABORATORIO </li>
363
+                                                            </ol>
364
+                        </td>
365
+
366
+                    </tr>
367
+                
368
+            </tbody>
369
+        </table>
370
+        <br>
371
+        <br>
372
+                              <span>
373
+            <h3>Research and Creation</h3>
374
+        </span>
375
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
376
+            <thead>
377
+                <tr>
378
+
379
+                    <th>Objectives</th>
380
+                    <th>Courses</th>
381
+
382
+                </tr>
383
+            </thead>
384
+            <tbody>
385
+
386
+                                    <tr>
387
+
388
+                        <td>
389
+                            1. Vamos a ver que pasaahora
390
+                        </td>
391
+                        <td>
392
+                            <ol>
393
+                                                                    <li>[CIFI3074] MAT EN ARTE Y CONSERVACION</li>
394
+                                                                    <li>[EDUC6140] EXPER PUERTO BILIN,BICUL </li>
395
+                                                            </ol>
396
+                        </td>
397
+
398
+                    </tr>
399
+                
400
+            </tbody>
401
+        </table>
402
+        <br>
403
+        <br>
404
+                              <span>
405
+            <h3>Critical Thinking</h3>
406
+        </span>
407
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
408
+            <thead>
409
+                <tr>
410
+
411
+                    <th>Objectives</th>
412
+                    <th>Courses</th>
413
+
414
+                </tr>
415
+            </thead>
416
+            <tbody>
417
+
418
+                                    <tr>
419
+
420
+                        <td>
421
+                            1. Esto es un objetivo 1 para prueba 1
422
+                        </td>
423
+                        <td>
424
+                            <ol>
425
+                                                                    <li>[COMU3043] PRINCIPIOS DE TELEVISION  </li>
426
+                                                                    <li>[INSI3001] COMUNIC BASICA EN INGL I  </li>
427
+                                                            </ol>
428
+                        </td>
429
+
430
+                    </tr>
431
+                
432
+            </tbody>
433
+        </table>
434
+        <br>
435
+        <br>
436
+                    <br>
437
+    <br>
438
+    <h2 class='header-text'>Second Semester 2021-2022</h2>
439
+    <br>
440
+                  <span>
441
+            <h3>Research and Creation</h3>
442
+        </span>
443
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
444
+            <thead>
445
+                <tr>
446
+
447
+                    <th>Objectives</th>
448
+                    <th>Courses</th>
449
+
450
+                </tr>
451
+            </thead>
452
+            <tbody>
453
+
454
+                                    <tr>
455
+
456
+                        <td>
457
+                            1. Vamos a ver que pasaahora
458
+                        </td>
459
+                        <td>
460
+                            <ol>
461
+                                                                    <li>[EDUC6140] EXPER PUERTO BILIN,BICUL </li>
462
+                                                            </ol>
463
+                        </td>
464
+
465
+                    </tr>
466
+                
467
+            </tbody>
468
+        </table>
469
+        <br>
470
+        <br>
471
+                                            <span>
472
+            <h3>Logical-mathematical reasoning </h3>
473
+        </span>
474
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
475
+            <thead>
476
+                <tr>
477
+
478
+                    <th>Objectives</th>
479
+                    <th>Courses</th>
480
+
481
+                </tr>
482
+            </thead>
483
+            <tbody>
484
+
485
+                                    <tr>
486
+
487
+                        <td>
488
+                            1. La habilidad de comunicar lo que desarrolló e investigó.
489
+                        </td>
490
+                        <td>
491
+                            <ol>
492
+                                                                    <li>[INSI3001] COMUNIC BASICA EN INGL I  </li>
493
+                                                            </ol>
494
+                        </td>
495
+
496
+                    </tr>
497
+                
498
+            </tbody>
499
+        </table>
500
+        <br>
501
+        <br>
502
+                 
503
+
504
+
505
+</body></html>
506
+
507
+
508
+<script>
509
+
510
+  
511
+    
512
+  
513
+
514
+
515
+  </script>
516
+
517
+

+ 236
- 184
vendor/dompdf/dompdf/include/cellmap.cls.php View File

1
 <?php
1
 <?php
2
+
2
 /**
3
 /**
3
  * @package dompdf
4
  * @package dompdf
4
  * @link    http://dompdf.github.com/
5
  * @link    http://dompdf.github.com/
15
  * @access private
16
  * @access private
16
  * @package dompdf
17
  * @package dompdf
17
  */
18
  */
18
-class Cellmap {
19
+class Cellmap
20
+{
19
 
21
 
20
   /**
22
   /**
21
    * Border style weight lookup for collapsed border resolution.
23
    * Border style weight lookup for collapsed border resolution.
33
     "double" => 8,
35
     "double" => 8,
34
     "hidden" => 9,
36
     "hidden" => 9,
35
     "none"   => 0,
37
     "none"   => 0,
36
-   );
38
+  );
37
 
39
 
38
   /**
40
   /**
39
    * The table object this cellmap is attached to.
41
    * The table object this cellmap is attached to.
104
    * @var int
106
    * @var int
105
    */
107
    */
106
   private $__row;
108
   private $__row;
107
-  
109
+
108
   /**
110
   /**
109
    * Tells wether the columns' width can be modified
111
    * Tells wether the columns' width can be modified
110
    *
112
    *
111
    * @var bool
113
    * @var bool
112
    */
114
    */
113
   private $_columns_locked = false;
115
   private $_columns_locked = false;
114
-  
116
+
115
   /**
117
   /**
116
    * Tells wether the table has table-layout:fixed
118
    * Tells wether the table has table-layout:fixed
117
    *
119
    *
121
 
123
 
122
   //........................................................................
124
   //........................................................................
123
 
125
 
124
-  function __construct(Table_Frame_Decorator $table) {
126
+  function __construct(Table_Frame_Decorator $table)
127
+  {
125
     $this->_table = $table;
128
     $this->_table = $table;
126
     $this->reset();
129
     $this->reset();
127
   }
130
   }
128
-  
129
-  function __destruct() {
131
+
132
+  function __destruct()
133
+  {
130
     clear_object($this);
134
     clear_object($this);
131
   }
135
   }
132
   //........................................................................
136
   //........................................................................
133
 
137
 
134
-  function reset() {
138
+  function reset()
139
+  {
135
     $this->_num_rows = 0;
140
     $this->_num_rows = 0;
136
     $this->_num_cols = 0;
141
     $this->_num_cols = 0;
137
 
142
 
138
     $this->_cells  = array();
143
     $this->_cells  = array();
139
     $this->_frames = array();
144
     $this->_frames = array();
140
 
145
 
141
-    if ( !$this->_columns_locked ) {
146
+    if (!$this->_columns_locked) {
142
       $this->_columns = array();
147
       $this->_columns = array();
143
     }
148
     }
144
-    
149
+
145
     $this->_rows = array();
150
     $this->_rows = array();
146
 
151
 
147
     $this->_borders = array();
152
     $this->_borders = array();
151
 
156
 
152
   //........................................................................
157
   //........................................................................
153
 
158
 
154
-  function lock_columns() { 
155
-    $this->_columns_locked = true; 
159
+  function lock_columns()
160
+  {
161
+    $this->_columns_locked = true;
156
   }
162
   }
157
 
163
 
158
-  function is_columns_locked() {
164
+  function is_columns_locked()
165
+  {
159
     return $this->_columns_locked;
166
     return $this->_columns_locked;
160
   }
167
   }
161
-  
162
-  function set_layout_fixed($fixed) { 
163
-    $this->_fixed_layout = $fixed; 
168
+
169
+  function set_layout_fixed($fixed)
170
+  {
171
+    $this->_fixed_layout = $fixed;
164
   }
172
   }
165
 
173
 
166
-  function is_layout_fixed() {
174
+  function is_layout_fixed()
175
+  {
167
     return $this->_fixed_layout;
176
     return $this->_fixed_layout;
168
   }
177
   }
169
-  
170
-  function get_num_rows() { return $this->_num_rows; }
171
-  function get_num_cols() { return $this->_num_cols; }
172
 
178
 
173
-  function &get_columns() {
179
+  function get_num_rows()
180
+  {
181
+    return $this->_num_rows;
182
+  }
183
+  function get_num_cols()
184
+  {
185
+    return $this->_num_cols;
186
+  }
187
+
188
+  function &get_columns()
189
+  {
174
     return $this->_columns;
190
     return $this->_columns;
175
   }
191
   }
176
 
192
 
177
-  function set_columns($columns) {
193
+  function set_columns($columns)
194
+  {
178
     $this->_columns = $columns;
195
     $this->_columns = $columns;
179
   }
196
   }
180
 
197
 
181
-  function &get_column($i) {
182
-    if ( !isset($this->_columns[$i]) ) {
198
+  function &get_column($i)
199
+  {
200
+    if (!isset($this->_columns[$i])) {
183
       $this->_columns[$i] = array(
201
       $this->_columns[$i] = array(
184
         "x" => 0,
202
         "x" => 0,
185
         "min-width" => 0,
203
         "min-width" => 0,
190
         "auto" => true,
208
         "auto" => true,
191
       );
209
       );
192
     }
210
     }
193
-    
211
+
194
     return $this->_columns[$i];
212
     return $this->_columns[$i];
195
   }
213
   }
196
 
214
 
197
-  function &get_rows() {
215
+  function &get_rows()
216
+  {
198
     return $this->_rows;
217
     return $this->_rows;
199
   }
218
   }
200
 
219
 
201
-  function &get_row($j) {
202
-    if ( !isset($this->_rows[$j]) ) {
220
+  function &get_row($j)
221
+  {
222
+    if (!isset($this->_rows[$j])) {
203
       $this->_rows[$j] = array(
223
       $this->_rows[$j] = array(
204
         "y" => 0,
224
         "y" => 0,
205
         "first-column" => 0,
225
         "first-column" => 0,
206
         "height" => null,
226
         "height" => null,
207
       );
227
       );
208
     }
228
     }
209
-    
229
+
210
     return $this->_rows[$j];
230
     return $this->_rows[$j];
211
   }
231
   }
212
 
232
 
213
-  function get_border($i, $j, $h_v, $prop = null) {
214
-    if ( !isset($this->_borders[$i][$j][$h_v]) ) {
233
+  function get_border($i, $j, $h_v, $prop = null)
234
+  {
235
+    if (!isset($this->_borders[$i][$j][$h_v])) {
215
       $this->_borders[$i][$j][$h_v] = array(
236
       $this->_borders[$i][$j][$h_v] = array(
216
         "width" => 0,
237
         "width" => 0,
217
         "style" => "solid",
238
         "style" => "solid",
218
         "color" => "black",
239
         "color" => "black",
219
       );
240
       );
220
     }
241
     }
221
-    
222
-    if ( isset($prop) ) {
242
+
243
+    if (isset($prop)) {
223
       return $this->_borders[$i][$j][$h_v][$prop];
244
       return $this->_borders[$i][$j][$h_v][$prop];
224
     }
245
     }
225
-    
246
+
226
     return $this->_borders[$i][$j][$h_v];
247
     return $this->_borders[$i][$j][$h_v];
227
   }
248
   }
228
 
249
 
229
-  function get_border_properties($i, $j) {
250
+  function get_border_properties($i, $j)
251
+  {
230
     return array(
252
     return array(
231
-      "top"    => $this->get_border($i,   $j,   "horizontal"), 
232
-      "right"  => $this->get_border($i,   $j+1, "vertical"),
233
-      "bottom" => $this->get_border($i+1, $j,   "horizontal"), 
253
+      "top"    => $this->get_border($i,   $j,   "horizontal"),
254
+      "right"  => $this->get_border($i,   $j + 1, "vertical"),
255
+      "bottom" => $this->get_border($i + 1, $j,   "horizontal"),
234
       "left"   => $this->get_border($i,   $j,   "vertical"),
256
       "left"   => $this->get_border($i,   $j,   "vertical"),
235
     );
257
     );
236
   }
258
   }
237
 
259
 
238
   //........................................................................
260
   //........................................................................
239
 
261
 
240
-  function get_spanned_cells(Frame $frame) {
262
+  function get_spanned_cells(Frame $frame)
263
+  {
241
     $key = $frame->get_id();
264
     $key = $frame->get_id();
242
 
265
 
243
-    if ( !isset($this->_frames[$key]) ) {
266
+    if (!isset($this->_frames[$key])) {
244
       throw new DOMPDF_Exception("Frame not found in cellmap");
267
       throw new DOMPDF_Exception("Frame not found in cellmap");
245
     }
268
     }
246
 
269
 
247
     return $this->_frames[$key];
270
     return $this->_frames[$key];
248
-
249
   }
271
   }
250
 
272
 
251
-  function frame_exists_in_cellmap(Frame $frame) {
273
+  function frame_exists_in_cellmap(Frame $frame)
274
+  {
252
     $key = $frame->get_id();
275
     $key = $frame->get_id();
253
     return isset($this->_frames[$key]);
276
     return isset($this->_frames[$key]);
254
   }
277
   }
255
-  
256
-  function get_frame_position(Frame $frame) {
278
+
279
+  function get_frame_position(Frame $frame)
280
+  {
257
     global $_dompdf_warnings;
281
     global $_dompdf_warnings;
258
 
282
 
259
     $key = $frame->get_id();
283
     $key = $frame->get_id();
260
 
284
 
261
-    if ( !isset($this->_frames[$key]) ) {
285
+    if (!isset($this->_frames[$key])) {
262
       throw new DOMPDF_Exception("Frame not found in cellmap");
286
       throw new DOMPDF_Exception("Frame not found in cellmap");
263
     }
287
     }
264
 
288
 
265
     $col = $this->_frames[$key]["columns"][0];
289
     $col = $this->_frames[$key]["columns"][0];
266
     $row = $this->_frames[$key]["rows"][0];
290
     $row = $this->_frames[$key]["rows"][0];
267
 
291
 
268
-    if ( !isset($this->_columns[$col])) {
292
+    if (!isset($this->_columns[$col])) {
269
       $_dompdf_warnings[] = "Frame not found in columns array.  Check your table layout for missing or extra TDs.";
293
       $_dompdf_warnings[] = "Frame not found in columns array.  Check your table layout for missing or extra TDs.";
270
       $x = 0;
294
       $x = 0;
271
-    }
272
-    else {
295
+    } else {
273
       $x = $this->_columns[$col]["x"];
296
       $x = $this->_columns[$col]["x"];
274
     }
297
     }
275
 
298
 
276
-    if ( !isset($this->_rows[$row])) {
299
+    if (!isset($this->_rows[$row])) {
277
       $_dompdf_warnings[] = "Frame not found in row array.  Check your table layout for missing or extra TDs.";
300
       $_dompdf_warnings[] = "Frame not found in row array.  Check your table layout for missing or extra TDs.";
278
       $y = 0;
301
       $y = 0;
279
-    }
280
-    else {
302
+    } else {
281
       $y = $this->_rows[$row]["y"];
303
       $y = $this->_rows[$row]["y"];
282
     }
304
     }
283
 
305
 
284
     return array($x, $y, "x" => $x, "y" => $y);
306
     return array($x, $y, "x" => $x, "y" => $y);
285
   }
307
   }
286
 
308
 
287
-  function get_frame_width(Frame $frame) {
309
+  function get_frame_width(Frame $frame)
310
+  {
288
     $key = $frame->get_id();
311
     $key = $frame->get_id();
289
 
312
 
290
-    if ( !isset($this->_frames[$key]) ) {
313
+    if (!isset($this->_frames[$key])) {
291
       throw new DOMPDF_Exception("Frame not found in cellmap");
314
       throw new DOMPDF_Exception("Frame not found in cellmap");
292
     }
315
     }
293
 
316
 
296
     foreach ($cols as $i) {
319
     foreach ($cols as $i) {
297
       $w += $this->_columns[$i]["used-width"];
320
       $w += $this->_columns[$i]["used-width"];
298
     }
321
     }
299
-    
322
+
300
     return $w;
323
     return $w;
301
   }
324
   }
302
 
325
 
303
-  function get_frame_height(Frame $frame) {
326
+  function get_frame_height(Frame $frame)
327
+  {
304
     $key = $frame->get_id();
328
     $key = $frame->get_id();
305
 
329
 
306
-    if ( !isset($this->_frames[$key]) ) {
330
+    if (!isset($this->_frames[$key])) {
307
       throw new DOMPDF_Exception("Frame not found in cellmap");
331
       throw new DOMPDF_Exception("Frame not found in cellmap");
308
     }
332
     }
309
 
333
 
310
     $rows = $this->_frames[$key]["rows"];
334
     $rows = $this->_frames[$key]["rows"];
311
     $h = 0;
335
     $h = 0;
312
     foreach ($rows as $i) {
336
     foreach ($rows as $i) {
313
-      if ( !isset($this->_rows[$i]) )  {
337
+      if (!isset($this->_rows[$i])) {
314
         throw new Exception("The row #$i could not be found, please file an issue in the tracker with the HTML code");
338
         throw new Exception("The row #$i could not be found, please file an issue in the tracker with the HTML code");
315
       }
339
       }
316
-      
340
+
317
       $h += $this->_rows[$i]["height"];
341
       $h += $this->_rows[$i]["height"];
318
     }
342
     }
319
-    
343
+
320
     return $h;
344
     return $h;
321
   }
345
   }
322
 
346
 
323
 
347
 
324
   //........................................................................
348
   //........................................................................
325
 
349
 
326
-  function set_column_width($j, $width) {
327
-    if ( $this->_columns_locked ) {
350
+  function set_column_width($j, $width)
351
+  {
352
+    if ($this->_columns_locked) {
328
       return;
353
       return;
329
     }
354
     }
330
-    
331
-    $col =& $this->get_column($j);
355
+
356
+    $col = &$this->get_column($j);
332
     $col["used-width"] = $width;
357
     $col["used-width"] = $width;
333
-    $next_col =& $this->get_column($j+1);
358
+    $next_col = &$this->get_column($j + 1);
334
     $next_col["x"] = $next_col["x"] + $width;
359
     $next_col["x"] = $next_col["x"] + $width;
335
   }
360
   }
336
 
361
 
337
-  function set_row_height($i, $height) {
338
-    $row =& $this->get_row($i);
339
-    
340
-    if ( $row["height"] !== null && $height <= $row["height"] ) {
362
+  function set_row_height($i, $height)
363
+  {
364
+    $row = &$this->get_row($i);
365
+
366
+    if ($row["height"] !== null && $height <= $row["height"]) {
341
       return;
367
       return;
342
     }
368
     }
343
 
369
 
344
     $row["height"] = $height;
370
     $row["height"] = $height;
345
-    $next_row =& $this->get_row($i+1);
371
+    $next_row = &$this->get_row($i + 1);
346
     $next_row["y"] = $row["y"] + $height;
372
     $next_row["y"] = $row["y"] + $height;
347
-
348
   }
373
   }
349
 
374
 
350
   //........................................................................
375
   //........................................................................
351
 
376
 
352
 
377
 
353
-  protected function _resolve_border($i, $j, $h_v, $border_spec) {
378
+  protected function _resolve_border($i, $j, $h_v, $border_spec)
379
+  {
354
     $n_width = $border_spec["width"];
380
     $n_width = $border_spec["width"];
355
     $n_style = $border_spec["style"];
381
     $n_style = $border_spec["style"];
356
 
382
 
357
-    if ( !isset($this->_borders[$i][$j][$h_v]) ) {
383
+    if (!isset($this->_borders[$i][$j][$h_v])) {
358
       $this->_borders[$i][$j][$h_v] = $border_spec;
384
       $this->_borders[$i][$j][$h_v] = $border_spec;
359
       return $this->_borders[$i][$j][$h_v]["width"];
385
       return $this->_borders[$i][$j][$h_v]["width"];
360
     }
386
     }
361
-    
387
+
362
     $border = &$this->_borders[$i][$j][$h_v];
388
     $border = &$this->_borders[$i][$j][$h_v];
363
-    
389
+
364
     $o_width = $border["width"];
390
     $o_width = $border["width"];
365
     $o_style = $border["style"];
391
     $o_style = $border["style"];
366
 
392
 
367
-    if ( ($n_style === "hidden" ||
368
-          $n_width  >  $o_width ||
369
-          $o_style === "none")
393
+    if (($n_style === "hidden" ||
394
+        $n_width  >  $o_width ||
395
+        $o_style === "none")
370
 
396
 
371
-         or
397
+      or
372
 
398
 
373
-         ($o_width == $n_width &&
374
-          in_array($n_style, self::$_BORDER_STYLE_SCORE) &&
375
-          self::$_BORDER_STYLE_SCORE[ $n_style ] > self::$_BORDER_STYLE_SCORE[ $o_style ]) ) {
399
+      ($o_width == $n_width &&
400
+        in_array($n_style, self::$_BORDER_STYLE_SCORE) &&
401
+        self::$_BORDER_STYLE_SCORE[$n_style] > self::$_BORDER_STYLE_SCORE[$o_style])
402
+    ) {
376
       $border = $border_spec;
403
       $border = $border_spec;
377
     }
404
     }
378
 
405
 
381
 
408
 
382
   //........................................................................
409
   //........................................................................
383
 
410
 
384
-  function add_frame(Frame $frame) {
385
-    
411
+  function add_frame(Frame $frame)
412
+  {
413
+
386
     $style = $frame->get_style();
414
     $style = $frame->get_style();
387
     $display = $style->display;
415
     $display = $style->display;
388
 
416
 
389
     $collapse = $this->_table->get_style()->border_collapse == "collapse";
417
     $collapse = $this->_table->get_style()->border_collapse == "collapse";
390
 
418
 
391
     // Recursively add the frames within tables, table-row-groups and table-rows
419
     // Recursively add the frames within tables, table-row-groups and table-rows
392
-    if ( $display === "table-row" ||
393
-         $display === "table" ||
394
-         $display === "inline-table" ||
395
-         in_array($display, Table_Frame_Decorator::$ROW_GROUPS) ) {
420
+    if (
421
+      $display === "table-row" ||
422
+      $display === "table" ||
423
+      $display === "inline-table" ||
424
+      in_array($display, Table_Frame_Decorator::$ROW_GROUPS)
425
+    ) {
396
 
426
 
397
       $start_row = $this->__row;
427
       $start_row = $this->__row;
398
-      foreach ( $frame->get_children() as $child ) {
399
-        $this->add_frame( $child );
428
+      foreach ($frame->get_children() as $child) {
429
+        $this->add_frame($child);
400
       }
430
       }
401
 
431
 
402
-      if ( $display === "table-row" ) {
432
+      if ($display === "table-row") {
403
         $this->add_row();
433
         $this->add_row();
404
       }
434
       }
405
 
435
 
407
       $key = $frame->get_id();
437
       $key = $frame->get_id();
408
 
438
 
409
       // Row groups always span across the entire table
439
       // Row groups always span across the entire table
410
-      $this->_frames[$key]["columns"] = range(0,max(0,$this->_num_cols-1));
440
+      $this->_frames[$key]["columns"] = range(0, max(0, $this->_num_cols - 1));
411
       $this->_frames[$key]["rows"] = range($start_row, max(0, $this->__row - 1));
441
       $this->_frames[$key]["rows"] = range($start_row, max(0, $this->__row - 1));
412
       $this->_frames[$key]["frame"] = $frame;
442
       $this->_frames[$key]["frame"] = $frame;
413
 
443
 
414
-      if ( $display !== "table-row" && $collapse ) {
444
+      if ($display !== "table-row" && $collapse) {
415
 
445
 
416
         $bp = $style->get_border_properties();
446
         $bp = $style->get_border_properties();
417
 
447
 
418
         // Resolve the borders
448
         // Resolve the borders
419
-        for ( $i = 0; $i < $num_rows+1; $i++) {
449
+        for ($i = 0; $i < $num_rows + 1; $i++) {
420
           $this->_resolve_border($start_row + $i, 0, "vertical", $bp["left"]);
450
           $this->_resolve_border($start_row + $i, 0, "vertical", $bp["left"]);
421
           $this->_resolve_border($start_row + $i, $this->_num_cols, "vertical", $bp["right"]);
451
           $this->_resolve_border($start_row + $i, $this->_num_cols, "vertical", $bp["right"]);
422
         }
452
         }
423
 
453
 
424
-        for ( $j = 0; $j < $this->_num_cols; $j++) {
454
+        for ($j = 0; $j < $this->_num_cols; $j++) {
425
           $this->_resolve_border($start_row, $j, "horizontal", $bp["top"]);
455
           $this->_resolve_border($start_row, $j, "horizontal", $bp["top"]);
426
           $this->_resolve_border($this->__row, $j, "horizontal", $bp["bottom"]);
456
           $this->_resolve_border($this->__row, $j, "horizontal", $bp["bottom"]);
427
         }
457
         }
430
 
460
 
431
       return;
461
       return;
432
     }
462
     }
433
-    
463
+
434
     $node = $frame->get_node();
464
     $node = $frame->get_node();
435
-    
465
+    /* Este cambio lo hice yo, Gabriel
436
     // Determine where this cell is going
466
     // Determine where this cell is going
437
     $colspan = $node->getAttribute("colspan");
467
     $colspan = $node->getAttribute("colspan");
438
     $rowspan = $node->getAttribute("rowspan");
468
     $rowspan = $node->getAttribute("rowspan");
445
     if ( !$rowspan ) {
475
     if ( !$rowspan ) {
446
       $rowspan = 1;
476
       $rowspan = 1;
447
       $node->setAttribute("rowspan",1);
477
       $node->setAttribute("rowspan",1);
478
+    }*/
479
+
480
+    if (method_exists($node, 'getAttribute')) {
481
+      $colspan = $node->getAttribute("colspan");
482
+      $rowspan = $node->getAttribute("rowspan");
483
+    } else {
484
+      $colspan = false;
485
+      $rowspan = false;
486
+    }
487
+
488
+
489
+    if (!$colspan) {
490
+      $colspan = 1;
491
+      if (method_exists($node, 'setAttribute')) {
492
+        $node->setAttribute("colspan", 1);
493
+      }
494
+    }
495
+
496
+    if (!$rowspan) {
497
+      $rowspan = 1;
498
+      if (method_exists($node, 'setAttribute')) {
499
+        $node->setAttribute("rowspan", 1);
500
+      }
448
     }
501
     }
502
+
449
     $key = $frame->get_id();
503
     $key = $frame->get_id();
450
 
504
 
451
     $bp = $style->get_border_properties();
505
     $bp = $style->get_border_properties();
456
 
510
 
457
     // Find the next available column (fix by Ciro Mondueri)
511
     // Find the next available column (fix by Ciro Mondueri)
458
     $ac = $this->__col;
512
     $ac = $this->__col;
459
-    while ( isset($this->_cells[$this->__row][$ac]) ) {
460
-       $ac++;
513
+    while (isset($this->_cells[$this->__row][$ac])) {
514
+      $ac++;
461
     }
515
     }
462
-    
516
+
463
     $this->__col = $ac;
517
     $this->__col = $ac;
464
 
518
 
465
     // Rows:
519
     // Rows:
466
-    for ( $i = 0; $i < $rowspan; $i++ ) {
520
+    for ($i = 0; $i < $rowspan; $i++) {
467
       $row = $this->__row + $i;
521
       $row = $this->__row + $i;
468
 
522
 
469
       $this->_frames[$key]["rows"][] = $row;
523
       $this->_frames[$key]["rows"][] = $row;
470
 
524
 
471
-      for ( $j = 0; $j < $colspan; $j++) {
525
+      for ($j = 0; $j < $colspan; $j++) {
472
         $this->_cells[$row][$this->__col + $j] = $frame;
526
         $this->_cells[$row][$this->__col + $j] = $frame;
473
       }
527
       }
474
 
528
 
475
-      if ( $collapse ) {
529
+      if ($collapse) {
476
         // Resolve vertical borders
530
         // Resolve vertical borders
477
         $max_left = max($max_left, $this->_resolve_border($row, $this->__col, "vertical", $bp["left"]));
531
         $max_left = max($max_left, $this->_resolve_border($row, $this->__col, "vertical", $bp["left"]));
478
         $max_right = max($max_right, $this->_resolve_border($row, $this->__col + $colspan, "vertical", $bp["right"]));
532
         $max_right = max($max_right, $this->_resolve_border($row, $this->__col + $colspan, "vertical", $bp["right"]));
482
     $max_top = $max_bottom = 0;
536
     $max_top = $max_bottom = 0;
483
 
537
 
484
     // Columns:
538
     // Columns:
485
-    for ( $j = 0; $j < $colspan; $j++ ) {
539
+    for ($j = 0; $j < $colspan; $j++) {
486
       $col = $this->__col + $j;
540
       $col = $this->__col + $j;
487
       $this->_frames[$key]["columns"][] = $col;
541
       $this->_frames[$key]["columns"][] = $col;
488
 
542
 
489
-      if ( $collapse ) {
543
+      if ($collapse) {
490
         // Resolve horizontal borders
544
         // Resolve horizontal borders
491
         $max_top = max($max_top, $this->_resolve_border($this->__row, $col, "horizontal", $bp["top"]));
545
         $max_top = max($max_top, $this->_resolve_border($this->__row, $col, "horizontal", $bp["top"]));
492
         $max_bottom = max($max_bottom, $this->_resolve_border($this->__row + $rowspan, $col, "horizontal", $bp["bottom"]));
546
         $max_bottom = max($max_bottom, $this->_resolve_border($this->__row + $rowspan, $col, "horizontal", $bp["bottom"]));
496
     $this->_frames[$key]["frame"] = $frame;
550
     $this->_frames[$key]["frame"] = $frame;
497
 
551
 
498
     // Handle seperated border model
552
     // Handle seperated border model
499
-    if ( !$collapse ) {
553
+    if (!$collapse) {
500
       list($h, $v) = $this->_table->get_style()->border_spacing;
554
       list($h, $v) = $this->_table->get_style()->border_spacing;
501
 
555
 
502
       // Border spacing is effectively a margin between cells
556
       // Border spacing is effectively a margin between cells
505
       $style->margin = "$v $h";
559
       $style->margin = "$v $h";
506
 
560
 
507
       // The additional 1/2 width gets added to the table proper
561
       // The additional 1/2 width gets added to the table proper
508
-    }
509
-    else {
562
+    } else {
510
       // Drop the frame's actual border
563
       // Drop the frame's actual border
511
       $style->border_left_width = $max_left / 2;
564
       $style->border_left_width = $max_left / 2;
512
       $style->border_right_width = $max_right / 2;
565
       $style->border_right_width = $max_right / 2;
515
       $style->margin = "none";
568
       $style->margin = "none";
516
     }
569
     }
517
 
570
 
518
-    if ( !$this->_columns_locked ) {
571
+    if (!$this->_columns_locked) {
519
       // Resolve the frame's width
572
       // Resolve the frame's width
520
-      if ( $this->_fixed_layout ) {
573
+      if ($this->_fixed_layout) {
521
         list($frame_min, $frame_max) = array(0, 10e-10);
574
         list($frame_min, $frame_max) = array(0, 10e-10);
522
-      }
523
-      else {
575
+      } else {
524
         list($frame_min, $frame_max) = $frame->get_min_max_width();
576
         list($frame_min, $frame_max) = $frame->get_min_max_width();
525
       }
577
       }
526
-  
578
+
527
       $width = $style->width;
579
       $width = $style->width;
528
 
580
 
529
       $val = null;
581
       $val = null;
530
-      if ( is_percent($width) ) {
582
+      if (is_percent($width)) {
531
         $var = "percent";
583
         $var = "percent";
532
         $val = (float)rtrim($width, "% ") / $colspan;
584
         $val = (float)rtrim($width, "% ") / $colspan;
533
-      }
534
-      else if ( $width !== "auto" ) {
585
+      } else if ($width !== "auto") {
535
         $var = "absolute";
586
         $var = "absolute";
536
         $val = $style->length_in_pt($frame_min) / $colspan;
587
         $val = $style->length_in_pt($frame_min) / $colspan;
537
       }
588
       }
538
-      
589
+
539
       $min = 0;
590
       $min = 0;
540
       $max = 0;
591
       $max = 0;
541
-      for ( $cs = 0; $cs < $colspan; $cs++ ) {
542
-  
592
+      for ($cs = 0; $cs < $colspan; $cs++) {
593
+
543
         // Resolve the frame's width(s) with other cells
594
         // Resolve the frame's width(s) with other cells
544
-        $col =& $this->get_column( $this->__col + $cs );
545
-  
595
+        $col = &$this->get_column($this->__col + $cs);
596
+
546
         // Note: $var is either 'percent' or 'absolute'.  We compare the
597
         // Note: $var is either 'percent' or 'absolute'.  We compare the
547
         // requested percentage or absolute values with the existing widths
598
         // requested percentage or absolute values with the existing widths
548
         // and adjust accordingly.
599
         // and adjust accordingly.
549
-        if ( isset($var) && $val > $col[$var] ) {
600
+        if (isset($var) && $val > $col[$var]) {
550
           $col[$var] = $val;
601
           $col[$var] = $val;
551
           $col["auto"] = false;
602
           $col["auto"] = false;
552
         }
603
         }
553
-  
604
+
554
         $min += $col["min-width"];
605
         $min += $col["min-width"];
555
         $max += $col["max-width"];
606
         $max += $col["max-width"];
556
       }
607
       }
557
-  
558
-      if ( $frame_min > $min ) {
608
+
609
+      if ($frame_min > $min) {
559
         // The frame needs more space.  Expand each sub-column
610
         // The frame needs more space.  Expand each sub-column
560
         // FIXME try to avoid putting this dummy value when table-layout:fixed
611
         // FIXME try to avoid putting this dummy value when table-layout:fixed
561
         $inc = ($this->is_layout_fixed() ? 10e-10 : ($frame_min - $min) / $colspan);
612
         $inc = ($this->is_layout_fixed() ? 10e-10 : ($frame_min - $min) / $colspan);
562
         for ($c = 0; $c < $colspan; $c++) {
613
         for ($c = 0; $c < $colspan; $c++) {
563
-          $col =& $this->get_column($this->__col + $c);
614
+          $col = &$this->get_column($this->__col + $c);
564
           $col["min-width"] += $inc;
615
           $col["min-width"] += $inc;
565
         }
616
         }
566
       }
617
       }
567
-  
568
-      if ( $frame_max > $max ) {
618
+
619
+      if ($frame_max > $max) {
569
         // FIXME try to avoid putting this dummy value when table-layout:fixed
620
         // FIXME try to avoid putting this dummy value when table-layout:fixed
570
         $inc = ($this->is_layout_fixed() ? 10e-10 : ($frame_max - $max) / $colspan);
621
         $inc = ($this->is_layout_fixed() ? 10e-10 : ($frame_max - $max) / $colspan);
571
         for ($c = 0; $c < $colspan; $c++) {
622
         for ($c = 0; $c < $colspan; $c++) {
572
-          $col =& $this->get_column($this->__col + $c);
623
+          $col = &$this->get_column($this->__col + $c);
573
           $col["max-width"] += $inc;
624
           $col["max-width"] += $inc;
574
         }
625
         }
575
       }
626
       }
576
     }
627
     }
577
 
628
 
578
     $this->__col += $colspan;
629
     $this->__col += $colspan;
579
-    if ( $this->__col > $this->_num_cols )
630
+    if ($this->__col > $this->_num_cols)
580
       $this->_num_cols = $this->__col;
631
       $this->_num_cols = $this->__col;
581
-
582
   }
632
   }
583
 
633
 
584
   //........................................................................
634
   //........................................................................
585
 
635
 
586
-  function add_row() {
636
+  function add_row()
637
+  {
587
 
638
 
588
     $this->__row++;
639
     $this->__row++;
589
     $this->_num_rows++;
640
     $this->_num_rows++;
590
 
641
 
591
     // Find the next available column
642
     // Find the next available column
592
     $i = 0;
643
     $i = 0;
593
-    while ( isset($this->_cells[$this->__row][$i]) ) {
644
+    while (isset($this->_cells[$this->__row][$i])) {
594
       $i++;
645
       $i++;
595
     }
646
     }
596
 
647
 
597
     $this->__col = $i;
648
     $this->__col = $i;
598
-
599
   }
649
   }
600
 
650
 
601
   //........................................................................
651
   //........................................................................
605
    *
655
    *
606
    * @param Frame
656
    * @param Frame
607
    */
657
    */
608
-  function remove_row(Frame $row) {
658
+  function remove_row(Frame $row)
659
+  {
609
 
660
 
610
     $key = $row->get_id();
661
     $key = $row->get_id();
611
-    if ( !isset($this->_frames[$key]) ) {
662
+    if (!isset($this->_frames[$key])) {
612
       return;  // Presumably this row has alredy been removed
663
       return;  // Presumably this row has alredy been removed
613
     }
664
     }
614
 
665
 
618
     $columns = $this->_frames[$key]["columns"];
669
     $columns = $this->_frames[$key]["columns"];
619
 
670
 
620
     // Remove all frames from this row
671
     // Remove all frames from this row
621
-    foreach ( $rows as $r ) {
622
-      foreach ( $columns as $c ) {
623
-        if ( isset($this->_cells[$r][$c]) ) {
672
+    foreach ($rows as $r) {
673
+      foreach ($columns as $c) {
674
+        if (isset($this->_cells[$r][$c])) {
624
           $id = $this->_cells[$r][$c]->get_id();
675
           $id = $this->_cells[$r][$c]->get_id();
625
-          
676
+
626
           $this->_frames[$id] = null;
677
           $this->_frames[$id] = null;
627
           unset($this->_frames[$id]);
678
           unset($this->_frames[$id]);
628
-          
679
+
629
           $this->_cells[$r][$c] = null;
680
           $this->_cells[$r][$c] = null;
630
           unset($this->_cells[$r][$c]);
681
           unset($this->_cells[$r][$c]);
631
         }
682
         }
632
       }
683
       }
633
-      
684
+
634
       $this->_rows[$r] = null;
685
       $this->_rows[$r] = null;
635
       unset($this->_rows[$r]);
686
       unset($this->_rows[$r]);
636
     }
687
     }
637
 
688
 
638
     $this->_frames[$key] = null;
689
     $this->_frames[$key] = null;
639
     unset($this->_frames[$key]);
690
     unset($this->_frames[$key]);
640
-
641
   }
691
   }
642
 
692
 
643
   /**
693
   /**
645
    *
695
    *
646
    * @param Frame $group  The group to remove
696
    * @param Frame $group  The group to remove
647
    */
697
    */
648
-  function remove_row_group(Frame $group) {
698
+  function remove_row_group(Frame $group)
699
+  {
649
 
700
 
650
     $key = $group->get_id();
701
     $key = $group->get_id();
651
-    if ( !isset($this->_frames[$key]) ) {
702
+    if (!isset($this->_frames[$key])) {
652
       return;  // Presumably this row has alredy been removed
703
       return;  // Presumably this row has alredy been removed
653
     }
704
     }
654
-    
705
+
655
     $iter = $group->get_first_child();
706
     $iter = $group->get_first_child();
656
     while ($iter) {
707
     while ($iter) {
657
       $this->remove_row($iter);
708
       $this->remove_row($iter);
668
    * @param Frame $group    The group to update
719
    * @param Frame $group    The group to update
669
    * @param Frame $last_row The last row in the row group
720
    * @param Frame $last_row The last row in the row group
670
    */
721
    */
671
-  function update_row_group(Frame $group, Frame $last_row) {
722
+  function update_row_group(Frame $group, Frame $last_row)
723
+  {
672
 
724
 
673
     $g_key = $group->get_id();
725
     $g_key = $group->get_id();
674
     $r_key = $last_row->get_id();
726
     $r_key = $last_row->get_id();
675
 
727
 
676
-    $r_rows = $this->_frames[$r_key]["rows"];
677
-    $this->_frames[$g_key]["rows"] = range( $this->_frames[$g_key]["rows"][0], end($r_rows) );
678
-
728
+    //cambiado por mi
729
+    $r_rows = $this->_frames[$g_key]["rows"];
730
+    $this->_frames[$g_key]["rows"] = range($this->_frames[$g_key]["rows"][0], end($r_rows));
679
   }
731
   }
680
 
732
 
681
   //........................................................................
733
   //........................................................................
682
 
734
 
683
-  function assign_x_positions() {
735
+  function assign_x_positions()
736
+  {
684
     // Pre-condition: widths must be resolved and assigned to columns and
737
     // Pre-condition: widths must be resolved and assigned to columns and
685
     // column[0]["x"] must be set.
738
     // column[0]["x"] must be set.
686
 
739
 
687
-    if ( $this->_columns_locked ) {
740
+    if ($this->_columns_locked) {
688
       return;
741
       return;
689
     }
742
     }
690
-    
743
+
691
     $x = $this->_columns[0]["x"];
744
     $x = $this->_columns[0]["x"];
692
-    foreach ( array_keys($this->_columns) as $j ) {
745
+    foreach (array_keys($this->_columns) as $j) {
693
       $this->_columns[$j]["x"] = $x;
746
       $this->_columns[$j]["x"] = $x;
694
       $x += $this->_columns[$j]["used-width"];
747
       $x += $this->_columns[$j]["used-width"];
695
     }
748
     }
696
-
697
   }
749
   }
698
 
750
 
699
-  function assign_frame_heights() {
751
+  function assign_frame_heights()
752
+  {
700
     // Pre-condition: widths and heights of each column & row must be
753
     // Pre-condition: widths and heights of each column & row must be
701
     // calcluated
754
     // calcluated
702
 
755
 
703
-    foreach ( $this->_frames as $arr ) {
756
+    foreach ($this->_frames as $arr) {
704
       $frame = $arr["frame"];
757
       $frame = $arr["frame"];
705
 
758
 
706
       $h = 0;
759
       $h = 0;
707
-      foreach( $arr["rows"] as $row ) {
708
-        if ( !isset($this->_rows[$row]) ) {
760
+      foreach ($arr["rows"] as $row) {
761
+        if (!isset($this->_rows[$row])) {
709
           // The row has been removed because of a page split, so skip it.
762
           // The row has been removed because of a page split, so skip it.
710
           continue;
763
           continue;
711
         }
764
         }
712
-        
765
+
713
         $h += $this->_rows[$row]["height"];
766
         $h += $this->_rows[$row]["height"];
714
       }
767
       }
715
 
768
 
716
-      if ( $frame instanceof Table_Cell_Frame_Decorator ) {
769
+      if ($frame instanceof Table_Cell_Frame_Decorator) {
717
         $frame->set_cell_height($h);
770
         $frame->set_cell_height($h);
718
-      }
719
-      else {
771
+      } else {
720
         $frame->get_style()->height = $h;
772
         $frame->get_style()->height = $h;
721
       }
773
       }
722
     }
774
     }
723
-
724
   }
775
   }
725
 
776
 
726
   //........................................................................
777
   //........................................................................
728
   /**
779
   /**
729
    * Re-adjust frame height if the table height is larger than its content
780
    * Re-adjust frame height if the table height is larger than its content
730
    */
781
    */
731
-  function set_frame_heights($table_height, $content_height) {
782
+  function set_frame_heights($table_height, $content_height)
783
+  {
732
 
784
 
733
 
785
 
734
     // Distribute the increased height proportionally amongst each row
786
     // Distribute the increased height proportionally amongst each row
735
-    foreach ( $this->_frames as $arr ) {
787
+    foreach ($this->_frames as $arr) {
736
       $frame = $arr["frame"];
788
       $frame = $arr["frame"];
737
 
789
 
738
       $h = 0;
790
       $h = 0;
739
-      foreach ($arr["rows"] as $row ) {
740
-        if ( !isset($this->_rows[$row]) ) {
791
+      foreach ($arr["rows"] as $row) {
792
+        if (!isset($this->_rows[$row])) {
741
           continue;
793
           continue;
742
         }
794
         }
743
 
795
 
744
         $h += $this->_rows[$row]["height"];
796
         $h += $this->_rows[$row]["height"];
745
       }
797
       }
746
-      
747
-      if ( $content_height > 0 ) {
798
+
799
+      if ($content_height > 0) {
748
         $new_height = ($h / $content_height) * $table_height;
800
         $new_height = ($h / $content_height) * $table_height;
749
-      }
750
-      else {
801
+      } else {
751
         $new_height = 0;
802
         $new_height = 0;
752
       }
803
       }
753
 
804
 
754
-      if ( $frame instanceof Table_Cell_Frame_Decorator ) {
805
+      if ($frame instanceof Table_Cell_Frame_Decorator) {
755
         $frame->set_cell_height($new_height);
806
         $frame->set_cell_height($new_height);
756
-      }
757
-      else {
807
+      } else {
758
         $frame->get_style()->height = $new_height;
808
         $frame->get_style()->height = $new_height;
759
       }
809
       }
760
     }
810
     }
761
-
762
   }
811
   }
763
 
812
 
764
   //........................................................................
813
   //........................................................................
765
 
814
 
766
   // Used for debugging:
815
   // Used for debugging:
767
-  function __toString() {
816
+  function __toString()
817
+  {
768
     $str = "";
818
     $str = "";
769
     $str .= "Columns:<br/>";
819
     $str .= "Columns:<br/>";
770
     $str .= pre_r($this->_columns, true);
820
     $str .= pre_r($this->_columns, true);
773
 
823
 
774
     $str .=  "Frames:<br/>";
824
     $str .=  "Frames:<br/>";
775
     $arr = array();
825
     $arr = array();
776
-    foreach ( $this->_frames as $key => $val ) {
826
+    foreach ($this->_frames as $key => $val) {
777
       $arr[$key] = array("columns" => $val["columns"], "rows" => $val["rows"]);
827
       $arr[$key] = array("columns" => $val["columns"], "rows" => $val["rows"]);
778
     }
828
     }
779
-    
829
+
780
     $str .= pre_r($arr, true);
830
     $str .= pre_r($arr, true);
781
 
831
 
782
-    if ( php_sapi_name() == "cli" ) {
783
-      $str = strip_tags(str_replace(array("<br/>","<b>","</b>"),
784
-                                    array("\n",chr(27)."[01;33m", chr(27)."[0m"),
785
-                                    $str));
832
+    if (php_sapi_name() == "cli") {
833
+      $str = strip_tags(str_replace(
834
+        array("<br/>", "<b>", "</b>"),
835
+        array("\n", chr(27) . "[01;33m", chr(27) . "[0m"),
836
+        $str
837
+      ));
786
     }
838
     }
787
-    
839
+
788
     return $str;
840
     return $str;
789
   }
841
   }
790
-}
842
+}

+ 241
- 202
vendor/dompdf/dompdf/include/frame_decorator.cls.php View File

1
 <?php
1
 <?php
2
+
2
 /**
3
 /**
3
  * @package dompdf
4
  * @package dompdf
4
  * @link    http://dompdf.github.com/
5
  * @link    http://dompdf.github.com/
12
  * @access private
13
  * @access private
13
  * @package dompdf
14
  * @package dompdf
14
  */
15
  */
15
-abstract class Frame_Decorator extends Frame {
16
+abstract class Frame_Decorator extends Frame
17
+{
16
   const DEFAULT_COUNTER = "-dompdf-default-counter";
18
   const DEFAULT_COUNTER = "-dompdf-default-counter";
17
-  
19
+
18
   public $_counters = array(); // array([id] => counter_value) (for generated content)
20
   public $_counters = array(); // array([id] => counter_value) (for generated content)
19
-  
21
+
20
   /**
22
   /**
21
    * The root node of the DOM tree
23
    * The root node of the DOM tree
22
    *
24
    *
44
    * @var Frame_Reflower
46
    * @var Frame_Reflower
45
    */
47
    */
46
   protected $_reflower;
48
   protected $_reflower;
47
-  
49
+
48
   /**
50
   /**
49
    * Reference to the current dompdf instance
51
    * Reference to the current dompdf instance
50
    *
52
    *
51
    * @var DOMPDF
53
    * @var DOMPDF
52
    */
54
    */
53
   protected $_dompdf;
55
   protected $_dompdf;
54
-  
56
+
55
   /**
57
   /**
56
    * First block parent
58
    * First block parent
57
    * 
59
    * 
58
    * @var Block_Frame_Decorator
60
    * @var Block_Frame_Decorator
59
    */
61
    */
60
   private $_block_parent;
62
   private $_block_parent;
61
-  
63
+
62
   /**
64
   /**
63
    * First positionned parent (position: relative | absolute | fixed)
65
    * First positionned parent (position: relative | absolute | fixed)
64
    * 
66
    * 
72
    * @param Frame  $frame  The decoration target
74
    * @param Frame  $frame  The decoration target
73
    * @param DOMPDF $dompdf The DOMPDF object
75
    * @param DOMPDF $dompdf The DOMPDF object
74
    */
76
    */
75
-  function __construct(Frame $frame, DOMPDF $dompdf) {
77
+  function __construct(Frame $frame, DOMPDF $dompdf)
78
+  {
76
     $this->_frame = $frame;
79
     $this->_frame = $frame;
77
     $this->_root = null;
80
     $this->_root = null;
78
     $this->_dompdf = $dompdf;
81
     $this->_dompdf = $dompdf;
84
    *
87
    *
85
    * @param bool $recursive if true, call dispose on all children
88
    * @param bool $recursive if true, call dispose on all children
86
    */
89
    */
87
-  function dispose($recursive = false) {
88
-    if ( $recursive ) {
89
-      while ( $child = $this->get_first_child() ) {
90
+  function dispose($recursive = false)
91
+  {
92
+    if ($recursive) {
93
+      while ($child = $this->get_first_child()) {
90
         $child->dispose(true);
94
         $child->dispose(true);
91
       }
95
       }
92
     }
96
     }
93
-    
97
+
94
     $this->_root = null;
98
     $this->_root = null;
95
     unset($this->_root);
99
     unset($this->_root);
96
-    
100
+
97
     $this->_frame->dispose(true);
101
     $this->_frame->dispose(true);
98
     $this->_frame = null;
102
     $this->_frame = null;
99
     unset($this->_frame);
103
     unset($this->_frame);
100
-    
104
+
101
     $this->_positioner = null;
105
     $this->_positioner = null;
102
     unset($this->_positioner);
106
     unset($this->_positioner);
103
-    
107
+
104
     $this->_reflower = null;
108
     $this->_reflower = null;
105
     unset($this->_reflower);
109
     unset($this->_reflower);
106
   }
110
   }
111
    * @param DOMNode $node
115
    * @param DOMNode $node
112
    *
116
    *
113
    * @return Frame
117
    * @return Frame
114
-   */ 
115
-  function copy(DOMNode $node) {
118
+   */
119
+  function copy(DOMNode $node)
120
+  {
116
     $frame = new Frame($node);
121
     $frame = new Frame($node);
117
     $frame->set_style(clone $this->_frame->get_original_style());
122
     $frame->set_style(clone $this->_frame->get_original_style());
118
-    
123
+
119
     return Frame_Factory::decorate_frame($frame, $this->_dompdf, $this->_root);
124
     return Frame_Factory::decorate_frame($frame, $this->_dompdf, $this->_root);
120
   }
125
   }
121
 
126
 
124
    *
129
    *
125
    * @return Frame
130
    * @return Frame
126
    */
131
    */
127
-  function deep_copy() {
132
+  function deep_copy()
133
+  {
128
     $frame = new Frame($this->get_node()->cloneNode());
134
     $frame = new Frame($this->get_node()->cloneNode());
129
     $frame->set_style(clone $this->_frame->get_original_style());
135
     $frame->set_style(clone $this->_frame->get_original_style());
130
-    
136
+
131
     $deco = Frame_Factory::decorate_frame($frame, $this->_dompdf, $this->_root);
137
     $deco = Frame_Factory::decorate_frame($frame, $this->_dompdf, $this->_root);
132
-    
138
+
133
     foreach ($this->get_children() as $child) {
139
     foreach ($this->get_children() as $child) {
134
       $deco->append_child($child->deep_copy());
140
       $deco->append_child($child->deep_copy());
135
     }
141
     }
136
-    
142
+
137
     return $deco;
143
     return $deco;
138
   }
144
   }
139
-  
145
+
140
   /**
146
   /**
141
    * Delegate calls to decorated frame object
147
    * Delegate calls to decorated frame object
142
    */
148
    */
143
-  function reset() {
149
+  function reset()
150
+  {
144
     $this->_frame->reset();
151
     $this->_frame->reset();
145
-    
152
+
146
     $this->_counters = array();
153
     $this->_counters = array();
147
-    
154
+
148
     // Reset all children
155
     // Reset all children
149
     foreach ($this->get_children() as $child) {
156
     foreach ($this->get_children() as $child) {
150
       $child->reset();
157
       $child->reset();
151
     }
158
     }
152
   }
159
   }
153
-  
160
+
154
   // Getters -----------
161
   // Getters -----------
155
-  function get_id() {
162
+  function get_id()
163
+  {
156
     return $this->_frame->get_id();
164
     return $this->_frame->get_id();
157
   }
165
   }
158
-  
166
+
159
   /**
167
   /**
160
    * @return Frame
168
    * @return Frame
161
    */
169
    */
162
-  function get_frame() {
170
+  function get_frame()
171
+  {
163
     return $this->_frame;
172
     return $this->_frame;
164
   }
173
   }
165
-  
174
+
166
   /**
175
   /**
167
    * @return DOMElement|DOMText
176
    * @return DOMElement|DOMText
168
    */
177
    */
169
-  function get_node() {
178
+  function get_node()
179
+  {
170
     return $this->_frame->get_node();
180
     return $this->_frame->get_node();
171
   }
181
   }
172
-  
182
+
173
   /**
183
   /**
174
    * @return Style
184
    * @return Style
175
    */
185
    */
176
-  function get_style() {
186
+  function get_style()
187
+  {
177
     return $this->_frame->get_style();
188
     return $this->_frame->get_style();
178
   }
189
   }
179
-  
190
+
180
   /**
191
   /**
181
    * @return Style
192
    * @return Style
182
    */
193
    */
183
-  function get_original_style() {
194
+  function get_original_style()
195
+  {
184
     return $this->_frame->get_original_style();
196
     return $this->_frame->get_original_style();
185
   }
197
   }
186
 
198
 
189
    *
201
    *
190
    * @return array|float
202
    * @return array|float
191
    */
203
    */
192
-  function get_containing_block($i = null) {
204
+  function get_containing_block($i = null)
205
+  {
193
     return $this->_frame->get_containing_block($i);
206
     return $this->_frame->get_containing_block($i);
194
   }
207
   }
195
 
208
 
198
    *
211
    *
199
    * @return array|float
212
    * @return array|float
200
    */
213
    */
201
-  function get_position($i = null) {
214
+  function get_position($i = null)
215
+  {
202
     return $this->_frame->get_position($i);
216
     return $this->_frame->get_position($i);
203
   }
217
   }
204
-  
218
+
205
   /**
219
   /**
206
    * @return DOMPDF
220
    * @return DOMPDF
207
    */
221
    */
208
-  function get_dompdf() {
222
+  function get_dompdf()
223
+  {
209
     return $this->_dompdf;
224
     return $this->_dompdf;
210
   }
225
   }
211
 
226
 
212
   /**
227
   /**
213
    * @return float
228
    * @return float
214
    */
229
    */
215
-  function get_margin_height() {
230
+  function get_margin_height()
231
+  {
216
     return $this->_frame->get_margin_height();
232
     return $this->_frame->get_margin_height();
217
   }
233
   }
218
 
234
 
219
   /**
235
   /**
220
    * @return float
236
    * @return float
221
    */
237
    */
222
-  function get_margin_width() {
238
+  function get_margin_width()
239
+  {
223
     return $this->_frame->get_margin_width();
240
     return $this->_frame->get_margin_width();
224
   }
241
   }
225
 
242
 
226
   /**
243
   /**
227
    * @return array
244
    * @return array
228
    */
245
    */
229
-  function get_padding_box() {
246
+  function get_padding_box()
247
+  {
230
     return $this->_frame->get_padding_box();
248
     return $this->_frame->get_padding_box();
231
   }
249
   }
232
 
250
 
233
   /**
251
   /**
234
    * @return array
252
    * @return array
235
    */
253
    */
236
-  function get_border_box() {
254
+  function get_border_box()
255
+  {
237
     return $this->_frame->get_border_box();
256
     return $this->_frame->get_border_box();
238
   }
257
   }
239
 
258
 
240
   /**
259
   /**
241
    * @param integer $id
260
    * @param integer $id
242
    */
261
    */
243
-  function set_id($id) {
262
+  function set_id($id)
263
+  {
244
     $this->_frame->set_id($id);
264
     $this->_frame->set_id($id);
245
   }
265
   }
246
 
266
 
247
   /**
267
   /**
248
    * @param Style $style
268
    * @param Style $style
249
    */
269
    */
250
-  function set_style(Style $style) {
270
+  function set_style(Style $style)
271
+  {
251
     $this->_frame->set_style($style);
272
     $this->_frame->set_style($style);
252
   }
273
   }
253
 
274
 
257
    * @param float $w
278
    * @param float $w
258
    * @param float $h
279
    * @param float $h
259
    */
280
    */
260
-  function set_containing_block($x = null, $y = null, $w = null, $h = null) {
281
+  function set_containing_block($x = null, $y = null, $w = null, $h = null)
282
+  {
261
     $this->_frame->set_containing_block($x, $y, $w, $h);
283
     $this->_frame->set_containing_block($x, $y, $w, $h);
262
   }
284
   }
263
 
285
 
265
    * @param float $x
287
    * @param float $x
266
    * @param float $y
288
    * @param float $y
267
    */
289
    */
268
-  function set_position($x = null, $y = null) {
290
+  function set_position($x = null, $y = null)
291
+  {
269
     $this->_frame->set_position($x, $y);
292
     $this->_frame->set_position($x, $y);
270
   }
293
   }
271
 
294
 
272
   /**
295
   /**
273
    * @return string
296
    * @return string
274
    */
297
    */
275
-  function __toString() {
298
+  function __toString()
299
+  {
276
     return $this->_frame->__toString();
300
     return $this->_frame->__toString();
277
   }
301
   }
278
 
302
 
280
    * @param Frame $child
304
    * @param Frame $child
281
    * @param bool  $update_node
305
    * @param bool  $update_node
282
    */
306
    */
283
-  function prepend_child(Frame $child, $update_node = true) {
284
-    while ( $child instanceof Frame_Decorator ) {
307
+  function prepend_child(Frame $child, $update_node = true)
308
+  {
309
+    while ($child instanceof Frame_Decorator) {
285
       $child = $child->_frame;
310
       $child = $child->_frame;
286
     }
311
     }
287
-    
312
+
288
     $this->_frame->prepend_child($child, $update_node);
313
     $this->_frame->prepend_child($child, $update_node);
289
   }
314
   }
290
 
315
 
292
    * @param Frame $child
317
    * @param Frame $child
293
    * @param bool  $update_node
318
    * @param bool  $update_node
294
    */
319
    */
295
-  function append_child(Frame $child, $update_node = true) {
296
-    while ( $child instanceof Frame_Decorator ) {
320
+  function append_child(Frame $child, $update_node = true)
321
+  {
322
+    while ($child instanceof Frame_Decorator) {
297
       $child = $child->_frame;
323
       $child = $child->_frame;
298
     }
324
     }
299
 
325
 
305
    * @param Frame $ref
331
    * @param Frame $ref
306
    * @param bool  $update_node
332
    * @param bool  $update_node
307
    */
333
    */
308
-  function insert_child_before(Frame $new_child, Frame $ref, $update_node = true) {
309
-    while ( $new_child instanceof Frame_Decorator ) {
334
+  function insert_child_before(Frame $new_child, Frame $ref, $update_node = true)
335
+  {
336
+    while ($new_child instanceof Frame_Decorator) {
310
       $new_child = $new_child->_frame;
337
       $new_child = $new_child->_frame;
311
     }
338
     }
312
 
339
 
313
-    if ( $ref instanceof Frame_Decorator ) {
340
+    if ($ref instanceof Frame_Decorator) {
314
       $ref = $ref->_frame;
341
       $ref = $ref->_frame;
315
     }
342
     }
316
 
343
 
322
    * @param Frame $ref
349
    * @param Frame $ref
323
    * @param bool  $update_node
350
    * @param bool  $update_node
324
    */
351
    */
325
-  function insert_child_after(Frame $new_child, Frame $ref, $update_node = true) {
326
-    while ( $new_child instanceof Frame_Decorator ) {
352
+  function insert_child_after(Frame $new_child, Frame $ref, $update_node = true)
353
+  {
354
+    while ($new_child instanceof Frame_Decorator) {
327
       $new_child = $new_child->_frame;
355
       $new_child = $new_child->_frame;
328
     }
356
     }
329
 
357
 
330
-    while ( $ref instanceof Frame_Decorator ) {
358
+    while ($ref instanceof Frame_Decorator) {
331
       $ref = $ref->_frame;
359
       $ref = $ref->_frame;
332
     }
360
     }
333
-    
361
+
334
     $this->_frame->insert_child_after($new_child, $ref, $update_node);
362
     $this->_frame->insert_child_after($new_child, $ref, $update_node);
335
   }
363
   }
336
 
364
 
340
    *
368
    *
341
    * @return Frame
369
    * @return Frame
342
    */
370
    */
343
-  function remove_child(Frame $child, $update_node = true) {
344
-    while  ( $child instanceof Frame_Decorator ) {
371
+  function remove_child(Frame $child, $update_node = true)
372
+  {
373
+    while ($child instanceof Frame_Decorator) {
345
       $child = $child->_frame;
374
       $child = $child->_frame;
346
     }
375
     }
347
 
376
 
351
   /**
380
   /**
352
    * @return Frame_Decorator
381
    * @return Frame_Decorator
353
    */
382
    */
354
-  function get_parent() {
383
+  function get_parent()
384
+  {
355
     $p = $this->_frame->get_parent();
385
     $p = $this->_frame->get_parent();
356
-    if ( $p && $deco = $p->get_decorator() ) {
357
-      while ( $tmp = $deco->get_decorator() ) {
386
+    if ($p && $deco = $p->get_decorator()) {
387
+      while ($tmp = $deco->get_decorator()) {
358
         $deco = $tmp;
388
         $deco = $tmp;
359
       }
389
       }
360
-      
390
+
361
       return $deco;
391
       return $deco;
362
-    }
363
-    else if ( $p ) {
392
+    } else if ($p) {
364
       return $p;
393
       return $p;
365
     }
394
     }
366
-    
395
+
367
     return null;
396
     return null;
368
   }
397
   }
369
 
398
 
370
   /**
399
   /**
371
    * @return Frame_Decorator
400
    * @return Frame_Decorator
372
    */
401
    */
373
-  function get_first_child() {
402
+  function get_first_child()
403
+  {
374
     $c = $this->_frame->get_first_child();
404
     $c = $this->_frame->get_first_child();
375
-    if ( $c && $deco = $c->get_decorator() ) {
376
-      while ( $tmp = $deco->get_decorator() ) {
405
+    if ($c && $deco = $c->get_decorator()) {
406
+      while ($tmp = $deco->get_decorator()) {
377
         $deco = $tmp;
407
         $deco = $tmp;
378
       }
408
       }
379
-      
409
+
380
       return $deco;
410
       return $deco;
381
-    }
382
-    else if ( $c ) {
411
+    } else if ($c) {
383
       return $c;
412
       return $c;
384
     }
413
     }
385
-    
414
+
386
     return null;
415
     return null;
387
   }
416
   }
388
 
417
 
389
   /**
418
   /**
390
    * @return Frame_Decorator
419
    * @return Frame_Decorator
391
    */
420
    */
392
-  function get_last_child() {
421
+  function get_last_child()
422
+  {
393
     $c = $this->_frame->get_last_child();
423
     $c = $this->_frame->get_last_child();
394
-    if ( $c && $deco = $c->get_decorator() ) {
395
-      while ( $tmp = $deco->get_decorator() ) {
424
+    if ($c && $deco = $c->get_decorator()) {
425
+      while ($tmp = $deco->get_decorator()) {
396
         $deco = $tmp;
426
         $deco = $tmp;
397
       }
427
       }
398
-      
428
+
399
       return $deco;
429
       return $deco;
400
-    }
401
-    else if ( $c ) {
430
+    } else if ($c) {
402
       return $c;
431
       return $c;
403
     }
432
     }
404
-    
433
+
405
     return null;
434
     return null;
406
   }
435
   }
407
 
436
 
408
   /**
437
   /**
409
    * @return Frame_Decorator
438
    * @return Frame_Decorator
410
    */
439
    */
411
-  function get_prev_sibling() {
440
+  function get_prev_sibling()
441
+  {
412
     $s = $this->_frame->get_prev_sibling();
442
     $s = $this->_frame->get_prev_sibling();
413
-    if ( $s && $deco = $s->get_decorator() ) {
414
-      while ( $tmp = $deco->get_decorator() ) {
443
+    if ($s && $deco = $s->get_decorator()) {
444
+      while ($tmp = $deco->get_decorator()) {
415
         $deco = $tmp;
445
         $deco = $tmp;
416
       }
446
       }
417
       return $deco;
447
       return $deco;
418
-    }
419
-    else if ( $s ) {
448
+    } else if ($s) {
420
       return $s;
449
       return $s;
421
     }
450
     }
422
-    
451
+
423
     return null;
452
     return null;
424
   }
453
   }
425
-  
454
+
426
   /**
455
   /**
427
    * @return Frame_Decorator
456
    * @return Frame_Decorator
428
    */
457
    */
429
-  function get_next_sibling() {
458
+  function get_next_sibling()
459
+  {
430
     $s = $this->_frame->get_next_sibling();
460
     $s = $this->_frame->get_next_sibling();
431
-    if ( $s && $deco = $s->get_decorator() ) {
432
-      while ( $tmp = $deco->get_decorator() ) {
461
+    if ($s && $deco = $s->get_decorator()) {
462
+      while ($tmp = $deco->get_decorator()) {
433
         $deco = $tmp;
463
         $deco = $tmp;
434
       }
464
       }
435
-      
465
+
436
       return $deco;
466
       return $deco;
437
-    }
438
-    else if ( $s ) {
467
+    } else if ($s) {
439
       return $s;
468
       return $s;
440
     }
469
     }
441
-    
470
+
442
     return null;
471
     return null;
443
   }
472
   }
444
 
473
 
445
   /**
474
   /**
446
    * @return FrameTreeList
475
    * @return FrameTreeList
447
    */
476
    */
448
-  function get_subtree() {
477
+  function get_subtree()
478
+  {
449
     return new FrameTreeList($this);
479
     return new FrameTreeList($this);
450
   }
480
   }
451
 
481
 
452
-  function set_positioner(Positioner $posn) {
482
+  function set_positioner(Positioner $posn)
483
+  {
453
     $this->_positioner = $posn;
484
     $this->_positioner = $posn;
454
-    if ( $this->_frame instanceof Frame_Decorator ) {
485
+    if ($this->_frame instanceof Frame_Decorator) {
455
       $this->_frame->set_positioner($posn);
486
       $this->_frame->set_positioner($posn);
456
     }
487
     }
457
   }
488
   }
458
 
489
 
459
-  function set_reflower(Frame_Reflower $reflower) {
490
+  function set_reflower(Frame_Reflower $reflower)
491
+  {
460
     $this->_reflower = $reflower;
492
     $this->_reflower = $reflower;
461
-    if ( $this->_frame instanceof Frame_Decorator ) {
462
-      $this->_frame->set_reflower( $reflower );
493
+    if ($this->_frame instanceof Frame_Decorator) {
494
+      $this->_frame->set_reflower($reflower);
463
     }
495
     }
464
   }
496
   }
465
-  
497
+
466
   /**
498
   /**
467
    * @return Frame_Reflower
499
    * @return Frame_Reflower
468
    */
500
    */
469
-  function get_reflower() {
501
+  function get_reflower()
502
+  {
470
     return $this->_reflower;
503
     return $this->_reflower;
471
   }
504
   }
472
 
505
 
473
   /**
506
   /**
474
    * @param Frame $root
507
    * @param Frame $root
475
    */
508
    */
476
-  function set_root(Frame $root) {
509
+  function set_root(Frame $root)
510
+  {
477
     $this->_root = $root;
511
     $this->_root = $root;
478
-    
479
-    if ( $this->_frame instanceof Frame_Decorator ) {
512
+
513
+    if ($this->_frame instanceof Frame_Decorator) {
480
       $this->_frame->set_root($root);
514
       $this->_frame->set_root($root);
481
     }
515
     }
482
   }
516
   }
483
-  
517
+
484
   /**
518
   /**
485
    * @return Page_Frame_Decorator
519
    * @return Page_Frame_Decorator
486
    */
520
    */
487
-  function get_root() {
521
+  function get_root()
522
+  {
488
     return $this->_root;
523
     return $this->_root;
489
   }
524
   }
490
 
525
 
491
   /**
526
   /**
492
    * @return Block_Frame_Decorator
527
    * @return Block_Frame_Decorator
493
    */
528
    */
494
-  function find_block_parent() {
529
+  function find_block_parent()
530
+  {
495
     // Find our nearest block level parent
531
     // Find our nearest block level parent
496
     $p = $this->get_parent();
532
     $p = $this->get_parent();
497
-    
498
-    while ( $p ) {
499
-      if ( $p->is_block() ) {
533
+
534
+    while ($p) {
535
+      if ($p->is_block()) {
500
         break;
536
         break;
501
       }
537
       }
502
-      
538
+
503
       $p = $p->get_parent();
539
       $p = $p->get_parent();
504
     }
540
     }
505
 
541
 
506
     return $this->_block_parent = $p;
542
     return $this->_block_parent = $p;
507
   }
543
   }
508
-  
544
+
509
   /**
545
   /**
510
    * @return Frame_Decorator
546
    * @return Frame_Decorator
511
    */
547
    */
512
-  function find_positionned_parent() {
548
+  function find_positionned_parent()
549
+  {
513
     // Find our nearest relative positionned parent
550
     // Find our nearest relative positionned parent
514
     $p = $this->get_parent();
551
     $p = $this->get_parent();
515
-    while ( $p ) {
516
-      if ( $p->is_positionned() ) {
552
+    while ($p) {
553
+      if ($p->is_positionned()) {
517
         break;
554
         break;
518
       }
555
       }
519
-      
556
+
520
       $p = $p->get_parent();
557
       $p = $p->get_parent();
521
     }
558
     }
522
-    
523
-    if ( !$p ) {
559
+
560
+    if (!$p) {
524
       $p = $this->_root->get_first_child(); // <body>
561
       $p = $this->_root->get_first_child(); // <body>
525
     }
562
     }
526
 
563
 
539
    * @throws DOMPDF_Exception
576
    * @throws DOMPDF_Exception
540
    * @return void
577
    * @return void
541
    */
578
    */
542
-  function split(Frame $child = null, $force_pagebreak = false) {
543
-    // decrement any counters that were incremented on the current node, unless that node is the body
579
+  function split(Frame $child = null, $force_pagebreak = false)
580
+  {
581
+
582
+    // decrement any counters that were incremented on the current node
544
     $style = $this->_frame->get_style();
583
     $style = $this->_frame->get_style();
545
-    if ( $this->_frame->get_node()->nodeName !== "body" && $style->counter_increment && ($decrement = $style->counter_increment) !== "none" ) {
584
+    if ($style->counter_increment && ($decrement = $style->counter_increment) !== "none") {
546
       $this->decrement_counters($decrement);
585
       $this->decrement_counters($decrement);
547
     }
586
     }
548
-    
549
-    if ( is_null( $child ) ) {
587
+
588
+    if (is_null($child)) {
550
       // check for counter increment on :before content (always a child of the selected element @link Frame_Reflower::_set_content)
589
       // check for counter increment on :before content (always a child of the selected element @link Frame_Reflower::_set_content)
551
       // this can push the current node to the next page before counter rules have bubbled up (but only if
590
       // this can push the current node to the next page before counter rules have bubbled up (but only if
552
       // it's been rendered, thus the position check)
591
       // it's been rendered, thus the position check)
553
-      if ( !$this->is_text_node() && $this->get_node()->hasAttribute("dompdf_before_frame_id") ) {
554
-        foreach($this->_frame->get_children() as $child) {
555
-          if ( $this->get_node()->getAttribute("dompdf_before_frame_id") == $child->get_id() && $child->get_position('x') !== NULL ) {
592
+      if (!$this->is_text_node() && $this->get_node()->hasAttribute("dompdf_before_frame_id")) {
593
+        foreach ($this->_frame->get_children() as $child) {
594
+          if ($this->get_node()->getAttribute("dompdf_before_frame_id") == $child->get_id() && $child->get_position('x') !== NULL) {
556
             $style = $child->get_style();
595
             $style = $child->get_style();
557
-            if ( $style->counter_increment && ($decrement = $style->counter_increment) !== "none" ) {
596
+            if ($style->counter_increment && ($decrement = $style->counter_increment) !== "none") {
558
               $this->decrement_counters($decrement);
597
               $this->decrement_counters($decrement);
559
             }
598
             }
560
           }
599
           }
563
       $this->get_parent()->split($this, $force_pagebreak);
602
       $this->get_parent()->split($this, $force_pagebreak);
564
       return;
603
       return;
565
     }
604
     }
566
-    
567
-    if ( $child->get_parent() !== $this ) {
605
+
606
+
607
+    if ($child->get_parent() !== $this) {
568
       throw new DOMPDF_Exception("Unable to split: frame is not a child of this one.");
608
       throw new DOMPDF_Exception("Unable to split: frame is not a child of this one.");
569
     }
609
     }
570
-    
610
+
611
+
571
     $node = $this->_frame->get_node();
612
     $node = $this->_frame->get_node();
572
-    
573
-    $split = $this->copy( $node->cloneNode() );
574
-    $split->reset();
575
-    $split->get_original_style()->text_indent = 0;
576
-    $split->_splitted = true;
577
-    
578
-    // The body's properties must be kept
579
-    if ( $node->nodeName !== "body" ) {
580
-      // Style reset on the first and second parts
581
-      $style = $this->_frame->get_style();
582
-      $style->margin_bottom = 0;
583
-      $style->padding_bottom = 0;
584
-      $style->border_bottom = 0;
585
-      
586
-      // second
587
-      $orig_style = $split->get_original_style();
588
-      $orig_style->text_indent = 0;
589
-      $orig_style->margin_top = 0;
590
-      $orig_style->padding_top = 0;
591
-      $orig_style->border_top = 0;
592
-    }
593
-    
613
+
614
+    $split = $this->copy($node->cloneNode());
615
+
616
+
617
+
594
     $this->get_parent()->insert_child_after($split, $this);
618
     $this->get_parent()->insert_child_after($split, $this);
595
-    
619
+
620
+
596
     // Add $frame and all following siblings to the new split node
621
     // Add $frame and all following siblings to the new split node
597
     $iter = $child;
622
     $iter = $child;
598
     while ($iter) {
623
     while ($iter) {
624
+
599
       $frame = $iter;
625
       $frame = $iter;
600
       $iter = $iter->get_next_sibling();
626
       $iter = $iter->get_next_sibling();
601
       $frame->reset();
627
       $frame->reset();
602
       $split->append_child($frame);
628
       $split->append_child($frame);
603
     }
629
     }
604
-    
630
+
631
+
605
     $this->get_parent()->split($split, $force_pagebreak);
632
     $this->get_parent()->split($split, $force_pagebreak);
606
-    
633
+
607
     // If this node resets a counter save the current value to use when rendering on the next page
634
     // If this node resets a counter save the current value to use when rendering on the next page
608
-    if ( $style->counter_reset && ( $reset = $style->counter_reset ) !== "none" ) {
609
-      $vars = preg_split( '/\s+/' , trim( $reset ) , 2 );
610
-      $split->_counters[ '__' . $vars[0] ] = $this->lookup_counter_frame( $vars[0] )->_counters[$vars[0]];
635
+    if ($style->counter_reset && ($reset = $style->counter_reset) !== "none") {
636
+      $vars = preg_split('/\s+/', trim($reset), 2);
637
+      $split->_counters['__' . $vars[0]] = $this->lookup_counter_frame($vars[0])->_counters[$vars[0]];
611
     }
638
     }
612
   }
639
   }
613
 
640
 
614
-  function reset_counter($id = self::DEFAULT_COUNTER, $value = 0) {
641
+
642
+  function reset_counter($id = self::DEFAULT_COUNTER, $value = 0)
643
+  {
615
     $this->get_parent()->_counters[$id] = intval($value);
644
     $this->get_parent()->_counters[$id] = intval($value);
616
   }
645
   }
617
-  
618
-  function decrement_counters($counters) {
619
-    foreach($counters as $id => $increment) {
646
+
647
+  function decrement_counters($counters)
648
+  {
649
+    foreach ($counters as $id => $increment) {
620
       $this->increment_counter($id, intval($increment) * -1);
650
       $this->increment_counter($id, intval($increment) * -1);
621
     }
651
     }
622
   }
652
   }
623
-  
624
-  function increment_counters($counters) {
625
-    foreach($counters as $id => $increment) {
653
+
654
+
655
+  function increment_counters($counters)
656
+  {
657
+    foreach ($counters as $id => $increment) {
626
       $this->increment_counter($id, intval($increment));
658
       $this->increment_counter($id, intval($increment));
627
     }
659
     }
628
   }
660
   }
629
 
661
 
630
-  function increment_counter($id = self::DEFAULT_COUNTER, $increment = 1) {
662
+  function increment_counter($id = self::DEFAULT_COUNTER, $increment = 1)
663
+  {
631
     $counter_frame = $this->lookup_counter_frame($id);
664
     $counter_frame = $this->lookup_counter_frame($id);
632
 
665
 
633
-    if ( $counter_frame ) {
634
-      if ( !isset($counter_frame->_counters[$id]) ) {
666
+    if ($counter_frame) {
667
+      if (!isset($counter_frame->_counters[$id])) {
635
         $counter_frame->_counters[$id] = 0;
668
         $counter_frame->_counters[$id] = 0;
636
       }
669
       }
637
-      
670
+
638
       $counter_frame->_counters[$id] += $increment;
671
       $counter_frame->_counters[$id] += $increment;
639
     }
672
     }
640
   }
673
   }
641
-  
642
-  function lookup_counter_frame($id = self::DEFAULT_COUNTER) {
674
+
675
+  function lookup_counter_frame($id = self::DEFAULT_COUNTER)
676
+  {
643
     $f = $this->get_parent();
677
     $f = $this->get_parent();
644
-    
645
-    while( $f ) {
646
-      if( isset($f->_counters[$id]) ) {
678
+
679
+    while ($f) {
680
+      if (isset($f->_counters[$id])) {
647
         return $f;
681
         return $f;
648
       }
682
       }
649
       $fp = $f->get_parent();
683
       $fp = $f->get_parent();
650
-      
651
-      if ( !$fp ) {
684
+
685
+      if (!$fp) {
652
         return $f;
686
         return $f;
653
       }
687
       }
654
-      
688
+
655
       $f = $fp;
689
       $f = $fp;
656
     }
690
     }
657
   }
691
   }
658
 
692
 
659
   // TODO: What version is the best : this one or the one in List_Bullet_Renderer ?
693
   // TODO: What version is the best : this one or the one in List_Bullet_Renderer ?
660
-  function counter_value($id = self::DEFAULT_COUNTER, $type = "decimal") {
694
+  function counter_value($id = self::DEFAULT_COUNTER, $type = "decimal")
695
+  {
661
     $type = mb_strtolower($type);
696
     $type = mb_strtolower($type);
662
-    
663
-    if ( !isset($this->_counters[$id]) ) {
697
+
698
+    if (!isset($this->_counters[$id])) {
664
       $this->_counters[$id] = 0;
699
       $this->_counters[$id] = 0;
665
     }
700
     }
666
 
701
 
667
     $value = $this->_counters[$id];
702
     $value = $this->_counters[$id];
668
-    
703
+
669
     switch ($type) {
704
     switch ($type) {
670
       default:
705
       default:
671
       case "decimal":
706
       case "decimal":
672
         return $value;
707
         return $value;
673
-  
708
+
674
       case "decimal-leading-zero":
709
       case "decimal-leading-zero":
675
         return str_pad($value, 2, "0");
710
         return str_pad($value, 2, "0");
676
-  
711
+
677
       case "lower-roman":
712
       case "lower-roman":
678
         return dec2roman($value);
713
         return dec2roman($value);
679
-  
714
+
680
       case "upper-roman":
715
       case "upper-roman":
681
         return mb_strtoupper(dec2roman($value));
716
         return mb_strtoupper(dec2roman($value));
682
-  
717
+
683
       case "lower-latin":
718
       case "lower-latin":
684
       case "lower-alpha":
719
       case "lower-alpha":
685
-        return chr( ($value % 26) + ord('a') - 1);
686
-  
720
+        return chr(($value % 26) + ord('a') - 1);
721
+
687
       case "upper-latin":
722
       case "upper-latin":
688
       case "upper-alpha":
723
       case "upper-alpha":
689
-        return chr( ($value % 26) + ord('A') - 1);
690
-  
724
+        return chr(($value % 26) + ord('A') - 1);
725
+
691
       case "lower-greek":
726
       case "lower-greek":
692
         return unichr($value + 944);
727
         return unichr($value + 944);
693
-  
728
+
694
       case "upper-greek":
729
       case "upper-greek":
695
         return unichr($value + 912);
730
         return unichr($value + 912);
696
     }
731
     }
697
   }
732
   }
698
 
733
 
699
-  final function position() {
734
+  final function position()
735
+  {
700
     $this->_positioner->position();
736
     $this->_positioner->position();
701
   }
737
   }
702
-  
703
-  final function move($offset_x, $offset_y, $ignore_self = false) {
704
-    $this->_positioner->move($offset_x, $offset_y, $ignore_self); 
738
+
739
+  final function move($offset_x, $offset_y, $ignore_self = false)
740
+  {
741
+    $this->_positioner->move($offset_x, $offset_y, $ignore_self);
705
   }
742
   }
706
-  
707
-  final function reflow(Block_Frame_Decorator $block = null) {
743
+
744
+  final function reflow(Block_Frame_Decorator $block = null)
745
+  {
708
     // Uncomment this to see the frames before they're laid out, instead of
746
     // Uncomment this to see the frames before they're laid out, instead of
709
     // during rendering.
747
     // during rendering.
710
     //echo $this->_frame; flush();
748
     //echo $this->_frame; flush();
711
     $this->_reflower->reflow($block);
749
     $this->_reflower->reflow($block);
712
   }
750
   }
713
 
751
 
714
-  final function get_min_max_width() {
752
+  final function get_min_max_width()
753
+  {
715
     return $this->_reflower->get_min_max_width();
754
     return $this->_reflower->get_min_max_width();
716
   }
755
   }
717
-}
756
+}