|
@@ -11,6 +11,7 @@ class ThreeYearPlanController extends \BaseController
|
11
|
11
|
DB::beginTransaction();
|
12
|
12
|
$yearStart = Input::get('years') + 0;
|
13
|
13
|
$yearEnd = $yearStart + 3;
|
|
14
|
+ $program_id = Input::get('program_id');
|
14
|
15
|
DB::insert("insert into three_year_plan (`year_start`, `year_end`) values ({$yearStart}, {$yearEnd})");
|
15
|
16
|
|
16
|
17
|
$typ = DB::table('three_year_plan')->where('year_start', '=', $yearStart)
|
|
@@ -30,13 +31,13 @@ class ThreeYearPlanController extends \BaseController
|
30
|
31
|
DB::commit();
|
31
|
32
|
Session::flash('status', 'success');
|
32
|
33
|
Session::flash('message', '<p> Cycle created.</p>');
|
33
|
|
- return Redirect::to('three-years-plan');
|
|
34
|
+ return Redirect::to("three-years-plan/{$program_id}");
|
34
|
35
|
} catch (Exception $e) {
|
35
|
36
|
Session::flash('status', 'danger');
|
36
|
37
|
Session::flash('message', "<p>Could not create cycle</p>");
|
37
|
38
|
Log::info($e);
|
38
|
39
|
DB::rollback();
|
39
|
|
- return Redirect::to('three-years-plan');;
|
|
40
|
+ return Redirect::to("three-years-plan/{$program_id}");
|
40
|
41
|
}
|
41
|
42
|
}
|
42
|
43
|
// load the Three year Plan page
|
|
@@ -105,11 +106,7 @@ class ThreeYearPlanController extends \BaseController
|
105
|
106
|
$typ_id = Input::get('typ_id');
|
106
|
107
|
|
107
|
108
|
$user_id = auth::user()->id;
|
108
|
|
- $program_id = DB::table('program_user')
|
109
|
|
- ->where('user_id', $user_id)
|
110
|
|
- ->select('program_id')
|
111
|
|
- ->get();
|
112
|
|
- $program_id = $program_id[0]->program_id;
|
|
109
|
+ $program_id = Input::get('program_id');
|
113
|
110
|
|
114
|
111
|
|
115
|
112
|
$result = DB::table('typ_program')
|
|
@@ -242,14 +239,11 @@ class ThreeYearPlanController extends \BaseController
|
242
|
239
|
$semester_id = Input::get('semester_id');
|
243
|
240
|
$previous_objective_id = Input::get('previous_objective_id');
|
244
|
241
|
$new_objective_id = Input::get('new_objective_id');
|
|
242
|
+ $program_id = Input::get('program_id');
|
245
|
243
|
|
246
|
244
|
// get program_id
|
247
|
245
|
$user_id = auth::user()->id;
|
248
|
|
- $program_id = DB::table('program_user')
|
249
|
|
- ->where('user_id', $user_id)
|
250
|
|
- ->select('program_id')
|
251
|
|
- ->get();
|
252
|
|
- $program_id = $program_id[0]->program_id;
|
|
246
|
+
|
253
|
247
|
|
254
|
248
|
// get typ_program_id
|
255
|
249
|
$result = DB::table('typ_program')
|
|
@@ -303,11 +297,7 @@ class ThreeYearPlanController extends \BaseController
|
303
|
297
|
{
|
304
|
298
|
// get program_id
|
305
|
299
|
$user_id = auth::user()->id;
|
306
|
|
- $program_id = DB::table('program_user')
|
307
|
|
- ->where('user_id', $user_id)
|
308
|
|
- ->select('program_id')
|
309
|
|
- ->get();
|
310
|
|
- $program_id = $program_id[0]->program_id;
|
|
300
|
+ $program_id = Input::get('program_id');
|
311
|
301
|
|
312
|
302
|
// get typ_program_id
|
313
|
303
|
$typ_id = Input::get('typ_id');
|
|
@@ -398,11 +388,7 @@ class ThreeYearPlanController extends \BaseController
|
398
|
388
|
{
|
399
|
389
|
// get program_id
|
400
|
390
|
$user_id = auth::user()->id;
|
401
|
|
- $program_id = DB::table('program_user')
|
402
|
|
- ->where('user_id', $user_id)
|
403
|
|
- ->select('program_id')
|
404
|
|
- ->get();
|
405
|
|
- $program_id = $program_id[0]->program_id;
|
|
391
|
+ $program_id = Input::get('program_id');
|
406
|
392
|
|
407
|
393
|
// get typ_program_id
|
408
|
394
|
$typ_id = Input::get('typ_id');
|
|
@@ -506,12 +492,7 @@ class ThreeYearPlanController extends \BaseController
|
506
|
492
|
$new_course_id = Input::get('new_course_id');
|
507
|
493
|
|
508
|
494
|
// get program_id
|
509
|
|
- $user_id = auth::user()->id;
|
510
|
|
- $program_id = DB::table('program_user')
|
511
|
|
- ->where('user_id', $user_id)
|
512
|
|
- ->select('program_id')
|
513
|
|
- ->get();
|
514
|
|
- $program_id = $program_id[0]->program_id;
|
|
495
|
+ $program_id = Input::get('program_id');
|
515
|
496
|
|
516
|
497
|
// get typ_program_id
|
517
|
498
|
$result = DB::table('typ_program')
|
|
@@ -568,7 +549,8 @@ class ThreeYearPlanController extends \BaseController
|
568
|
549
|
}
|
569
|
550
|
public function createAnnualPlan($program_id)
|
570
|
551
|
{
|
571
|
|
- $current_typ = DB::select("select * from three_year_plan where year_start <=" . date('Y') . " and year_end >=" . date('Y'))[0];
|
|
552
|
+ $input_id = Input::get('typ_id');
|
|
553
|
+ $current_typ = DB::select("select * from three_year_plan where id = {$input_id}")[0];
|
572
|
554
|
$count = 0;
|
573
|
555
|
$yearStartPlusOne = $current_typ->year_start + 1;
|
574
|
556
|
$yearStart = $current_typ->year_start;
|