|
@@ -222,7 +222,7 @@ class AnnualPlansController extends \BaseController
|
222
|
222
|
// Log::info($annual_plans);
|
223
|
223
|
$outcomes = array();
|
224
|
224
|
$allSemesterOrder = array();
|
225
|
|
- Log::info($annual_plans);
|
|
225
|
+// Log::info($annual_plans);
|
226
|
226
|
/*foreach ($annual_plans as $an_plan) {
|
227
|
227
|
Log::info($an_plan->id);
|
228
|
228
|
$outcomes[$an_plan->id]["first"] = DB::select("select * from outcomes where id in (select outcome_id from typ_semester_outcome where semester_id = {$an_plan->semester_start} and typ_program_id in (select id from typ_program where program_id ={$an_plan->program_id} and three_year_plan_id ={$current_typ->id} ))");
|
|
@@ -238,7 +238,7 @@ class AnnualPlansController extends \BaseController
|
238
|
238
|
|
239
|
239
|
public function fetchInfo()
|
240
|
240
|
{
|
241
|
|
- Log::info(Input::get('id'));
|
|
241
|
+// Log::info(Input::get('id'));
|
242
|
242
|
$an_plan = DB::table("annual_plans")
|
243
|
243
|
->join('annual_cycle', 'annual_cycle.id', '=', 'annual_plans.annual_cycle_id')
|
244
|
244
|
->where('annual_plans.id', '=', Input::get('id'))
|
|
@@ -257,8 +257,8 @@ class AnnualPlansController extends \BaseController
|
257
|
257
|
})
|
258
|
258
|
->select('typ_program.*')
|
259
|
259
|
->first();
|
260
|
|
- Log::info(array($an_plan));
|
261
|
|
- Log::info(array($current_typ_program));
|
|
260
|
+// Log::info(array($an_plan));
|
|
261
|
+// Log::info(array($current_typ_program));
|
262
|
262
|
|
263
|
263
|
//DB::select("select * from typ_program where program_id = {$an_plan->program_id} and three_year_plan_id in (select id from three_year_plan where year_start <= {$years[0]} and year_end>= {$years[1]})")[0];
|
264
|
264
|
|
|
@@ -354,13 +354,13 @@ class AnnualPlansController extends \BaseController
|
354
|
354
|
$typ_info['courses'][$objective->id] = DB::select("select c.id, c.number, c.name, c.code, typ.id typ_course_id from courses c, typ_semester_courses typ, (select course_id, id from typ_semester_courses where typ_semester_objective_id in (select id from typ_semester_objectives where objective_id ={$objective->id} and typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id =? and semester_id ={$semester->id} and typ_program_id in(select id from typ_program where program_id ={$program_id})))) rel where typ.course_id =c.id and rel.course_id = c.id and typ.id = rel.id ", array(Input::get('id')));
|
355
|
355
|
|
356
|
356
|
$typ_info['criteria'][$objective->id] = DB::select("select * from criteria where deleted_at IS NULL and id in (select criterion_id from criterion_objective_outcome join program_criterion_objective_outcome on program_criterion_objective_outcome.cri_obj_out_id = criterion_objective_outcome.id where outcome_id = ? and program_id = {$program_id} and objective_id = {$objective->id})", array(Input::get('id')));
|
357
|
|
- Log::info($typ_info['criteria'][$objective->id]);
|
|
357
|
+// Log::info($typ_info['criteria'][$objective->id]);
|
358
|
358
|
$typ_info['typ_objective_id'][$objective->id] = DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id =? and semester_id ={$semester->id} and typ_program_id in (select id from typ_program where program_id ={$program_id}))", array(Input::get('id')));
|
359
|
|
- Log::info($typ_info['typ_objective_id'][$objective->id]);
|
|
359
|
+// Log::info($typ_info['typ_objective_id'][$objective->id]);
|
360
|
360
|
$typ_info['typ_objective_id'][$objective->id] = $typ_info['typ_objective_id'][$objective->id][0];
|
361
|
361
|
|
362
|
|
- Log::info($typ_info['typ_objective_id'][$objective->id]->id);
|
363
|
|
- Log::info($annual_plan->id);
|
|
362
|
+// Log::info($typ_info['typ_objective_id'][$objective->id]->id);
|
|
363
|
+// Log::info($annual_plan->id);
|
364
|
364
|
// $typ_info['annual_plans_transformative'][$objective->id] = DB::select(
|
365
|
365
|
// "select trans_id from annual_plan_transformative
|
366
|
366
|
// where annual_plan_id={$annual_plan->id}
|
|
@@ -386,7 +386,7 @@ class AnnualPlansController extends \BaseController
|
386
|
386
|
}
|
387
|
387
|
}
|
388
|
388
|
$typ_info['annual_plan'] = $annual_plan;
|
389
|
|
- Log::info($typ_info);
|
|
389
|
+// Log::info($typ_info);
|
390
|
390
|
|
391
|
391
|
$typ_info['transformative_actions_for_outcome'] = DB::table('transformative_actions')
|
392
|
392
|
->join('transformative_typ_outcome', 'transformative_typ_outcome.trans_id', '=', 'transformative_actions.id')
|
|
@@ -533,8 +533,8 @@ class AnnualPlansController extends \BaseController
|
533
|
533
|
foreach ($annual_plan['first']['outcomes'] as $outcomes) {
|
534
|
534
|
|
535
|
535
|
$annual_plan['first']['objectives'][$outcomes->id] = DB::select("select * from objectives where id in (select objective_id from typ_semester_objectives where typ_semester_outcome_id in(select id from typ_semester_outcome where outcome_id = {$outcomes->id} and semester_id = {$an_semesters->semester_start} and typ_program_id in (select id from typ_program where program_id ={$an_semesters->program_id})))");
|
536
|
|
- Log::info($outcomes->id);
|
537
|
|
- Log::info($annual_plan['first']['objectives'][$outcomes->id]);
|
|
536
|
+ //Log::info($outcomes->id);
|
|
537
|
+// Log::info($annual_plan['first']['objectives'][$outcomes->id]);
|
538
|
538
|
foreach ($annual_plan['first']['objectives'][$outcomes->id] as $objective) {
|
539
|
539
|
$annual_plan['first']['typ_objective_id'][$objective->id] = DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id ={$outcomes->id} and semester_id ={$an_semesters->semester_start} and typ_program_id in(select id from typ_program where program_id ={$an_semesters->program_id})) ")[0];
|
540
|
540
|
$annual_plan['first']['courses'][$objective->id] = DB::select("select typ.id typ_course_id, typ.course_id, c.code, c.number, c.name from (select course_id, id from typ_semester_courses where typ_semester_objective_id = {$annual_plan['first']['typ_objective_id'][$objective->id]->id}) typ, courses c where c.id = typ.course_id");
|
|
@@ -543,7 +543,7 @@ class AnnualPlansController extends \BaseController
|
543
|
543
|
$annual_plan['first']['trans_actions'][$objective->id][$course->typ_course_id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_course_id = {$course->typ_course_id})");
|
544
|
544
|
}
|
545
|
545
|
|
546
|
|
- Log::info($objective->id);
|
|
546
|
+// Log::info($objective->id);
|
547
|
547
|
/*$annual_plan['first']['trans_actions'][$objective->id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_objective_id ={$annual_plan['first']['typ_objective_id'][$objective->id]->id})");
|
548
|
548
|
foreach ($annual_plan['first']['trans_actions'][$objective->id] as $trans) {
|
549
|
549
|
Log::info($annual_plan['first']['typ_objective_id'][$objective->id]->id);
|
|
@@ -658,7 +658,7 @@ class AnnualPlansController extends \BaseController
|
658
|
658
|
->select('courses.code', 'courses.number')
|
659
|
659
|
->distinct()
|
660
|
660
|
->get();
|
661
|
|
- Log::info($course_codes);
|
|
661
|
+// Log::info($course_codes);
|
662
|
662
|
$all_courses_info = [];
|
663
|
663
|
|
664
|
664
|
foreach ($course_codes as $index => $course_code) {
|
|
@@ -671,8 +671,8 @@ class AnnualPlansController extends \BaseController
|
671
|
671
|
->where('number', $course_code->number)
|
672
|
672
|
->where('program_id', $program_id)
|
673
|
673
|
->get();
|
674
|
|
- Log::info("run number " . $index);
|
675
|
|
- Log::info($courses);
|
|
674
|
+ //Log::info("run number " . $index);
|
|
675
|
+// Log::info($courses);
|
676
|
676
|
foreach ($courses as $course) {
|
677
|
677
|
$all_courses_info[$course_code->code . '_' . $course_code->number][] = $course->getReportObject();
|
678
|
678
|
}
|
|
@@ -751,7 +751,7 @@ class AnnualPlansController extends \BaseController
|
751
|
751
|
$outcome->semester_info = DB::table('semesters')
|
752
|
752
|
->where('id', $semester_id)
|
753
|
753
|
->first();
|
754
|
|
- Log::info($typ_semester_outcome_id);
|
|
754
|
+// Log::info($typ_semester_outcome_id);
|
755
|
755
|
$outcome->comments = $outcome->getCommentsAttribute();
|
756
|
756
|
// $outcome->comments = "COMMENT";
|
757
|
757
|
//Log::info("Comments");
|
|
@@ -765,8 +765,8 @@ class AnnualPlansController extends \BaseController
|
765
|
765
|
|
766
|
766
|
|
767
|
767
|
foreach ($outcome->objectives as $index => $objective) {
|
768
|
|
- Log::info("Ella son besties");
|
769
|
|
- Log::info(array($objective));
|
|
768
|
+// Log::info("Ella son besties");
|
|
769
|
+// Log::info(array($objective));
|
770
|
770
|
$objective->courses = Objective::getPlanReport($objective);
|
771
|
771
|
}
|
772
|
772
|
|
|
@@ -976,7 +976,7 @@ class AnnualPlansController extends \BaseController
|
976
|
976
|
$typ_semester_outcome_id = Input::get('typ_outcome_semester_id');
|
977
|
977
|
$comments = Input::get('comments');
|
978
|
978
|
|
979
|
|
- Log::info(Input::all());
|
|
979
|
+// Log::info(Input::all());
|
980
|
980
|
|
981
|
981
|
if ($edit_id) {
|
982
|
982
|
DB::table('typ_outcome_report_comments')
|
|
@@ -1021,8 +1021,8 @@ class AnnualPlansController extends \BaseController
|
1021
|
1021
|
$pdf->save(app_path() . '/storage/annual_pdfs/' . date('d-m-Y') . '-for-' . $annualPlan->program->id . '.pdf');
|
1022
|
1022
|
return $pdf->download(date('d-m-Y') . '-for-' . $annualPlan->program->id . '.pdf');
|
1023
|
1023
|
*/ //pdf = $pdf->setOrientation("landscape");
|
1024
|
|
- Log::info("submit");
|
1025
|
|
- Log::info($submit);
|
|
1024
|
+// Log::info("submit");
|
|
1025
|
+// Log::info($submit);
|
1026
|
1026
|
return View::make('local.managers.shared.print_annual_report', compact('annualPlan', 'submit'));
|
1027
|
1027
|
}
|
1028
|
1028
|
|
|
@@ -1037,7 +1037,7 @@ class AnnualPlansController extends \BaseController
|
1037
|
1037
|
// ->setOrientation("landscape")
|
1038
|
1038
|
|
1039
|
1039
|
// ->setPaper('legal', 'landscape');
|
1040
|
|
- $path = app_path() . '/views/annual_htmls/report-on-' . date('d-m-Y') . '-for-' . $annualPlan->program->id . '-by-' . $user_id . '.blade.php';
|
|
1040
|
+ $path = app_path() . '/views/annual_htmls/report-on-' . date('d-m-Y') .'ac'.$annualPlan->annual_cycle_id . '-for-' . $annualPlan->program->id . '-by-' . $user_id . '.blade.php';
|
1041
|
1041
|
//$pdf->save($path);
|
1042
|
1042
|
//$name = date('d-m-Y') . '-for-' . $annualPlan->program->id . '.pdf';
|
1043
|
1043
|
//$pdf->download($name);
|
|
@@ -1120,8 +1120,8 @@ class AnnualPlansController extends \BaseController
|
1120
|
1120
|
$path = DB::table('paths_for_annual_plans')->where('id', $path_id)->first();
|
1121
|
1121
|
|
1122
|
1122
|
if (isset($path)) {
|
1123
|
|
- Log::info($path->path_to_pdf);
|
1124
|
|
- Log::info(app_path()); //. "/views/annual_htmls/");
|
|
1123
|
+// Log::info($path->path_to_pdf);
|
|
1124
|
+// Log::info(app_path()); //. "/views/annual_htmls/");
|
1125
|
1125
|
|
1126
|
1126
|
|
1127
|
1127
|
//FALTA COMO HACER PAl REPORT.
|
|
@@ -1141,9 +1141,6 @@ class AnnualPlansController extends \BaseController
|
1141
|
1141
|
$path = str_replace(app_path() . '/views/annual_htmls/', '', $path->path_to_pdf);
|
1142
|
1142
|
|
1143
|
1143
|
|
1144
|
|
-
|
1145
|
|
-
|
1146
|
|
-
|
1147
|
1144
|
$path = trim($path, ".blade.php");
|
1148
|
1145
|
$dir = '';
|
1149
|
1146
|
|
|
@@ -1218,7 +1215,7 @@ class AnnualPlansController extends \BaseController
|
1218
|
1215
|
public function checkIfPlanReady()
|
1219
|
1216
|
{
|
1220
|
1217
|
$annual_plan = AnnualPlan::findOrFail(Input::get("annual_id"));
|
1221
|
|
- Log::info('annual_plan' . $annual_plan->courses);
|
|
1218
|
+// Log::info('annual_plan' . $annual_plan->courses);
|
1222
|
1219
|
|
1223
|
1220
|
/*
|
1224
|
1221
|
error = [
|
|
@@ -1229,14 +1226,14 @@ class AnnualPlansController extends \BaseController
|
1229
|
1226
|
*/
|
1230
|
1227
|
$error_array = [];
|
1231
|
1228
|
|
1232
|
|
- Log::info("Esto devuelve?");
|
|
1229
|
+// Log::info("Esto devuelve?");
|
1233
|
1230
|
|
1234
|
|
- Log::info($annual_plan->courses);
|
|
1231
|
+// Log::info($annual_plan->courses);
|
1235
|
1232
|
|
1236
|
1233
|
foreach ($annual_plan->courses as $index => $course) {
|
1237
|
1234
|
|
1238
|
|
- Log::info('paired Criteria');
|
1239
|
|
- Log::info($course->paired_criteria);
|
|
1235
|
+// Log::info('paired Criteria');
|
|
1236
|
+// Log::info($course->paired_criteria);
|
1240
|
1237
|
if (count($course->paired_criteria) <= 0) {
|
1241
|
1238
|
$outcome = $course->paired_objective->paired_outcome;
|
1242
|
1239
|
$objective = $course->paired_objective;
|
|
@@ -1283,7 +1280,7 @@ class AnnualPlansController extends \BaseController
|
1283
|
1280
|
'courses' => [],
|
1284
|
1281
|
'outcomes' => []
|
1285
|
1282
|
];
|
1286
|
|
- Log::info($annual_plan->courses_with_transformative_actions);
|
|
1283
|
+// Log::info($annual_plan->courses_with_transformative_actions);
|
1287
|
1284
|
foreach ($annual_plan->courses_with_transformative_actions as $course) {
|
1288
|
1285
|
|
1289
|
1286
|
foreach ($course->proposed_transformative_actions as $ta) {
|
|
@@ -1331,6 +1328,12 @@ class AnnualPlansController extends \BaseController
|
1331
|
1328
|
{
|
1332
|
1329
|
$alphabet = range("A", "Z");
|
1333
|
1330
|
$annualPlan = AnnualPlan::findOrFail($annual_id);
|
|
1331
|
+ Log::info(json_encode($annualPlan));
|
|
1332
|
+ $temp=$annualPlan->getCoursesAttribute();
|
|
1333
|
+ Log::info("cursos plan");
|
|
1334
|
+ Log::info(json_encode($temp));
|
|
1335
|
+ Log::info("termina cursos plan");
|
|
1336
|
+
|
1334
|
1337
|
$small_alphabet = range('a', 'z');
|
1335
|
1338
|
return View::make('local.managers.shared.print_annual_plan', compact('annualPlan', 'alphabet', 'small_alphabet', 'submit'));
|
1336
|
1339
|
}
|
|
@@ -1340,15 +1343,17 @@ class AnnualPlansController extends \BaseController
|
1340
|
1343
|
$alphabet = range("A", "Z");
|
1341
|
1344
|
$small_alphabet = range('a', 'z');
|
1342
|
1345
|
$annualPlan = AnnualPlan::findOrFail($annual_id);
|
|
1346
|
+// Log::info(json_encode($annualPlan));
|
|
1347
|
+// Log::info($annualPlan->annual_cycle_id);
|
1343
|
1348
|
$user_id = Auth::user()->id;
|
1344
|
1349
|
//$pdf = new PDF(app('config'), app("Filesystem"), app('view'), '/storage/plan_pdf');
|
1345
|
1350
|
//$pdf = $pdf->loadView('local.managers.shared.print_annual_plan', compact('annualPlan', 'alphabet', 'small_alphabet'))
|
1346
|
1351
|
// ->setOrientation("landscape")
|
1347
|
1352
|
|
1348
|
1353
|
// ->setPaper('legal', 'landscape');
|
1349
|
|
- $path = app_path() . '/views/annual_htmls/plan-on-' . date('d-m-Y') . '-for-' . $annualPlan->program->id . '-by-' . $user_id . '.blade.php';
|
|
1354
|
+ $path = app_path() . '/views/annual_htmls/plan-on-' . date('d-m-Y') .'ac'.$annualPlan->annual_cycle_id . '-for-' . $annualPlan->program->id . '-by-' . $user_id . '.blade.php';
|
1350
|
1355
|
//$pdf->save($path);
|
1351
|
|
- $name = "plan-on-" . date('d-m-Y') . '-for-' . $annualPlan->program->id . '.blade.php';
|
|
1356
|
+ $name = "plan-on-" . date('d-m-Y') .'ac'.$annualPlan->annual_cycle_id .'-for-' . $annualPlan->program->id . '.blade.php';
|
1352
|
1357
|
//$pdf->download($name);
|
1353
|
1358
|
|
1354
|
1359
|
//is a path already there
|
|
@@ -1356,7 +1361,7 @@ class AnnualPlansController extends \BaseController
|
1356
|
1361
|
$it_exists = DB::table("paths_for_annual_plans")
|
1357
|
1362
|
->where('path_to_pdf', $path)
|
1358
|
1363
|
->first();
|
1359
|
|
-
|
|
1364
|
+// Log::info(
|
1360
|
1365
|
if (isset($it_exists)) {
|
1361
|
1366
|
return '200';
|
1362
|
1367
|
}
|