Przeglądaj źródła

Bug de three year plans

rodzic
commit
7406e4fc83

+ 4
- 4
app/controllers/ThreeYearPlanController.php Wyświetl plik

@@ -251,7 +251,7 @@ class ThreeYearPlanController extends \BaseController
251 251
 
252 252
     // get program_id
253 253
     $user_id = auth::user()->id;
254
-
254
+    Log::info(Input::all());
255 255
 
256 256
     // get typ_program_id
257 257
     $result = DB::table('typ_program')
@@ -691,7 +691,7 @@ class ThreeYearPlanController extends \BaseController
691 691
 
692 692
   public function printPlan($program_id, $typ)
693 693
   {
694
-	$view=0;
694
+    $view = 0;
695 695
 
696 696
     $program = DB::table('programs')->where('id', $program_id)->first();
697 697
     $three_year_plan = DB::table('three_year_plan')->where('id', $typ)->first();
@@ -736,10 +736,10 @@ class ThreeYearPlanController extends \BaseController
736 736
 
737 737
     return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome', 'view'));
738 738
   }
739
-  
739
+
740 740
   public function viewPlan($program_id, $typ)
741 741
   {
742
-	$view=1;
742
+    $view = 1;
743 743
     $program = DB::table('programs')->where('id', $program_id)->first();
744 744
     $three_year_plan = DB::table('three_year_plan')->where('id', $typ)->first();
745 745
 

BIN
app/storage/three_year_plan_pdfs/09-05-2022-for-89-by-206.pdf Wyświetl plik


+ 51
- 58
app/views/global/print_three_year_plan.blade.php Wyświetl plik

@@ -4,8 +4,7 @@ echo '<html>';
4 4
 echo '<body>';
5 5
 
6 6
 //Inline styles (only for printing)
7
-echo
8
-'<style type="text/css">
7
+echo '<style type="text/css">
9 8
     body
10 9
     {
11 10
         font-family: "Arial", sans-serif;
@@ -93,82 +92,76 @@ echo
93 92
     @media print{@page {size: landscape}}
94 93
 </style>';
95 94
 
96
-if(!$view) 
97
-{
98
-	echo '<style type="text/css" media="print">
95
+echo '<style type="text/css" media="print">
99 96
 	  @page { size: landscape; }
100 97
 	</style>';
101
-}
98
+
102 99
 ?>
103 100
 <img class="logo" src="{{ asset('images/logo_uprrp_bw.png') }}" alt="UPRRP Logo">
104 101
 
105
-<div class="header"><p class="header-text">University of Puerto Rico, Río Piedras Campus</p>
106
-<p class="header-text">Online Learning Assessment System</p>
102
+<div class="header">
103
+    <p class="header-text">University of Puerto Rico, Río Piedras Campus</p>
104
+    <p class="header-text">Online Learning Assessment System</p>
107 105
 
108
-<h1 class="header-text">Three Year Plan for {{$program->name}} from {{$three_year_plan->year_start}} to {{$three_year_plan->year_end}}</h1></div>
106
+    <h1 class="header-text">Three Year Plan for {{ $program->name }} from {{ $three_year_plan->year_start }} to
107
+        {{ $three_year_plan->year_end }}</h1>
108
+</div>
109 109
 
110 110
 
111 111
 
112
-@foreach($typ_semesters as $semester)
113
-    <br>
114
-    <br>
115
-    <h2 class ='header-text'>{{$semester->name}}</h2>
112
+@foreach ($typ_semesters as $semester)
116 113
     <br>
117
-    @foreach($typ_semester_outcome[$semester->semester_id] as $outcome)
118
-
119
-    <span><h3>{{$outcome->name}}</h3></span>
120
-    <table class="table table-striped table-condensed" style = "table-layout: fixed">
121
-    <thead>
122
-        <tr>
123
-        
124
-        <th>Objectives</th>
125
-        <th>Courses</th>
126
-        
127
-        </tr>
128
-    </thead>
129
-    <tbody>
130
-
131
-        @foreach($outcome->objectives as $index=> $objective)
132
-        <tr>
133
-       
134
-        <td>
135
-            {{ $index + 1 }}. {{$objective->text}}
136
-        </td>
137
-        <td>
138
-            <ol>
139
-            @foreach($objective->courses as $course)
140
-            
141
-    <li>[{{$course->code}}{{$course->number}}] {{$course->name}}</li>
142
-            
143
-            @endforeach
144
-        </ol>
145
-
146
-        </tr>     
147
-          @endforeach
148
-
149
-    </tbody>
150
-    </table>
151 114
     <br>
115
+    <h2 class='header-text'>{{ $semester->name }}</h2>
152 116
     <br>
153
-  
154
-
155
-@endforeach
156
-
117
+    @foreach ($typ_semester_outcome[$semester->semester_id] as $outcome)
118
+        <span>
119
+            <h3>{{ $outcome->name }}</h3>
120
+        </span>
121
+        <table class="table table-striped table-condensed" style="table-layout: fixed">
122
+            <thead>
123
+                <tr>
124
+
125
+                    <th>Objectives</th>
126
+                    <th>Courses</th>
127
+
128
+                </tr>
129
+            </thead>
130
+            <tbody>
131
+
132
+                @foreach ($outcome->objectives as $index => $objective)
133
+                    <tr>
134
+
135
+                        <td>
136
+                            {{ $index + 1 }}. {{ $objective->text }}
137
+                        </td>
138
+                        <td>
139
+                            <ol>
140
+                                @foreach ($objective->courses as $course)
141
+                                    <li>[{{ $course->code }}{{ $course->number }}] {{ $course->name }}</li>
142
+                                @endforeach
143
+                            </ol>
144
+
145
+                    </tr>
146
+                @endforeach
147
+
148
+            </tbody>
149
+        </table>
150
+        <br>
151
+        <br>
152
+    @endforeach
157 153
 @endforeach
158 154
 
159 155
 <?php
160 156
 
161 157
 echo '</body>';
162 158
 echo '</html>';
163
-if(!$view)
164
-{
159
+
165 160
 ?>
166 161
 
167 162
 <script type="text/javascript">
168
-
169
-window.print();
170
-
163
+    window.print();
171 164
 </script>
172 165
 <?php
173
-}
174
-?>
166
+
167
+?>

+ 14
- 5
app/views/global/view-three-year-plan.blade.php Wyświetl plik

@@ -103,7 +103,7 @@
103 103
             </div>
104 104
             <br>
105 105
             <!--<button type="button" class="btn btn-secondary" id = "three_year_button" data-toggle="modal" data-target="#three_year">Create Three Year Cycle</button>
106
-                              -->
106
+                                                                                                                                      -->
107 107
         </div>
108 108
 
109 109
         <!-- Modal -->
@@ -256,7 +256,7 @@
256 256
                                             <option class="default-option" value="nothing_selected">Select a course</option>
257 257
                                         </select>
258 258
                                         <button class="btn btn-md btn-primary delete-selection-0"
259
-                                            style="margin:5px;"><span></span> X</button>
259
+                                            style="margin:5px; "><span></span> X</button>
260 260
                                     </div>
261 261
                                     <div class="clone-objective-course-select-0">
262 262
                                         <button class="btn btn-md btn-secondary add-objective-course"
@@ -349,7 +349,9 @@
349 349
                                 outcome_id: (outcome_id),
350 350
                                 semester_id: (semester_id),
351 351
                                 new_objective_id: (new_objective_id),
352
-                                program_id: {{ $program_id }}
352
+                                program_id: {{ $program_id }},
353
+
354
+
353 355
 
354 356
                             },
355 357
                             function(data) {
@@ -658,6 +660,9 @@
658 660
                                 select_area.find('.clone-objective-course-select-0')
659 661
                                     .before(new_select);
660 662
                                 select_area.find('.objective-selector').show();
663
+                                objective_selector = select_area.find(
664
+                                    '.objective-selector');
665
+                                objective_selector.find(".delete-selection-0").show();
661 666
                             });
662 667
                             area.append(select_area);
663 668
                         });
@@ -758,6 +763,7 @@
758 763
                                 new_select.find('.objective-selector-0').before(
759 764
                                     '<p>Objective: <b>' + objective_text +
760 765
                                     '</b></p>');
766
+
761 767
                                 {{-- new_select.find('.objective-selector-0 select').attr('style','width:100%;max-width:25%;'); --}}
762 768
                                 $.each(objective.available_courses, function(index,
763 769
                                     course) {
@@ -832,7 +838,9 @@
832 838
                         area.append('<br>');
833 839
                         area.show(true);
834 840
                         $('.courses-section').append(area);
841
+
835 842
                     });
843
+                    //$('.objective-selector').children('.delete-selection-0').css("margin:5px; display:block;");
836 844
                 }
837 845
             );
838 846
         });
@@ -891,7 +899,7 @@
891 899
                     var x = $(this).parent().parent().attr('class');
892 900
                     if ($(this).parent().attr('class') == 'objective-selector-0') {
893 901
                         // if it is then hide it 
894
-                        $(this).parent().parent().hide();
902
+                        $(this).parent().hide();
895 903
                         return true;
896 904
 
897 905
                     }
@@ -906,7 +914,8 @@
906 914
                         previous_objective_id: (previous_objective_id),
907 915
                         outcome_id: (outcome_id),
908 916
                         semester_id: (semester_id),
909
-                        new_objective_id: (new_objective_id)
917
+                        new_objective_id: (new_objective_id),
918
+                        program_id: {{ $program_id }},
910 919
                     },
911 920
                     function(data) {
912 921
                         //