| @@ -28,7 +28,7 @@ discard block | ||
| 28 | 28 | $this->grade = $grade; | 
| 29 | 29 | $this->student = new Security_user(); | 
| 30 | 30 | $this->examination_student = new Examination_student(); | 
| 31 | -        $this->academic_period =  Academic_period::where('code', '=', $this->year)->first(); | |
| 31 | +        $this->academic_period = Academic_period::where('code', '=', $this->year)->first(); | |
| 32 | 32 |          $this->education_grade = Education_grade::where('code', '=', $this->grade)->first(); | 
| 33 | 33 | $this->output = new \Symfony\Component\Console\Output\ConsoleOutput(); | 
| 34 | 34 | } | 
| @@ -70,10 +70,10 @@ discard block | ||
| 70 | 70 | ); | 
| 71 | 71 |                      Session::flash('message', 'File upload successfully!'); | 
| 72 | 72 | // Redirect to index | 
| 73 | -                } else { | |
| 73 | +                }else { | |
| 74 | 74 |                      Session::flash('message', 'File too large. File must be less than 20MB.'); | 
| 75 | 75 | } | 
| 76 | -            } else { | |
| 76 | +            }else { | |
| 77 | 77 |                  Session::flash('message', 'Invalid File Extension.'); | 
| 78 | 78 | } | 
| 79 | 79 | } | 
| @@ -95,7 +95,7 @@ discard block | ||
| 95 | 95 | $import->import($excelFile, 'local', \Maatwebsite\Excel\Excel::CSV); | 
| 96 | 96 |              if ($import->failures()->count() > 0) { | 
| 97 | 97 | $errors = $import->failures(); | 
| 98 | - $columns = [ | |
| 98 | + $columns = [ | |
| 99 | 99 | 'remarks', | 
| 100 | 100 | 'st_no', | 
| 101 | 101 | 'stu_no', | 
| @@ -116,10 +116,10 @@ discard block | ||
| 116 | 116 |                  Storage::put($file, implode(',', $columns)); | 
| 117 | 117 | |
| 118 | 118 |                  foreach ($errors as $error) { | 
| 119 | -                    Storage::append($file, implode(':', $error->errors()) . ',' . implode(',', $error->values())); | |
| 119 | +                    Storage::append($file, implode(':', $error->errors()).','.implode(',', $error->values())); | |
| 120 | 120 | } | 
| 121 | 121 | } | 
| 122 | -        } catch (\Maatwebsite\Excel\Validators\ValidationException $e) { | |
| 122 | +        }catch (\Maatwebsite\Excel\Validators\ValidationException $e) { | |
| 123 | 123 | } | 
| 124 | 124 | } | 
| 125 | 125 | |
| @@ -207,7 +207,7 @@ discard block | ||
| 207 | 207 | |
| 208 | 208 | //TODO implement insert student to admission table | 
| 209 | 209 | $student['id'] = $sis_student['id']; | 
| 210 | - $sis_student['student_id'] = $student['id']; | |
| 210 | + $sis_student['student_id'] = $student['id']; | |
| 211 | 211 | |
| 212 | 212 | $student = $this->setIsTakingExam($student); | 
| 213 | 213 |                  if (count($institutionClass) == 1) { | 
| @@ -215,13 +215,13 @@ discard block | ||
| 215 | 215 | Institution_student::createExaminationData($student, $admissionInfo); | 
| 216 | 216 | Institution_student_admission::createExaminationData($student, $admissionInfo); | 
| 217 | 217 | Institution_class_student::createExaminationData($student, $admissionInfo); | 
| 218 | -                } else { | |
| 218 | +                }else { | |
| 219 | 219 | Institution_student_admission::createExaminationData($student, $admissionInfo); | 
| 220 | 220 | Institution_student::createExaminationData($student, $admissionInfo); | 
| 221 | 221 | } | 
| 222 | 222 | $this->updateStudentId($student, $sis_student); | 
| 223 | 223 | // update the matched student's data | 
| 224 | -            } else { | |
| 224 | +            }else { | |
| 225 | 225 | $studentData = $this->student->updateExaminationStudent($student, $matchedStudent); | 
| 226 | 226 | $matchedStudent = array_merge((array) $student, $matchedStudent); | 
| 227 | 227 | $studentData = array_merge((array) $matchedStudent, $studentData); | 
| @@ -247,7 +247,7 @@ discard block | ||
| 247 | 247 | // if the same gender same DOE has more than one | 
| 248 | 248 |          if (!is_null($sis_users) && (count($sis_users) > 1)) { | 
| 249 | 249 | $studentData = $this->searchSimilarName($student, $sis_users); | 
| 250 | -        }else{ | |
| 250 | +        }else { | |
| 251 | 251 | $studentData = $sis_users; | 
| 252 | 252 | } | 
| 253 | 253 | return $studentData; | 
| @@ -308,11 +308,11 @@ discard block | ||
| 308 | 308 | public function updateStudentId($student, $sis_student) | 
| 309 | 309 |      { | 
| 310 | 310 |          try { | 
| 311 | - $student['nsid'] = $sis_student['openemis_no']; | |
| 311 | + $student['nsid'] = $sis_student['openemis_no']; | |
| 312 | 312 | // add new NSID to the examinations data set | 
| 313 | 313 | $this->examination_student->where(['st_no' => $student['st_no']])->update($student); | 
| 314 | -            $this->output->writeln('Updated ' . $sis_student['student_id'] . ' to NSID' . $sis_student['openemis_no']); | |
| 315 | -        } catch (\Exception $th) { | |
| 314 | +            $this->output->writeln('Updated '.$sis_student['student_id'].' to NSID'.$sis_student['openemis_no']); | |
| 315 | +        }catch (\Exception $th) { | |
| 316 | 316 | Log::error($th); | 
| 317 | 317 | } | 
| 318 | 318 | } | 
| @@ -328,7 +328,7 @@ discard block | ||
| 328 | 328 |          try { | 
| 329 | 329 |              (new ExaminationStudentsExport)->store('examination/student_data_with_nsid.csv'); | 
| 330 | 330 | (new ExportReady($adminUser)); | 
| 331 | -        } catch (\Throwable $th) { | |
| 331 | +        }catch (\Throwable $th) { | |
| 332 | 332 | //throw $th; | 
| 333 | 333 | dd($th); | 
| 334 | 334 | } | 
| @@ -338,13 +338,13 @@ discard block | ||
| 338 | 338 | public function downloadErrors() | 
| 339 | 339 |      { | 
| 340 | 340 | |
| 341 | - $file_path = storage_path() . '/app/examination/errors.csv'; | |
| 341 | + $file_path = storage_path().'/app/examination/errors.csv'; | |
| 342 | 342 | return Response::download($file_path); | 
| 343 | 343 | } | 
| 344 | 344 | |
| 345 | 345 | public function downloadProcessedFile() | 
| 346 | 346 |      { | 
| 347 | - $file_path = storage_path() . '/app/examination/student_data_with_nsid.csv'; | |
| 347 | + $file_path = storage_path().'/app/examination/student_data_with_nsid.csv'; | |
| 348 | 348 | return Response::download($file_path); | 
| 349 | 349 | } | 
| 350 | 350 | } | 
| @@ -247,7 +247,7 @@ | ||
| 247 | 247 | // if the same gender same DOE has more than one | 
| 248 | 248 |          if (!is_null($sis_users) && (count($sis_users) > 1)) { | 
| 249 | 249 | $studentData = $this->searchSimilarName($student, $sis_users); | 
| 250 | -        }else{ | |
| 250 | +        } else{ | |
| 251 | 251 | $studentData = $sis_users; | 
| 252 | 252 | } | 
| 253 | 253 | return $studentData; |