@@ -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 if (!is_null($sis_users) && (count($sis_users) == 1)){ |
|
| 250 | + }else if (!is_null($sis_users) && (count($sis_users) == 1)) { |
|
| 251 | 251 | $studentData = $sis_users[0]; |
| 252 | 252 | } |
| 253 | 253 | return $studentData; |
@@ -308,15 +308,15 @@ 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 | unset($student['id']); |
| 314 | 314 | unset($studentData['taking_g5_exam']); |
| 315 | 315 | unset($studentData['taking_al_exam']); |
| 316 | 316 | unset($studentData['taking_ol_exam']); |
| 317 | - $this->examination_student->where('st_no' , $student['st_no'])->update($student); |
|
| 318 | - $this->output->writeln('Updated ' . $sis_student['student_id'] . ' to NSID' . $sis_student['openemis_no']); |
|
| 319 | - } catch (\Exception $th) { |
|
| 317 | + $this->examination_student->where('st_no', $student['st_no'])->update($student); |
|
| 318 | + $this->output->writeln('Updated '.$sis_student['student_id'].' to NSID'.$sis_student['openemis_no']); |
|
| 319 | + }catch (\Exception $th) { |
|
| 320 | 320 | Log::error($th); |
| 321 | 321 | } |
| 322 | 322 | } |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | try { |
| 333 | 333 | (new ExaminationStudentsExport)->store('examination/student_data_with_nsid.csv'); |
| 334 | 334 | (new ExportReady($adminUser)); |
| 335 | - } catch (\Throwable $th) { |
|
| 335 | + }catch (\Throwable $th) { |
|
| 336 | 336 | //throw $th; |
| 337 | 337 | dd($th); |
| 338 | 338 | } |
@@ -342,13 +342,13 @@ discard block |
||
| 342 | 342 | public function downloadErrors() |
| 343 | 343 | { |
| 344 | 344 | |
| 345 | - $file_path = storage_path() . '/app/examination/errors.csv'; |
|
| 345 | + $file_path = storage_path().'/app/examination/errors.csv'; |
|
| 346 | 346 | return Response::download($file_path); |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | public function downloadProcessedFile() |
| 350 | 350 | { |
| 351 | - $file_path = storage_path() . '/app/examination/student_data_with_nsid.csv'; |
|
| 351 | + $file_path = storage_path().'/app/examination/student_data_with_nsid.csv'; |
|
| 352 | 352 | return Response::download($file_path); |
| 353 | 353 | } |
| 354 | 354 | } |