@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | public static function boot() |
| 64 | 64 | { |
| 65 | 65 | parent::boot(); |
| 66 | - self::creating(function ($model) { |
|
| 66 | + self::creating(function($model) { |
|
| 67 | 67 | $model->id = (string) Uuid::generate(4); |
| 68 | 68 | $model->created = now(); |
| 69 | 69 | }); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | public static function createExaminationData($student, $admissionInfo) |
| 134 | 134 | { |
| 135 | - $student['sp_center'] = gettype((int)$student['sp_center']) == 'integer' ? $student['sp_center'] : 0; |
|
| 135 | + $student['sp_center'] = gettype((int) $student['sp_center']) == 'integer' ? $student['sp_center'] : 0; |
|
| 136 | 136 | try { |
| 137 | 137 | self::create([ |
| 138 | 138 | 'id' => (string) Uuid::generate(4), |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | 'created' => now(), |
| 157 | 157 | 'created_user_id' => 1 |
| 158 | 158 | ]); |
| 159 | - } catch (\Throwable $th) { |
|
| 159 | + }catch (\Throwable $th) { |
|
| 160 | 160 | Log::error($th); |
| 161 | 161 | } |
| 162 | 162 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | public static function updateExaminationData($student, $admissionInfo) |
| 172 | 172 | { |
| 173 | - $student['sp_center'] = gettype((int)$student['sp_center']) == 'integer' ? $student['sp_center'] : 0; |
|
| 173 | + $student['sp_center'] = gettype((int) $student['sp_center']) == 'integer' ? $student['sp_center'] : 0; |
|
| 174 | 174 | try { |
| 175 | 175 | self::where([ |
| 176 | 176 | 'student_id' => $student['student_id'], |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | 'modified_user_id' => 1 |
| 192 | 192 | ] |
| 193 | 193 | ); |
| 194 | - } catch (\Throwable $th) { |
|
| 194 | + }catch (\Throwable $th) { |
|
| 195 | 195 | Log::error($th); |
| 196 | 196 | } |
| 197 | 197 | } |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $studentData['id'] = $id; |
| 181 | 181 | $this->uniqueUserId->updateOrInsertRecord($studentData); |
| 182 | 182 | return $studentData; |
| 183 | - } catch (\Exception $th) { |
|
| 183 | + }catch (\Exception $th) { |
|
| 184 | 184 | Log::error($th->getMessage()); |
| 185 | 185 | // in case of duplication of the Unique ID this will recursive. |
| 186 | 186 | $this->insertExaminationStudent($student); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | $this->uniqueUserId = new Unique_user_id(); |
| 202 | 202 | $this->uniqueUId = new UniqueUid(); |
| 203 | 203 | // regenerate unique id if it's not available |
| 204 | - $uniqueId = ($this->uniqueUId::isValidUniqueId($sis_student['openemis_no']) && $this->isUnique) ? $sis_student['openemis_no'] : $this->uniqueUId::getUniqueAlphanumeric(); |
|
| 204 | + $uniqueId = ($this->uniqueUId::isValidUniqueId($sis_student['openemis_no']) && $this->isUnique) ? $sis_student['openemis_no'] : $this->uniqueUId::getUniqueAlphanumeric(); |
|
| 205 | 205 | |
| 206 | 206 | $studentData = [ |
| 207 | 207 | 'username' => str_replace('-', '', $uniqueId), |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | self::where(['id' => $sis_student['student_id']])->update($studentData); |
| 218 | 218 | $this->uniqueUserId->updateOrInsertRecord($studentData); |
| 219 | 219 | return $studentData; |
| 220 | - } catch (\Exception $th) { |
|
| 220 | + }catch (\Exception $th) { |
|
| 221 | 221 | $this->isUnique = false; |
| 222 | 222 | Log::error($th->getMessage()); |
| 223 | 223 | // in case of duplication of the Unique ID this will recursive. |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $this->grade = $grade; |
| 28 | 28 | $this->student = new Security_user(); |
| 29 | 29 | $this->examination_student = new Examination_student(); |
| 30 | - $this->academic_period = Academic_period::where('code', '=', $this->year)->first(); |
|
| 30 | + $this->academic_period = Academic_period::where('code', '=', $this->year)->first(); |
|
| 31 | 31 | $this->education_grade = Education_grade::where('code', '=', $this->grade)->first(); |
| 32 | 32 | $this->output = new \Symfony\Component\Console\Output\ConsoleOutput(); |
| 33 | 33 | } |
@@ -69,10 +69,10 @@ discard block |
||
| 69 | 69 | ); |
| 70 | 70 | Session::flash('message', 'File upload successfully!'); |
| 71 | 71 | // Redirect to index |
| 72 | - } else { |
|
| 72 | + }else { |
|
| 73 | 73 | Session::flash('message', 'File too large. File must be less than 20MB.'); |
| 74 | 74 | } |
| 75 | - } else { |
|
| 75 | + }else { |
|
| 76 | 76 | Session::flash('message', 'Invalid File Extension.'); |
| 77 | 77 | } |
| 78 | 78 | } |
@@ -184,12 +184,12 @@ discard block |
||
| 184 | 184 | Institution_student::createExaminationData($student, $admissionInfo); |
| 185 | 185 | Institution_student_admission::createExaminationData($student, $admissionInfo); |
| 186 | 186 | Institution_class_student::createExaminationData($student, $admissionInfo); |
| 187 | - } else { |
|
| 187 | + }else { |
|
| 188 | 188 | Institution_student_admission::createExaminationData($student, $admissionInfo); |
| 189 | 189 | Institution_student::createExaminationData($student, $admissionInfo); |
| 190 | 190 | } |
| 191 | 191 | // update the matched student's data |
| 192 | - } else { |
|
| 192 | + }else { |
|
| 193 | 193 | $studentData = $this->student->updateExaminationStudent($student, $matchedStudent); |
| 194 | 194 | $matchedStudent = array_merge((array) $student, $matchedStudent); |
| 195 | 195 | $studentData = array_merge((array) $matchedStudent, $matchedStudent); |
@@ -240,21 +240,21 @@ discard block |
||
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | if (($previousValue)) { |
| 243 | - $highest = ($percentage > $previousValue['rate']) ? $value : $value; |
|
| 244 | - } else { |
|
| 243 | + $highest = ($percentage > $previousValue['rate']) ? $value : $value; |
|
| 244 | + }else { |
|
| 245 | 245 | $highest = $value; |
| 246 | 246 | } |
| 247 | 247 | $previousValue = $value; |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | //If the not matched 100% try to get most highest value with full name |
| 251 | - if (($highest['rate'] < 100) || (count($matchedData) > 1)) { |
|
| 251 | + if (($highest['rate'] < 100) || (count($matchedData) > 1)) { |
|
| 252 | 252 | foreach ($sis_students as $key => $value) { |
| 253 | 253 | similar_text(strtoupper($student['f_name']), strtoupper($value['first_name']), $percentage); |
| 254 | 254 | $value['rate'] = $percentage; |
| 255 | 255 | if (($previousValue)) { |
| 256 | - $highest = ($percentage > $previousValue['rate']) ? $value : $value; |
|
| 257 | - } else { |
|
| 256 | + $highest = ($percentage > $previousValue['rate']) ? $value : $value; |
|
| 257 | + }else { |
|
| 258 | 258 | $highest = $value; |
| 259 | 259 | } |
| 260 | 260 | $previousValue = $value; |
@@ -273,12 +273,12 @@ discard block |
||
| 273 | 273 | public function updateStudentId($student, $sis_student) |
| 274 | 274 | { |
| 275 | 275 | try { |
| 276 | - $student['nsid'] = $sis_student['openemis_no']; |
|
| 276 | + $student['nsid'] = $sis_student['openemis_no']; |
|
| 277 | 277 | |
| 278 | 278 | // add new NSID to the examinations data set |
| 279 | 279 | $this->examination_student->where(['st_no' => $student['st_no']])->update($student); |
| 280 | - $this->output->writeln('Updated ' . $sis_student['student_id'] . ' to NSID' . $sis_student['openemis_no']); |
|
| 281 | - } catch (\Exception $th) { |
|
| 280 | + $this->output->writeln('Updated '.$sis_student['student_id'].' to NSID'.$sis_student['openemis_no']); |
|
| 281 | + }catch (\Exception $th) { |
|
| 282 | 282 | Log::error($th); |
| 283 | 283 | } |
| 284 | 284 | } |