|
@@ -5,6 +5,7 @@ use Illuminate\Database\Eloquent\Collection;
|
5
|
5
|
class ThreeYearPlanController extends \BaseController
|
6
|
6
|
{
|
7
|
7
|
|
|
8
|
+ // load the Three year Plan page
|
8
|
9
|
public function threeYearsReport()
|
9
|
10
|
{
|
10
|
11
|
$user_id = auth::user()->id;
|
|
@@ -19,22 +20,15 @@ class ThreeYearPlanController extends \BaseController
|
19
|
20
|
->where('deactivation_date','=','0000-00-00')
|
20
|
21
|
->orWhereNull('deactivation_date')
|
21
|
22
|
->get();
|
22
|
|
- // $outcomes = DB::table('outcomes')
|
23
|
|
- // ->orderBy('name', 'asc')
|
24
|
|
- // ->get();
|
25
|
23
|
$typs = DB::table('three_year_plan')
|
26
|
24
|
->orderBy('year_start', 'asc')
|
27
|
25
|
->get();
|
28
|
26
|
$criteria = Criterion::withTrashed()->orderBy('name', 'ASC')->get();
|
29
|
|
- // $criteria = DB::table('criteria')
|
30
|
|
- // ->orderBy('name', 'asc')
|
31
|
|
- // ->get();
|
32
|
27
|
$program_id = DB::table('program_user')
|
33
|
28
|
->where('user_id',$user_id)
|
34
|
|
- // ->where('user_id',8) //voy a usar 8 porque user 60 no tiene
|
35
|
29
|
->select('program_id')
|
36
|
30
|
->get();
|
37
|
|
- $program_id = $program_id[0]->program_id; //program id 15 debido al user 8
|
|
31
|
+ $program_id = $program_id[0]->program_id;
|
38
|
32
|
|
39
|
33
|
// se annadio la nueva variable
|
40
|
34
|
return View::make('global.view-three-year-plan', compact('title', 'outcomes', 'typs', 'criteria', 'semesters', 'program_id'));
|
|
@@ -42,6 +36,7 @@ class ThreeYearPlanController extends \BaseController
|
42
|
36
|
}
|
43
|
37
|
|
44
|
38
|
|
|
39
|
+ //when the user select a three year period from the left column, load the corresponding info
|
45
|
40
|
public function fetchThreeYears()
|
46
|
41
|
{
|
47
|
42
|
$id = Input::get('id');
|
|
@@ -49,7 +44,6 @@ class ThreeYearPlanController extends \BaseController
|
49
|
44
|
$semesters = DB::table('typ_semesters')
|
50
|
45
|
->join('semesters','semesters.id','=','typ_semesters.semester_id')
|
51
|
46
|
->where('typ_semesters.typ_id',$id)
|
52
|
|
- // ->select('semesters.*')
|
53
|
47
|
->orderBy('typ_semesters.semester_id', 'asc')
|
54
|
48
|
->get();
|
55
|
49
|
$typs = DB::table('three_year_plan')
|
|
@@ -66,18 +60,18 @@ class ThreeYearPlanController extends \BaseController
|
66
|
60
|
);
|
67
|
61
|
}
|
68
|
62
|
|
|
63
|
+ // add or remove a semester associated with an outcome when a user selects a checkbox
|
69
|
64
|
public function update_typ_outcomes_semesters()
|
70
|
65
|
{
|
71
|
66
|
$outcomeSemesterArray = json_decode(Input::get('outcomeSemesterArray'), true);
|
72
|
67
|
$typ_id = Input::get('typ_id');
|
73
|
68
|
|
74
|
|
- $user_id = auth::user()->id; //ya, tester es 60
|
|
69
|
+ $user_id = auth::user()->id;
|
75
|
70
|
$program_id = DB::table('program_user')
|
76
|
71
|
->where('user_id',$user_id)
|
77
|
|
- // ->where('user_id',8) //voy a usar 8 porque user 60 no tiene
|
78
|
72
|
->select('program_id')
|
79
|
73
|
->get();
|
80
|
|
- $program_id = $program_id[0]->program_id; //program id 15 debido al user 8
|
|
74
|
+ $program_id = $program_id[0]->program_id;
|
81
|
75
|
|
82
|
76
|
|
83
|
77
|
$result = DB::table('typ_program')
|
|
@@ -158,6 +152,7 @@ class ThreeYearPlanController extends \BaseController
|
158
|
152
|
return;
|
159
|
153
|
}
|
160
|
154
|
|
|
155
|
+ // load semesters asociated with the outcomes if previously selected
|
161
|
156
|
public function lookup_typ_semester_outcome()
|
162
|
157
|
{
|
163
|
158
|
$box_value = array();
|
|
@@ -200,27 +195,22 @@ class ThreeYearPlanController extends \BaseController
|
200
|
195
|
);
|
201
|
196
|
}
|
202
|
197
|
|
|
198
|
+ // save or delete Objectives associated with the outcomes and semsters
|
203
|
199
|
public function section2_on_change()
|
204
|
200
|
{
|
205
|
201
|
$typ_id = Input::get('typ_id');
|
206
|
|
- // typ_id: (typ_id),
|
207
|
202
|
$outcome_id = Input::get('outcome_id');
|
208
|
|
- // outcome_id: (outcome_id),
|
209
|
203
|
$semester_id = Input::get('semester_id');
|
210
|
|
- // semester_id: (semester_id),
|
211
|
204
|
$previous_objective_id = Input::get('previous_objective_id');
|
212
|
|
- // previous_objective_id: (previous_objective_id),
|
213
|
205
|
$new_objective_id = Input::get('new_objective_id');
|
214
|
|
- // new_objective_id: (new_objective_id)
|
215
|
206
|
|
216
|
207
|
// get program_id
|
217
|
|
- $user_id = auth::user()->id; //ya, tester es 60
|
|
208
|
+ $user_id = auth::user()->id;
|
218
|
209
|
$program_id = DB::table('program_user')
|
219
|
210
|
->where('user_id',$user_id)
|
220
|
|
- // ->where('user_id',8) //voy a usar 8 porque user 60 no tiene
|
221
|
211
|
->select('program_id')
|
222
|
212
|
->get();
|
223
|
|
- $program_id = $program_id[0]->program_id; //program id 15 debido al user 8
|
|
213
|
+ $program_id = $program_id[0]->program_id;
|
224
|
214
|
|
225
|
215
|
// get typ_program_id
|
226
|
216
|
$result = DB::table('typ_program')
|
|
@@ -268,16 +258,16 @@ class ThreeYearPlanController extends \BaseController
|
268
|
258
|
return 'update was succes';
|
269
|
259
|
}
|
270
|
260
|
|
|
261
|
+ // load the corresponding info after associating semesters with outcomes
|
271
|
262
|
public function section2_arrive()
|
272
|
263
|
{
|
273
|
264
|
// get program_id
|
274
|
|
- $user_id = auth::user()->id; //ya, tester es 60
|
|
265
|
+ $user_id = auth::user()->id;
|
275
|
266
|
$program_id = DB::table('program_user')
|
276
|
267
|
->where('user_id',$user_id)
|
277
|
|
- // ->where('user_id',8) //voy a usar 8 porque user 60 no tiene
|
278
|
268
|
->select('program_id')
|
279
|
269
|
->get();
|
280
|
|
- $program_id = $program_id[0]->program_id; //program id 15 debido al user 8
|
|
270
|
+ $program_id = $program_id[0]->program_id;
|
281
|
271
|
|
282
|
272
|
// get typ_program_id
|
283
|
273
|
$typ_id = Input::get('typ_id');
|
|
@@ -363,16 +353,16 @@ class ThreeYearPlanController extends \BaseController
|
363
|
353
|
return $info;
|
364
|
354
|
}
|
365
|
355
|
|
|
356
|
+ // load the corresponding info after associating objectives to semesters outcomes
|
366
|
357
|
public function section3_arrive()
|
367
|
358
|
{
|
368
|
359
|
// get program_id
|
369
|
|
- $user_id = auth::user()->id; //ya, tester es 60
|
|
360
|
+ $user_id = auth::user()->id;
|
370
|
361
|
$program_id = DB::table('program_user')
|
371
|
362
|
->where('user_id',$user_id)
|
372
|
|
- // ->where('user_id',8) //voy a usar 8 porque user 60 no tiene
|
373
|
363
|
->select('program_id')
|
374
|
364
|
->get();
|
375
|
|
- $program_id = $program_id[0]->program_id; //program id 15 debido al user 8
|
|
365
|
+ $program_id = $program_id[0]->program_id;
|
376
|
366
|
|
377
|
367
|
// get typ_program_id
|
378
|
368
|
$typ_id = Input::get('typ_id');
|
|
@@ -473,30 +463,23 @@ class ThreeYearPlanController extends \BaseController
|
473
|
463
|
return $info;
|
474
|
464
|
}
|
475
|
465
|
|
476
|
|
-
|
|
466
|
+ // save or delete courses associated with objectives
|
477
|
467
|
public function section3_on_change()
|
478
|
468
|
{
|
479
|
469
|
$typ_id = Input::get('typ_id');
|
480
|
|
- // typ_id: (typ_id),
|
481
|
470
|
$outcome_id = Input::get('outcome_id');
|
482
|
|
- // outcome_id: (outcome_id),
|
483
|
471
|
$semester_id = Input::get('semester_id');
|
484
|
|
- // semester_id: (semester_id),
|
485
|
472
|
$objective_id = Input::get('objective_id');
|
486
|
|
- // objective_id: (objective_id),
|
487
|
473
|
$previous_course_id = Input::get('previous_course_id');
|
488
|
|
- // previous_course_id: (previous_course_id),
|
489
|
474
|
$new_course_id = Input::get('new_course_id');
|
490
|
|
- // new_course_id: (new_course_id)
|
491
|
475
|
|
492
|
476
|
// get program_id
|
493
|
|
- $user_id = auth::user()->id; //ya, tester es 60
|
|
477
|
+ $user_id = auth::user()->id;
|
494
|
478
|
$program_id = DB::table('program_user')
|
495
|
479
|
->where('user_id',$user_id)
|
496
|
|
- // ->where('user_id',8) //voy a usar 8 porque user 60 no tiene
|
497
|
480
|
->select('program_id')
|
498
|
481
|
->get();
|
499
|
|
- $program_id = $program_id[0]->program_id; //program id 15 debido al user 8
|
|
482
|
+ $program_id = $program_id[0]->program_id;
|
500
|
483
|
|
501
|
484
|
// get typ_program_id
|
502
|
485
|
$result = DB::table('typ_program')
|