@@ -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 | 'id' => $sis_student['id'], |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | $this->update($studentData); |
219 | 219 | $this->uniqueUserId->updateOrInsertRecord($studentData); |
220 | 220 | return $studentData; |
221 | - } catch (\Exception $th) { |
|
221 | + }catch (\Exception $th) { |
|
222 | 222 | $this->isUnique = false; |
223 | 223 | Log::error($th->getMessage()); |
224 | 224 | // in case of duplication of the Unique ID this will recursive. |
@@ -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 | } |
@@ -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 | $studentData['student_id'] = $studentData['id']; |
195 | 195 | $matchedStudent = array_merge((array) $student, $matchedStudent); |
@@ -241,21 +241,21 @@ discard block |
||
241 | 241 | } |
242 | 242 | |
243 | 243 | if (($previousValue)) { |
244 | - $highest = ($percentage > $previousValue['rate']) ? $value : $value; |
|
245 | - } else { |
|
244 | + $highest = ($percentage > $previousValue['rate']) ? $value : $value; |
|
245 | + }else { |
|
246 | 246 | $highest = $value; |
247 | 247 | } |
248 | 248 | $previousValue = $value; |
249 | 249 | } |
250 | 250 | |
251 | 251 | //If the not matched 100% try to get most highest value with full name |
252 | - if (($highest['rate'] < 100) || (count($matchedData) > 1)) { |
|
252 | + if (($highest['rate'] < 100) || (count($matchedData) > 1)) { |
|
253 | 253 | foreach ($sis_students as $key => $value) { |
254 | 254 | similar_text(strtoupper($student['f_name']), strtoupper($value['first_name']), $percentage); |
255 | 255 | $value['rate'] = $percentage; |
256 | 256 | if (($previousValue)) { |
257 | - $highest = ($percentage > $previousValue['rate']) ? $value : $value; |
|
258 | - } else { |
|
257 | + $highest = ($percentage > $previousValue['rate']) ? $value : $value; |
|
258 | + }else { |
|
259 | 259 | $highest = $value; |
260 | 260 | } |
261 | 261 | $previousValue = $value; |
@@ -274,12 +274,12 @@ discard block |
||
274 | 274 | public function updateStudentId($student, $sis_student) |
275 | 275 | { |
276 | 276 | try { |
277 | - $student['nsid'] = $sis_student['openemis_no']; |
|
277 | + $student['nsid'] = $sis_student['openemis_no']; |
|
278 | 278 | |
279 | 279 | // add new NSID to the examinations data set |
280 | 280 | $this->examination_student->where(['st_no' => $student['st_no']])->update($student); |
281 | - $this->output->writeln('Updated ' . $sis_student['student_id'] . ' to NSID' . $sis_student['openemis_no']); |
|
282 | - } catch (\Exception $th) { |
|
281 | + $this->output->writeln('Updated '.$sis_student['student_id'].' to NSID'.$sis_student['openemis_no']); |
|
282 | + }catch (\Exception $th) { |
|
283 | 283 | Log::error($th); |
284 | 284 | } |
285 | 285 | } |