@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | DB::table('uploads') |
| 101 | 101 | ->where('id', $id) |
| 102 | 102 | ->update(['is_processed' => 0]); |
| 103 | - }elseif ($action == 200) { |
|
| 103 | + } elseif ($action == 200) { |
|
| 104 | 104 | DB::table('uploads') |
| 105 | 105 | ->where('id', $id) |
| 106 | 106 | ->update(['is_processed' => 4]); |
@@ -117,8 +117,7 @@ discard block |
||
| 117 | 117 | return Response::download($file_path, Auth::user()->openemis_no.'_'.$filename.$version, [ |
| 118 | 118 | 'Content-Length: '. filesize($file_path) |
| 119 | 119 | ]); |
| 120 | - } |
|
| 121 | - else |
|
| 120 | + } else |
|
| 122 | 121 | { |
| 123 | 122 | return View::make('errors.404'); |
| 124 | 123 | } |
@@ -137,8 +136,7 @@ discard block |
||
| 137 | 136 | return Response::download($file_path, $filename, [ |
| 138 | 137 | 'Content-Length: '. filesize($file_path) |
| 139 | 138 | ]); |
| 140 | - } |
|
| 141 | - else |
|
| 139 | + } else |
|
| 142 | 140 | { |
| 143 | 141 | abort(404, 'We did not found an error file.'); |
| 144 | 142 | } |
@@ -152,8 +150,7 @@ discard block |
||
| 152 | 150 | return Response::download($file_path, $filename, [ |
| 153 | 151 | 'Content-Length: '. filesize($file_path) |
| 154 | 152 | ]); |
| 155 | - } |
|
| 156 | - else |
|
| 153 | + } else |
|
| 157 | 154 | { |
| 158 | 155 | |
| 159 | 156 | abort(404, 'We did not found an error file.'); |
@@ -100,9 +100,9 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | $this->isValidSheet = false; |
| 102 | 102 | $error = \Illuminate\Validation\ValidationException::withMessages([]); |
| 103 | - $failure = new Failure(3, 'remark', [0 => 'Template is not valid for upload, use the template given in the system'], [null]); |
|
| 104 | - $failures = [0 => $failure]; |
|
| 105 | - throw new \Maatwebsite\Excel\Validators\ValidationException($error, $failures); |
|
| 103 | + $failure = new Failure(3, 'remark', [0 => 'Template is not valid for upload, use the template given in the system'], [null]); |
|
| 104 | + $failures = [0 => $failure]; |
|
| 105 | + throw new \Maatwebsite\Excel\Validators\ValidationException($error, $failures); |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
@@ -194,9 +194,9 @@ discard block |
||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | protected function checkKeys($key,$count,$row){ |
| 197 | - if(array_key_exists($key,$row)){ |
|
| 198 | - return true; |
|
| 199 | - }else{ |
|
| 197 | + if(array_key_exists($key,$row)){ |
|
| 198 | + return true; |
|
| 199 | + }else{ |
|
| 200 | 200 | $error = \Illuminate\Validation\ValidationException::withMessages([]); |
| 201 | 201 | $failure = new Failure($count, 'remark', [0 => 'Template is not valid for upload, use the template given in the system'. $key ,' Is missing form the template'], [null]); |
| 202 | 202 | $failures = [0 => $failure]; |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | public function map($row): array { |
| 218 | 218 | try { |
| 219 | - $row = $this->mapFields($row); |
|
| 219 | + $row = $this->mapFields($row); |
|
| 220 | 220 | } catch (\Maatwebsite\Excel\Validators\ValidationException $e) { |
| 221 | 221 | $error = \Illuminate\Validation\ValidationException::withMessages([]); |
| 222 | 222 | $failure = new Failure(3, 'remark', [0 => 'Template is not valid for upload, use the template given in the system'], [null]); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | return $row; |
| 153 | - }catch (Exception $e){ |
|
| 153 | + } catch (Exception $e){ |
|
| 154 | 154 | $error = \Illuminate\Validation\ValidationException::withMessages([]); |
| 155 | 155 | $failure = new Failure(3, 'remark', [0 => 'Template is not valid for upload, use the template given in the system'], [null]); |
| 156 | 156 | $failures = [0 => $failure]; |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | protected function checkKeys($key,$count,$row){ |
| 197 | 197 | if(array_key_exists($key,$row)){ |
| 198 | 198 | return true; |
| 199 | - }else{ |
|
| 199 | + } else{ |
|
| 200 | 200 | $error = \Illuminate\Validation\ValidationException::withMessages([]); |
| 201 | 201 | $failure = new Failure($count, 'remark', [0 => 'Template is not valid for upload, use the template given in the system'. $key ,' Is missing form the template'], [null]); |
| 202 | 202 | $failures = [0 => $failure]; |
@@ -423,8 +423,9 @@ |
||
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | protected function insertSubject($subject){ |
| 426 | - if(!Institution_subject_student::isDuplicated($subject)) |
|
| 427 | - Institution_subject_student::updateOrInsert($subject); |
|
| 426 | + if(!Institution_subject_student::isDuplicated($subject)) { |
|
| 427 | + Institution_subject_student::updateOrInsert($subject); |
|
| 428 | + } |
|
| 428 | 429 | } |
| 429 | 430 | |
| 430 | 431 | |
@@ -18,10 +18,10 @@ |
||
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | - * @param array $row |
|
| 22 | - * |
|
| 23 | - * @return \Illuminate\Database\Eloquent\Model|null |
|
| 24 | - */ |
|
| 21 | + * @param array $row |
|
| 22 | + * |
|
| 23 | + * @return \Illuminate\Database\Eloquent\Model|null |
|
| 24 | + */ |
|
| 25 | 25 | |
| 26 | 26 | public function sheets(): array |
| 27 | 27 | { |
@@ -25,11 +25,11 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @return void |
| 27 | 27 | */ |
| 28 | - public function boot() |
|
| 29 | - { |
|
| 30 | - // |
|
| 31 | - if((\App::environment('dev')) | (\App::environment('stage')) | (\App::environment('prod'))) { |
|
| 32 | - URL::forceScheme('https'); |
|
| 33 | - } |
|
| 34 | - } |
|
| 28 | + public function boot() |
|
| 29 | + { |
|
| 30 | + // |
|
| 31 | + if((\App::environment('dev')) | (\App::environment('stage')) | (\App::environment('prod'))) { |
|
| 32 | + URL::forceScheme('https'); |
|
| 33 | + } |
|
| 34 | + } |
|
| 35 | 35 | } |
@@ -135,13 +135,13 @@ |
||
| 135 | 135 | } |
| 136 | 136 | protected function validateNic($attribute, $value, $perameters, $validator){ |
| 137 | 137 | $valid = preg_match('/^([0-9]{9}[VX]|[0-9]{12})$/i', $value); |
| 138 | - if(!$valid){ |
|
| 139 | - $this->_custom_messages['nic'] = $attribute. ' is not valid, Please check the NIC number'; |
|
| 140 | - $this->_set_custom_stuff(); |
|
| 141 | - return false; |
|
| 142 | - }else{ |
|
| 143 | - return true; |
|
| 144 | - } |
|
| 138 | + if(!$valid){ |
|
| 139 | + $this->_custom_messages['nic'] = $attribute. ' is not valid, Please check the NIC number'; |
|
| 140 | + $this->_set_custom_stuff(); |
|
| 141 | + return false; |
|
| 142 | + }else{ |
|
| 143 | + return true; |
|
| 144 | + } |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | protected function validateUserUnique($attribute, $value, $perameters, $validator) { |
@@ -87,12 +87,12 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | return true; |
| 89 | 89 | } |
| 90 | - }else{ |
|
| 90 | + } else{ |
|
| 91 | 91 | $this->_custom_messages['bmi'] = $attribute.' is required for '. $educationGrade->name; |
| 92 | 92 | $this->_set_custom_stuff(); |
| 93 | 93 | return false; |
| 94 | 94 | } |
| 95 | - }else{ |
|
| 95 | + } else{ |
|
| 96 | 96 | return true; |
| 97 | 97 | } |
| 98 | 98 | } |
@@ -125,10 +125,10 @@ discard block |
||
| 125 | 125 | $check = Institution_class_student::where('student_id', '=', $student['id'])->where('institution_class_id','=',$perameters[0])->count(); |
| 126 | 126 | if($check == 1){ |
| 127 | 127 | return true; |
| 128 | - }else{ |
|
| 128 | + } else{ |
|
| 129 | 129 | return false; |
| 130 | 130 | } |
| 131 | - }else{ |
|
| 131 | + } else{ |
|
| 132 | 132 | return false; |
| 133 | 133 | } |
| 134 | 134 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | $this->_custom_messages['nic'] = $attribute. ' is not valid, Please check the NIC number'; |
| 140 | 140 | $this->_set_custom_stuff(); |
| 141 | 141 | return false; |
| 142 | - }else{ |
|
| 142 | + } else{ |
|
| 143 | 143 | return true; |
| 144 | 144 | } |
| 145 | 145 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | public function boot() { |
| 13 | 13 | $this->app->validator->resolver( function( $translator, $data, $rules, |
| 14 | - $messages = array(), $customAttributes = array() ) { |
|
| 14 | + $messages = array(), $customAttributes = array() ) { |
|
| 15 | 15 | return new ValidatorExtended( $translator, $data, $rules, $messages, |
| 16 | 16 | $customAttributes ); |
| 17 | 17 | } ); |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | protected function mapWebRoutes() |
| 53 | 53 | { |
| 54 | 54 | Route::middleware('web') |
| 55 | - ->namespace($this->namespace) |
|
| 56 | - ->group(base_path('routes/web.php')); |
|
| 55 | + ->namespace($this->namespace) |
|
| 56 | + ->group(base_path('routes/web.php')); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | protected function mapApiRoutes() |
| 67 | 67 | { |
| 68 | 68 | Route::prefix('api') |
| 69 | - ->middleware('api') |
|
| 70 | - ->namespace($this->namespace) |
|
| 71 | - ->group(base_path('routes/api.php')); |
|
| 69 | + ->middleware('api') |
|
| 70 | + ->namespace($this->namespace) |
|
| 71 | + ->group(base_path('routes/api.php')); |
|
| 72 | 72 | } |
| 73 | 73 | } |
@@ -212,7 +212,7 @@ |
||
| 212 | 212 | 'created_user_id' => $student['created_user_id'] |
| 213 | 213 | ]; |
| 214 | 214 | try{ |
| 215 | - Institution_student::where('id',(string)$student['id'])->update($studentData); |
|
| 215 | + Institution_student::where('id',(string)$student['id'])->update($studentData); |
|
| 216 | 216 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); |
| 217 | 217 | $output->writeln('----------------- '. $student['admission_id'] . ' to ' . $studentData['education_grade_id']); |
| 218 | 218 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | if (!empty($isAvailableforPromotion)) { |
| 82 | 82 | $this->process($institutionGrade,$nextGrade,$year,1); |
| 83 | - }else{ |
|
| 83 | + } else{ |
|
| 84 | 84 | $this->process($institutionGrade,$nextGrade,$year,3); |
| 85 | 85 | } |
| 86 | 86 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | array_walk($studentListToPromote,array($this,'assingeToClasses'),$params); |
| 128 | 128 | array_walk($parallelClasses,array($this,'updateStudentCount')); |
| 129 | 129 | } |
| 130 | - }catch (\Exception $e){ |
|
| 130 | + } catch (\Exception $e){ |
|
| 131 | 131 | dd($e); |
| 132 | 132 | Log::error($e->getMessage()); |
| 133 | 133 | } |
@@ -166,20 +166,20 @@ discard block |
||
| 166 | 166 | // promote parallel classes |
| 167 | 167 | $this->promotion($institutionGrade,$nextGrade,$academicPeriod,$nextAcademicPeriod,$nextGradeObj->toArray(),1); |
| 168 | 168 | return 1; |
| 169 | - }elseif (($nextGradeObj->count() > 1) && ($nextGradeObj->count() !== $currentGradeObj->count())){ |
|
| 169 | + } elseif (($nextGradeObj->count() > 1) && ($nextGradeObj->count() !== $currentGradeObj->count())){ |
|
| 170 | 170 | // promote pool promotion |
| 171 | 171 | $this->promotion($institutionGrade,$nextGrade,$academicPeriod,$nextAcademicPeriod,[],1); |
| 172 | 172 | return 2; |
| 173 | - }elseif(($nextGradeObj->count() > 1) && $currentGradeObj->count() == $nextGradeObj->count()){ |
|
| 173 | + } elseif(($nextGradeObj->count() > 1) && $currentGradeObj->count() == $nextGradeObj->count()){ |
|
| 174 | 174 | // Promote matching class name with previous class |
| 175 | 175 | $this->promotion($institutionGrade,$nextGrade,$academicPeriod,$nextAcademicPeriod,$nextGradeObj->toArray(),1); |
| 176 | 176 | return 1; |
| 177 | - }else{ |
|
| 177 | + } else{ |
|
| 178 | 178 | // default pool promotion |
| 179 | 179 | $this->promotion($institutionGrade,$nextGrade,$academicPeriod,$nextAcademicPeriod,[],1); |
| 180 | 180 | return 2; |
| 181 | 181 | } |
| 182 | - }else{ |
|
| 182 | + } else{ |
|
| 183 | 183 | // default pool promotion |
| 184 | 184 | $this->promotion($institutionGrade,$nextGrade,$academicPeriod,$nextAcademicPeriod,[],3); |
| 185 | 185 | return 2; |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); |
| 217 | 217 | $output->writeln('----------------- '. $student['admission_id'] . ' to ' . $studentData['education_grade_id']); |
| 218 | 218 | |
| 219 | - }catch (\Exception $e){ |
|
| 219 | + } catch (\Exception $e){ |
|
| 220 | 220 | dd($e); |
| 221 | 221 | Log::error($e->getMessage()); |
| 222 | 222 | } |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $studentClass = $this->institution_class_students->getStudentNewClass($student); |
| 237 | 237 | if(!is_null($studentClass)){ |
| 238 | 238 | return array_search(str_replace($educationGrade['name'],$nextGrade->name,$studentClass->name),array_column($classes,'name')); |
| 239 | - }else{ |
|
| 239 | + } else{ |
|
| 240 | 240 | return false; |
| 241 | 241 | } |
| 242 | 242 | |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | $this->institution_class_students->create($studentObj); |
| 281 | 281 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); |
| 282 | 282 | $output->writeln('----------------- '. $student['student_id']. 'to ' . $class['name']); |
| 283 | - }else{ |
|
| 283 | + } else{ |
|
| 284 | 284 | $this->institution_class_students->where('id',(string)$student['id'])->update($studentObj); |
| 285 | 285 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); |
| 286 | 286 | $output->writeln('----------------- '. $student['student_id']. 'to ' . $class['name']); |