|
@@ -73,7 +73,7 @@
|
73
|
73
|
|
74
|
74
|
<select id ="semester_id" name="semester_id" class="form-control selectpicker">
|
75
|
75
|
@foreach ($semesters as $semester)
|
76
|
|
- @if (Input::old('semester_prof') != $semester->id)
|
|
76
|
+ @if (Input::old('semester_id') != $semester->id)
|
77
|
77
|
<option value="{{ $semester->id }}">{{ $semester->name }}</option>
|
78
|
78
|
@else
|
79
|
79
|
<option selected value="{{ $semester->id }}">{{ $semester->name }}</option>
|
|
@@ -82,6 +82,22 @@
|
82
|
82
|
</select>
|
83
|
83
|
</div>
|
84
|
84
|
|
|
85
|
+
|
|
86
|
+ <div class = "form-group">
|
|
87
|
+ {{Form::label('modality','Course Modality')}}
|
|
88
|
+
|
|
89
|
+ <select id="modality" name = "modality" class= "form-control selectpicker">
|
|
90
|
+ @foreach($modalities as $modality)
|
|
91
|
+ @if (Input::old('modality') != $modality)
|
|
92
|
+ <option value="{{ $modality }}">{{ $modality }}</option>
|
|
93
|
+ @else
|
|
94
|
+ <option selected value="{{ $modality }}">{{ $modality }}</option>
|
|
95
|
+ @endif
|
|
96
|
+
|
|
97
|
+ @endforeach
|
|
98
|
+ </select>
|
|
99
|
+ </div>
|
|
100
|
+
|
85
|
101
|
<div class ="form-group">
|
86
|
102
|
<label for="file">Choose student text file</label>
|
87
|
103
|
<input type="file"
|
|
@@ -118,52 +134,118 @@
|
118
|
134
|
<div class="col-md-6">
|
119
|
135
|
<div class="panel panel-default panel-button">
|
120
|
136
|
<div class="panel-heading">
|
121
|
|
- Reassign Sections' Professors
|
|
137
|
+ Edit Course
|
122
|
138
|
</div>
|
123
|
139
|
<div class="panel-body">
|
124
|
140
|
|
125
|
|
- <p>Use this to reassign a section to a specific professor. Write down the code, number and section of
|
126
|
|
- the course. Then, choose a professor from the list. <strong>All fields are required.</strong></p>
|
127
|
141
|
|
128
|
|
- {{ Form::open(['action' => 'CoursesController@update']) }}
|
129
|
142
|
|
|
143
|
+ <p>You can enroll students in this setting, by choosing the course and uploading a .txt file with the students numbers</p>
|
|
144
|
+
|
|
145
|
+ {{ Form::open(['action' => 'CoursesController@updateCourseInfo', 'enctype'=>"multipart/form-data"]) }}
|
|
146
|
+ <button class="btn btn-md btn-secondary filterButton">
|
|
147
|
+ <span class="glyphicon glyphicon-minus">
|
|
148
|
+ </span>
|
|
149
|
+ Filters
|
|
150
|
+ </button>
|
|
151
|
+ <div class="filterSection">
|
|
152
|
+ <br>
|
|
153
|
+ <div class="form-group">
|
|
154
|
+ {{ Form::label('program_id2', 'Associated Program') }}
|
|
155
|
+ <select id='select-program' class="form-control selectpicker"
|
|
156
|
+ onchange='fetchCourses("#select-program", "#select-semester")'>
|
|
157
|
+
|
|
158
|
+ @foreach ($programs as $program)
|
|
159
|
+ <option value='{{ $program->id }}' data-subtext="{{ $program->code }}">
|
|
160
|
+ {{ $program->name }}</option>
|
|
161
|
+ @endforeach
|
|
162
|
+
|
|
163
|
+ </select>
|
|
164
|
+ </div>
|
|
165
|
+
|
|
166
|
+ <div class="form-group">
|
|
167
|
+ {{ Form::label('semester_assoc', 'Course Semester') }}
|
|
168
|
+ <select id='select-semester' class="form-control selectpicker"
|
|
169
|
+ onchange='fetchCourses("#select-program", "#select-semester")'>
|
|
170
|
+
|
|
171
|
+ @foreach ($semesters as $semester)
|
|
172
|
+ <option value='{{ $semester->id }}' data-subtext="{{ $semester->code }}">
|
|
173
|
+ {{ $semester->name }}</option>
|
|
174
|
+ @endforeach
|
|
175
|
+
|
|
176
|
+ </select>
|
|
177
|
+ </div>
|
|
178
|
+
|
|
179
|
+ </div>
|
|
180
|
+ <hr>
|
|
181
|
+ <div class = "form-group">
|
|
182
|
+ {{Form::label('select_course', "Course")}}
|
|
183
|
+ <select id = "select-course" name = "select-course" class ='form-control selectpicker'
|
|
184
|
+ onchange = "fetchCourseInfo('#select-course')">
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+ </select>
|
|
188
|
+ </div>
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+ <div class="form-group">
|
|
192
|
+ {{ Form::label("name",'Name')}}
|
|
193
|
+ {{ Form::text('name', Input::old('name'), ['class'=>'form-control', 'placeholder' => "Introducción a la ...", 'id'=> 'edit_name'])}}
|
|
194
|
+ </div>
|
130
|
195
|
<div class="form-group">
|
131
|
|
- {{ Form::label('code_prof', 'Code') }}
|
132
|
|
- {{ Form::text('code_prof', Input::old('code_prof'), ['class' => 'form-control', 'placeholder' => 'TEST', 'maxLength' => 4]) }}
|
|
196
|
+ {{ Form::label('code', 'Code') }}
|
|
197
|
+ {{ Form::text('code', Input::old('code'), ['class' => 'form-control', 'placeholder' => 'TEST', 'maxLength' => 4, 'id'=> 'edit_code']) }}
|
133
|
198
|
</div>
|
134
|
199
|
|
135
|
200
|
<div class="form-group">
|
136
|
|
- {{ Form::label('number_prof', 'Number') }}
|
137
|
|
- {{ Form::text('number_prof', Input::old('number_prof'), ['class' => 'form-control', 'placeholder' => '3001', 'maxLength' => 4]) }}
|
|
201
|
+ {{ Form::label('number', 'Number') }}
|
|
202
|
+ {{ Form::text('number', Input::old('number'), ['class' => 'form-control', 'placeholder' => '3001', 'maxLength' => 4, 'id'=> 'edit_number']) }}
|
138
|
203
|
</div>
|
139
|
204
|
|
140
|
205
|
<div class="form-group">
|
141
|
|
- {{ Form::label('section_prof', 'Section') }}
|
142
|
|
- {{ Form::text('section_prof', Input::old('section_prof'), ['class' => 'form-control', 'placeholder' => '001', 'maxLength' => 3]) }}
|
|
206
|
+ {{ Form::label('section', 'Section') }}
|
|
207
|
+ {{ Form::text('section', Input::old('section'), ['class' => 'form-control', 'placeholder' => '001', 'maxLength' => 3, 'id'=> 'edit_section']) }}
|
143
|
208
|
</div>
|
144
|
209
|
|
145
|
210
|
<!-- Program -->
|
146
|
|
- {{--
|
147
|
211
|
<div class="form-group">
|
148
|
|
- {{ Form::label('user_prof', 'User') }}
|
149
|
|
- <select id="user_prof" name="user_prof" class="form-control">
|
150
|
|
- @foreach ($users as $user)
|
151
|
|
- @if (Input::old('user_prof') != $user->id)
|
152
|
|
- <option value="{{ $user->id }}">{{ $user->surnames }},
|
153
|
|
- {{ $user->first_name }}</option>
|
|
212
|
+ {{ Form::label('program', 'Program') }}
|
|
213
|
+ <select id="edit_program" name="program" class="form-control selectpicker">
|
|
214
|
+
|
|
215
|
+ @foreach ($programs as $program)
|
|
216
|
+ @if (Input::old('program') != $program->id)
|
|
217
|
+ <option value="{{ $program->id }}">{{ $program->name }}
|
|
218
|
+ ({{ $program->school->name }})</option>
|
154
|
219
|
@else
|
155
|
|
- <option selected value="{{ $user->id }}">{{ $user->surnames }},
|
156
|
|
- {{ $user->first_name }}</option>
|
|
220
|
+ <option selected value="{{ $program->id }}">{{ $program->name }}
|
|
221
|
+ ({{ $program->school->name }})</option>
|
157
|
222
|
@endif
|
158
|
223
|
@endforeach
|
159
|
224
|
</select>
|
160
|
225
|
</div>
|
161
|
|
- --}}
|
162
|
226
|
|
163
|
|
- <!-- Semester -->
|
164
|
227
|
<div class="form-group">
|
165
|
|
- {{ Form::label('semester_prof', 'Semester') }}
|
166
|
|
- <select id="semester_prof" name="semester_prof" class="form-control selectpicker">
|
|
228
|
+ {{ Form::label('user_id', 'Professor') }}
|
|
229
|
+ <select id="edit_professor_id" name="professor_id" class="form-control selectpicker">
|
|
230
|
+ @foreach ($professors as $professor)
|
|
231
|
+ @if (Input::old('professor_id') != $professor->id )
|
|
232
|
+ <option value="{{$professor->id}}">{{ $professor->surnames }}, {{$professor->first_name}}
|
|
233
|
+ {{-- $professor->program->name --}}</option>
|
|
234
|
+ @else
|
|
235
|
+ <option selected value="{{ $professor->id }}">{{ $professor->name }}
|
|
236
|
+ {{-- $professor->program->name --}}</option>
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+ @endif
|
|
241
|
+ @endforeach
|
|
242
|
+ </select>
|
|
243
|
+ </div>
|
|
244
|
+
|
|
245
|
+ <div class ="form-group">
|
|
246
|
+ {{ Form::label("semester_id",'Semester')}}
|
|
247
|
+
|
|
248
|
+ <select id ="edit_semester_id" name="semester_id" class="form-control selectpicker">
|
167
|
249
|
@foreach ($semesters as $semester)
|
168
|
250
|
@if (Input::old('semester_prof') != $semester->id)
|
169
|
251
|
<option value="{{ $semester->id }}">{{ $semester->name }}</option>
|
|
@@ -174,15 +256,114 @@
|
174
|
256
|
</select>
|
175
|
257
|
</div>
|
176
|
258
|
|
|
259
|
+ <div class = "form-group">
|
|
260
|
+ {{Form::label('modality','Course Modality')}}
|
|
261
|
+
|
|
262
|
+ <select id="edit_modality" name = "modality" class= "form-control selectpicker">
|
|
263
|
+ @foreach($modalities as $modality)
|
|
264
|
+ @if (Input::old('modality') != $modality)
|
|
265
|
+ <option value="{{ $modality }}">{{ $modality }}</option>
|
|
266
|
+ @else
|
|
267
|
+ <option selected value="{{ $modality }}">{{ $modality }}</option>
|
|
268
|
+ @endif
|
|
269
|
+
|
|
270
|
+ @endforeach
|
|
271
|
+ </select>
|
|
272
|
+ </div>
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+ <div class ="form-group">
|
|
276
|
+ <label for="file">Choose student text file</label>
|
|
277
|
+ <input type="file"
|
|
278
|
+ id="edit_students" class="form-control" name="students"
|
|
279
|
+ accept=".txt">
|
|
280
|
+ </div>
|
|
281
|
+
|
177
|
282
|
<br>
|
178
|
283
|
|
179
|
|
- {{ Form::submit('Create Course', ['class' => 'btn btn-primary btn-block', 'name' => 'create_professor']) }}
|
|
284
|
+ {{ Form::submit('Edit Course', ['class' => 'btn btn-primary btn-block', 'name' => 'edit_course_info']) }}
|
180
|
285
|
{{ Form::close() }}
|
181
|
286
|
|
182
|
287
|
</div>
|
183
|
288
|
</div>
|
184
|
289
|
</div>
|
185
|
290
|
</div>
|
|
291
|
+
|
|
292
|
+ <script>
|
|
293
|
+ $('.filterSection').show();
|
|
294
|
+ $('.filterButton').on('click', function() {
|
|
295
|
+ var span = $(this).find('span');
|
|
296
|
+ if (span.attr('class') == 'glyphicon glyphicon-plus') {
|
|
297
|
+ span.attr('class', 'glyphicon glyphicon-minus');
|
|
298
|
+ } else {
|
|
299
|
+ span.attr('class', 'glyphicon glyphicon-plus');
|
|
300
|
+ }
|
|
301
|
+ $('.filterSection').toggle(533);
|
|
302
|
+ });
|
|
303
|
+ $('.filterButton').on('click', function(e) {
|
|
304
|
+ // Prevent the default action of the clicked item. In this case that is submit
|
|
305
|
+ e.preventDefault();
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+ return false;
|
|
309
|
+ });
|
|
310
|
+
|
|
311
|
+ function fetchCourses(select, semester){
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+ program_id = $(select).val();
|
|
316
|
+ semester_id = $(semester).val();
|
|
317
|
+ $.post(
|
|
318
|
+ "{{URL::action('CoursesController@fetchCourses')}}",
|
|
319
|
+ {
|
|
320
|
+ program_id:program_id,
|
|
321
|
+ semester_id:semester_id
|
|
322
|
+ },
|
|
323
|
+ function(courses){
|
|
324
|
+ $('#select-course').html(
|
|
325
|
+ " "
|
|
326
|
+ )
|
|
327
|
+ $.each(courses, function(ind, course){
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+ option = "<option value= '"+course.id+"' data-subtext ='"+course.code+course.number+"'"+
|
|
331
|
+ "data-code='"+course.code+"' data-number='"+course.number+"' data-program-id='"+course.program_id+"'"+
|
|
332
|
+ "data-section='"+course.section+"' data-user-id='"+course.user_id+"' data-semester-id = '"+course.semester_id+"'"+
|
|
333
|
+ "data-modality='"+course.modality+"' "+
|
|
334
|
+ ">"+course.name+"</option>";
|
|
335
|
+ $("#select-course").append(option);
|
|
336
|
+ });
|
|
337
|
+ $("#select-course").trigger('change');
|
|
338
|
+ $("#select-course").selectpicker('refresh');
|
|
339
|
+ }
|
|
340
|
+ )
|
|
341
|
+ }
|
|
342
|
+
|
|
343
|
+ function fetchCourseInfo(course_select){
|
|
344
|
+
|
|
345
|
+ course_option = $(course_select).find(':selected');
|
|
346
|
+
|
|
347
|
+ $('#edit_name').val($(course_option).html())
|
|
348
|
+ $('#edit_code').val($(course_option).data('code'))
|
|
349
|
+ $('#edit_number').val($(course_option).data('number'))
|
|
350
|
+ $('#edit_section').val($(course_option).data('section'))
|
|
351
|
+ $('#edit_program').val($(course_option).data('program-id'))
|
|
352
|
+ $("#edit_program").selectpicker('refresh');
|
|
353
|
+ $('#edit_professor_id').val($(course_option).data('user-id'))
|
|
354
|
+ $("#edit_professor_id").selectpicker('refresh');
|
|
355
|
+
|
|
356
|
+ $('#edit_semester_id').val($(course_option).data('semester-id'))
|
|
357
|
+ $("#edit_semester_id").selectpicker('refresh');
|
|
358
|
+
|
|
359
|
+ $('#edit_modality').val($(course_option).data('modality'))
|
|
360
|
+ $("#edit_modality").selectpicker('refresh');
|
|
361
|
+ $(course_select).selectpicker('refresh');
|
|
362
|
+
|
|
363
|
+ }
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+ </script>
|
186
|
367
|
@stop
|
187
|
368
|
|
188
|
369
|
@section('javascript')
|