Kaynağa Gözat

Bug de three year plans

Gabriel Santiago Plaza 2 yıl önce
ebeveyn
işleme
7406e4fc83

+ 4
- 4
app/controllers/ThreeYearPlanController.php Dosyayı Görüntüle

251
 
251
 
252
     // get program_id
252
     // get program_id
253
     $user_id = auth::user()->id;
253
     $user_id = auth::user()->id;
254
-
254
+    Log::info(Input::all());
255
 
255
 
256
     // get typ_program_id
256
     // get typ_program_id
257
     $result = DB::table('typ_program')
257
     $result = DB::table('typ_program')
691
 
691
 
692
   public function printPlan($program_id, $typ)
692
   public function printPlan($program_id, $typ)
693
   {
693
   {
694
-	$view=0;
694
+    $view = 0;
695
 
695
 
696
     $program = DB::table('programs')->where('id', $program_id)->first();
696
     $program = DB::table('programs')->where('id', $program_id)->first();
697
     $three_year_plan = DB::table('three_year_plan')->where('id', $typ)->first();
697
     $three_year_plan = DB::table('three_year_plan')->where('id', $typ)->first();
736
 
736
 
737
     return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome', 'view'));
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
   public function viewPlan($program_id, $typ)
740
   public function viewPlan($program_id, $typ)
741
   {
741
   {
742
-	$view=1;
742
+    $view = 1;
743
     $program = DB::table('programs')->where('id', $program_id)->first();
743
     $program = DB::table('programs')->where('id', $program_id)->first();
744
     $three_year_plan = DB::table('three_year_plan')->where('id', $typ)->first();
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 Dosyayı Görüntüle


+ 51
- 58
app/views/global/print_three_year_plan.blade.php Dosyayı Görüntüle

4
 echo '<body>';
4
 echo '<body>';
5
 
5
 
6
 //Inline styles (only for printing)
6
 //Inline styles (only for printing)
7
-echo
8
-'<style type="text/css">
7
+echo '<style type="text/css">
9
     body
8
     body
10
     {
9
     {
11
         font-family: "Arial", sans-serif;
10
         font-family: "Arial", sans-serif;
93
     @media print{@page {size: landscape}}
92
     @media print{@page {size: landscape}}
94
 </style>';
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
 	  @page { size: landscape; }
96
 	  @page { size: landscape; }
100
 	</style>';
97
 	</style>';
101
-}
98
+
102
 ?>
99
 ?>
103
 <img class="logo" src="{{ asset('images/logo_uprrp_bw.png') }}" alt="UPRRP Logo">
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
     <br>
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
     <br>
114
     <br>
115
+    <h2 class='header-text'>{{ $semester->name }}</h2>
152
     <br>
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
 @endforeach
153
 @endforeach
158
 
154
 
159
 <?php
155
 <?php
160
 
156
 
161
 echo '</body>';
157
 echo '</body>';
162
 echo '</html>';
158
 echo '</html>';
163
-if(!$view)
164
-{
159
+
165
 ?>
160
 ?>
166
 
161
 
167
 <script type="text/javascript">
162
 <script type="text/javascript">
168
-
169
-window.print();
170
-
163
+    window.print();
171
 </script>
164
 </script>
172
 <?php
165
 <?php
173
-}
174
-?>
166
+
167
+?>

+ 14
- 5
app/views/global/view-three-year-plan.blade.php Dosyayı Görüntüle

103
             </div>
103
             </div>
104
             <br>
104
             <br>
105
             <!--<button type="button" class="btn btn-secondary" id = "three_year_button" data-toggle="modal" data-target="#three_year">Create Three Year Cycle</button>
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
         </div>
107
         </div>
108
 
108
 
109
         <!-- Modal -->
109
         <!-- Modal -->
256
                                             <option class="default-option" value="nothing_selected">Select a course</option>
256
                                             <option class="default-option" value="nothing_selected">Select a course</option>
257
                                         </select>
257
                                         </select>
258
                                         <button class="btn btn-md btn-primary delete-selection-0"
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
                                     </div>
260
                                     </div>
261
                                     <div class="clone-objective-course-select-0">
261
                                     <div class="clone-objective-course-select-0">
262
                                         <button class="btn btn-md btn-secondary add-objective-course"
262
                                         <button class="btn btn-md btn-secondary add-objective-course"
349
                                 outcome_id: (outcome_id),
349
                                 outcome_id: (outcome_id),
350
                                 semester_id: (semester_id),
350
                                 semester_id: (semester_id),
351
                                 new_objective_id: (new_objective_id),
351
                                 new_objective_id: (new_objective_id),
352
-                                program_id: {{ $program_id }}
352
+                                program_id: {{ $program_id }},
353
+
354
+
353
 
355
 
354
                             },
356
                             },
355
                             function(data) {
357
                             function(data) {
658
                                 select_area.find('.clone-objective-course-select-0')
660
                                 select_area.find('.clone-objective-course-select-0')
659
                                     .before(new_select);
661
                                     .before(new_select);
660
                                 select_area.find('.objective-selector').show();
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
                             area.append(select_area);
667
                             area.append(select_area);
663
                         });
668
                         });
758
                                 new_select.find('.objective-selector-0').before(
763
                                 new_select.find('.objective-selector-0').before(
759
                                     '<p>Objective: <b>' + objective_text +
764
                                     '<p>Objective: <b>' + objective_text +
760
                                     '</b></p>');
765
                                     '</b></p>');
766
+
761
                                 {{-- new_select.find('.objective-selector-0 select').attr('style','width:100%;max-width:25%;'); --}}
767
                                 {{-- new_select.find('.objective-selector-0 select').attr('style','width:100%;max-width:25%;'); --}}
762
                                 $.each(objective.available_courses, function(index,
768
                                 $.each(objective.available_courses, function(index,
763
                                     course) {
769
                                     course) {
832
                         area.append('<br>');
838
                         area.append('<br>');
833
                         area.show(true);
839
                         area.show(true);
834
                         $('.courses-section').append(area);
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
                     var x = $(this).parent().parent().attr('class');
899
                     var x = $(this).parent().parent().attr('class');
892
                     if ($(this).parent().attr('class') == 'objective-selector-0') {
900
                     if ($(this).parent().attr('class') == 'objective-selector-0') {
893
                         // if it is then hide it 
901
                         // if it is then hide it 
894
-                        $(this).parent().parent().hide();
902
+                        $(this).parent().hide();
895
                         return true;
903
                         return true;
896
 
904
 
897
                     }
905
                     }
906
                         previous_objective_id: (previous_objective_id),
914
                         previous_objective_id: (previous_objective_id),
907
                         outcome_id: (outcome_id),
915
                         outcome_id: (outcome_id),
908
                         semester_id: (semester_id),
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
                     function(data) {
920
                     function(data) {
912
                         //
921
                         //